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 ''; - meta = { + postFixup = '' + substituteInPlace "$out/share/applications/hopper-${rev}.desktop" \ + --replace "Exec=/opt/hopper-${rev}/bin/Hopper" "Exec=$out/bin/hopper" + ''; + + 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; }; } diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 8accbf10b664..3af321398cd4 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1880,7 +1880,7 @@ in hostsblock = callPackage ../tools/misc/hostsblock { }; - hopper = callPackage ../development/tools/analysis/hopper {}; + hopper = qt5.callPackage ../development/tools/analysis/hopper {}; hr = callPackage ../applications/misc/hr { };