From 4a25526e19187c7c24b132de058476d30723148d Mon Sep 17 00:00:00 2001 From: Mistyttm Date: Sat, 23 Nov 2024 02:09:29 +1000 Subject: [PATCH] bs-manager: init at 1.5.0-alpha.7 --- pkgs/by-name/bs/bs-manager/package.nix | 176 +++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 pkgs/by-name/bs/bs-manager/package.nix diff --git a/pkgs/by-name/bs/bs-manager/package.nix b/pkgs/by-name/bs/bs-manager/package.nix new file mode 100644 index 0000000000000..de3131a246087 --- /dev/null +++ b/pkgs/by-name/bs/bs-manager/package.nix @@ -0,0 +1,176 @@ +{ + alsa-lib, + autoPatchelfHook, + atk, + bash, + cairo, + cups, + dbus, + dpkg, + fetchurl, + ffmpeg, + glib, + glibc, + gtk3, + lib, + libappindicator-gtk3, + libdrm, + libxcb, + libxkbfile, + libxkbcommon, + makeWrapper, + mesa, + nss, + nspr, + nix-update-script, + pango, + pkgs, + python3, + opencomposite, + stdenv, + systemd, + vulkan-loader, + xorg, + depotdownloader, + openssl, +}: +let + version = "1.5.0-alpha.7"; + + src = + if stdenv.hostPlatform.system == "x86_64-linux" then + fetchurl { + url = "https://github.com/Zagrios/bs-manager/releases/download/v1.5.0-alpha.7/bs-manager_1.5.0-alpha.7_amd64.deb"; + hash = "sha256-AL8i7uuvbAADECRrW0bUQkhe8NERPddZRKsXdeAjdg8="; + } + else + throw "BSManager is not available for your platform"; + + rpath = lib.makeLibraryPath [ + alsa-lib + atk + cairo + cups + dbus + ffmpeg + glib + glibc + gtk3 + libappindicator-gtk3 + libdrm + libxcb + libxkbcommon + libxkbfile + mesa + mesa.drivers + nspr + nss + pango + stdenv.cc.cc + vulkan-loader + xorg.libX11 + xorg.libXcomposite + xorg.libXcursor + xorg.libXdamage + xorg.libXext + xorg.libXfixes + xorg.libXi + xorg.libXrandr + xorg.libXrender + xorg.libXScrnSaver + xorg.libXtst + xorg.libxcb + xorg.libxkbfile + ]; +in +stdenv.mkDerivation { + pname = "bs-manager"; + inherit version; + + system = "x86_64-linux"; + + inherit src; + + runtimeDependencies = [ + bash + opencomposite + python3 + systemd + depotdownloader + openssl + ]; + + nativeBuildInputs = [ + autoPatchelfHook + ffmpeg + gtk3 + mesa + mesa.drivers + nspr + nss + makeWrapper + openssl.dev + ]; + + buildInputs = [ + dpkg + ffmpeg + openssl.dev + ]; + + dontUnpack = true; + + installPhase = '' + runHook preInstall + + mkdir -p $out + dpkg -x $src $out + cp -av $out/usr/* $out + rm -rf $out/usr + + # Otherwise it looks "suspicious" + chmod -R g-w $out + + export FONTCONFIG_FILE=${pkgs.makeFontsConf { fontDirectories = [ ]; }} + + patchelf --set-rpath $out/opt/BSManager $out/opt/BSManager/bs-manager + + for file in $(find $out -type f \( -perm /0111 -o -name \*.so\* \)); do + patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" "$file" || true + patchelf --set-rpath ${rpath} "$file" || true + done + + mkdir -p $out/bin + ln -s $out/opt/BSManager/bs-manager $out/bin/bs-manager + + runHook postInstall + ''; + + postInstall = '' + # Create a wrapper script to use the correct LD_LIBRARY_PATH + mv $out/opt/BSManager/resources/assets/scripts/DepotDownloader $out/opt/BSManager/resources/assets/scripts/DepotDownload + cat > $out/opt/BSManager/resources/assets/scripts/DepotDownloader <