about summary refs log tree commit diff
path: root/pkgs/development/tools
diff options
context:
space:
mode:
authorJörg Thalheim <Mic92@users.noreply.github.com>2020-02-19 14:25:14 +0000
committerGitHub <noreply@github.com>2020-02-19 14:25:14 +0000
commit2d87562b42fbedea6dc750559485f8aa49878f09 (patch)
treeb74fc0841bdb454d2182506f4b9430a185b7cd0e /pkgs/development/tools
parent944775e0c5c0c477e48a2c1a557ca94e232b9fe2 (diff)
parent970e6452ed5f94f55487502dbdf0703e8c628adb (diff)
downloadnixlib-2d87562b42fbedea6dc750559485f8aa49878f09.tar
nixlib-2d87562b42fbedea6dc750559485f8aa49878f09.tar.gz
nixlib-2d87562b42fbedea6dc750559485f8aa49878f09.tar.bz2
nixlib-2d87562b42fbedea6dc750559485f8aa49878f09.tar.lz
nixlib-2d87562b42fbedea6dc750559485f8aa49878f09.tar.xz
nixlib-2d87562b42fbedea6dc750559485f8aa49878f09.tar.zst
nixlib-2d87562b42fbedea6dc750559485f8aa49878f09.zip
Merge pull request #75522 from Enteee/bugfix/hopper
hopper: fix libxml2 dynamic linking issue
Diffstat (limited to 'pkgs/development/tools')
-rw-r--r--pkgs/development/tools/analysis/hopper/default.nix71
1 files changed, 53 insertions, 18 deletions
diff --git a/pkgs/development/tools/analysis/hopper/default.nix b/pkgs/development/tools/analysis/hopper/default.nix
index c9214ae7e35d..8bb1c5d04f87 100644
--- a/pkgs/development/tools/analysis/hopper/default.nix
+++ b/pkgs/development/tools/analysis/hopper/default.nix
@@ -1,42 +1,77 @@
-{ stdenv, fetchurl, pkgs, lib }:
-
+{ stdenv
+, fetchurl
+, lib
+, autoPatchelfHook
+, wrapQtAppsHook
+, libbsd
+, python27
+, gmpxx
+, ncurses5
+, gnustep
+}:
 stdenv.mkDerivation rec {
-  pname    = "hopper";
-  version = "4.5.7";
+  pname = "hopper";
+  version = "4.5.19";
   rev = "v${lib.versions.major version}";
 
   src = fetchurl {
     url = "https://d2ap6ypl1xbe4k.cloudfront.net/Hopper-${rev}-${version}-Linux.pkg.tar.xz";
-    sha256 = "1ce7a0f13126a940398aa8da4a74e250dff0401074f30446a8840ac3dbb902c0";
+    sha256 = "1c9wbjwz5xn0skz2a1wpxyx78hhrm8vcbpzagsg4wwnyblap59db";
   };
 
   sourceRoot = ".";
 
-  ldLibraryPath = with pkgs; stdenv.lib.makeLibraryPath  [
-libbsd.out libffi.out gmpxx.out python27Full.out python27Packages.libxml2 qt5.qtbase zlib  xlibs.libX11.out xorg_sys_opengl.out xlibs.libXrender.out gcc-unwrapped.lib
+  nativeBuildInputs = [
+    wrapQtAppsHook
+    autoPatchelfHook
   ];
 
-  nativeBuildInputs = [ pkgs.qt5.wrapQtAppsHook ];
+  buildInputs = [
+    libbsd
+    python27
+    gmpxx
 
-  qtWrapperArgs = [ ''--suffix LD_LIBRARY_PATH : ${ldLibraryPath}'' ];
+    ncurses5
+    gnustep.libobjc
+  ];
 
   installPhase = ''
+    runHook preInstall
+
     mkdir -p $out/bin
     mkdir -p $out/lib
     mkdir -p $out/share
+
     cp $sourceRoot/opt/hopper-${rev}/bin/Hopper $out/bin/hopper
-    cp -r $sourceRoot/opt/hopper-${rev}/lib $out
-    cp -r $sourceRoot/usr/share $out/share
-    patchelf \
-      --set-interpreter ${stdenv.glibc}/lib/ld-linux-x86-64.so.2 \
-      $out/bin/hopper
+    cp \
+      --archive \
+      $sourceRoot/opt/hopper-${rev}/lib/libBlocksRuntime.so* \
+      $sourceRoot/opt/hopper-${rev}/lib/libdispatch.so* \
+      $sourceRoot/opt/hopper-${rev}/lib/libgnustep-base.so* \
+      $sourceRoot/opt/hopper-${rev}/lib/libHopperCore.so* \
+      $sourceRoot/opt/hopper-${rev}/lib/libkqueue.so* \
+      $sourceRoot/opt/hopper-${rev}/lib/libobjcxx.so* \
+      $sourceRoot/opt/hopper-${rev}/lib/libpthread_workqueue.so* \
+      $out/lib
+
+    cp -r $sourceRoot/usr/share $out
+
+    runHook postInstall
+  '';
+
+  postFixup = ''
+    substituteInPlace "$out/share/applications/hopper-${rev}.desktop" \
+      --replace "Exec=/opt/hopper-${rev}/bin/Hopper" "Exec=$out/bin/hopper"
   '';
 
-  meta = {
+  meta = with stdenv.lib; {
     homepage = "https://www.hopperapp.com/index.html";
     description = "A macOS and Linux Disassembler";
-    license = stdenv.lib.licenses.unfree;
-    maintainers = [ stdenv.lib.maintainers.luis ];
-    platforms = stdenv.lib.platforms.linux;
+    license = licenses.unfree;
+    maintainers = with maintainers; [
+      luis
+      Enteee
+    ];
+    platforms = platforms.linux;
   };
 }