about summary refs log tree commit diff
path: root/pkgs/games
diff options
context:
space:
mode:
authorArtturi <Artturin@artturin.com>2022-06-11 01:45:23 +0300
committerGitHub <noreply@github.com>2022-06-11 01:45:23 +0300
commitb03082ac7986809ae792dbf1c592ecd45c513ec8 (patch)
tree9554fe9b547d28b4ff71c32f20021994425e1980 /pkgs/games
parentcffe8efc3cfb3a4c9263976812b411a96895b9fc (diff)
parent8974c1ced3f693dd717964a5c40697e443df6f23 (diff)
Merge pull request #176384 from helium18/master
grapejuice: 4.10.2 -> 5.1.1
Diffstat (limited to 'pkgs/games')
-rw-r--r--pkgs/games/grapejuice/default.nix48
1 files changed, 38 insertions, 10 deletions
diff --git a/pkgs/games/grapejuice/default.nix b/pkgs/games/grapejuice/default.nix
index 4ddb58c81482d..901045f750ffb 100644
--- a/pkgs/games/grapejuice/default.nix
+++ b/pkgs/games/grapejuice/default.nix
@@ -1,6 +1,7 @@
 { lib
 , fetchFromGitLab
 , gobject-introspection
+, pciutils
 , python3Packages
 , gtk3
 , wrapGAppsHook
@@ -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 = [
@@ -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;
@@ -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 \
@@ -71,6 +76,12 @@ 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 = ''
@@ -78,6 +89,23 @@ python3Packages.buildPythonApplication rec  {
     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
@@ -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 ];
   };
 }