2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, fetchFromGitLab
|
|
|
|
, gobject-introspection
|
2022-06-16 17:23:12 +00:00
|
|
|
, pciutils
|
2021-06-28 23:13:55 +00:00
|
|
|
, python3Packages
|
|
|
|
, gtk3
|
|
|
|
, wrapGAppsHook
|
|
|
|
, glib
|
|
|
|
, cairo
|
|
|
|
, desktop-file-utils
|
|
|
|
, xdg-utils
|
|
|
|
, xdg-user-dirs
|
2022-06-16 17:23:12 +00:00
|
|
|
, gettext
|
2021-06-28 23:13:55 +00:00
|
|
|
, winetricks
|
2022-06-16 17:23:12 +00:00
|
|
|
, wine
|
2022-01-19 23:45:15 +00:00
|
|
|
, glxinfo
|
2022-12-17 10:02:37 +00:00
|
|
|
, xrandr
|
2021-06-28 23:13:55 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
python3Packages.buildPythonApplication rec {
|
|
|
|
pname = "grapejuice";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "7.2.0";
|
2021-06-28 23:13:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitLab {
|
|
|
|
owner = "BrinkerVII";
|
|
|
|
repo = "grapejuice";
|
2022-06-16 17:23:12 +00:00
|
|
|
rev = "v${version}";
|
2022-12-17 10:02:37 +00:00
|
|
|
sha256 = "sha256-BNVoSJbGi+u2DHuAicOjEUpDlmu25vMWoBudbV1FLgM=";
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gobject-introspection
|
|
|
|
desktop-file-utils
|
|
|
|
glib
|
|
|
|
wrapGAppsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
cairo
|
2022-06-16 17:23:12 +00:00
|
|
|
gettext
|
2022-08-12 12:06:08 +00:00
|
|
|
gtk3
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
propagatedBuildInputs = with python3Packages; [
|
2022-06-16 17:23:12 +00:00
|
|
|
psutil
|
2021-06-28 23:13:55 +00:00
|
|
|
dbus-python
|
2022-06-16 17:23:12 +00:00
|
|
|
pygobject3
|
2021-06-28 23:13:55 +00:00
|
|
|
packaging
|
2022-06-16 17:23:12 +00:00
|
|
|
wheel
|
2021-06-28 23:13:55 +00:00
|
|
|
setuptools
|
2022-06-16 17:23:12 +00:00
|
|
|
requests
|
2022-01-19 23:45:15 +00:00
|
|
|
unidecode
|
2022-06-16 17:23:12 +00:00
|
|
|
click
|
2022-12-17 10:02:37 +00:00
|
|
|
pydantic
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
dontWrapGApps = true;
|
|
|
|
|
|
|
|
makeWrapperArgs = [
|
|
|
|
"\${gappsWrapperArgs[@]}"
|
2022-12-17 10:02:37 +00:00
|
|
|
"--prefix PATH : ${lib.makeBinPath [ xdg-user-dirs wine winetricks pciutils glxinfo xrandr ]}"
|
2022-08-21 13:32:41 +00:00
|
|
|
# make xdg-open overrideable at runtime
|
|
|
|
"--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}"
|
2021-06-28 23:13:55 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace src/grapejuice_common/assets/desktop/grapejuice.desktop \
|
|
|
|
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
|
2022-06-16 17:23:12 +00:00
|
|
|
--replace \$GRAPEJUICE_GUI_EXECUTABLE "$out/bin/grapejuice-gui" \
|
2021-06-28 23:13:55 +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"
|
|
|
|
|
|
|
|
substituteInPlace src/grapejuice_common/assets/desktop/roblox-studio.desktop \
|
|
|
|
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
|
|
|
|
--replace \$STUDIO_ICON "grapejuice-roblox-studio"
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
substituteInPlace src/grapejuice_common/paths.py \
|
|
|
|
--replace 'return local_share() / "locale"' 'return Path("${placeholder "out"}/share/locale")'
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
substituteInPlace src/grapejuice_common/models/settings_model.py \
|
|
|
|
--replace 'default_wine_home: Optional[str] = ""' 'default_wine_home: Optional[str] = "${wine}"'
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postInstall = ''
|
|
|
|
mkdir -p "$out/share/icons" "$out/share/applications" "$out/share/mime/packages"
|
|
|
|
cp -r src/grapejuice_common/assets/desktop/* $out/share/applications/
|
|
|
|
cp -r src/grapejuice_common/assets/icons $out/share/
|
|
|
|
cp src/grapejuice_common/assets/mime_xml/*.xml $out/share/mime/packages/
|
2022-06-16 17:23:12 +00:00
|
|
|
|
|
|
|
# compile locales (*.po -> *.mo)
|
|
|
|
# from https://gitlab.com/brinkervii/grapejuice/-/blob/master/src/grapejuice_common/util/mo_util.py
|
|
|
|
LOCALE_DIR="$out/share/locale"
|
|
|
|
PO_DIR="src/grapejuice_common/assets/po"
|
|
|
|
LINGUAS_FILE="src/grapejuice_common/assets/po/LINGUAS"
|
|
|
|
|
|
|
|
for lang in $(<"$LINGUAS_FILE") # extract langs from LINGUAS_FILE
|
|
|
|
do
|
|
|
|
po_file="$PO_DIR/$lang.po"
|
|
|
|
mo_file_dir="$LOCALE_DIR/$lang/LC_MESSAGES"
|
|
|
|
|
|
|
|
mkdir -p $mo_file_dir
|
|
|
|
|
|
|
|
mo_file="$mo_file_dir/grapejuice.mo"
|
|
|
|
msgfmt $po_file -o $mo_file # msgfmt from gettext
|
|
|
|
done
|
2021-06-28 23:13:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
# No tests
|
|
|
|
doCheck = false;
|
|
|
|
|
|
|
|
pythonImportsCheck = [ "grapejuice" ];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://gitlab.com/brinkervii/grapejuice";
|
2022-06-16 17:23:12 +00:00
|
|
|
description = "Simple Wine+Roblox management tool";
|
2021-06-28 23:13:55 +00:00
|
|
|
license = licenses.gpl3Plus;
|
|
|
|
platforms = platforms.linux;
|
2022-06-16 17:23:12 +00:00
|
|
|
maintainers = with maintainers; [ artturin helium ];
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
}
|