11{
22 autoPatchelfHook ,
33 cairo ,
4- copyDesktopItems ,
54 dbus ,
65 fetchurl ,
76 fontconfig ,
1615 libsForQt5 ,
1716 libunwind ,
1817 libxkbcommon ,
19- makeDesktopItem ,
2018 makeWrapper ,
2119 openssl ,
2220 stdenv ,
2321 xorg ,
2422 zlib ,
2523} :
2624
27- let
28- srcs = builtins . fromJSON ( builtins . readFile ./srcs.json ) ;
29- in
3025stdenv . mkDerivation rec {
3126 pname = "ida-free" ;
32- version = "8.4.240320 " ;
27+ version = "9.0sp1 " ;
3328
3429 src = fetchurl {
35- inherit ( srcs . ${ stdenv . system } or ( throw "Unsupported system: ${ stdenv . hostPlatform . system } " ) )
36- urls
37- sha256
38- ;
30+ url = "https://archive.org/download/ida-free-pc_90sp1_x64linux/ida-free-pc_90sp1_x64linux.run" ;
31+ hash = "sha256-e5uCcJVn6xDwmVm14QCBUvNcB1MpVxNA2WcLyuK23vo=" ;
3932 } ;
4033
41- icon = fetchurl {
42- urls = [
43- "https://web.archive.org/web/20221105181231if_/https://hex-rays.com/products/ida/news/8_1/images/icon_free.png"
44- ] ;
45- hash = "sha256-widkv2VGh+eOauUK/6Sz/e2auCNFAsc8n9z0fdrSnW0=" ;
46- } ;
47-
48- desktopItem = makeDesktopItem {
49- name = "ida-free" ;
50- exec = "ida64" ;
51- icon = icon ;
52- comment = meta . description ;
53- desktopName = "IDA Free" ;
54- genericName = "Interactive Disassembler" ;
55- categories = [ "Development" ] ;
56- startupWMClass = "IDA" ;
57- } ;
58-
59- desktopItems = [ desktopItem ] ;
60-
6134 nativeBuildInputs = [
6235 makeWrapper
63- copyDesktopItems
6436 autoPatchelfHook
6537 libsForQt5 . wrapQtAppsHook
6638 ] ;
@@ -107,31 +79,39 @@ stdenv.mkDerivation rec {
10779 runHook preInstall
10880
10981 mkdir -p $out/bin $out/lib $out/opt
82+ mkdir -p $out/.local/share/applications
11083
11184 # IDA depends on quite some things extracted by the runfile, so first extract everything
11285 # into $out/opt, then remove the unnecessary files and directories.
11386 IDADIR=$out/opt
11487
88+ # The installer doesn't honor `--prefix` in all places,
89+ # thus needing to set `HOME` here.
90+ HOME=$out
91+
11592 # Invoke the installer with the dynamic loader directly, avoiding the need
11693 # to copy it to fix permissions and patch the executable.
11794 $(cat $NIX_CC/nix-support/dynamic-linker) $src \
118- --mode unattended --prefix $IDADIR --installpassword ""
95+ --mode unattended --prefix $IDADIR
11996
12097 # Copy the exported libraries to the output.
121- cp $IDADIR/libida64 .so $out/lib
98+ cp $IDADIR/libida .so $out/lib
12299
123100 # Some libraries come with the installer.
124101 addAutoPatchelfSearchPath $IDADIR
125102
126- for bb in ida64 assistant; do
103+ for bb in ida assistant; do
127104 wrapProgram $IDADIR/$bb \
128105 --prefix QT_PLUGIN_PATH : $IDADIR/plugins/platforms
129106 ln -s $IDADIR/$bb $out/bin/$bb
130107 done
131108
132109 # runtimeDependencies don't get added to non-executables, and openssl is needed
133110 # for cloud decompilation
134- patchelf --add-needed libcrypto.so $IDADIR/libida64.so
111+ patchelf --add-needed libcrypto.so $IDADIR/libida.so
112+
113+ mv $out/.local/share $out
114+ rm -r $out/.local
135115
136116 runHook postInstall
137117 '' ;
@@ -141,7 +121,7 @@ stdenv.mkDerivation rec {
141121 homepage = "https://hex-rays.com/ida-free/" ;
142122 changelog = "https://hex-rays.com/products/ida/news/" ;
143123 license = licenses . unfree ;
144- mainProgram = "ida64 " ;
124+ mainProgram = "ida " ;
145125 maintainers = with maintainers ; [ msanft ] ;
146126 platforms = [ "x86_64-linux" ] ; # Right now, the installation script only supports Linux.
147127 sourceProvenance = with sourceTypes ; [ binaryNativeCode ] ;
0 commit comments