abbaye-des-morts: fix darwin build, refactor (#430653)

This commit is contained in:
Sandro 2025-08-12 00:52:28 +02:00 committed by GitHub
commit f43a56ac70
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7,14 +7,14 @@
SDL2_mixer,
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "abbaye-des-morts";
version = "2.0.5";
src = fetchFromGitHub {
owner = "nevat";
repo = "abbayedesmorts-gpl";
tag = "v${version}";
tag = "v${finalAttrs.version}";
sha256 = "sha256-muJt1cml0nYdgl0v8cudpUXcdSntc49e6zICTCwzkks=";
};
@ -25,18 +25,17 @@ stdenv.mkDerivation rec {
];
makeFlags = [
"PREFIX=$(out)"
"PREFIX=${placeholder "out"}"
"DESTDIR="
];
]
++ lib.optional stdenv.isDarwin "PLATFORM=mac";
preBuild = lib.optionalString stdenv.cc.isClang ''
# Even with PLATFORM=mac, the Makefile specifies some GCC-specific CFLAGS that
# are not supported by modern Clang on macOS
postPatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace Makefile \
--replace -fpredictive-commoning ""
'';
preInstall = ''
mkdir -p $out/bin
mkdir -p $out/share/applications
--replace-fail "-funswitch-loops" "" \
--replace-fail "-fgcse-after-reload" ""
'';
meta = {
@ -46,4 +45,4 @@ stdenv.mkDerivation rec {
license = lib.licenses.gpl3;
maintainers = with lib.maintainers; [ marius851000 ];
};
}
})