23 nistTestSuite = fetchurl {
24 # Used to check GnuCOBOL with the NIST test suite
25 url = "mirror://sourceforge/gnucobol/newcob.val.tar.gz";
26 hash = "sha256-5FE/JqmziRH3v4gv49MzmoC0XKvCyvheswVbD1zofuA=";
29 stdenv.mkDerivation (finalAttrs: {
34 url = "mirror://gnu/gnucobol/gnucobol-${finalAttrs.version}.tar.xz";
35 hash = "sha256-O7SK9GztR3n6z0H9wu5g5My4bqqZ0BCzZoUxXfOcLuI=";
63 # XXX: Without this, we get a cycle between bin and dev
64 propagatedBuildOutputs = [ ];
68 sed -i '/^AT_CHECK.*crud\.cob/i AT_SKIP_IF([true])' tests/testsuite.src/listings.at
69 # upstream reports the following tests as known failures
70 # test 843 (runtime check: write to internal storage (1))
71 sed -i "/^843;/d" tests/testsuite
72 # test 875 (INDEXED sample)
73 sed -i "/^875;/d" tests/testsuite
82 + lib.optionalString stdenv.hostPlatform.isDarwin ''
83 # when building with nix on darwin, configure will use GNU strip,
84 # which fails due to using --strip-unneeded, which is not supported
85 substituteInPlace configure --replace-fail '"GNU strip"' 'FAKE GNU strip'
88 # error: call to undeclared function 'xmlCleanupParser'
89 # ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
90 env.CFLAGS = lib.optionalString stdenv.hostPlatform.isDarwin "-Wno-error=implicit-function-declaration";
92 enableParallelBuilding = true;
97 "localedir=$out/share/locale"
100 # Tests must run after install.
103 doInstallCheck = true;
104 installCheckPhase = ''
105 runHook preInstallCheck
108 TESTSUITEFLAGS="--jobs=$NIX_BUILD_CORES" make check
111 cp -v ${nistTestSuite} ./tests/cobol85/newcob.val.tar.gz
112 TESTSUITEFLAGS="--jobs=$NIX_BUILD_CORES" make test
115 message="Hello, COBOL!"
116 # XXX: Don't for a second think you can just get rid of these spaces, they
119 IDENTIFICATION DIVISION.
126 $bin/bin/cobc -x -o hello-cobol "hello.cbl"
127 hello="$(./hello-cobol | tee >(cat >&2))"
128 [[ "$hello" == "$message" ]] || exit 1
130 runHook postInstallCheck
134 description = "Free/libre COBOL compiler";
135 homepage = "https://gnu.org/software/gnucobol/";
136 license = with licenses; [
140 maintainers = with maintainers; [
146 platforms = platforms.all;