diff options
-rw-r--r-- | pkgs/applications/misc/bottles/default.nix | 32 | ||||
-rw-r--r-- | pkgs/applications/misc/bottles/fhsenv.nix | 101 | ||||
-rw-r--r-- | pkgs/top-level/all-packages.nix | 6 |
3 files changed, 106 insertions, 33 deletions
diff --git a/pkgs/applications/misc/bottles/default.nix b/pkgs/applications/misc/bottles/default.nix index 3563f06adf897..05a49db76ad3c 100644 --- a/pkgs/applications/misc/bottles/default.nix +++ b/pkgs/applications/misc/bottles/default.nix @@ -14,7 +14,6 @@ , gtk4 , gtksourceview5 , libadwaita -, steam , cabextract , p7zip , xdpyinfo @@ -26,46 +25,20 @@ , mangohud , vkbasalt-cli , vmtouch -, wine -, bottlesExtraLibraries ? pkgs: [ ] # extra packages to add to steam.run multiPkgs -, bottlesExtraPkgs ? pkgs: [ ] # extra packages to add to steam.run targetPkgs }: - -let - steam-run = (steam.override { - # required by wine runner `caffe` - extraLibraries = pkgs: with pkgs; [ libunwind libusb1 gnutls ] - ++ bottlesExtraLibraries pkgs; - extraPkgs = pkgs: [ ] - ++ bottlesExtraPkgs pkgs; - }).run; -in python3Packages.buildPythonApplication rec { - pname = "bottles"; + pname = "bottles-unwrapped"; version = "2022.11.14"; src = fetchFromGitHub { owner = "bottlesdevs"; - repo = pname; + repo = "bottles"; rev = version; sha256 = "sha256-bigrJtqx9iZURYojwxlGe7xSGWS13wSaGcrTTROP9J8="; }; patches = [ ./vulkan_icd.patch ]; - postPatch = '' - chmod +x build-aux/meson/postinstall.py - patchShebangs build-aux/meson/postinstall.py - - substituteInPlace bottles/backend/wine/winecommand.py \ - --replace \ - "command = f\"{runner} {command}\"" \ - "command = f\"{''' if runner == 'wine' or runner == 'wine64' else '${steam-run}/bin/steam-run '}{runner} {command}\"" \ - --replace \ - "command = f\"{_picked['entry_point']} {command}\"" \ - "command = f\"${steam-run}/bin/steam-run {_picked['entry_point']} {command}\"" - ''; - nativeBuildInputs = [ blueprint-compiler meson @@ -109,7 +82,6 @@ python3Packages.buildPythonApplication rec { gamescope mangohud vmtouch - wine # Undocumented (subprocess.Popen()) lsb-release diff --git a/pkgs/applications/misc/bottles/fhsenv.nix b/pkgs/applications/misc/bottles/fhsenv.nix new file mode 100644 index 0000000000000..dfb0d36f64dd0 --- /dev/null +++ b/pkgs/applications/misc/bottles/fhsenv.nix @@ -0,0 +1,101 @@ +{ lib +, buildFHSUserEnvBubblewrap +, symlinkJoin +, bottles-unwrapped +, extraPkgs ? pkgs: [ ] +, extraLibraries ? pkgs: [ ] +}: + +let fhsEnv = { + targetPkgs = pkgs: with pkgs; [ + bottles-unwrapped + vkbasalt + ] ++ extraPkgs pkgs; + + multiPkgs = + let + xorgDeps = pkgs: with pkgs.xorg; [ + libpthreadstubs + libSM + libX11 + libXaw + libxcb + libXcomposite + libXcursor + libXdmcp + libXext + libXi + libXinerama + libXmu + libXrandr + libXrender + libXv + libXxf86vm + ]; + in + pkgs: with pkgs; [ + # https://wiki.winehq.org/Building_Wine + alsa-lib + cups + dbus + fontconfig + freetype + glib + gnutls + libglvnd + gsm + gst_all_1.gstreamer + gst_all_1.gst-plugins-base + libgphoto2 + libjpeg_turbo + libkrb5 + libpcap + libpng + libpulseaudio + libtiff + libunwind + libusb1 + libv4l + libxml2 + mpg123 + ocl-icd + openldap + samba4 + sane-backends + SDL2 + udev + vulkan-loader + + # https://www.gloriouseggroll.tv/how-to-get-out-of-wine-dependency-hell/ + alsa-plugins + dosbox + giflib + gtk3 + libva + libxslt + ncurses + openal + + # Steam runtime + libgcrypt + libgpg-error + p11-kit + zlib # Freetype + ] ++ xorgDeps pkgs + ++ extraLibraries pkgs; +}; +in +symlinkJoin { + name = "bottles"; + paths = [ + (buildFHSUserEnvBubblewrap (fhsEnv // { name = "bottles"; runScript = "bottles"; })) + (buildFHSUserEnvBubblewrap (fhsEnv // { name = "bottles-cli"; runScript = "bottles-cli"; })) + ]; + postBuild = '' + mkdir -p $out/share + ln -s ${bottles-unwrapped}/share/applications $out/share + ln -s ${bottles-unwrapped}/share/icons $out/share + ''; + + inherit (bottles-unwrapped) meta; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 6ca265218a2c5..4d320f893c805 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -27752,9 +27752,9 @@ with pkgs; bonzomatic = callPackage ../applications/editors/bonzomatic { }; - bottles = callPackage ../applications/misc/bottles { - wine = null; - }; + bottles = callPackage ../applications/misc/bottles/fhsenv.nix { }; + + bottles-unwrapped = callPackage ../applications/misc/bottles { }; brave = callPackage ../applications/networking/browsers/brave { }; |