nixpkgs/pkgs/by-name/x1/x16/rom.nix
Artturin e0464e4788 treewide: replace stdenv.is with stdenv.hostPlatform.is
In preparation for the deprecation of `stdenv.isX`.

These shorthands are not conducive to cross-compilation because they
hide the platforms.

Darwin might get cross-compilation for which the continued usage of `stdenv.isDarwin` will get in the way

One example of why this is bad and especially affects compiler packages
https://www.github.com/NixOS/nixpkgs/pull/343059

There are too many files to go through manually but a treewide should
get users thinking when they see a `hostPlatform.isX` in a place where it
doesn't make sense.

```
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv.is" "stdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenv'.is" "stdenv'.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "clangStdenv.is" "clangStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "gccStdenv.is" "gccStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "stdenvNoCC.is" "stdenvNoCC.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "inherit (stdenv) is" "inherit (stdenv.hostPlatform) is"
fd --type f "\.nix" | xargs sd --fixed-strings "buildStdenv.is" "buildStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "effectiveStdenv.is" "effectiveStdenv.hostPlatform.is"
fd --type f "\.nix" | xargs sd --fixed-strings "originalStdenv.is" "originalStdenv.hostPlatform.is"
```
2024-09-25 00:04:37 +03:00

60 lines
1.3 KiB
Nix

{ lib
, stdenv
, fetchFromGitHub
, cc65
, lzsa
, python3
}:
stdenv.mkDerivation (finalAttrs: {
pname = "x16-rom";
version = "48";
src = fetchFromGitHub {
owner = "X16Community";
repo = "x16-rom";
rev = "r${finalAttrs.version}";
hash = "sha256-MXt839wpPdGVFgf1CAqfmWEP2Ws+5uUFOI14vAdUTvk=";
};
nativeBuildInputs = [
cc65
lzsa
python3
];
postPatch = ''
patchShebangs findsymbols scripts/
substituteInPlace Makefile \
--replace-fail '/bin/echo' 'echo'
'';
dontConfigure = true;
makeFlags = [ "PRERELEASE_VERSION=${finalAttrs.version}" ];
installPhase = ''
runHook preInstall
install -Dm 444 -t $out/share/x16-rom/ build/x16/rom.bin
install -Dm 444 -t $out/share/doc/x16-rom/ README.md
runHook postInstall
'';
passthru = {
# upstream project recommends emulator and rom to be synchronized; passing
# through the version is useful to ensure this
inherit (finalAttrs) version;
};
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.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;
};
})