2017-05-09 07:10:29 +02:00
|
|
|
{ stdenv, fetchurl, gcc, makeWrapper
|
|
|
|
, db, gmp, ncurses }:
|
|
|
|
|
2017-12-21 10:28:52 +01:00
|
|
|
let
|
|
|
|
version = "2.2";
|
|
|
|
lib = stdenv.lib;
|
|
|
|
in
|
2017-05-09 07:10:29 +02:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 14:41:18 +02:00
|
|
|
pname = "gnu-cobol";
|
2017-12-21 10:28:52 +01:00
|
|
|
inherit version;
|
2017-05-09 07:10:29 +02:00
|
|
|
|
|
|
|
src = fetchurl {
|
2017-12-21 10:28:52 +01:00
|
|
|
url = "https://sourceforge.com/projects/open-cobol/files/gnu-cobol/${version}/gnucobol-${version}.tar.gz";
|
|
|
|
sha256 = "1jrjmdx0swssjh388pp08awhiisbrs2i7gx4lcm4p1k5rpg3hn4j";
|
2017-05-09 07:10:29 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [ db gmp ncurses ];
|
|
|
|
|
2017-12-21 10:28:52 +01:00
|
|
|
cflags = stdenv.lib.concatMapStringsSep " " (p: "-L" + (lib.getLib p) + "/lib ") buildInputs;
|
|
|
|
ldflags = stdenv.lib.concatMapStringsSep " " (p: "-I" + (lib.getDev p) + "/include ") buildInputs;
|
|
|
|
|
|
|
|
cobolCCFlags = "-I$out/include ${ldflags} -L$out/lib ${cflags}";
|
|
|
|
|
2017-05-09 07:10:29 +02:00
|
|
|
postInstall = with stdenv.lib; ''
|
|
|
|
wrapProgram "$out/bin/cobc" \
|
2017-12-21 10:28:52 +01:00
|
|
|
--set COB_CC "${gcc}/bin/gcc" \
|
|
|
|
--prefix COB_LDFLAGS " " "${cobolCCFlags}" \
|
|
|
|
--prefix COB_CFLAGS " " "${cobolCCFlags}"
|
2017-05-09 07:10:29 +02:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "An open-source COBOL compiler";
|
2017-08-02 23:50:51 +02:00
|
|
|
homepage = https://sourceforge.net/projects/open-cobol/;
|
2017-05-09 07:10:29 +02:00
|
|
|
license = licenses.gpl3;
|
2017-12-21 10:28:52 +01:00
|
|
|
maintainers = with maintainers; [ ericsagnes the-kenny ];
|
2019-02-12 04:55:07 +01:00
|
|
|
platforms = with platforms; linux ++ darwin;
|
2017-05-09 07:10:29 +02:00
|
|
|
};
|
|
|
|
}
|