vuls: init at 0.27.0 (#348530)
[NixPkgs.git] / pkgs / applications / misc / sidequest / default.nix
blobc90a7116b6df20c8f8d85b465731386e08895c91
1 { stdenv
2 , lib
3 , fetchurl
4 , buildFHSEnv
5 , makeDesktopItem
6 , makeWrapper
7 , alsa-lib
8 , at-spi2-atk
9 , cairo
10 , cups
11 , dbus
12 , expat
13 , gdk-pixbuf
14 , glib
15 , gtk3
16 , mesa
17 , nss
18 , nspr
19 , libdrm
20 , xorg
21 , libxkbcommon
22 , libxshmfence
23 , pango
24 , systemd
25 , icu
26 , openssl
27 , zlib
29   let
30     pname = "sidequest";
31     version = "0.10.33";
33     desktopItem = makeDesktopItem rec {
34       name = "SideQuest";
35       exec = "SideQuest";
36       desktopName = name;
37       genericName = "VR App Store";
38       categories = [ "Settings" "PackageManager" ];
39     };
41     sidequest = stdenv.mkDerivation {
42       inherit pname version;
44       src = fetchurl {
45         url = "https://github.com/SideQuestVR/SideQuest/releases/download/v${version}/SideQuest-${version}.tar.xz";
46         sha256 = "8ac3d97400a8e3ce86902b5bea7b8d042a092acd888d20e5139490a38507f995";
47       };
48       dontUnpack = true;
50       nativeBuildInputs = [ makeWrapper ];
52       installPhase = ''
53         mkdir -p "$out/lib/SideQuest" "$out/bin"
54         tar -xJf "$src" -C "$out/lib/SideQuest" --strip-components 1
56         ln -s "$out/lib/SideQuest/sidequest" "$out/bin"
57       '';
59       postFixup = let
60         libPath = lib.makeLibraryPath [
61           alsa-lib
62           at-spi2-atk
63           cairo
64           cups
65           dbus
66           expat
67           gdk-pixbuf
68           glib
69           gtk3
70           mesa
71           nss
72           nspr
73           libdrm
74           xorg.libX11
75           xorg.libxcb
76           xorg.libXcomposite
77           xorg.libXdamage
78           xorg.libXext
79           xorg.libXfixes
80           xorg.libXrandr
81           xorg.libxshmfence
82           libxkbcommon
83           xorg.libxkbfile
84           pango
85           stdenv.cc.cc.lib
86           systemd
87         ];
88       in ''
89         patchelf \
90           --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
91           --set-rpath "${libPath}:$out/lib/SideQuest" \
92           "$out/lib/SideQuest/sidequest"
93       '';
94     };
95   in buildFHSEnv {
96     name = "SideQuest";
98     passthru = {
99       inherit pname version;
101       meta = with lib; {
102         description = "Open app store and side-loading tool for Android-based VR devices such as the Oculus Go, Oculus Quest or Moverio BT 300";
103         homepage = "https://github.com/SideQuestVR/SideQuest";
104         downloadPage = "https://github.com/SideQuestVR/SideQuest/releases";
105         sourceProvenance = with sourceTypes; [ binaryNativeCode ];
106         license = licenses.mit;
107         maintainers = with maintainers; [ joepie91 rvolosatovs ];
108         platforms = [ "x86_64-linux" ];
109         mainProgram = "SideQuest";
110       };
111     };
113     targetPkgs = pkgs: [
114       sidequest
115       # Needed in the environment on runtime, to make QuestSaberPatch work
116       icu openssl zlib
117       libxkbcommon libxshmfence
118     ];
120     extraInstallCommands = ''
121       mkdir -p "$out/share/applications"
122       ln -s ${desktopItem}/share/applications/* "$out/share/applications"
123     '';
125     runScript = "sidequest";
126   }