1{ stdenv, fetchurl, unzip, cairo, xorg, gdk_pixbuf, fontconfig, pango, gnome2, atk, gtk2, glib 2, freetype, dbus, nss, nspr, alsaLib, cups, expat, udev, makeDesktopItem 3}: 4 5let 6 rpath = stdenv.lib.makeLibraryPath [ 7 cairo 8 stdenv.cc.cc 9 gdk_pixbuf 10 fontconfig 11 pango 12 atk 13 gtk2 14 glib 15 freetype 16 dbus 17 nss 18 nspr 19 alsaLib 20 cups 21 expat 22 udev 23 24 gnome2.GConf 25 26 xorg.libX11 27 xorg.libXcursor 28 xorg.libXtst 29 xorg.libxcb 30 xorg.libXext 31 xorg.libXi 32 xorg.libXdamage 33 xorg.libXrandr 34 xorg.libXcomposite 35 xorg.libXfixes 36 xorg.libXrender 37 xorg.libXScrnSaver 38 ]; 39in stdenv.mkDerivation rec { 40 name = "react-native-debugger-${version}"; 41 version = "0.7.20"; 42 43 src = fetchurl { 44 url = "https://github.com/jhen0409/react-native-debugger/releases/download/v${version}/rn-debugger-linux-x64.zip"; 45 sha256 = "0nd707plj2c96g0dl976dv8b6dlfh12pdqrmxvp0qc2m2j6y9vig"; 46 }; 47 48 buildInputs = [ unzip ]; 49 buildCommand = '' 50 shopt -s extglob 51 mkdir -p $out 52 unzip $src -d $out 53 54 mkdir $out/{lib,bin,share} 55 mv $out/lib{node,ffmpeg}.so $out/lib 56 mv $out/!(lib|share|bin) $out/share 57 58 patchelf \ 59 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \ 60 --set-rpath ${rpath}:$out/lib \ 61 $out/share/React\ Native\ Debugger 62 63 ln -s $out/share/React\ Native\ Debugger $out/bin/React\ Native\ Debugger 64 65 install -Dm644 "${desktopItem}/share/applications/"* \ 66 -t $out/share/applications/ 67 ''; 68 69 desktopItem = makeDesktopItem { 70 name = "rndebugger"; 71 exec = "React\\ Native\\ Debugger"; 72 desktopName = "React Native Debugger"; 73 genericName = "React Native Debugger"; 74 categories = "Development;Tools;"; 75 }; 76 77 meta = with stdenv.lib; { 78 homepage = https://github.com/jhen0409/react-native-debugger; 79 license = licenses.mit; 80 description = "The standalone app based on official debugger of React Native, and includes React Inspector / Redux DevTools"; 81 maintainers = with maintainers; [ ma27 ]; 82 }; 83}