2023-07-15 23:00:04 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2021-01-28 08:48:49 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, SDL2
|
2023-12-10 20:11:47 +00:00
|
|
|
, callPackage
|
2023-07-15 23:00:04 +00:00
|
|
|
, zlib
|
2021-01-28 08:48:49 +00:00
|
|
|
}:
|
|
|
|
|
2022-08-09 02:26:29 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2021-01-28 08:48:49 +00:00
|
|
|
pname = "x16-emulator";
|
2023-12-10 20:22:15 +00:00
|
|
|
version = "46";
|
2021-01-28 08:48:49 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
2023-07-15 23:00:04 +00:00
|
|
|
owner = "X16Community";
|
2022-08-09 02:26:29 +00:00
|
|
|
repo = "x16-emulator";
|
|
|
|
rev = "r${finalAttrs.version}";
|
2023-12-10 20:22:15 +00:00
|
|
|
hash = "sha256-cYr6s69eua1hCFqNkcomZDK9akxBqMTIaGqOl/YX2kc=";
|
2021-01-28 08:48:49 +00:00
|
|
|
};
|
|
|
|
|
2023-07-15 23:00:04 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Makefile \
|
|
|
|
--replace '/bin/echo' 'echo'
|
|
|
|
'';
|
|
|
|
|
2021-01-28 08:48:49 +00:00
|
|
|
dontConfigure = true;
|
|
|
|
|
2023-07-15 23:00:04 +00:00
|
|
|
buildInputs = [
|
|
|
|
SDL2
|
|
|
|
zlib
|
|
|
|
];
|
2021-01-28 08:48:49 +00:00
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
2022-04-24 03:19:43 +00:00
|
|
|
|
|
|
|
install -Dm 755 -t $out/bin/ x16emu
|
2022-08-09 02:26:29 +00:00
|
|
|
install -Dm 444 -t $out/share/doc/x16-emulator/ README.md
|
2022-04-24 03:19:43 +00:00
|
|
|
|
2021-01-28 08:48:49 +00:00
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
2023-07-15 23:00:04 +00:00
|
|
|
passthru = {
|
|
|
|
# upstream project recommends emulator and rom to be synchronized; passing
|
|
|
|
# through the version is useful to ensure this
|
|
|
|
inherit (finalAttrs) version;
|
2023-12-10 20:11:47 +00:00
|
|
|
emulator = finalAttrs.finalPackage;
|
|
|
|
rom = callPackage ./rom.nix { };
|
|
|
|
run = (callPackage ./run.nix { }){
|
|
|
|
inherit (finalAttrs.finalPackage) emulator rom;
|
|
|
|
};
|
2023-07-15 23:00:04 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://cx16forum.com/";
|
2022-08-09 02:26:29 +00:00
|
|
|
description = "The official emulator of CommanderX16 8-bit computer";
|
2023-07-15 23:00:04 +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-05 00:46:39 +00:00
|
|
|
mainProgram = "x16emu";
|
2022-04-24 03:19:43 +00:00
|
|
|
inherit (SDL2.meta) platforms;
|
2023-07-17 03:41:30 +00:00
|
|
|
broken = stdenv.isAarch64; # ofborg fails to compile it
|
2021-01-28 08:48:49 +00:00
|
|
|
};
|
2022-08-09 02:26:29 +00:00
|
|
|
})
|