git.iko.soy/typeable/nixpkgs
on master help sign in
gnu-cobol: 2.0-rc2 -> 2.2

Instead of wrapping `cobc` and setting NIX_{LDFLAGS,CFLAGS_COMPILE} set `COB_CC`, `COB_CFLAGS` and `COB_LDFLAGS` to make `cobc` find the necessary libraries.

commite222d21eed9ea6b83b08162ec49f7850aa64a299 authorMoritz Ulrich <moritz@tarn-vedra.de> dateThu 21 Dec 2017, 10:28 (9 years ago) parent3622447
1 file changed+17−12
pkgs/development/compilers/gnu-cobol/default.nix+17−12
pkgs/development/compilers/gnu-cobol/default.nix+17−12
@@ -1,35 +1,40 @@
11{ stdenv, fetchurl, gcc, makeWrapper
22, db, gmp, ncurses }:
33
4−let version = {
5− maj = "2.0";
6− min = "rc-2";
7−};
8−in
4+let
5+ version = "2.2";
6+ lib = stdenv.lib;
7+in
98stdenv.mkDerivation rec {
10− name = "gnu-cobol-${version.maj}${version.min}";
9+ name = "gnu-cobol-${version}";
10+ inherit version;
1111
1212 src = fetchurl {
13− url = "https://sourceforge.com/projects/open-cobol/files/gnu-cobol/${version.maj}/gnu-cobol-${version.maj}_${version.min}.tar.gz";
14− sha256 = "1pj7mjnp3l76zvzrh1xa6d4kw3jkvzqh39sbf02kiinq4y65s7zj";
13+ url = "https://sourceforge.com/projects/open-cobol/files/gnu-cobol/${version}/gnucobol-${version}.tar.gz";
14+ sha256 = "1jrjmdx0swssjh388pp08awhiisbrs2i7gx4lcm4p1k5rpg3hn4j";
1515 };
1616
1717 nativeBuildInputs = [ makeWrapper ];
1818
1919 buildInputs = [ db gmp ncurses ];
2020
21+ cflags = stdenv.lib.concatMapStringsSep " " (p: "-L" + (lib.getLib p) + "/lib ") buildInputs;
22+ ldflags = stdenv.lib.concatMapStringsSep " " (p: "-I" + (lib.getDev p) + "/include ") buildInputs;
23+
24+ cobolCCFlags = "-I$out/include ${ldflags} -L$out/lib ${cflags}";
25+
2126 postInstall = with stdenv.lib; ''
2227 wrapProgram "$out/bin/cobc" \
23− --prefix PATH ':' "${gcc}/bin" \
24− --prefix NIX_LDFLAGS ' ' "'$NIX_LDFLAGS'" \
25− --prefix NIX_CFLAGS_COMPILE ' ' "'$NIX_CFLAGS_COMPILE'"
28+ --set COB_CC "${gcc}/bin/gcc" \
29+ --prefix COB_LDFLAGS " " "${cobolCCFlags}" \
30+ --prefix COB_CFLAGS " " "${cobolCCFlags}"
2631 '';
2732
2833 meta = with stdenv.lib; {
2934 description = "An open-source COBOL compiler";
3035 homepage = https://sourceforge.net/projects/open-cobol/;
3136 license = licenses.gpl3;
32− maintainers = with maintainers; [ ericsagnes ];
37+ maintainers = with maintainers; [ ericsagnes the-kenny ];
3338 platforms = platforms.linux;
3439 };
3540}