nixpkgs/pkgs/by-name/x1/x16/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

63 lines
1.4 KiB
Nix
Raw Normal View History

2023-07-15 23:00:04 +00:00
{ lib
, stdenv
2021-01-28 08:48:49 +00:00
, fetchFromGitHub
, SDL2
, 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";
2024-03-31 01:27:51 +00:00
version = "47";
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}";
2024-03-31 01:27:51 +00:00
hash = "sha256-v7INa0Xpq7WlrSqc6VNBwLQPUoloqsGbv5rd/VTQtUg=";
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;
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/";
description = "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 ];
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
})