nixpkgs/pkgs/by-name/at/attract-mode/package.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

77 lines
1.6 KiB
Nix

{
lib,
stdenv,
fetchFromGitHub,
pkg-config,
expat,
ffmpeg_7,
freetype,
libarchive,
libjpeg,
libGLU,
sfml,
zlib,
openal,
fontconfig,
darwin,
}:
stdenv.mkDerivation {
pname = "attract-mode";
version = "2.7.0-unstable-2024-08-02";
src = fetchFromGitHub {
owner = "mickelson";
repo = "attract";
rev = "6ed3a1e32a519608c0b495295cc4c18ceea6b461";
hash = "sha256-uhbu/DaQSE9Dissv7XLFMVYitPn8ZEewq90poCtEfYY=";
};
nativeBuildInputs = [ pkg-config ];
buildInputs =
[
expat
ffmpeg_7
freetype
libarchive
libjpeg
libGLU
sfml
zlib
]
++ lib.optionals (!stdenv.hostPlatform.isDarwin) [
openal
fontconfig
]
++ lib.optionals stdenv.hostPlatform.isDarwin [
darwin.apple_sdk.frameworks.Cocoa
darwin.apple_sdk.frameworks.Carbon
darwin.apple_sdk.frameworks.IOKit
darwin.apple_sdk.frameworks.CoreVideo
darwin.apple_sdk.frameworks.OpenAL
];
makeFlags = [
"prefix=$(out)"
"CC=${stdenv.cc.targetPrefix}cc"
"CXX=${stdenv.cc.targetPrefix}c++"
"STRIP=${stdenv.cc.targetPrefix}strip"
"OBJCOPY=${stdenv.cc.targetPrefix}objcopy"
"PKG_CONFIG=${stdenv.cc.targetPrefix}pkg-config"
"AR=${stdenv.cc.targetPrefix}ar"
"BUILD_EXPAT=0"
] ++ lib.optionals stdenv.hostPlatform.isDarwin [ "USE_FONTCONFIG=0" ];
enableParallelBuilding = true;
meta = {
description = "Frontend for arcade cabinets and media PCs";
homepage = "http://attractmode.org";
license = lib.licenses.gpl3Plus;
maintainers = [ lib.maintainers.hrdinka ];
platforms = lib.platforms.unix;
mainProgram = "attract";
};
}