Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib, stdenv, fetchFromGitHub, fetchpatch, makeWrapper, gmp, gcc }: 2 3stdenv.mkDerivation rec { 4 pname = "mkcl"; 5 version = "1.1.11"; 6 7 src = fetchFromGitHub { 8 owner = "jcbeaudoin"; 9 repo = "mkcl"; 10 rev = "v${version}"; 11 sha256 = "0i2bfkda20lfypis6i4m7srfz6miyf66d8knp693d6sms73m2l26"; 12 }; 13 14 patches = [ 15 # "Array sys_siglist[] never was part of the public interface. Replace it with calls to psiginfo()." 16 (fetchpatch { 17 name = "sys_siglist.patch"; 18 url = "https://github.com/jcbeaudoin/MKCL/commit/0777dd08254c88676f4f101117b10786b22111d6.patch"; 19 sha256 = "1dnr1jzha77nrxs22mclrcqyqvxxn6q1sfn35qjs77fi3jcinjsc"; 20 }) 21 22 # Pull upstream fix for -fno-common toolchins like gcc-10 23 (fetchpatch { 24 name = "fno-common.patch"; 25 url = "https://gitlab.common-lisp.net/mkcl/mkcl/-/commit/ef1981dbf4ceb1793cd6434e66e97b3db48b4ea0.patch"; 26 sha256 = "00y6qanwvgb1r4haaqmvz7lbqa51l4wcnns1rwlfgvcvkpjc3dif"; 27 }) 28 ]; 29 30 nativeBuildInputs = [ makeWrapper ]; 31 32 propagatedBuildInputs = [ gmp ]; 33 34 hardeningDisable = [ "format" ]; 35 36 configureFlags = [ 37 "GMP_CFLAGS=-I${lib.getDev gmp}/include" 38 "GMP_LDFLAGS=-L${gmp.out}/lib" 39 ]; 40 41 # tinycc configure flags copied from the tinycc derivation. 42 postConfigure = ''( 43 cd contrib/tinycc 44 ./configure --cc=cc \ 45 --elfinterp=$(< $NIX_CC/nix-support/dynamic-linker) \ 46 --crtprefix=${lib.getLib stdenv.cc.libc}/lib \ 47 --sysincludepaths=${lib.getDev stdenv.cc.libc}/include:{B}/include \ 48 --libpaths=${lib.getLib stdenv.cc.libc}/lib 49 )''; 50 51 postInstall = '' 52 wrapProgram $out/bin/mkcl --prefix PATH : "${gcc}/bin" 53 ''; 54 55 enableParallelBuilding = true; 56 57 meta = with lib; { 58 broken = (stdenv.isLinux && stdenv.isAarch64); 59 description = "ANSI Common Lisp Implementation"; 60 homepage = "https://common-lisp.net/project/mkcl/"; 61 license = licenses.lgpl2Plus; 62 platforms = platforms.linux; 63 maintainers = lib.teams.lisp.members; 64 }; 65}