nixpkgs/pkgs/by-name/mo/mosml/package.nix
Troels Henriksen 27a515f9dd mosml: pass -fpermissive to C compiler
The MosML build system relies on some terrible C that GCC 14 now
refuses to compile. This has supposedly been fixed in MosML upstream,
but the fix is not yet in any released version. It is not so easy to
simply cherry-pick the changes necessary to make GCC 14 work, since
they seem spread over various different commits. This change serves to
make this rather obscure derivation work for a little while longer.
2025-01-02 21:02:26 +01:00

50 lines
1.0 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
gmp,
perl,
}:
stdenv.mkDerivation rec {
pname = "mosml";
version = "2.10.1";
buildInputs = [
gmp
perl
];
makeFlags = [
"PREFIX=$(out)"
"CC=${stdenv.cc.targetPrefix}cc"
];
env.NIX_CFLAGS_COMPILE = "-fpermissive";
src = fetchFromGitHub {
owner = "kfl";
repo = "mosml";
rev = "ver-${version}";
sha256 = "sha256-GK39WvM7NNhoC5f0Wjy4/5VWT+Rbh2qo+W71hWrbPso=";
};
setSourceRoot = ''export sourceRoot="$(echo */src)"'';
# MosML needs a specific RPATH entry pointing to $(out)/lib (added
# by the build system), which patchelf will remove.
dontPatchELF = true;
meta = with lib; {
description = "Light-weight implementation of Standard ML";
longDescription = ''
Moscow ML is a light-weight implementation of Standard ML (SML), a strict
functional language used in teaching and research.
'';
homepage = "https://mosml.org/";
license = licenses.gpl2;
platforms = platforms.unix;
maintainers = with maintainers; [ vaibhavsagar ];
};
}