|
| 1 | +{ stdenv, requireFile, zlib, libpng, libSM, libICE, fontconfig, xorg, mesa_glu, bc }: |
| 2 | + |
| 3 | +let |
| 4 | + ld_library_path = builtins.concatStringsSep ":" [ |
| 5 | + "${stdenv.cc.cc.lib}/lib64" |
| 6 | + "/run/opengl-driver/lib" |
| 7 | + (stdenv.lib.makeLibraryPath [ |
| 8 | + mesa_glu |
| 9 | + xorg.libXmu |
| 10 | + xorg.libXi |
| 11 | + xorg.libXext |
| 12 | + xorg.libX11 |
| 13 | + xorg.libXrender |
| 14 | + fontconfig |
| 15 | + libSM |
| 16 | + libICE |
| 17 | + zlib |
| 18 | + libpng |
| 19 | + ]) |
| 20 | + ]; |
| 21 | + license_dir = "~/.config/houdini"; |
| 22 | +in |
| 23 | +stdenv.mkDerivation rec { |
| 24 | + version = "16.0.633"; |
| 25 | + name = "houdini-runtime-${version}"; |
| 26 | + src = requireFile rec { |
| 27 | + name = "houdini-16.0.633-linux_x86_64_gcc4.8.tar.gz"; |
| 28 | + sha256 = "1laxncwgsr4hj53bn4pn9ibv3pkrpliwxlx0558wgnhq42js3wvl"; |
| 29 | + message = '' |
| 30 | + This nix expression requires that ${name} is already part of the store. |
| 31 | + Download it from https://sidefx.com and add it to the nix store with: |
| 32 | + |
| 33 | + nix-prefetch-url <URL> |
| 34 | +
|
| 35 | + This can't be done automatically because you need to create an account on |
| 36 | + their website and agree to their license terms before you can download |
| 37 | + it. That's what you get for using proprietary software. |
| 38 | + ''; |
| 39 | + }; |
| 40 | + |
| 41 | + buildInputs = [ bc ]; |
| 42 | + installPhase = '' |
| 43 | + patchShebangs houdini.install |
| 44 | + mkdir -p $out |
| 45 | + sed -i "s|/usr/lib/sesi|${license_dir}|g" houdini.install |
| 46 | + ./houdini.install --install-houdini \ |
| 47 | + --no-install-menus \ |
| 48 | + --no-install-bin-symlink \ |
| 49 | + --auto-install \ |
| 50 | + --no-root-check \ |
| 51 | + --accept-EULA \ |
| 52 | + $out |
| 53 | + sed -i "s|/usr/lib/sesi|${license_dir}|g" $out/houdini/Licensing.opt |
| 54 | + sed -i "s|/usr/lib/sesi|${license_dir}|g" $out/houdini/sbin/sesinetd_safe |
| 55 | + sed -i "s|/usr/lib/sesi|${license_dir}|g" $out/houdini/sbin/sesinetd.startup |
| 56 | + echo "export LD_LIBRARY_PATH=${ld_library_path}" >> $out/bin/app_init.sh |
| 57 | + echo "export LD_LIBRARY_PATH=${ld_library_path}" >> $out/houdini/sbin/app_init.sh |
| 58 | + ''; |
| 59 | + postFixup = '' |
| 60 | + INTERPRETER="$(cat "$NIX_CC"/nix-support/dynamic-linker)" |
| 61 | + for BIN in $(find $out/bin -type f -executable); do |
| 62 | + if patchelf $BIN 2>/dev/null ; then |
| 63 | + echo "Patching ELF $BIN" |
| 64 | + patchelf --set-interpreter "$INTERPRETER" "$BIN" |
| 65 | + fi |
| 66 | + done |
| 67 | + ''; |
| 68 | + meta = { |
| 69 | + description = "3D animation application software"; |
| 70 | + homepage = "https://sidefx.com"; |
| 71 | + license = stdenv.lib.licenses.unfree; |
| 72 | + platforms = stdenv.lib.platforms.linux; |
| 73 | + maintainers = [ stdenv.lib.maintainers.canndrew ]; |
| 74 | + }; |
| 75 | +} |
| 76 | + |
0 commit comments