Skip to content

Commit

Permalink
Merge pull request #176384 from helium18/master
Browse files Browse the repository at this point in the history
grapejuice: 4.10.2 -> 5.1.1
  • Loading branch information
Artturin authored Jun 10, 2022
2 parents cffe8ef + 8974c1c commit b03082a
Showing 1 changed file with 38 additions and 10 deletions.
48 changes: 38 additions & 10 deletions pkgs/games/grapejuice/default.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
{ lib
, fetchFromGitLab
, gobject-introspection
, pciutils
, python3Packages
, gtk3
, wrapGAppsHook
Expand All @@ -9,21 +10,21 @@
, desktop-file-utils
, xdg-utils
, xdg-user-dirs
, wine
, gettext
, winetricks
, pciutils
, wine
, glxinfo
}:

python3Packages.buildPythonApplication rec {
pname = "grapejuice";
version = "4.10.2";
version = "5.1.1";

src = fetchFromGitLab {
owner = "BrinkerVII";
repo = "grapejuice";
rev = "9a7cf806d35b4d53b3d3762339eba7d861b5043d";
sha256 = "sha256-cKZv9qPCnl7i4kb6PG8RYx3HNLcwgI4d2zkw899MA6E=";
rev = "v${version}";
sha256 = "sha256-31pxQtKw5sLGnnNdboF7AAIFqsan5pXKHIHtKq/ErRE=";
};

nativeBuildInputs = [
Expand All @@ -36,16 +37,19 @@ python3Packages.buildPythonApplication rec {

buildInputs = [
cairo
gettext
];

propagatedBuildInputs = with python3Packages; [
requests
pygobject3
psutil
dbus-python
pygobject3
packaging
psutil
wheel
setuptools
requests
unidecode
click
];

dontWrapGApps = true;
Expand All @@ -58,6 +62,7 @@ python3Packages.buildPythonApplication rec {
postPatch = ''
substituteInPlace src/grapejuice_common/assets/desktop/grapejuice.desktop \
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
--replace \$GRAPEJUICE_GUI_EXECUTABLE "$out/bin/grapejuice-gui" \
--replace \$GRAPEJUICE_ICON grapejuice
substituteInPlace src/grapejuice_common/assets/desktop/roblox-player.desktop \
Expand All @@ -71,13 +76,36 @@ python3Packages.buildPythonApplication rec {
substituteInPlace src/grapejuice_common/assets/desktop/roblox-studio.desktop \
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
--replace \$STUDIO_ICON "grapejuice-roblox-studio"
substituteInPlace src/grapejuice_common/paths.py \
--replace 'return local_share() / "locale"' 'return Path("${placeholder "out"}/share/locale")'
substituteInPlace src/grapejuice_common/features/settings.py \
--replace 'k_default_wine_home: "",' 'k_default_wine_home: "${wine}",'
'';

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/
# 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
'';

# No tests
Expand All @@ -87,9 +115,9 @@ python3Packages.buildPythonApplication rec {

meta = with lib; {
homepage = "https://gitlab.com/brinkervii/grapejuice";
description = "A wine+Roblox management application";
description = "Simple Wine+Roblox management tool";
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ artturin ];
maintainers = with maintainers; [ artturin helium ];
};
}

0 comments on commit b03082a

Please sign in to comment.