1{ stdenv, lib, fetchzip, freeglut, libXmu, libXi, libX11, libICE, libGLU, libGL, libSM
2, libXext, glibc, lua, luabind, glfw, libgccjit, dialog, makeWrapper
3}:
4let
5 lpath = lib.makeLibraryPath [ libXmu libXi libX11 freeglut libICE libGLU libGL libSM libXext glibc lua glfw luabind libgccjit ];
6in
7stdenv.mkDerivation rec {
8 pname = "iceSL";
9 version = "2.4.1";
10
11 src = if stdenv.hostPlatform.system == "x86_64-linux" then fetchzip {
12 url = "https://icesl.loria.fr/assets/other/download.php?build=${version}&os=amd64";
13 extension = "zip";
14 sha256 = "0rrnkqkhlsjclif5cjbf17qz64vs95ja49xarxjvq54wb4jhbs4l";
15 } else if stdenv.hostPlatform.system == "i686-linux" then fetchzip {
16 url = "https://icesl.loria.fr/assets/other/download.php?build=${version}&os=i386";
17 extension = "zip";
18 sha256 = "0n2yyxzw0arkc70f0qli4n5chdlh9vc7aqizk4v7825mcglhwlyh";
19 } else throw "Unsupported architecture";
20
21 nativeBuildInputs = [ makeWrapper ];
22 installPhase = ''
23 cp -r ./ $out
24 rm $out/bin/*.so
25 mkdir $out/oldbin
26 mv $out/bin/IceSL-slicer $out/oldbin/IceSL-slicer
27 runHook postInstall
28 '';
29
30 postInstall = ''
31 patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
32 --set-rpath "${lpath}" \
33 $out/oldbin/IceSL-slicer
34 makeWrapper $out/oldbin/IceSL-slicer $out/bin/icesl --prefix PATH : ${dialog}/bin
35 '';
36
37 meta = with lib; {
38 description = "GPU-accelerated procedural modeler and slicer for 3D printing";
39 homepage = "https://icesl.loria.fr/";
40 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
41 license = licenses.inria-icesl;
42 platforms = [ "i686-linux" "x86_64-linux" ];
43 maintainers = with maintainers; [ mgttlinger ];
44 };
45}