Skip to content

Commit

Permalink
Merge pull request NixOS#196817 from SuperSamus/bottles
Browse files Browse the repository at this point in the history
  • Loading branch information
SuperSandro2000 authored Nov 21, 2022
2 parents 53dff5c + d155128 commit f3bf8a1
Show file tree
Hide file tree
Showing 6 changed files with 139 additions and 40 deletions.
98 changes: 59 additions & 39 deletions pkgs/applications/misc/bottles/default.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,28 @@
{ lib, fetchFromGitHub, gitUpdater
, meson, ninja, pkg-config, wrapGAppsHook
, desktop-file-utils, gsettings-desktop-schemas, libnotify, libhandy, webkitgtk
, python3Packages, gettext
, appstream-glib, gdk-pixbuf, glib, gobject-introspection, gspell, gtk3, gtksourceview4, gnome
, steam, xdg-utils, pciutils, cabextract
, freetype, p7zip, gamemode, mangohud
{ lib
, fetchFromGitHub
, fetchFromGitLab
, gitUpdater
, python3Packages
, blueprint-compiler
, meson
, ninja
, pkg-config
, wrapGAppsHook4
, appstream-glib
, desktop-file-utils
, librsvg
, gtk4
, gtksourceview5
, libadwaita
, steam
, cabextract
, p7zip
, xdpyinfo
, imagemagick
, procps
, gamescope
, mangohud
, vmtouch
, wine
, bottlesExtraLibraries ? pkgs: [ ] # extra packages to add to steam.run multiPkgs
, bottlesExtraPkgs ? pkgs: [ ] # extra packages to add to steam.run targetPkgs
Expand All @@ -21,75 +39,77 @@ let
in
python3Packages.buildPythonApplication rec {
pname = "bottles";
version = "2022.5.28-trento-3";
version = "2022.10.14.1";

src = fetchFromGitHub {
owner = "bottlesdevs";
repo = pname;
rev = version;
sha256 = "sha256-KIDLRqDLFTsVAczRpTchnUtKJfVHqbYzf8MhIR5UdYY=";
sha256 = "sha256-FO91GSGlc2f3TSLrlmRDPi5p933/Y16tdEpX4RcKhL0=";
};

patches = [ ./vulkan_icd.patch ];

postPatch = ''
chmod +x build-aux/meson/postinstall.py
patchShebangs build-aux/meson/postinstall.py
substituteInPlace src/backend/wine/winecommand.py \
substituteInPlace bottles/backend/wine/winecommand.py \
--replace \
'self.__get_runner()' \
'(lambda r: (f"${steam-run}/bin/steam-run {r}", r)[r == "wine" or r == "wine64"])(self.__get_runner())'
'';
"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
ninja
pkg-config
wrapGAppsHook
gettext
wrapGAppsHook4
gtk4 # gtk4-update-icon-cache
appstream-glib
desktop-file-utils
];

buildInputs = [
gdk-pixbuf
glib
gobject-introspection
gsettings-desktop-schemas
gspell
gtk3
gtksourceview4
libhandy
libnotify
webkitgtk
gnome.adwaita-icon-theme
librsvg
gtk4
gtksourceview5
libadwaita
];

propagatedBuildInputs = with python3Packages; [
pyyaml
pytoml
requests
pycairo
pygobject3
lxml
dbus-python
gst-python
liblarch
patool
markdown
fvs
pefile
urllib3
chardet
certifi
idna
pillow
orjson
icoextract
] ++ [
steam-run
xdg-utils
pciutils
cabextract
wine
freetype
p7zip
gamemode # programs.gamemode.enable
xdpyinfo
imagemagick
procps

gamescope
mangohud
vmtouch
wine
];

format = "other";
strictDeps = false; # broken with gobject-introspection setup hook, see https://github.com/NixOS/nixpkgs/issues/56943
dontWrapGApps = true; # prevent double wrapping

preFixup = ''
Expand Down
13 changes: 13 additions & 0 deletions pkgs/applications/misc/bottles/vulkan_icd.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/bottles/backend/utils/vulkan.py b/bottles/backend/utils/vulkan.py
index 6673493..07f70d1 100644
--- a/bottles/backend/utils/vulkan.py
+++ b/bottles/backend/utils/vulkan.py
@@ -29,6 +29,8 @@ class VulkanUtils:
"/etc/vulkan",
"/usr/local/share/vulkan",
"/usr/local/etc/vulkan"
+ "/run/opengl-driver/share/vulkan/",
+ "/run/opengl-driver-32/share/vulkan/",
]
if "FLATPAK_ID" in os.environ:
__vk_icd_dirs += [
31 changes: 31 additions & 0 deletions pkgs/development/python-modules/fvs/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ lib, buildPythonPackage, fetchPypi, orjson}:

buildPythonPackage rec {
pname = "fvs";
version = "0.3.4";

src = fetchPypi {
inherit version;
pname = "FVS";
extension = "tar.gz";
sha256 = "sha256-yYd0HzdwbqB9kexJjBRRYmdsoWtZtcjCNRz0ZJVM5CI=";
};

propagatedBuildInputs = [
orjson
];

# no tests in src
doCheck = false;

pythonImportsCheck = [
"fvs"
];

meta = with lib; {
description = "File Versioning System with hash comparison and data storage to create unlinked states that can be deleted";
homepage = "https://github.com/mirkobrombin/FVS";
license = licenses.mit;
maintainers = with maintainers; [ bryanasdev000 ];
};
}
31 changes: 31 additions & 0 deletions pkgs/development/python-modules/icoextract/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{ lib, buildPythonPackage, fetchPypi, pefile, pillow}:

buildPythonPackage rec {
pname = "icoextract";
version = "0.1.4";

src = fetchPypi {
inherit pname version;
extension = "tar.gz";
sha256 = "sha256-x0GEV0PUbkAzoUJgAqup9bHd7iYttGyzIZNdo8KsFyo=";
};

propagatedBuildInputs = [
pefile
pillow
];

# tests expect mingw and multiarch
doCheck = false;

pythonImportsCheck = [
"icoextract"
];

meta = with lib; {
description = "Extract icons from Windows PE files";
homepage = "https://github.com/jlu5/icoextract";
license = licenses.mit;
maintainers = with maintainers; [ bryanasdev000 ];
};
}
2 changes: 1 addition & 1 deletion pkgs/top-level/all-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -27600,7 +27600,7 @@ with pkgs;
bonzomatic = callPackage ../applications/editors/bonzomatic { };

bottles = callPackage ../applications/misc/bottles {
wine = wineWowPackages.minimal;
wine = null;
};

brave = callPackage ../applications/networking/browsers/brave { };
Expand Down
4 changes: 4 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3560,6 +3560,8 @@ self: super: with self; {

fuzzywuzzy = callPackage ../development/python-modules/fuzzywuzzy { };

fvs = callPackage ../development/python-modules/fvs { };

fx2 = callPackage ../development/python-modules/fx2 { };

g2pkk = callPackage ../development/python-modules/g2pkk { };
Expand Down Expand Up @@ -4403,6 +4405,8 @@ self: super: with self; {

idasen = callPackage ../development/python-modules/idasen { };

icoextract = callPackage ../development/python-modules/icoextract { };

icontract = callPackage ../development/python-modules/icontract { };

identify = callPackage ../development/python-modules/identify { };
Expand Down

0 comments on commit f3bf8a1

Please sign in to comment.