1{ lib, stdenv, fetchurl, unzip, cairo, xorg, gdk-pixbuf, fontconfig, pango, gnome, atk, at-spi2-atk, at-spi2-core
2, gtk3, glib, freetype, dbus, nss, nspr, alsa-lib, cups, expat, udev, makeDesktopItem
3}:
4
5let
6 rpath = lib.makeLibraryPath [
7 cairo
8 stdenv.cc.cc
9 gdk-pixbuf
10 fontconfig
11 pango
12 atk
13 gtk3
14 glib
15 freetype
16 dbus
17 nss
18 nspr
19 alsa-lib
20 cups
21 expat
22 udev
23 at-spi2-atk
24 at-spi2-core
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 pname = "react-native-debugger";
41 version = "0.13.0";
42 src = fetchurl {
43 url = "https://github.com/jhen0409/react-native-debugger/releases/download/v${version}/rn-debugger-linux-x64.zip";
44 sha256 = "sha256-/uVXMVrVS7n4/mqz6IlKkk63hy67fn9KRjZ1wP5MHB0=";
45 };
46
47 nativeBuildInputs = [ unzip ];
48 buildCommand = ''
49 shopt -s extglob
50 mkdir -p $out
51 unzip $src -d $out
52
53 mkdir $out/{lib,bin,share}
54 mv $out/{libEGL,libGLESv2,libvk_swiftshader,libffmpeg}.so $out/lib
55 mv $out/!(lib|share|bin) $out/share
56
57 patchelf \
58 --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) \
59 --set-rpath ${rpath}:$out/lib \
60 $out/share/react-native-debugger
61
62 ln -s $out/share/react-native-debugger $out/bin/react-native-debugger
63
64 install -Dm644 "${desktopItem}/share/applications/"* \
65 -t $out/share/applications/
66 '';
67
68 desktopItem = makeDesktopItem {
69 name = "rndebugger";
70 exec = "react-native-debugger";
71 desktopName = "React Native Debugger";
72 genericName = "React Native Debugger";
73 categories = [ "Development" "Debugger" ];
74 };
75
76 meta = with lib; {
77 homepage = "https://github.com/jhen0409/react-native-debugger";
78 sourceProvenance = with sourceTypes; [ binaryNativeCode ];
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; [ ];
82 };
83}