nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{ lib, stdenv, writeScript, callPackage, buildFHSEnv, unwrapped ? callPackage ./runtime.nix {} }:
2
3buildFHSEnv rec {
4 name = "houdini-${unwrapped.version}";
5
6 # houdini spawns hserver (and other license tools) that is supposed to live beyond the lifespan of houdini process
7 dieWithParent = false;
8
9 # houdini needs to communicate with hserver process that it seem to be checking to be present in running processes
10 unsharePid = false;
11
12 targetPkgs = pkgs: with pkgs; [
13 libGLU
14 libGL
15 alsa-lib
16 fontconfig
17 zlib
18 libpng
19 dbus
20 nss
21 nspr
22 expat
23 pciutils
24 libxkbcommon
25 libudev0-shim
26 tbb
27 xwayland
28 qt5.qtwayland
29 nettools # needed by licensing tools
30 bintools # needed for ld and other tools, so ctypes can find/load sos from python
31 ocl-icd # needed for opencl
32 numactl # needed by hfs ocl backend
33 ncurses5 # needed by hfs ocl backend
34 ] ++ (with xorg; [
35 libICE
36 libSM
37 libXmu
38 libXi
39 libXt
40 libXext
41 libX11
42 libXrender
43 libXcursor
44 libXfixes
45 libXrender
46 libXcomposite
47 libXdamage
48 libXtst
49 libxcb
50 libXScrnSaver
51 libXrandr
52 libxcb
53 xcbutil
54 xcbutilimage
55 xcbutilrenderutil
56 xcbutilcursor
57 xcbutilkeysyms
58 xcbutilwm
59 ]);
60
61 passthru = {
62 inherit unwrapped;
63 };
64
65 extraInstallCommands = let
66 executables = [
67 "bin/houdini" # houdini flavours
68 "bin/houdinicore"
69 "bin/houdinifx"
70 "bin/hgpuinfo" # houdini ocl config tool
71 "bin/hotl" # hda/otl manipulation tool
72 "bin/hython" # hython
73 "bin/hkey" # license administration
74 "houdini/sbin/sesinetd"
75 ];
76 in ''
77 WRAPPER=$out/bin/${name}
78 EXECUTABLES="${lib.concatStringsSep " " executables}"
79 for executable in $EXECUTABLES; do
80 mkdir -p $out/$(dirname $executable)
81
82 echo "#!${stdenv.shell}" >> $out/$executable
83 echo "$WRAPPER ${unwrapped}/$executable \$@" >> $out/$executable
84 done
85
86 cd $out
87 chmod +x $EXECUTABLES
88 '';
89
90 extraBwrapArgs = [
91 "--ro-bind-try /run/opengl-driver/etc/OpenCL/vendors /etc/OpenCL/vendors" # this is the case of NixOS
92 "--ro-bind-try /etc/OpenCL/vendors /etc/OpenCL/vendors" # this is the case of not NixOS
93 ];
94
95 runScript = writeScript "${name}-wrapper" ''
96 exec $@
97 '';
98}