pokeruby: init at unstable-2021-07-16

This commit is contained in:
Simon Bruder 2021-08-07 14:08:39 +02:00
parent f2e86dbd50
commit 336d0e18cf
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC
2 changed files with 58 additions and 0 deletions

View file

@ -16,6 +16,11 @@ final: prev: {
crystal = prev.callPackage ./pokecrystal { };
ruby = prev.callPackage ./pokeruby { };
ruby-modern = prev.callPackage ./pokeruby { modern = true; };
ruby-de = prev.callPackage ./pokeruby { german = true; }; # german version
ruby-de-modern = prev.callPackage ./pokeruby { german = true; modern = true; };
all = prev.callPackage ./pokeall { };
};
}

53
pokeruby/default.nix Normal file
View file

@ -0,0 +1,53 @@
{ lib, stdenv, fetchFromGitHub, libpng, agbcc, gcc-arm-embedded, rsync, modern ? false, roms ? null, german ? false }:
let
roms' =
if roms == null
then
(if german
then [ "ruby_de" "ruby_de_rev1" "sapphire_de" "sapphire_de_rev1" ]
else [ "ruby" "ruby_rev1" "ruby_rev2" "sapphire" "sapphire_rev1" "sapphire_rev2" ])
else roms;
in
stdenv.mkDerivation rec {
pname = "pokeruby${lib.optionalString german "-de"}${lib.optionalString modern "-modern"}";
version = "unstable-2021-07-16";
src = fetchFromGitHub {
owner = "pret";
repo = "pokeruby";
rev = "7cc7f95aa646bb38cb4c29e4422df7b6f1ffd81e";
sha256 = "sha256-i4MOcvJQTAoWJRgf0l0oSSFz2MoUzD4+ADmvhldytg4=";
};
nativeBuildInputs = [ gcc-arm-embedded ] ++ lib.optional german rsync;
buildInputs = [ libpng ];
postPatch = ''
ln -s ${agbcc}/tools/agbcc tools/
'';
preBuild = lib.optionalString german ''
bash de_before.sh
'';
makeFlags = [
"TOOLCHAIN=${gcc-arm-embedded}"
"MODERN=${if modern then "1" else "0"}"
] ++ roms';
enableParallelBuilding = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp poke{${lib.concatStringsSep "," roms'}}${lib.optionalString modern "_modern"}.gba $out
runHook postInstall
'';
meta = with lib; {
description = "ROM built from disassembly of Pokémon Ruby/Sapphire";
homepage = "https://github.com/pret/pokeruby";
license = licenses.unfree;
maintainers = with maintainers; [ sbruder ];
};
}