2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitHub
|
|
|
|
, fetchurl
|
|
|
|
, cmake
|
|
|
|
, unzip
|
|
|
|
, makeWrapper
|
2021-12-26 17:43:05 +00:00
|
|
|
, boost169
|
|
|
|
, pinnedBoost ? boost169
|
2020-04-24 23:36:52 +00:00
|
|
|
, llvmPackages
|
|
|
|
, gmp
|
|
|
|
, emacs
|
|
|
|
, jre_headless
|
|
|
|
, tcl
|
|
|
|
, tk
|
|
|
|
}:
|
|
|
|
|
|
|
|
let stdenv = llvmPackages.stdenv;
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "mozart2";
|
|
|
|
version = "2.0.1";
|
|
|
|
name = "${pname}-${version}";
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/mozart/mozart2/releases/download/v${version}/${name}-Source.zip";
|
|
|
|
sha256 = "1mad9z5yzzix87cdb05lmif3960vngh180s2mb66cj5gwh5h9dll";
|
|
|
|
};
|
|
|
|
|
|
|
|
# This is a workaround to avoid using sbt.
|
|
|
|
# I guess it is acceptable to fetch the bootstrapping compiler in binary form.
|
|
|
|
bootcompiler = fetchurl {
|
|
|
|
url = "https://github.com/layus/mozart2/releases/download/v2.0.0-beta.1/bootcompiler.jar";
|
|
|
|
sha256 = "1hgh1a8hgzgr6781as4c4rc52m2wbazdlw3646s57c719g5xphjz";
|
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
patches = [ ./patch-limits.diff ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postConfigure = ''
|
|
|
|
cp ${bootcompiler} bootcompiler/bootcompiler.jar
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cmake makeWrapper unzip ];
|
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DBoost_USE_STATIC_LIBS=OFF"
|
|
|
|
"-DMOZART_BOOST_USE_STATIC_LIBS=OFF"
|
|
|
|
# We are building with clang, as nix does not support having clang and
|
|
|
|
# gcc together as compilers and we need clang for the sources generation.
|
|
|
|
# However, clang emits tons of warnings about gcc's atomic-base library.
|
|
|
|
"-DCMAKE_CXX_FLAGS=-Wno-braced-scalar-init"
|
2020-09-25 04:45:31 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
fixupPhase = ''
|
|
|
|
wrapProgram $out/bin/oz --set OZEMACS ${emacs}/bin/emacs
|
|
|
|
'';
|
|
|
|
|
|
|
|
buildInputs = [
|
2021-12-26 17:43:05 +00:00
|
|
|
pinnedBoost
|
2020-04-24 23:36:52 +00:00
|
|
|
gmp
|
2020-09-25 04:45:31 +00:00
|
|
|
emacs
|
2020-04-24 23:36:52 +00:00
|
|
|
jre_headless
|
|
|
|
tcl
|
|
|
|
tk
|
|
|
|
];
|
|
|
|
|
2022-11-27 09:42:12 +00:00
|
|
|
meta = with lib; {
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "An open source implementation of Oz 3";
|
2022-11-27 09:42:12 +00:00
|
|
|
maintainers = with maintainers; [ layus h7x4 ];
|
|
|
|
license = licenses.bsd2;
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://mozart.github.io";
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|