2023-08-04 22:07:22 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-02-05 17:12:51 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, SDL2
|
2024-01-02 11:29:13 +00:00
|
|
|
, callPackage
|
2023-08-04 22:07:22 +00:00
|
|
|
, zlib
|
2021-02-05 17:12:51 +00:00
|
|
|
}:
|
|
|
|
|
2022-08-12 12:06:08 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-02-05 17:12:51 +00:00
|
|
|
pname = "x16-emulator";
|
2024-09-19 14:19:46 +00:00
|
|
|
version = "48";
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-08-04 22:07:22 +00:00
|
|
|
owner = "X16Community";
|
2022-08-12 12:06:08 +00:00
|
|
|
repo = "x16-emulator";
|
|
|
|
rev = "r${finalAttrs.version}";
|
2024-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-E4TosRoORCWLotOIXROP9oqwqo1IRSa6X13GnmuxE9A=";
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
2024-09-19 14:19:46 +00:00
|
|
|
--replace-fail '/bin/echo' 'echo'
|
2023-08-04 22:07:22 +00:00
|
|
|
'';
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
zlib
|
|
|
|
];
|
2021-02-05 17:12:51 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
install -Dm 755 -t $out/bin/ x16emu
|
2022-08-12 12:06:08 +00:00
|
|
|
install -Dm 444 -t $out/share/doc/x16-emulator/ README.md
|
2022-04-27 09:35:20 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-08-04 22:07:22 +00:00
|
|
|
passthru = {
|
|
|
|
# upstream project recommends emulator and rom to be synchronized; passing
|
|
|
|
# through the version is useful to ensure this
|
|
|
|
inherit (finalAttrs) version;
|
2024-01-02 11:29:13 +00:00
|
|
|
emulator = finalAttrs.finalPackage;
|
|
|
|
rom = callPackage ./rom.nix { };
|
|
|
|
run = (callPackage ./run.nix { }){
|
|
|
|
inherit (finalAttrs.finalPackage) emulator rom;
|
|
|
|
};
|
2023-08-04 22:07:22 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://cx16forum.com/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Official emulator of CommanderX16 8-bit computer";
|
2023-08-04 22:07:22 +00:00
|
|
|
changelog = "https://github.com/X16Community/x16-emulator/blob/r${finalAttrs.version}/RELEASES.md";
|
|
|
|
license = lib.licenses.bsd2;
|
|
|
|
maintainers = with lib.maintainers; [ AndersonTorres ];
|
2022-05-18 14:49:53 +00:00
|
|
|
mainProgram = "x16emu";
|
2022-04-27 09:35:20 +00:00
|
|
|
inherit (SDL2.meta) platforms;
|
2024-09-26 11:04:55 +00:00
|
|
|
broken = stdenv.hostPlatform.isAarch64; # ofborg fails to compile it
|
2021-02-05 17:12:51 +00:00
|
|
|
};
|
2022-08-12 12:06:08 +00:00
|
|
|
})
|