diff options
Diffstat (limited to 'pkgs/idafree/package.nix')
-rw-r--r-- | pkgs/idafree/package.nix | 125 |
1 files changed, 125 insertions, 0 deletions
diff --git a/pkgs/idafree/package.nix b/pkgs/idafree/package.nix new file mode 100644 index 0000000..d29a54f --- /dev/null +++ b/pkgs/idafree/package.nix | |||
@@ -0,0 +1,125 @@ | |||
1 | # Copy from https://github.com/NixOS/nixpkgs/pull/217753 | ||
2 | { lib | ||
3 | , stdenv | ||
4 | , fetchurl | ||
5 | , libGL | ||
6 | , zlib | ||
7 | , libkrb5 | ||
8 | , libsecret | ||
9 | , libunwind | ||
10 | , libxkbcommon | ||
11 | , glib | ||
12 | , makeWrapper | ||
13 | , openssl | ||
14 | , xorg | ||
15 | , dbus | ||
16 | , fontconfig | ||
17 | , freetype | ||
18 | , makeDesktopItem | ||
19 | }: | ||
20 | |||
21 | |||
22 | let | ||
23 | srcs = builtins.fromJSON (builtins.readFile ./srcs.json); | ||
24 | in | ||
25 | |||
26 | stdenv.mkDerivation rec { | ||
27 | pname = "ida-free"; | ||
28 | version = "8.2.230124"; | ||
29 | |||
30 | src = fetchurl { | ||
31 | inherit (srcs.${stdenv.system}) url sha256; | ||
32 | }; | ||
33 | |||
34 | icon = fetchurl { | ||
35 | urls = [ | ||
36 | "https://www.hex-rays.com/products/ida/news/8_1/images/icon_free.png" | ||
37 | "https://web.archive.org/web/20221105181231if_/https://hex-rays.com/products/ida/news/8_1/images/icon_free.png" | ||
38 | ]; | ||
39 | sha256 = "sha256-widkv2VGh+eOauUK/6Sz/e2auCNFAsc8n9z0fdrSnW0="; | ||
40 | }; | ||
41 | |||
42 | desktopItem = makeDesktopItem { | ||
43 | name = pname; | ||
44 | exec = "ida64"; | ||
45 | icon = icon; | ||
46 | comment = "Freeware version of the world's smartest and most feature-full disassembler"; | ||
47 | desktopName = "IDA Free"; | ||
48 | genericName = "Interactive Disassembler"; | ||
49 | categories = [ "Development" ]; | ||
50 | }; | ||
51 | |||
52 | ldLibraryPath = lib.makeLibraryPath [ | ||
53 | stdenv.cc.cc | ||
54 | zlib | ||
55 | glib | ||
56 | xorg.libXi | ||
57 | xorg.libxcb | ||
58 | xorg.libXrender | ||
59 | xorg.libXau | ||
60 | xorg.libX11 | ||
61 | xorg.libSM | ||
62 | xorg.libICE | ||
63 | xorg.libXext | ||
64 | xorg.xcbutilwm | ||
65 | xorg.xcbutilimage | ||
66 | xorg.xcbutilkeysyms | ||
67 | xorg.xcbutilrenderutil | ||
68 | libkrb5 | ||
69 | libsecret | ||
70 | libunwind | ||
71 | libxkbcommon | ||
72 | openssl | ||
73 | dbus | ||
74 | fontconfig | ||
75 | freetype | ||
76 | libGL | ||
77 | ]; | ||
78 | |||
79 | nativeBuildInputs = [ makeWrapper ]; | ||
80 | |||
81 | dontUnpack = true; | ||
82 | dontStrip = true; | ||
83 | dontPatchELF = true; | ||
84 | |||
85 | installPhase = '' | ||
86 | runHook preInstall | ||
87 | |||
88 | IDADIR=$out/opt/${pname} | ||
89 | |||
90 | install -d $IDADIR $out/bin $out/share/applications | ||
91 | |||
92 | # Invoke the installer with the dynamic loader directly, avoiding the need | ||
93 | # to copy it to fix permissions and patch the executable. | ||
94 | $(cat $NIX_CC/nix-support/dynamic-linker) ${src} \ | ||
95 | --mode unattended --prefix $IDADIR --installpassword "" | ||
96 | |||
97 | rm $IDADIR/[Uu]ninstall* | ||
98 | |||
99 | for bb in ida64 assistant; do | ||
100 | patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) $IDADIR/$bb | ||
101 | wrapProgram \ | ||
102 | $IDADIR/$bb \ | ||
103 | --set LD_LIBRARY_PATH "$IDADIR:${ldLibraryPath}" \ | ||
104 | --set QT_PLUGIN_PATH "$IDADIR/plugins/platforms" | ||
105 | done | ||
106 | |||
107 | ln -s $IDADIR/ida64 $out/bin/ida64 | ||
108 | |||
109 | cp $desktopItem/share/applications/* $out/share/applications | ||
110 | |||
111 | runHook postInstall | ||
112 | ''; | ||
113 | |||
114 | passthru.updateScript = ./update.sh; | ||
115 | |||
116 | meta = with lib; { | ||
117 | description = "Freeware version of the world's smartest and most feature-full disassembler"; | ||
118 | homepage = "https://hex-rays.com/ida-free/"; | ||
119 | sourceProvenance = with sourceTypes; [ binaryNativeCode ]; | ||
120 | license = licenses.unfree; | ||
121 | maintainers = with maintainers; [ lourkeur ]; | ||
122 | platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]; | ||
123 | mainProgram = "ida64"; | ||
124 | }; | ||
125 | } | ||