Merge pull request #250064 from TheNexusAvenger/grapejuice-7.14.4
This commit is contained in:
commit
4525ce10b5
@ -15,17 +15,18 @@
|
|||||||
, wine
|
, wine
|
||||||
, glxinfo
|
, glxinfo
|
||||||
, xrandr
|
, xrandr
|
||||||
|
, bash
|
||||||
}:
|
}:
|
||||||
|
|
||||||
python3Packages.buildPythonApplication rec {
|
python3Packages.buildPythonApplication rec {
|
||||||
pname = "grapejuice";
|
pname = "grapejuice";
|
||||||
version = "7.8.3";
|
version = "7.14.4";
|
||||||
|
|
||||||
src = fetchFromGitLab {
|
src = fetchFromGitLab {
|
||||||
owner = "BrinkerVII";
|
owner = "BrinkerVII";
|
||||||
repo = "grapejuice";
|
repo = "grapejuice";
|
||||||
rev = "v${version}";
|
rev = "v${version}";
|
||||||
sha256 = "sha256-jNh3L6JDuJryFpHQaP8UesBmepmJopoHxb/XUfOwZz4=";
|
hash = "sha256-CWTnofJXx9T/hGXx3rdephXHjpiVRdFEJQ1u2v6n7yo=";
|
||||||
};
|
};
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
@ -39,6 +40,7 @@ python3Packages.buildPythonApplication rec {
|
|||||||
cairo
|
cairo
|
||||||
gettext
|
gettext
|
||||||
gtk3
|
gtk3
|
||||||
|
bash
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = with python3Packages; [
|
propagatedBuildInputs = with python3Packages; [
|
||||||
@ -57,7 +59,6 @@ python3Packages.buildPythonApplication rec {
|
|||||||
dontWrapGApps = true;
|
dontWrapGApps = true;
|
||||||
|
|
||||||
makeWrapperArgs = [
|
makeWrapperArgs = [
|
||||||
"\${gappsWrapperArgs[@]}"
|
|
||||||
"--prefix PATH : ${lib.makeBinPath [ xdg-user-dirs wine winetricks pciutils glxinfo xrandr ]}"
|
"--prefix PATH : ${lib.makeBinPath [ xdg-user-dirs wine winetricks pciutils glxinfo xrandr ]}"
|
||||||
# make xdg-open overrideable at runtime
|
# make xdg-open overrideable at runtime
|
||||||
"--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}"
|
"--suffix PATH : ${lib.makeBinPath [ xdg-utils ]}"
|
||||||
@ -77,7 +78,7 @@ python3Packages.buildPythonApplication rec {
|
|||||||
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
|
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
|
||||||
--replace \$PLAYER_ICON "grapejuice-roblox-player"
|
--replace \$PLAYER_ICON "grapejuice-roblox-player"
|
||||||
|
|
||||||
substituteInPlace src/grapejuice_common/assets/desktop/roblox-studio.desktop \
|
substituteInPlace src/grapejuice_common/assets/desktop/roblox-studio.desktop src/grapejuice_common/assets/desktop/roblox-studio-auth.desktop \
|
||||||
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
|
--replace \$GRAPEJUICE_EXECUTABLE "$out/bin/grapejuice" \
|
||||||
--replace \$STUDIO_ICON "grapejuice-roblox-studio"
|
--replace \$STUDIO_ICON "grapejuice-roblox-studio"
|
||||||
|
|
||||||
@ -86,29 +87,38 @@ python3Packages.buildPythonApplication rec {
|
|||||||
|
|
||||||
substituteInPlace src/grapejuice_common/models/settings_model.py \
|
substituteInPlace src/grapejuice_common/models/settings_model.py \
|
||||||
--replace 'default_wine_home: Optional[str] = ""' 'default_wine_home: Optional[str] = "${wine}"'
|
--replace 'default_wine_home: Optional[str] = ""' 'default_wine_home: Optional[str] = "${wine}"'
|
||||||
|
|
||||||
|
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}"
|
||||||
'';
|
'';
|
||||||
|
|
||||||
postInstall = ''
|
installPhase = ''
|
||||||
mkdir -p "$out/share/icons" "$out/share/applications" "$out/share/mime/packages"
|
runHook preInstall
|
||||||
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)
|
PYTHONPATH=$(pwd)/src:$PYTHONPATH python3 -m grapejuice_packaging linux_package
|
||||||
# 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
|
mkdir -p "$out" "$out/${python3Packages.python.sitePackages}"
|
||||||
do
|
tar -xvf ./dist/linux_package/grapejuice-''${version}.tar.gz --strip-components=1 -C "$out"
|
||||||
po_file="$PO_DIR/$lang.po"
|
|
||||||
mo_file_dir="$LOCALE_DIR/$lang/LC_MESSAGES"
|
|
||||||
|
|
||||||
mkdir -p $mo_file_dir
|
mv "$out/lib/python3/dist-packages/"* "$out/${python3Packages.python.sitePackages}"
|
||||||
|
rmdir --ignore-fail-on-non-empty -p "$out/lib/python3/dist-packages"
|
||||||
|
|
||||||
mo_file="$mo_file_dir/grapejuice.mo"
|
runHook postInstall
|
||||||
msgfmt $po_file -o $mo_file # msgfmt from gettext
|
'';
|
||||||
|
|
||||||
|
postFixup = ''
|
||||||
|
patchShebangs "$out/bin/grapejuice{,-gui}"
|
||||||
|
|
||||||
|
buildPythonPath "$out $pythonPath"
|
||||||
|
|
||||||
|
for bin in grapejuice grapejuice-gui; do
|
||||||
|
wrapProgram "$out/bin/$bin" \
|
||||||
|
--prefix PYTHONPATH : "$PYTHONPATH:$(toPythonPath $out)" \
|
||||||
|
''${makeWrapperArgs[@]} \
|
||||||
|
''${gappsWrapperArgs[@]}
|
||||||
done
|
done
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user