From 6d6edb9689f90b63f8d39fc0cd1c639b78e0031d Mon Sep 17 00:00:00 2001 From: Enric Morales Date: Thu, 12 Sep 2024 00:55:14 -0400 Subject: [PATCH 1/5] gnu-cobol: move to pkgs/by-name --- .../gnu-cobol/default.nix => by-name/gn/gnu-cobol/package.nix} | 0 pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 2 deletions(-) rename pkgs/{development/compilers/gnu-cobol/default.nix => by-name/gn/gnu-cobol/package.nix} (100%) diff --git a/pkgs/development/compilers/gnu-cobol/default.nix b/pkgs/by-name/gn/gnu-cobol/package.nix similarity index 100% rename from pkgs/development/compilers/gnu-cobol/default.nix rename to pkgs/by-name/gn/gnu-cobol/package.nix diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9f5a5ece5be8..97bf23bde3e6 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -8040,8 +8040,6 @@ with pkgs; gnu-cim = callPackage ../development/compilers/gnu-cim { }; - gnu-cobol = callPackage ../development/compilers/gnu-cobol { }; - gnuclad = callPackage ../applications/graphics/gnuclad { }; gnufdisk = callPackage ../tools/system/fdisk { From 7293c205fd0257b908eed7a49ba815ce3260e2b6 Mon Sep 17 00:00:00 2001 From: Enric Morales Date: Tue, 17 Sep 2024 11:27:52 -0400 Subject: [PATCH 2/5] gnucobol: rename from gnu-cobol --- pkgs/by-name/gn/{gnu-cobol => gnucobol}/package.nix | 6 +++--- pkgs/top-level/aliases.nix | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) rename pkgs/by-name/gn/{gnu-cobol => gnucobol}/package.nix (95%) diff --git a/pkgs/by-name/gn/gnu-cobol/package.nix b/pkgs/by-name/gn/gnucobol/package.nix similarity index 95% rename from pkgs/by-name/gn/gnu-cobol/package.nix rename to pkgs/by-name/gn/gnucobol/package.nix index 83f24fff864e..e42840bcb163 100644 --- a/pkgs/by-name/gn/gnu-cobol/package.nix +++ b/pkgs/by-name/gn/gnucobol/package.nix @@ -19,7 +19,7 @@ }: stdenv.mkDerivation rec { - pname = "gnu-cobol"; + pname = "gnucobol"; version = "3.2"; src = fetchurl { @@ -107,8 +107,8 @@ stdenv.mkDerivation rec { ''; meta = with lib; { - description = "Open-source COBOL compiler"; - homepage = "https://sourceforge.net/projects/gnucobol/"; + description = "Free/libre COBOL compiler"; + homepage = "https://gnu.org/software/gnucobol/"; license = with licenses; [ gpl3Only lgpl3Only ]; maintainers = with maintainers; [ ericsagnes lovesegfault techknowlogick ]; platforms = platforms.all; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index b2a11c0a2549..85be9b0fa166 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -532,6 +532,7 @@ mapAliases ({ gmpc = throw "'gmpc' has been removed due to lack of maintenance upstream. Consider using 'plattenalbum' instead"; # Added 2024-09-14 gmtk = throw "'gmtk' has been removed due to lack of maintenance upstream"; # Added 2024-09-14 gmtp = throw "'gmtp' has been removed due to lack of maintenance upstream. Consider using 'gnome-music' instead"; # Added 2024-09-14 + gnu-cobol = gnucobol; # Added 2024-09-17 go-dependency-manager = throw "'go-dependency-manager' is unmaintained and the go community now uses 'go.mod' mostly instead"; # Added 2023-10-04 gotktrix = throw "'gotktrix' has been removed, as it was broken and unmaintained"; # Added 2023-12-06 git-backup = throw "git-backup has been removed, as it has been abandoned upstream. Consider using git-backup-go instead."; From 16686f2b3f11bb6a93310aeea723f167dc05f736 Mon Sep 17 00:00:00 2001 From: Enric Morales Date: Thu, 12 Sep 2024 00:58:04 -0400 Subject: [PATCH 3/5] gnucobol: nixfmt --- pkgs/by-name/gn/gnucobol/package.nix | 81 +++++++++++++++++----------- 1 file changed, 50 insertions(+), 31 deletions(-) diff --git a/pkgs/by-name/gn/gnucobol/package.nix b/pkgs/by-name/gn/gnucobol/package.nix index e42840bcb163..f68390c2879a 100644 --- a/pkgs/by-name/gn/gnucobol/package.nix +++ b/pkgs/by-name/gn/gnucobol/package.nix @@ -1,20 +1,21 @@ -{ lib -, stdenv -, fetchurl -, autoconf269 -, automake -, libtool -, pkg-config -# libs -, cjson -, db -, gmp -, libxml2 -, ncurses -# docs -, help2man -, texinfo -, texliveBasic +{ + lib, + stdenv, + fetchurl, + autoconf269, + automake, + libtool, + pkg-config, + # libs + cjson, + db, + gmp, + libxml2, + ncurses, + # docs + help2man, + texinfo, + texliveBasic, # test }: @@ -45,9 +46,14 @@ stdenv.mkDerivation rec { ncurses ]; - outputs = [ "bin" "dev" "lib" "out" ]; + outputs = [ + "bin" + "dev" + "lib" + "out" + ]; # XXX: Without this, we get a cycle between bin and dev - propagatedBuildOutputs = []; + propagatedBuildOutputs = [ ]; # Skips a broken test postPatch = '' @@ -59,15 +65,17 @@ stdenv.mkDerivation rec { sed -i '2894s/^/AT_SKIP_IF([true])/' tests/testsuite.src/run_file.at ''; - preConfigure = '' - autoconf - aclocal - automake - '' + lib.optionalString stdenv.isDarwin '' - # when building with nix on darwin, configure will use GNU strip, - # which fails due to using --strip-unneeded, which is not supported - substituteInPlace configure --replace-fail '"GNU strip"' 'FAKE GNU strip' - ''; + preConfigure = + '' + autoconf + aclocal + automake + '' + + lib.optionalString stdenv.isDarwin '' + # when building with nix on darwin, configure will use GNU strip, + # which fails due to using --strip-unneeded, which is not supported + substituteInPlace configure --replace-fail '"GNU strip"' 'FAKE GNU strip' + ''; # error: call to undeclared function 'xmlCleanupParser' # ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] @@ -75,7 +83,11 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - installFlags = [ "install-pdf" "install-html" "localedir=$out/share/locale" ]; + installFlags = [ + "install-pdf" + "install-html" + "localedir=$out/share/locale" + ]; # Tests must run after install. doCheck = false; @@ -109,8 +121,15 @@ stdenv.mkDerivation rec { meta = with lib; { description = "Free/libre COBOL compiler"; homepage = "https://gnu.org/software/gnucobol/"; - license = with licenses; [ gpl3Only lgpl3Only ]; - maintainers = with maintainers; [ ericsagnes lovesegfault techknowlogick ]; + license = with licenses; [ + gpl3Only + lgpl3Only + ]; + maintainers = with maintainers; [ + ericsagnes + lovesegfault + techknowlogick + ]; platforms = platforms.all; }; } From e1b2d8cfdffc4a4246d637893aab0e6eb246612d Mon Sep 17 00:00:00 2001 From: Enric Morales Date: Thu, 12 Sep 2024 01:08:20 -0400 Subject: [PATCH 4/5] gnucobol: add NIST test suite --- pkgs/by-name/gn/gnucobol/package.nix | 32 +++++++++++++++++++--------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/pkgs/by-name/gn/gnucobol/package.nix b/pkgs/by-name/gn/gnucobol/package.nix index f68390c2879a..62c44ad4a9a1 100644 --- a/pkgs/by-name/gn/gnucobol/package.nix +++ b/pkgs/by-name/gn/gnucobol/package.nix @@ -16,15 +16,22 @@ help2man, texinfo, texliveBasic, -# test + # test + perl, }: - -stdenv.mkDerivation rec { +let + nistTestSuite = fetchurl { + # Used to check GnuCOBOL with the NIST test suite + url = "mirror://sourceforge/gnucobol/newcob.val.tar.gz"; + hash = "sha256-5FE/JqmziRH3v4gv49MzmoC0XKvCyvheswVbD1zofuA="; + }; +in +stdenv.mkDerivation (finalAttrs: { pname = "gnucobol"; version = "3.2"; src = fetchurl { - url = "mirror://sourceforge/gnucobol/${lib.versions.majorMinor version}/gnucobol-${version}.tar.xz"; + url = "mirror://gnu/gnucobol/gnucobol-${finalAttrs.version}.tar.xz"; hash = "sha256-O7SK9GztR3n6z0H9wu5g5My4bqqZ0BCzZoUxXfOcLuI="; }; @@ -32,8 +39,9 @@ stdenv.mkDerivation rec { pkg-config autoconf269 automake - libtool help2man + libtool + perl texinfo texliveBasic ]; @@ -59,10 +67,10 @@ stdenv.mkDerivation rec { postPatch = '' sed -i '/^AT_CHECK.*crud\.cob/i AT_SKIP_IF([true])' tests/testsuite.src/listings.at # upstream reports the following tests as known failures - # test 843: - sed -i '14180i\AT_SKIP_IF([true])' tests/testsuite.src/run_misc.at - # test 875: - sed -i '2894s/^/AT_SKIP_IF([true])/' tests/testsuite.src/run_file.at + # test 843 (runtime check: write to internal storage (1)) + sed -i "/^843;/d" tests/testsuite + # test 875 (INDEXED sample) + sed -i "/^875;/d" tests/testsuite ''; preConfigure = @@ -99,6 +107,10 @@ stdenv.mkDerivation rec { # Run tests TESTSUITEFLAGS="--jobs=$NIX_BUILD_CORES" make check + # Run NIST tests + cp -v ${nistTestSuite} ./tests/cobol85/newcob.val.tar.gz + TESTSUITEFLAGS="--jobs=$NIX_BUILD_CORES" make test + # Sanity check message="Hello, COBOL!" # XXX: Don't for a second think you can just get rid of these spaces, they @@ -132,4 +144,4 @@ stdenv.mkDerivation rec { ]; platforms = platforms.all; }; -} +}) From 621a378cbbea77fca43c30112a9b2f45bd6d8540 Mon Sep 17 00:00:00 2001 From: Enric Morales Date: Tue, 17 Sep 2024 11:25:10 -0400 Subject: [PATCH 5/5] gnucobol: add kiike to maintainers --- pkgs/by-name/gn/gnucobol/package.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/by-name/gn/gnucobol/package.nix b/pkgs/by-name/gn/gnucobol/package.nix index 62c44ad4a9a1..7c698954e5ab 100644 --- a/pkgs/by-name/gn/gnucobol/package.nix +++ b/pkgs/by-name/gn/gnucobol/package.nix @@ -141,6 +141,7 @@ stdenv.mkDerivation (finalAttrs: { ericsagnes lovesegfault techknowlogick + kiike ]; platforms = platforms.all; };