Add infinite fusion legacy version

This commit is contained in:
Peder Bergebakken Sundt 2023-06-15 22:41:31 +02:00
parent 7ca39f5b56
commit d625ea056c
4 changed files with 46 additions and 8 deletions

View File

@ -19,13 +19,16 @@
inherit (callPackage ./pkgs/fetchers.nix { inherit badown mediafire-dl; }) inherit (callPackage ./pkgs/fetchers.nix { inherit badown mediafire-dl; })
fetchFromDrive fetchFromDrive
fetchFromMega
fetchFromMediafire; fetchFromMediafire;
pokemon = let pokemon = let
callPackage = newScope (erosanix.lib.x86_64-linux // { callPackage = newScope (erosanix.lib.x86_64-linux // {
wine = wineWowPackages.full; wine = wineWowPackages.full;
wineArch = "win64";
inherit inherit
fetchFromDrive fetchFromDrive
fetchFromMega
fetchFromMediafire; fetchFromMediafire;
}); });
in { in {
@ -34,7 +37,15 @@
# - https://github.com/emmanuelrosa/erosanix/tree/master/pkgs/mkwindowsapp # - https://github.com/emmanuelrosa/erosanix/tree/master/pkgs/mkwindowsapp
# - https://github.com/emmanuelrosa/sumatrapdf-nix/blob/master/sumatrapdf.nix # - https://github.com/emmanuelrosa/sumatrapdf-nix/blob/master/sumatrapdf.nix
infinite-fusion = callPackage ./games/infinite-fusion.nix { }; infinite-fusion = callPackage ./games/infinite-fusion.nix {
legacy-version = false;
};
infinite-fusion-legacy = callPackage ./games/infinite-fusion.nix {
legacy-version = true;
wine = winePackages.full;
wineArch = "win32";
};
project-untamed = callPackage ./games/project-untamed.nix { }; project-untamed = callPackage ./games/project-untamed.nix { };
@ -51,6 +62,7 @@
lib.x86_64-linux = { lib.x86_64-linux = {
inherit (self.packages.x86_64-linux) inherit (self.packages.x86_64-linux)
fetchFromDrive fetchFromDrive
fetchFromMega
fetchFromMediafire; fetchFromMediafire;
}; };

View File

@ -4,29 +4,39 @@
, fetchurl , fetchurl
, mkWindowsApp , mkWindowsApp
, wine , wine
, wineArch
, unzip , unzip
, makeDesktopItem , makeDesktopItem
, makeDesktopIcon , makeDesktopIcon
, copyDesktopItems , copyDesktopItems
, copyDesktopIcons , copyDesktopIcons
, legacy-version ? false
}: }:
let uid = "pkmn-infinite-fusion"; let uid = "pkmn-infinite-fusion";
in mkWindowsApp rec { in mkWindowsApp rec {
pname = "Pokemon Infinite Fusion"; pname = "Pokemon Infinite Fusion";
version = "5.2.1"; version = if legacy-version
then "4.9.2"
else "5.2.1";
meta.homepage = "https://www.pokecommunity.com/showthread.php?t=347883"; meta.homepage = "https://www.pokecommunity.com/showthread.php?t=347883";
meta.description = "This game re-introduces the DNA Splicers from Black and White 2... Except this time, you can use it on EVERY Pokémon!"; meta.description = "This game re-introduces the DNA Splicers from Black and White 2... Except this time, you can use it on EVERY Pokémon!";
dontUnpack = true; dontUnpack = true;
src = fetchFromMediafire rec { src = if legacy-version
then fetchFromMega rec {
name = "infinitefusion_${version}-full.zip";
url = "https://mega.nz/file/kg9UxbAI#G-bG8rv1HkOqTkza4R1TCcNFihc0C9ir21GtcMD6FPo";
hash = "sha256-YTEVoQ6Dml5XBb9jSkzKHCWs4MAtdULSsnkJHp7uUCY=";
assert_exists = [ name ];
}
else fetchFromMediafire rec {
name = "infinitefusion_preloaded_${version}_full.zip"; name = "infinitefusion_preloaded_${version}_full.zip";
url = "https://www.mediafire.com/file/2eqpi1qq74yl1gb/infinitefusion_preloaded_5.2.1_full.zip/file"; url = "https://www.mediafire.com/file/2eqpi1qq74yl1gb/infinitefusion_preloaded_5.2.1_full.zip/file";
hash = "sha256-JyalBh2ikwAbNm1SUg2oYXnLKbg2jG0ZmBUjoFOhGuk="; hash = "sha256-JyalBh2ikwAbNm1SUg2oYXnLKbg2jG0ZmBUjoFOhGuk=";
assert_exists = [ name ]; assert_exists = [ name ];
}; };
inherit wine; inherit wine wineArch;
wineArch = "win64";
nativeBuildInputs = [ copyDesktopItems copyDesktopIcons ]; nativeBuildInputs = [ copyDesktopItems copyDesktopIcons ];
installPhase = '' installPhase = ''
@ -37,12 +47,23 @@ in mkWindowsApp rec {
winAppInstall = '' winAppInstall = ''
${unzip}/bin/unzip ${src} -d "$WINEPREFIX/drive_c/${uid}" ${unzip}/bin/unzip ${src} -d "$WINEPREFIX/drive_c/${uid}"
'' + lib.optionalString legacy-version ''
mkdir -vp "$WINEPREFIX/drive_c/windows/fonts"
cp -v "$WINEPREFIX/drive_c/${uid}/Fonts/"* "$WINEPREFIX/drive_c/windows/fonts/"
''; '';
# v5+
fileMap."$HOME/.local/share/${uid}/AppData/infinitefusion" fileMap."$HOME/.local/share/${uid}/AppData/infinitefusion"
= "drive_c/users/$USER/AppData/Roaming/infinitefusion"; = "drive_c/users/$USER/AppData/Roaming/infinitefusion";
# legacy
fileMap."$HOME/.local/share/${uid}/Saved Games"
= "drive_c/users/$USER/Saved Games";
winAppRun = '' winAppRun = if legacy-version
then ''
$WINE start /unix "$WINEPREFIX"/drive_c/${uid}/Game.exe "$ARGS"
''
else ''
$WINE start /unix "$WINEPREFIX"/drive_c/${uid}/"Pokemon Infinite Fusion".exe "$ARGS" $WINE start /unix "$WINEPREFIX"/drive_c/${uid}/"Pokemon Infinite Fusion".exe "$ARGS"
''; '';

View File

@ -3,6 +3,7 @@
, fetchurl , fetchurl
, mkWindowsApp , mkWindowsApp
, wine , wine
, wineArch
, unzip , unzip
, makeDesktopItem , makeDesktopItem
, makeDesktopIcon , makeDesktopIcon
@ -24,8 +25,7 @@ in mkWindowsApp rec {
assert_exists = [ name ]; assert_exists = [ name ];
}; };
inherit wine; inherit wine wineArch;
wineArch = "win64";
nativeBuildInputs = [ copyDesktopItems copyDesktopIcons ]; nativeBuildInputs = [ copyDesktopItems copyDesktopIcons ];
installPhase = '' installPhase = ''

View File

@ -1,6 +1,7 @@
{ lib { lib
, runCommand , runCommand
, findutils , findutils
, megatools
, badown , badown
, mediafire-dl , mediafire-dl
, gdown , gdown
@ -42,6 +43,10 @@ in {
"HOME=$(mktemp -d) ${gdown}/bin/gdown ${lib.escapeShellArg url}" "HOME=$(mktemp -d) ${gdown}/bin/gdown ${lib.escapeShellArg url}"
); );
fetchFromMega = mkFetcher (url:
"${megatools}/bin/megadl ${lib.escapeShellArg url} --disable-resume --no-ask-password"
);
fetchFromMediafire = mkFetcher (url: fetchFromMediafire = mkFetcher (url:
# TODO: why doesn't this work inside a FOD? # TODO: why doesn't this work inside a FOD?
#"${badown}/bin/badown ${lib.escapeShellArg url}" #"${badown}/bin/badown ${lib.escapeShellArg url}"