1{
2 lib,
3 stdenv,
4 fetchurl,
5 unzip,
6 cairo,
7 xorg,
8 gdk-pixbuf,
9 fontconfig,
10 pango,
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 libgbm,
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 libgbm
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 = [
78 makeWrapper
79 unzip
80 ];
81 buildCommand = ''
82 shopt -s extglob
83 mkdir -p $out
84 unzip $src -d $out
85
86 mkdir $out/{lib,bin,share}
87 mv $out/{libEGL,libGLESv2,libvk_swiftshader,libffmpeg}.so $out/lib
88 mv $out/!(lib|share|bin) $out/share
89
90 patchelf \
91 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
92 --set-rpath ${rpath}:$out/lib \
93 $out/share/react-native-debugger
94
95 wrapProgram $out/share/react-native-debugger \
96 --add-flags --no-sandbox
97
98 ln -s $out/share/react-native-debugger $out/bin/react-native-debugger
99
100 install -Dm644 "${desktopItem}/share/applications/"* \
101 -t $out/share/applications/
102 '';
103
104 desktopItem = makeDesktopItem {
105 name = "rndebugger";
106 exec = "react-native-debugger";
107 desktopName = "React Native Debugger";
108 genericName = "React Native Debugger";
109 categories = [
110 "Development"
111 "Debugger"
112 ];
113 };
114
115 meta = with lib; {
116 homepage = "https://github.com/jhen0409/react-native-debugger";
117 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
118 license = licenses.mit;
119 description = "Standalone app based on official debugger of React Native, and includes React Inspector / Redux DevTools";
120 mainProgram = "react-native-debugger";
121 maintainers = [ ];
122 };
123}