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