aerospike: 8.0.0.1 -> 8.0.0.2 (#380565)
[NixPkgs.git] / pkgs / development / compilers / mozart / binary.nix
blob12983124b0e42bf3ca96d60c38031e0ab30ae0bb
2   lib,
3   stdenv,
4   fetchurl,
5   makeWrapper,
6   boost,
7   gmp,
8   tcl-8_5,
9   tk-8_5,
10   emacs,
13 let
14   version = "2.0.0";
16   binaries = {
17     x86_64-linux = fetchurl {
18       url = "mirror://sourceforge/project/mozart-oz/v${version}-alpha.0/mozart2-${version}-alpha.0+build.4105.5c06ced-x86_64-linux.tar.gz";
19       sha256 = "0rsfrjimjxqbwprpzzlmydl3z3aiwg5qkb052jixdxjyad7gyh5z";
20     };
21   };
24 stdenv.mkDerivation {
25   pname = "mozart-binary";
26   inherit version;
28   preferLocalBuild = true;
30   src =
31     binaries.${stdenv.hostPlatform.system}
32       or (throw "unsupported system: ${stdenv.hostPlatform.system}");
34   libPath = lib.makeLibraryPath [
35     stdenv.cc.cc
36     boost
37     gmp
38     tcl-8_5
39     tk-8_5
40   ];
42   TK_LIBRARY = "${tk-8_5}/lib/tk8.5";
44   nativeBuildInputs = [ makeWrapper ];
46   buildCommand = ''
47     mkdir $out
48     tar xvf $src -C $out --strip-components=1
50     for exe in $out/bin/{ozemulator,ozwish} ; do
51       patchelf --set-interpreter $(< $NIX_CC/nix-support/dynamic-linker) \
52                --set-rpath $libPath \
53                $exe
54     done
56     wrapProgram $out/bin/ozwish \
57       --set OZHOME $out \
58       --set TK_LIBRARY $TK_LIBRARY
60     wrapProgram $out/bin/ozemulator --set OZHOME $out
62     ${lib.optionalString (emacs != null) ''
63       wrapProgram $out/bin/oz --suffix PATH ":" ${lib.makeBinPath [ emacs ]}
64     ''}
66     sed -i $out/share/applications/oz.desktop \
67         -e "s,Exec=oz %u,Exec=$out/bin/oz %u,"
69     gzip -9n $out/share/mozart/elisp"/"*.elc
71     patchShebangs $out
72   '';
74   meta = with lib; {
75     homepage = "https://www.mozart-oz.org/";
76     description = "Multiplatform implementation of the Oz programming language";
77     longDescription = ''
78       The Mozart Programming System combines ongoing research in
79       programming language design and implementation, constraint logic
80       programming, distributed computing, and human-computer
81       interfaces. Mozart implements the Oz language and provides both
82       expressive power and advanced functionality.
83     '';
84     sourceProvenance = with sourceTypes; [ binaryBytecode ];
85     license = licenses.mit;
86     platforms = attrNames binaries;
87     hydraPlatforms = [ ];
88   };