From 064b8df1844c77e6f59556b70e0f35be39a2f7e1 Mon Sep 17 00:00:00 2001 From: kyehn Date: Fri, 26 Sep 2025 15:47:55 +0800 Subject: [PATCH] sidequest: 0.10.33 -> 0.10.42 --- pkgs/by-name/si/sidequest/package.nix | 164 ++++++++++++++------------ 1 file changed, 86 insertions(+), 78 deletions(-) diff --git a/pkgs/by-name/si/sidequest/package.nix b/pkgs/by-name/si/sidequest/package.nix index fe78c9ff3188..9bc2341ac105 100644 --- a/pkgs/by-name/si/sidequest/package.nix +++ b/pkgs/by-name/si/sidequest/package.nix @@ -1,8 +1,9 @@ { - stdenv, lib, + stdenv, fetchurl, buildFHSEnv, + copyDesktopItems, makeDesktopItem, makeWrapper, alsa-lib, @@ -15,6 +16,7 @@ glib, gtk3, libgbm, + libGL, nss, nspr, libdrm, @@ -26,100 +28,93 @@ icu, openssl, zlib, + bintools, }: let pname = "sidequest"; - version = "0.10.33"; - - desktopItem = makeDesktopItem rec { - name = "SideQuest"; - exec = "SideQuest"; - desktopName = name; - genericName = "VR App Store"; - categories = [ - "Settings" - "PackageManager" - ]; - }; + version = "0.10.42"; sidequest = stdenv.mkDerivation { inherit pname version; src = fetchurl { url = "https://github.com/SideQuestVR/SideQuest/releases/download/v${version}/SideQuest-${version}.tar.xz"; - sha256 = "8ac3d97400a8e3ce86902b5bea7b8d042a092acd888d20e5139490a38507f995"; + hash = "sha256-YZp7OAjUOXepVv5dPhh9Q2HicUKjSOGfhrWyMKy2gME="; }; - dontUnpack = true; - nativeBuildInputs = [ makeWrapper ]; + nativeBuildInputs = [ + copyDesktopItems + makeWrapper + ]; + + desktopItems = [ + (makeDesktopItem { + name = "sidequest"; + exec = "sidequest"; + icon = "sidequest"; + desktopName = "SideQuest"; + genericName = "VR App Store"; + categories = [ + "Settings" + "PackageManager" + ]; + }) + ]; installPhase = '' - mkdir -p "$out/lib/SideQuest" "$out/bin" - tar -xJf "$src" -C "$out/lib/SideQuest" --strip-components 1 + runHook preInstall - ln -s "$out/lib/SideQuest/sidequest" "$out/bin" + mkdir -p "$out/libexec" "$out/bin" + cp --recursive . "$out/libexec/sidequest" + ln -s "$out/libexec/sidequest/sidequest" "$out/bin/sidequest" + for size in 16 24 32 48 64 128 256 512 1024; do + install -D --mode=0644 resources/app.asar.unpacked/build/icons/''${size}x''${size}.png $out/share/icons/hicolor/''${size}x''${size}/apps/sidequest.png + done + + runHook postInstall ''; - postFixup = - let - libPath = lib.makeLibraryPath [ - alsa-lib - at-spi2-atk - cairo - cups - dbus - expat - gdk-pixbuf - glib - gtk3 - libgbm - nss - nspr - libdrm - xorg.libX11 - xorg.libxcb - xorg.libXcomposite - xorg.libXdamage - xorg.libXext - xorg.libXfixes - xorg.libXrandr - xorg.libxshmfence - libxkbcommon - xorg.libxkbfile - pango - (lib.getLib stdenv.cc.cc) - systemd - ]; - in - '' - patchelf \ - --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \ - --set-rpath "${libPath}:$out/lib/SideQuest" \ - "$out/lib/SideQuest/sidequest" - ''; + postFixup = '' + patchelf \ + --set-interpreter "${bintools.dynamicLinker}" \ + --set-rpath "${ + lib.makeLibraryPath [ + alsa-lib + at-spi2-atk + cairo + cups + dbus + expat + gdk-pixbuf + glib + gtk3 + libgbm + libGL + nss + nspr + libdrm + xorg.libX11 + xorg.libxcb + xorg.libXcomposite + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXrandr + xorg.libxshmfence + libxkbcommon + xorg.libxkbfile + pango + (lib.getLib stdenv.cc.cc) + systemd + ] + }:$out/libexec/sidequest" \ + --add-needed libGL.so.1 \ + "$out/libexec/sidequest/sidequest" + ''; }; in buildFHSEnv { - pname = "SideQuest"; - inherit version; - - passthru = { - inherit pname version; - - meta = with lib; { - description = "Open app store and side-loading tool for Android-based VR devices such as the Oculus Go, Oculus Quest or Moverio BT 300"; - homepage = "https://github.com/SideQuestVR/SideQuest"; - downloadPage = "https://github.com/SideQuestVR/SideQuest/releases"; - sourceProvenance = with sourceTypes; [ binaryNativeCode ]; - license = licenses.mit; - maintainers = with maintainers; [ - joepie91 - rvolosatovs - ]; - platforms = [ "x86_64-linux" ]; - mainProgram = "SideQuest"; - }; - }; + inherit pname version; targetPkgs = pkgs: [ sidequest @@ -132,9 +127,22 @@ buildFHSEnv { ]; extraInstallCommands = '' - mkdir -p "$out/share/applications" - ln -s ${desktopItem}/share/applications/* "$out/share/applications" + ln -s ${sidequest}/share "$out/share" ''; runScript = "sidequest"; + + meta = { + description = "Open app store and side-loading tool for Android-based VR devices such as the Oculus Go, Oculus Quest or Moverio BT 300"; + homepage = "https://github.com/SideQuestVR/SideQuest"; + downloadPage = "https://github.com/SideQuestVR/SideQuest/releases"; + sourceProvenance = with lib.sourceTypes; [ binaryNativeCode ]; + license = lib.licenses.mit; + maintainers = with lib.maintainers; [ + joepie91 + rvolosatovs + ]; + platforms = [ "x86_64-linux" ]; + mainProgram = "SideQuest"; + }; }