2023-07-16 00:02:42 +01:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-01-28 08:50:55 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, cc65
|
2023-12-10 20:18:00 +00:00
|
|
|
, lzsa
|
2022-04-24 04:12:46 +01:00
|
|
|
, python3
|
2021-01-28 08:50:55 +00:00
|
|
|
}:
|
|
|
|
|
2022-08-09 03:25:58 +01:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-01-28 08:50:55 +00:00
|
|
|
pname = "x16-rom";
|
2024-03-31 02:34:38 +01:00
|
|
|
version = "47";
|
2021-01-28 08:50:55 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-07-16 00:02:42 +01:00
|
|
|
owner = "X16Community";
|
2022-08-09 03:25:58 +01:00
|
|
|
repo = "x16-rom";
|
|
|
|
rev = "r${finalAttrs.version}";
|
2024-03-31 02:34:38 +01:00
|
|
|
hash = "sha256-+NvuCW8CIj5cnrGh+VQOExhAeXMElqdl9DVJjjGhNPk=";
|
2021-01-28 08:50:55 +00:00
|
|
|
};
|
|
|
|
|
2022-04-24 04:12:46 +01:00
|
|
|
nativeBuildInputs = [
|
|
|
|
cc65
|
2023-12-10 20:18:00 +00:00
|
|
|
lzsa
|
2022-04-24 04:12:46 +01:00
|
|
|
python3
|
|
|
|
];
|
2021-01-28 08:50:55 +00:00
|
|
|
|
|
|
|
postPatch = ''
|
2023-07-16 00:02:42 +01:00
|
|
|
patchShebangs findsymbols scripts/
|
|
|
|
substituteInPlace Makefile \
|
2024-08-25 16:07:30 +01:00
|
|
|
--replace-fail '/bin/echo' 'echo'
|
2021-01-28 08:50:55 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
dontConfigure = true;
|
|
|
|
|
2023-07-16 00:02:42 +01:00
|
|
|
makeFlags = [ "PRERELEASE_VERSION=${finalAttrs.version}" ];
|
|
|
|
|
2021-01-28 08:50:55 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2022-04-24 04:12:46 +01:00
|
|
|
|
2022-08-09 03:25:58 +01:00
|
|
|
install -Dm 444 -t $out/share/x16-rom/ build/x16/rom.bin
|
|
|
|
install -Dm 444 -t $out/share/doc/x16-rom/ README.md
|
2022-04-24 04:12:46 +01:00
|
|
|
|
2021-01-28 08:50:55 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
passthru = {
|
2023-07-16 00:02:42 +01:00
|
|
|
# upstream project recommends emulator and rom to be synchronized; passing
|
|
|
|
# through the version is useful to ensure this
|
2022-08-09 03:25:58 +01:00
|
|
|
inherit (finalAttrs) version;
|
2021-01-28 08:50:55 +00:00
|
|
|
};
|
2023-07-16 00:02:42 +01:00
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://github.com/X16Community/x16-rom";
|
|
|
|
description = "ROM file for CommanderX16 8-bit computer";
|
|
|
|
license = lib.licenses.bsd2;
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
|
|
|
inherit (cc65.meta) platforms;
|
|
|
|
broken = stdenv.isDarwin && stdenv.isAarch64;
|
|
|
|
};
|
2022-08-09 03:25:58 +01:00
|
|
|
})
|