2021-01-22 11:25:31 +00:00
|
|
|
{ lib, stdenv, fetchurl, gcc, makeWrapper
|
2017-05-09 06:10:29 +01:00
|
|
|
, db, gmp, ncurses }:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 13:41:18 +01:00
|
|
|
pname = "gnu-cobol";
|
2021-01-25 16:38:04 +00:00
|
|
|
version = "3.1.2";
|
2017-05-09 06:10:29 +01:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-01-25 16:38:04 +00:00
|
|
|
url = "mirror://sourceforge/gnucobol/${lib.versions.majorMinor version}/gnucobol-${version}.tar.xz";
|
|
|
|
sha256 = "0x15ybfm63g7c9340fc6712h9v59spnbyaz4rf85pmnp3zbhaw2r";
|
2017-05-09 06:10:29 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
|
|
|
buildInputs = [ db gmp ncurses ];
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
cflags = lib.concatMapStringsSep " " (p: "-L" + (lib.getLib p) + "/lib ") buildInputs;
|
|
|
|
ldflags = lib.concatMapStringsSep " " (p: "-I" + (lib.getDev p) + "/include ") buildInputs;
|
2017-12-21 09:28:52 +00:00
|
|
|
|
|
|
|
cobolCCFlags = "-I$out/include ${ldflags} -L$out/lib ${cflags}";
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
postInstall = with lib; ''
|
2017-05-09 06:10:29 +01:00
|
|
|
wrapProgram "$out/bin/cobc" \
|
2017-12-21 09:28:52 +00:00
|
|
|
--set COB_CC "${gcc}/bin/gcc" \
|
|
|
|
--prefix COB_LDFLAGS " " "${cobolCCFlags}" \
|
|
|
|
--prefix COB_CFLAGS " " "${cobolCCFlags}"
|
2017-05-09 06:10:29 +01:00
|
|
|
'';
|
|
|
|
|
2021-01-22 11:25:31 +00:00
|
|
|
meta = with lib; {
|
2017-05-09 06:10:29 +01:00
|
|
|
description = "An open-source COBOL compiler";
|
2021-01-25 16:38:04 +00:00
|
|
|
homepage = "https://sourceforge.net/projects/gnucobol/";
|
|
|
|
license = with licenses; [ gpl3Only lgpl3Only ];
|
2020-05-09 10:25:07 +01:00
|
|
|
maintainers = with maintainers; [ ericsagnes ];
|
2021-01-25 16:38:04 +00:00
|
|
|
platforms = platforms.all;
|
2017-05-09 06:10:29 +01:00
|
|
|
};
|
|
|
|
}
|