2021-06-18 18:47:51 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitLab
|
|
|
|
, gobject-introspection
|
2022-06-05 10:58:17 +00:00
|
|
|
, pciutils
|
2021-06-18 18:47:51 +00:00
|
|
|
, python3Packages
|
|
|
|
, gtk3
|
2024-04-26 20:24:03 +00:00
|
|
|
, wrapGAppsHook3
|
2021-06-18 18:47:51 +00:00
|
|
|
, glib
|
|
|
|
, cairo
|
|
|
|
, desktop-file-utils
|
|
|
|
, xdg-utils
|
|
|
|
, xdg-user-dirs
|
2022-06-05 10:58:17 +00:00
|
|
|
, gettext
|
2021-06-18 18:47:51 +00:00
|
|
|
, winetricks
|
2022-06-05 10:58:17 +00:00
|
|
|
, wine
|
2022-01-13 17:15:15 +00:00
|
|
|
, glxinfo
|
2022-12-03 00:48:11 +00:00
|
|
|
, xrandr
|
2023-08-19 19:03:15 +00:00
|
|
|
, bash
|
2021-06-18 18:47:51 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "grapejuice";
|
2023-09-06 13:45:18 +00:00
|
|
|
version = "7.20.11";
|
2021-06-18 18:47:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "BrinkerVII";
|
|
|
|
repo = "grapejuice";
|
2022-06-05 10:58:17 +00:00
|
|
|
rev = "v${version}";
|
2023-09-06 13:45:18 +00:00
|
|
|
hash = "sha256-sDw67Xseeak1v5x0daznfdeNQahDTj21AVvXmuZlsgg=";
|
2021-06-18 18:47:51 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gobject-introspection
|
|
|
|
desktop-file-utils
|
|
|
|
glib
|
2024-04-26 20:24:03 +00:00
|
|
|
wrapGAppsHook3
|
2023-08-28 23:32:10 +00:00
|
|
|
python3Packages.pip
|
2021-06-18 18:47:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cairo
|
2022-06-05 10:58:17 +00:00
|
|
|
gettext
|
2022-08-03 14:14:28 +00:00
|
|
|
gtk3
|
2023-08-19 19:03:15 +00:00
|
|
|
bash
|
2021-06-18 18:47:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2022-06-05 10:58:17 +00:00
|
|
|
psutil
|
2021-06-18 18:47:51 +00:00
|
|
|
dbus-python
|
2022-06-05 10:58:17 +00:00
|
|
|
pygobject3
|
2021-06-18 18:47:51 +00:00
|
|
|
packaging
|
2022-06-05 10:58:17 +00:00
|
|
|
wheel
|
2021-06-18 18:47:51 +00:00
|
|
|
setuptools
|
2022-06-05 10:58:17 +00:00
|
|
|
requests
|
2022-01-13 17:15:15 +00:00
|
|
|
unidecode
|
2022-06-05 10:58:17 +00:00
|
|
|
click
|
2022-12-03 00:48:11 +00:00
|
|
|
pydantic
|
2021-06-18 18:47:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
makeWrapperArgs = [
|
2022-12-03 00:48:11 +00:00
|
|
|
"--prefix PATH : ${lib.makeBinPath [ xdg-user-dirs wine winetricks pciutils glxinfo xrandr ]}"
|
2022-07-11 23:23:52 +00:00
|
|
|
# make xdg-open overrideable at runtime
|
|
|
|
"--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}"
|
2021-06-18 18:47:51 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/grapejuice_common/assets/desktop/grapejuice.desktop \
|
|
|
|
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
|
2022-06-05 10:58:17 +00:00
|
|
|
--replace \$GRAPEJUICE_GUI_EXECUTABLE "$out/bin/grapejuice-gui" \
|
2021-06-18 18:47:51 +00:00
|
|
|
--replace \$GRAPEJUICE_ICON grapejuice
|
|
|
|
|
|
|
|
substituteInPlace src/grapejuice_common/assets/desktop/roblox-player.desktop \
|
|
|
|
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
|
|
|
|
--replace \$PLAYER_ICON "grapejuice-roblox-player"
|
|
|
|
|
|
|
|
substituteInPlace src/grapejuice_common/assets/desktop/roblox-app.desktop \
|
|
|
|
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
|
|
|
|
--replace \$PLAYER_ICON "grapejuice-roblox-player"
|
|
|
|
|
2023-08-19 19:03:15 +00:00
|
|
|
substituteInPlace src/grapejuice_common/assets/desktop/roblox-studio.desktop src/grapejuice_common/assets/desktop/roblox-studio-auth.desktop \
|
2021-06-18 18:47:51 +00:00
|
|
|
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
|
|
|
|
--replace \$STUDIO_ICON "grapejuice-roblox-studio"
|
2022-06-05 10:58:17 +00:00
|
|
|
|
|
|
|
substituteInPlace src/grapejuice_common/paths.py \
|
|
|
|
--replace 'return local_share() / "locale"' 'return Path("${placeholder "out"}/share/locale")'
|
|
|
|
|
2022-12-03 00:48:11 +00:00
|
|
|
substituteInPlace src/grapejuice_common/models/settings_model.py \
|
|
|
|
--replace 'default_wine_home: Optional[str] = ""' 'default_wine_home: Optional[str] = "${wine}"'
|
2023-08-19 00:05:39 +00:00
|
|
|
|
2023-08-19 19:03:15 +00:00
|
|
|
substituteInPlace src/grapejuice_packaging/builders/linux_package_builder.py \
|
|
|
|
--replace '"--no-dependencies",' '"--no-dependencies", "--no-build-isolation",'
|
|
|
|
|
|
|
|
substituteInPlace src/grapejuice_packaging/packaging_resources/bin/grapejuice src/grapejuice_packaging/packaging_resources/bin/grapejuice-gui \
|
|
|
|
--replace "/usr/bin/env python3" "${python3Packages.python.interpreter}"
|
2021-06-18 18:47:51 +00:00
|
|
|
'';
|
|
|
|
|
2023-08-19 19:03:15 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
PYTHONPATH=$(pwd)/src:$PYTHONPATH python3 -m grapejuice_packaging linux_package
|
|
|
|
|
|
|
|
mkdir -p "$out" "$out/${python3Packages.python.sitePackages}"
|
|
|
|
tar -xvf ./dist/linux_package/grapejuice-''${version}.tar.gz --strip-components=1 -C "$out"
|
2022-06-05 10:58:17 +00:00
|
|
|
|
2023-08-19 19:03:15 +00:00
|
|
|
mv "$out/lib/python3/dist-packages/"* "$out/${python3Packages.python.sitePackages}"
|
|
|
|
rmdir --ignore-fail-on-non-empty -p "$out/lib/python3/dist-packages"
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2022-06-05 10:58:17 +00:00
|
|
|
|
2023-08-19 19:03:15 +00:00
|
|
|
postFixup = ''
|
|
|
|
patchShebangs "$out/bin/grapejuice{,-gui}"
|
2022-06-05 10:58:17 +00:00
|
|
|
|
2023-08-19 19:03:15 +00:00
|
|
|
buildPythonPath "$out $pythonPath"
|
2022-06-05 10:58:17 +00:00
|
|
|
|
2023-08-19 19:03:15 +00:00
|
|
|
for bin in grapejuice grapejuice-gui; do
|
|
|
|
wrapProgram "$out/bin/$bin" \
|
|
|
|
--prefix PYTHONPATH : "$PYTHONPATH:$(toPythonPath $out)" \
|
|
|
|
''${makeWrapperArgs[@]} \
|
|
|
|
''${gappsWrapperArgs[@]}
|
2022-06-05 10:58:17 +00:00
|
|
|
done
|
2021-06-18 18:47:51 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# No tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "grapejuice" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://gitlab.com/brinkervii/grapejuice";
|
2022-06-05 10:58:17 +00:00
|
|
|
description = "Simple Wine+Roblox management tool";
|
2021-06-18 18:47:51 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2022-06-05 10:58:17 +00:00
|
|
|
maintainers = with maintainers; [ artturin helium ];
|
2021-06-18 18:47:51 +00:00
|
|
|
};
|
|
|
|
}
|