From 83eb83e70e8b05757cd291963e0aa851a6cbc813 Mon Sep 17 00:00:00 2001 From: Kai Wohlfahrt Date: Sat, 26 Jun 2021 23:51:48 +0100 Subject: [PATCH 1/3] houdini: remove unnecessary build steps --- pkgs/applications/misc/houdini/default.nix | 4 ---- pkgs/applications/misc/houdini/runtime.nix | 9 --------- 2 files changed, 13 deletions(-) diff --git a/pkgs/applications/misc/houdini/default.nix b/pkgs/applications/misc/houdini/default.nix index db06efd6a2a2..3a63883c6989 100644 --- a/pkgs/applications/misc/houdini/default.nix +++ b/pkgs/applications/misc/houdini/default.nix @@ -5,10 +5,6 @@ let in buildFHSUserEnv { name = "houdini-${houdini-runtime.version}"; - extraBuildCommands = '' - mkdir -p $out/usr/lib/sesi - ''; - passthru = { unwrapped = houdini-runtime; }; diff --git a/pkgs/applications/misc/houdini/runtime.nix b/pkgs/applications/misc/houdini/runtime.nix index 8436b66719f7..fdf50cbe0eec 100644 --- a/pkgs/applications/misc/houdini/runtime.nix +++ b/pkgs/applications/misc/houdini/runtime.nix @@ -68,15 +68,6 @@ stdenv.mkDerivation rec { echo "export LD_LIBRARY_PATH=${ld_library_path}" >> $out/houdini/sbin/app_init.sh echo "export QT_XKB_CONFIG_ROOT="${xkeyboardconfig}/share/X11/xkb"" >> $out/houdini/sbin/app_init.sh ''; - postFixup = '' - INTERPRETER="$(cat "$NIX_CC"/nix-support/dynamic-linker)" - for BIN in $(find $out/bin -type f -executable); do - if patchelf $BIN 2>/dev/null ; then - echo "Patching ELF $BIN" - patchelf --set-interpreter "$INTERPRETER" "$BIN" - fi - done - ''; meta = { description = "3D animation application software"; homepage = "https://www.sidefx.com"; From d9f81d9bf62f9c0f28aa17856256a68c3a39775c Mon Sep 17 00:00:00 2001 From: Kai Wohlfahrt Date: Sun, 27 Jun 2021 21:47:50 +0100 Subject: [PATCH 2/3] Switch to pure FHS env --- pkgs/applications/misc/houdini/default.nix | 18 ++++--- pkgs/applications/misc/houdini/runtime.nix | 55 ++++------------------ 2 files changed, 20 insertions(+), 53 deletions(-) diff --git a/pkgs/applications/misc/houdini/default.nix b/pkgs/applications/misc/houdini/default.nix index 3a63883c6989..e681854de07a 100644 --- a/pkgs/applications/misc/houdini/default.nix +++ b/pkgs/applications/misc/houdini/default.nix @@ -1,14 +1,18 @@ { callPackage, buildFHSUserEnv, undaemonize, unwrapped ? callPackage ./runtime.nix {} }: -let - houdini-runtime = callPackage ./runtime.nix { }; -in buildFHSUserEnv { - name = "houdini-${houdini-runtime.version}"; +buildFHSUserEnv { + name = "houdini-${unwrapped.version}"; + + targetPkgs = pkgs: with pkgs; [ + libGLU libGL alsa-lib fontconfig zlib libpng dbus nss nspr expat pciutils libxkbcommon + ] ++ (with xorg; [ + libICE libSM libXmu libXi libXext libX11 libXrender libXcursor libXfixes + libXrender libXcomposite libXdamage libXtst libxcb libXScrnSaver + ]); passthru = { - unwrapped = houdini-runtime; + inherit unwrapped; }; - runScript = "${undaemonize}/bin/undaemonize ${houdini-runtime}/bin/houdini"; + runScript = "${undaemonize}/bin/undaemonize ${unwrapped}/bin/houdini"; } - diff --git a/pkgs/applications/misc/houdini/runtime.nix b/pkgs/applications/misc/houdini/runtime.nix index fdf50cbe0eec..452c763338f2 100644 --- a/pkgs/applications/misc/houdini/runtime.nix +++ b/pkgs/applications/misc/houdini/runtime.nix @@ -1,50 +1,17 @@ -{ lib, stdenv, requireFile, zlib, libpng, libSM, libICE, fontconfig, xorg, libGLU, libGL, alsa-lib -, dbus, xkeyboardconfig, nss, nspr, expat, pciutils, libxkbcommon, bc, addOpenGLRunpath -}: +{ lib, stdenv, requireFile, bc }: let - # NOTE: Some dependencies only show in errors when run with QT_DEBUG_PLUGINS=1 - ld_library_path = builtins.concatStringsSep ":" [ - "${stdenv.cc.cc.lib}/lib64" - (lib.makeLibraryPath [ - libGLU - libGL - xorg.libXmu - xorg.libXi - xorg.libXext - xorg.libX11 - xorg.libXrender - xorg.libXcursor - xorg.libXfixes - xorg.libXrender - xorg.libXcomposite - xorg.libXdamage - xorg.libXtst - xorg.libxcb - xorg.libXScrnSaver - alsa-lib - fontconfig - libSM - libICE - zlib - libpng - dbus - addOpenGLRunpath.driverLink - nss - nspr - expat - pciutils - libxkbcommon - ]) - ]; license_dir = "~/.config/houdini"; in stdenv.mkDerivation rec { version = "18.0.460"; pname = "houdini-runtime"; src = requireFile rec { + #name = "houdini-py3-${version}-linux_x86_64_gcc6.3.tar.gz"; + #sha256 = "10qp8nml1ivl0syh0iwzx3zdwdpilnwakax50wydcrzdzyxza7xw"; # 18.5.621 + #sha256 = "1b1k7rkn7svmciijqdwvi9p00srsf81vkb55grjg6xa7fgyidjx1"; # 18.5.596 name = "houdini-${version}-linux_x86_64_gcc6.3.tar.gz"; - sha256 = "18rbwszcks2zfn9zbax62rxmq50z9mc3h39b13jpd39qjqdd3jsd"; + sha256 = "18rbwszcks2zfn9zbax62rxmq50z9mc3h39b13jpd39qjqdd3jsd"; # 18.0.460 url = meta.homepage; }; @@ -63,17 +30,13 @@ stdenv.mkDerivation rec { echo -e "localValidatorDir = ${license_dir}\nlicensingMode = localValidator" > $out/houdini/Licensing.opt sed -i "s|/usr/lib/sesi|${license_dir}|g" $out/houdini/sbin/sesinetd_safe sed -i "s|/usr/lib/sesi|${license_dir}|g" $out/houdini/sbin/sesinetd.startup - echo "export LD_LIBRARY_PATH=${ld_library_path}" >> $out/bin/app_init.sh - echo "export QT_XKB_CONFIG_ROOT="${xkeyboardconfig}/share/X11/xkb"" >> $out/bin/app_init.sh - echo "export LD_LIBRARY_PATH=${ld_library_path}" >> $out/houdini/sbin/app_init.sh - echo "export QT_XKB_CONFIG_ROOT="${xkeyboardconfig}/share/X11/xkb"" >> $out/houdini/sbin/app_init.sh ''; - meta = { + meta = with lib; { description = "3D animation application software"; homepage = "https://www.sidefx.com"; - license = lib.licenses.unfree; - platforms = lib.platforms.linux; + license = licenses.unfree; + platforms = platforms.linux; hydraPlatforms = [ ]; # requireFile src's should be excluded - maintainers = with lib.maintainers; [ canndrew kwohlfahrt ]; + maintainers = with maintainers; [ canndrew kwohlfahrt ]; }; } From 6fb4874a07ee098489a035bee2325ba5a55def45 Mon Sep 17 00:00:00 2001 From: Kai Wohlfahrt Date: Sun, 27 Jun 2021 22:58:58 +0100 Subject: [PATCH 3/3] houdini: 18.0 -> 18.5 sesinetd must be started manually for licensing to succeed. Also add individual tools to the output. hkey requires libudev, and something requires tbb. --- pkgs/applications/misc/houdini/default.nix | 27 ++++++++++++++++++---- pkgs/applications/misc/houdini/runtime.nix | 20 ++++++++-------- 2 files changed, 32 insertions(+), 15 deletions(-) diff --git a/pkgs/applications/misc/houdini/default.nix b/pkgs/applications/misc/houdini/default.nix index e681854de07a..81a5eddaf6ed 100644 --- a/pkgs/applications/misc/houdini/default.nix +++ b/pkgs/applications/misc/houdini/default.nix @@ -1,10 +1,11 @@ -{ callPackage, buildFHSUserEnv, undaemonize, unwrapped ? callPackage ./runtime.nix {} }: +{ lib, stdenv, writeScript, callPackage, buildFHSUserEnv, undaemonize, unwrapped ? callPackage ./runtime.nix {} }: -buildFHSUserEnv { +buildFHSUserEnv rec { name = "houdini-${unwrapped.version}"; targetPkgs = pkgs: with pkgs; [ - libGLU libGL alsa-lib fontconfig zlib libpng dbus nss nspr expat pciutils libxkbcommon + libGLU libGL alsa-lib fontconfig zlib libpng dbus nss nspr expat pciutils + libxkbcommon libudev tbb ] ++ (with xorg; [ libICE libSM libXmu libXi libXext libX11 libXrender libXcursor libXfixes libXrender libXcomposite libXdamage libXtst libxcb libXScrnSaver @@ -14,5 +15,23 @@ buildFHSUserEnv { inherit unwrapped; }; - runScript = "${undaemonize}/bin/undaemonize ${unwrapped}/bin/houdini"; + extraInstallCommands = let + executables = [ "bin/houdini" "bin/hkey" "houdini/sbin/sesinetd" ]; + in '' + WRAPPER=$out/bin/${name} + EXECUTABLES="${lib.concatStringsSep " " executables}" + for executable in $EXECUTABLES; do + mkdir -p $out/$(dirname $executable) + + echo "#!${stdenv.shell}" >> $out/$executable + echo "$WRAPPER ${unwrapped}/$executable \$@" >> $out/$executable + done + + cd $out + chmod +x $EXECUTABLES + ''; + + runScript = writeScript "${name}-wrapper" '' + exec $@ + ''; } diff --git a/pkgs/applications/misc/houdini/runtime.nix b/pkgs/applications/misc/houdini/runtime.nix index 452c763338f2..4fb2d91b99f4 100644 --- a/pkgs/applications/misc/houdini/runtime.nix +++ b/pkgs/applications/misc/houdini/runtime.nix @@ -4,14 +4,11 @@ let license_dir = "~/.config/houdini"; in stdenv.mkDerivation rec { - version = "18.0.460"; + version = "18.5.596"; pname = "houdini-runtime"; src = requireFile rec { - #name = "houdini-py3-${version}-linux_x86_64_gcc6.3.tar.gz"; - #sha256 = "10qp8nml1ivl0syh0iwzx3zdwdpilnwakax50wydcrzdzyxza7xw"; # 18.5.621 - #sha256 = "1b1k7rkn7svmciijqdwvi9p00srsf81vkb55grjg6xa7fgyidjx1"; # 18.5.596 - name = "houdini-${version}-linux_x86_64_gcc6.3.tar.gz"; - sha256 = "18rbwszcks2zfn9zbax62rxmq50z9mc3h39b13jpd39qjqdd3jsd"; # 18.0.460 + name = "houdini-py3-${version}-linux_x86_64_gcc6.3.tar.gz"; + sha256 = "1b1k7rkn7svmciijqdwvi9p00srsf81vkb55grjg6xa7fgyidjx1"; url = meta.homepage; }; @@ -19,18 +16,19 @@ stdenv.mkDerivation rec { installPhase = '' patchShebangs houdini.install mkdir -p $out - sed -i "s|/usr/lib/sesi|${license_dir}|g" houdini.install ./houdini.install --install-houdini \ + --install-license \ --no-install-menus \ --no-install-bin-symlink \ --auto-install \ --no-root-check \ - --accept-EULA \ + --accept-EULA 2020-05-05 \ $out - echo -e "localValidatorDir = ${license_dir}\nlicensingMode = localValidator" > $out/houdini/Licensing.opt - sed -i "s|/usr/lib/sesi|${license_dir}|g" $out/houdini/sbin/sesinetd_safe - sed -i "s|/usr/lib/sesi|${license_dir}|g" $out/houdini/sbin/sesinetd.startup + echo "licensingMode = localValidator" >> $out/houdini/Licensing.opt ''; + + dontFixup = true; + meta = with lib; { description = "3D animation application software"; homepage = "https://www.sidefx.com";