1{ lib
2, stdenv
3, fetchurl
4, unzip
5, cairo
6, xorg
7, gdk-pixbuf
8, fontconfig
9, pango
10, gnome
11, atk
12, at-spi2-atk
13, at-spi2-core
14, gtk3
15, glib
16, freetype
17, dbus
18, nss
19, nspr
20, alsa-lib
21, cups
22, expat
23, udev
24, makeDesktopItem
25, libdrm
26, libxkbcommon
27, mesa
28, makeWrapper
29}:
30
31let
32 rpath = lib.makeLibraryPath [
33 cairo
34 stdenv.cc.cc
35 gdk-pixbuf
36 fontconfig
37 pango
38 atk
39 gtk3
40 glib
41 freetype
42 dbus
43 nss
44 nspr
45 alsa-lib
46 cups
47 expat
48 udev
49 at-spi2-atk
50 at-spi2-core
51 libdrm
52 libxkbcommon
53 mesa
54
55 xorg.libX11
56 xorg.libXcursor
57 xorg.libXtst
58 xorg.libxcb
59 xorg.libXext
60 xorg.libXi
61 xorg.libXdamage
62 xorg.libXrandr
63 xorg.libXcomposite
64 xorg.libXfixes
65 xorg.libXrender
66 xorg.libXScrnSaver
67 ];
68in
69stdenv.mkDerivation rec {
70 pname = "react-native-debugger";
71 version = "0.14.0";
72 src = fetchurl {
73 url = "https://github.com/jhen0409/react-native-debugger/releases/download/v${version}/rn-debugger-linux-x64.zip";
74 sha256 = "sha256-RioBe0MAR47M84aavFaTJikGsJtcZDak8Tkg3WtX2l0=";
75 };
76
77 nativeBuildInputs = [ makeWrapper unzip ];
78 buildCommand = ''
79 shopt -s extglob
80 mkdir -p $out
81 unzip $src -d $out
82
83 mkdir $out/{lib,bin,share}
84 mv $out/{libEGL,libGLESv2,libvk_swiftshader,libffmpeg}.so $out/lib
85 mv $out/!(lib|share|bin) $out/share
86
87 patchelf \
88 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
89 --set-rpath ${rpath}:$out/lib \
90 $out/share/react-native-debugger
91
92 wrapProgram $out/share/react-native-debugger \
93 --add-flags --no-sandbox
94
95 ln -s $out/share/react-native-debugger $out/bin/react-native-debugger
96
97 install -Dm644 "${desktopItem}/share/applications/"* \
98 -t $out/share/applications/
99 '';
100
101 desktopItem = makeDesktopItem {
102 name = "rndebugger";
103 exec = "react-native-debugger";
104 desktopName = "React Native Debugger";
105 genericName = "React Native Debugger";
106 categories = [ "Development" "Debugger" ];
107 };
108
109 meta = with lib; {
110 homepage = "https://github.com/jhen0409/react-native-debugger";
111 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
112 license = licenses.mit;
113 description = "The standalone app based on official debugger of React Native, and includes React Inspector / Redux DevTools";
114 maintainers = with maintainers; [ ];
115 };
116}