diff --git a/pkgs/by-name/id/ida-free/package.nix b/pkgs/by-name/id/ida-free/package.nix index 81078c2929a4..4f8ac0bcdf1b 100644 --- a/pkgs/by-name/id/ida-free/package.nix +++ b/pkgs/by-name/id/ida-free/package.nix @@ -1,7 +1,6 @@ { autoPatchelfHook, cairo, - copyDesktopItems, dbus, fetchurl, fontconfig, @@ -16,7 +15,6 @@ libsForQt5, libunwind, libxkbcommon, - makeDesktopItem, makeWrapper, openssl, stdenv, @@ -24,43 +22,17 @@ zlib, }: -let - srcs = builtins.fromJSON (builtins.readFile ./srcs.json); -in stdenv.mkDerivation rec { pname = "ida-free"; - version = "8.4.240320"; + version = "9.0sp1"; src = fetchurl { - inherit (srcs.${stdenv.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}")) - urls - sha256 - ; + url = "https://archive.org/download/ida-free-pc_90sp1_x64linux/ida-free-pc_90sp1_x64linux.run"; + hash = "sha256-e5uCcJVn6xDwmVm14QCBUvNcB1MpVxNA2WcLyuK23vo="; }; - icon = fetchurl { - urls = [ - "https://web.archive.org/web/20221105181231if_/https://hex-rays.com/products/ida/news/8_1/images/icon_free.png" - ]; - hash = "sha256-widkv2VGh+eOauUK/6Sz/e2auCNFAsc8n9z0fdrSnW0="; - }; - - desktopItem = makeDesktopItem { - name = "ida-free"; - exec = "ida64"; - icon = icon; - comment = meta.description; - desktopName = "IDA Free"; - genericName = "Interactive Disassembler"; - categories = [ "Development" ]; - startupWMClass = "IDA"; - }; - - desktopItems = [ desktopItem ]; - nativeBuildInputs = [ makeWrapper - copyDesktopItems autoPatchelfHook libsForQt5.wrapQtAppsHook ]; @@ -107,23 +79,28 @@ stdenv.mkDerivation rec { runHook preInstall mkdir -p $out/bin $out/lib $out/opt + mkdir -p $out/.local/share/applications # IDA depends on quite some things extracted by the runfile, so first extract everything # into $out/opt, then remove the unnecessary files and directories. IDADIR=$out/opt + # The installer doesn't honor `--prefix` in all places, + # thus needing to set `HOME` here. + HOME=$out + # Invoke the installer with the dynamic loader directly, avoiding the need # to copy it to fix permissions and patch the executable. $(cat $NIX_CC/nix-support/dynamic-linker) $src \ - --mode unattended --prefix $IDADIR --installpassword "" + --mode unattended --prefix $IDADIR # Copy the exported libraries to the output. - cp $IDADIR/libida64.so $out/lib + cp $IDADIR/libida.so $out/lib # Some libraries come with the installer. addAutoPatchelfSearchPath $IDADIR - for bb in ida64 assistant; do + for bb in ida assistant; do wrapProgram $IDADIR/$bb \ --prefix QT_PLUGIN_PATH : $IDADIR/plugins/platforms ln -s $IDADIR/$bb $out/bin/$bb @@ -131,7 +108,10 @@ stdenv.mkDerivation rec { # runtimeDependencies don't get added to non-executables, and openssl is needed # for cloud decompilation - patchelf --add-needed libcrypto.so $IDADIR/libida64.so + patchelf --add-needed libcrypto.so $IDADIR/libida.so + + mv $out/.local/share $out + rm -r $out/.local runHook postInstall ''; @@ -141,7 +121,7 @@ stdenv.mkDerivation rec { homepage = "https://hex-rays.com/ida-free/"; changelog = "https://hex-rays.com/products/ida/news/"; license = licenses.unfree; - mainProgram = "ida64"; + mainProgram = "ida"; maintainers = with maintainers; [ msanft ]; platforms = [ "x86_64-linux" ]; # Right now, the installation script only supports Linux. sourceProvenance = with sourceTypes; [ binaryNativeCode ]; diff --git a/pkgs/by-name/id/ida-free/srcs.json b/pkgs/by-name/id/ida-free/srcs.json deleted file mode 100644 index 2087ed4381d9..000000000000 --- a/pkgs/by-name/id/ida-free/srcs.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "x86_64-linux": { - "urls": [ - "https://web.archive.org/web/20240330140328/https://out7.hex-rays.com/files/idafree84_linux.run" - ], - "sha256": "1wg60afkhjj7my2la4x4qf6gdxzl2aqdbvd6zfnwf8n3bl7ckn2a" - }, - "x86_64-darwin": { - "urls": [ - "https://web.archive.org/web/20240330140623/https://out7.hex-rays.com/files/idafree84_mac.app.zip" - ], - "sha256": "0a97xb0ah6rcq69whs5xvkar43ci8r5nan9wa29ad19w8k25ryym" - }, - "aarch64-darwin": { - "urls": [ - "https://web.archive.org/web/20240330140634/https://out7.hex-rays.com/files/arm_idafree84_mac.app.zip" - ], - "sha256": "10wwq7ia1z1kxfigj4i7xr037bzv1cg3pyvrl27jdq9v7bghdf3m" - } -}