summary refs log tree commit diff
diff options
context:
space:
mode:
authormdarocha <git@mdarocha.pl>2022-11-23 20:18:39 +0100
committermdarocha <git@mdarocha.pl>2022-11-25 03:56:45 +0100
commit1872a3931d20ce0a10654b1c02a46637dacd7255 (patch)
tree598a945e1f2ff0ccf7bdfbbcdfdd5142a1180877
parentbee931454b4a2e40505dc7fd3590466d13b57759 (diff)
downloadnixpkgs-1872a3931d20ce0a10654b1c02a46637dacd7255.tar
nixpkgs-1872a3931d20ce0a10654b1c02a46637dacd7255.tar.gz
nixpkgs-1872a3931d20ce0a10654b1c02a46637dacd7255.tar.bz2
nixpkgs-1872a3931d20ce0a10654b1c02a46637dacd7255.tar.lz
nixpkgs-1872a3931d20ce0a10654b1c02a46637dacd7255.tar.xz
nixpkgs-1872a3931d20ce0a10654b1c02a46637dacd7255.tar.zst
nixpkgs-1872a3931d20ce0a10654b1c02a46637dacd7255.zip
wasabiwallet: fixup bad dependencies causing app not to run
Also add a wrapper script that sets the proper environment variables,
instead of trying to find all executable binaries.
-rw-r--r--pkgs/applications/blockchains/wasabiwallet/default.nix30
1 files changed, 19 insertions, 11 deletions
diff --git a/pkgs/applications/blockchains/wasabiwallet/default.nix b/pkgs/applications/blockchains/wasabiwallet/default.nix
index 70c67db31c9..ad5cbcdd10b 100644
--- a/pkgs/applications/blockchains/wasabiwallet/default.nix
+++ b/pkgs/applications/blockchains/wasabiwallet/default.nix
@@ -1,8 +1,11 @@
 { lib, stdenv
+, autoPatchelfHook
+, makeWrapper
 , fetchurl
 , makeDesktopItem
 , curl
 , dotnetCorePackages
+, lttng-ust_2_12
 , fontconfig
 , krb5
 , openssl
@@ -11,15 +14,18 @@
 }:
 
 let
-  dotnet-runtime = dotnetCorePackages.runtime_5_0;
-  libPath = lib.makeLibraryPath [
+  dotnet-runtime = dotnetCorePackages.runtime_6_0;
+  # These libraries are dynamically loaded by the application,
+  # and need to be present in LD_LIBRARY_PATH
+  runtimeLibs = [
     curl
-    dotnet-runtime
     fontconfig.lib
     krb5
     openssl
     stdenv.cc.cc.lib
     xorg.libX11
+    xorg.libICE
+    xorg.libSM
     zlib
   ];
 in
@@ -33,7 +39,6 @@ stdenv.mkDerivation rec {
   };
 
   dontBuild = true;
-  dontPatchELF = true;
 
   desktopItem = makeDesktopItem {
     name = "wasabi";
@@ -44,16 +49,19 @@ stdenv.mkDerivation rec {
     categories = [ "Network" "Utility" ];
   };
 
+  nativeBuildInputs = [ autoPatchelfHook makeWrapper ];
+  buildInputs = runtimeLibs ++ [
+    lttng-ust_2_12
+  ];
+
   installPhase = ''
     mkdir -p $out/opt/${pname} $out/bin $out/share/applications
     cp -Rv . $out/opt/${pname}
-    cd $out/opt/${pname}
-    for i in $(find . -type f -name '*.so') wassabee
-      do
-        patchelf --set-rpath ${libPath} $i
-      done
-    patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" wassabee
-    ln -s $out/opt/${pname}/wassabee $out/bin/${pname}
+
+    makeWrapper "${dotnet-runtime}/bin/dotnet" "$out/bin/${pname}" \
+      --add-flags "$out/opt/${pname}/WalletWasabi.Fluent.Desktop.dll" \
+      --suffix "LD_LIBRARY_PATH" : "${lib.makeLibraryPath runtimeLibs}"
+
     cp -v $desktopItem/share/applications/* $out/share/applications
   '';