vifm: 0.13 -> 0.14 (#380559)
[NixPkgs.git] / pkgs / by-name / ic / icesl / package.nix
blobcf0494f76f6e1d2a8801dd5de6247940a7d6b982
2   stdenv,
3   lib,
4   fetchzip,
5   libglut,
6   libXmu,
7   libXi,
8   libX11,
9   libICE,
10   libGLU,
11   libGL,
12   libSM,
13   libXext,
14   glibc,
15   lua,
16   luabind,
17   glfw,
18   libgccjit,
19   dialog,
20   makeWrapper,
22 let
23   lpath = lib.makeLibraryPath [
24     libXmu
25     libXi
26     libX11
27     libglut
28     libICE
29     libGLU
30     libGL
31     libSM
32     libXext
33     glibc
34     lua
35     glfw
36     luabind
37     libgccjit
38   ];
40 stdenv.mkDerivation rec {
41   pname = "iceSL";
42   version = "2.4.1";
44   src =
45     if stdenv.hostPlatform.system == "x86_64-linux" then
46       fetchzip {
47         url = "https://icesl.loria.fr/assets/other/download.php?build=${version}&os=amd64";
48         extension = "zip";
49         sha256 = "0rrnkqkhlsjclif5cjbf17qz64vs95ja49xarxjvq54wb4jhbs4l";
50       }
51     else if stdenv.hostPlatform.system == "i686-linux" then
52       fetchzip {
53         url = "https://icesl.loria.fr/assets/other/download.php?build=${version}&os=i386";
54         extension = "zip";
55         sha256 = "0n2yyxzw0arkc70f0qli4n5chdlh9vc7aqizk4v7825mcglhwlyh";
56       }
57     else
58       throw "Unsupported architecture";
60   nativeBuildInputs = [ makeWrapper ];
61   installPhase = ''
62     cp -r ./ $out
63     rm $out/bin/*.so
64     mkdir $out/oldbin
65     mv $out/bin/IceSL-slicer $out/oldbin/IceSL-slicer
66     runHook postInstall
67   '';
69   postInstall = ''
70     patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
71       --set-rpath "${lpath}" \
72       $out/oldbin/IceSL-slicer
73     makeWrapper $out/oldbin/IceSL-slicer $out/bin/icesl --prefix PATH : ${dialog}/bin
74   '';
76   meta = with lib; {
77     description = "GPU-accelerated procedural modeler and slicer for 3D printing";
78     homepage = "https://icesl.loria.fr/";
79     sourceProvenance = with sourceTypes; [ binaryNativeCode ];
80     license = licenses.inria-icesl;
81     platforms = [
82       "i686-linux"
83       "x86_64-linux"
84     ];
85     maintainers = with maintainers; [ mgttlinger ];
86   };