2021-07-30 02:16:40 +00:00
|
|
|
{ lib, stdenv, fetchFromGitHub, fetchpatch, makeWrapper, gmp, gcc }:
|
2015-03-27 05:24:35 +00:00
|
|
|
|
2021-07-30 08:27:09 +00:00
|
|
|
stdenv.mkDerivation rec {
|
2019-08-15 12:41:18 +00:00
|
|
|
pname = "mkcl";
|
2019-05-17 21:10:49 +00:00
|
|
|
version = "1.1.11";
|
2015-03-27 05:24:35 +00:00
|
|
|
|
2017-11-15 17:09:18 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "jcbeaudoin";
|
|
|
|
repo = "mkcl";
|
2019-05-17 21:10:49 +00:00
|
|
|
rev = "v${version}";
|
|
|
|
sha256 = "0i2bfkda20lfypis6i4m7srfz6miyf66d8knp693d6sms73m2l26";
|
2015-03-27 05:24:35 +00:00
|
|
|
};
|
|
|
|
|
2021-07-30 02:16:40 +00:00
|
|
|
patches = [
|
|
|
|
# "Array sys_siglist[] never was part of the public interface. Replace it with calls to psiginfo()."
|
|
|
|
(fetchpatch {
|
|
|
|
name = "sys_siglist.patch";
|
|
|
|
url = "https://github.com/jcbeaudoin/MKCL/commit/0777dd08254c88676f4f101117b10786b22111d6.patch";
|
|
|
|
sha256 = "1dnr1jzha77nrxs22mclrcqyqvxxn6q1sfn35qjs77fi3jcinjsc";
|
|
|
|
})
|
2022-05-22 10:28:27 +00:00
|
|
|
|
|
|
|
# Pull upstream fix for -fno-common toolchins like gcc-10
|
|
|
|
(fetchpatch {
|
|
|
|
name = "fno-common.patch";
|
|
|
|
url = "https://gitlab.common-lisp.net/mkcl/mkcl/-/commit/ef1981dbf4ceb1793cd6434e66e97b3db48b4ea0.patch";
|
|
|
|
sha256 = "00y6qanwvgb1r4haaqmvz7lbqa51l4wcnns1rwlfgvcvkpjc3dif";
|
|
|
|
})
|
2021-07-30 02:16:40 +00:00
|
|
|
];
|
|
|
|
|
2017-11-15 17:09:18 +00:00
|
|
|
nativeBuildInputs = [ makeWrapper ];
|
|
|
|
|
2015-03-27 05:24:35 +00:00
|
|
|
propagatedBuildInputs = [ gmp ];
|
|
|
|
|
2016-02-26 17:38:15 +00:00
|
|
|
hardeningDisable = [ "format" ];
|
2016-02-12 12:44:15 +00:00
|
|
|
|
2015-03-27 05:24:35 +00:00
|
|
|
configureFlags = [
|
2021-07-30 08:27:09 +00:00
|
|
|
"GMP_CFLAGS=-I${lib.getDev gmp}/include"
|
2015-10-15 15:43:23 +00:00
|
|
|
"GMP_LDFLAGS=-L${gmp.out}/lib"
|
2015-03-27 05:24:35 +00:00
|
|
|
];
|
|
|
|
|
2017-11-15 17:09:18 +00:00
|
|
|
# tinycc configure flags copied from the tinycc derivation.
|
|
|
|
postConfigure = ''(
|
|
|
|
cd contrib/tinycc
|
|
|
|
./configure --cc=cc \
|
|
|
|
--elfinterp=$(< $NIX_CC/nix-support/dynamic-linker) \
|
2021-07-30 08:27:09 +00:00
|
|
|
--crtprefix=${lib.getLib stdenv.cc.libc}/lib \
|
|
|
|
--sysincludepaths=${lib.getDev stdenv.cc.libc}/include:{B}/include \
|
|
|
|
--libpaths=${lib.getLib stdenv.cc.libc}/lib
|
2017-11-15 17:09:18 +00:00
|
|
|
)'';
|
|
|
|
|
2015-10-14 21:39:12 +00:00
|
|
|
postInstall = ''
|
|
|
|
wrapProgram $out/bin/mkcl --prefix PATH : "${gcc}/bin"
|
|
|
|
'';
|
|
|
|
|
2017-11-15 17:09:18 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2021-07-30 08:27:09 +00:00
|
|
|
meta = with lib; {
|
2022-05-29 10:10:05 +00:00
|
|
|
broken = (stdenv.isLinux && stdenv.isAarch64);
|
2015-03-27 05:24:35 +00:00
|
|
|
description = "ANSI Common Lisp Implementation";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "https://common-lisp.net/project/mkcl/";
|
2017-11-15 17:09:18 +00:00
|
|
|
license = licenses.lgpl2Plus;
|
|
|
|
platforms = platforms.linux;
|
|
|
|
maintainers = with maintainers; [ tohl ];
|
2015-03-27 05:24:35 +00:00
|
|
|
};
|
|
|
|
}
|