abbaye-des-morts: fix darwin build, refactor (#430653)
This commit is contained in:
commit
f43a56ac70
@ -7,14 +7,14 @@
|
|||||||
SDL2_mixer,
|
SDL2_mixer,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "abbaye-des-morts";
|
pname = "abbaye-des-morts";
|
||||||
version = "2.0.5";
|
version = "2.0.5";
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "nevat";
|
owner = "nevat";
|
||||||
repo = "abbayedesmorts-gpl";
|
repo = "abbayedesmorts-gpl";
|
||||||
tag = "v${version}";
|
tag = "v${finalAttrs.version}";
|
||||||
sha256 = "sha256-muJt1cml0nYdgl0v8cudpUXcdSntc49e6zICTCwzkks=";
|
sha256 = "sha256-muJt1cml0nYdgl0v8cudpUXcdSntc49e6zICTCwzkks=";
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -25,18 +25,17 @@ stdenv.mkDerivation rec {
|
|||||||
];
|
];
|
||||||
|
|
||||||
makeFlags = [
|
makeFlags = [
|
||||||
"PREFIX=$(out)"
|
"PREFIX=${placeholder "out"}"
|
||||||
"DESTDIR="
|
"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 \
|
substituteInPlace Makefile \
|
||||||
--replace -fpredictive-commoning ""
|
--replace-fail "-funswitch-loops" "" \
|
||||||
'';
|
--replace-fail "-fgcse-after-reload" ""
|
||||||
|
|
||||||
preInstall = ''
|
|
||||||
mkdir -p $out/bin
|
|
||||||
mkdir -p $out/share/applications
|
|
||||||
'';
|
'';
|
||||||
|
|
||||||
meta = {
|
meta = {
|
||||||
@ -46,4 +45,4 @@ stdenv.mkDerivation rec {
|
|||||||
license = lib.licenses.gpl3;
|
license = lib.licenses.gpl3;
|
||||||
maintainers = with lib.maintainers; [ marius851000 ];
|
maintainers = with lib.maintainers; [ marius851000 ];
|
||||||
};
|
};
|
||||||
}
|
})
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user