flips: Darwin support

This commit is contained in:
Nadia Holmquist Pedersen 2025-05-03 09:37:52 +02:00
parent 10809c9d67
commit e99e423033

View file

@ -2,9 +2,12 @@
lib,
stdenv,
fetchFromGitHub,
gtk3,
libdivsufsort,
pkg-config,
withGTK3 ? !stdenv.hostPlatform.isDarwin,
gtk3,
llvmPackages,
wrapGAppsHook3,
}:
@ -21,24 +24,34 @@ stdenv.mkDerivation rec {
nativeBuildInputs = [
pkg-config
wrapGAppsHook3
];
] ++ lib.optional withGTK3 wrapGAppsHook3;
buildInputs = [
gtk3
libdivsufsort
];
buildInputs =
[
libdivsufsort
]
++ lib.optional withGTK3 gtk3
++ lib.optional (withGTK3 && stdenv.hostPlatform.isDarwin) llvmPackages.openmp;
patches = [ ./use-system-libdivsufsort.patch ];
makeFlags = [ "PREFIX=${placeholder "out"}" ];
makeFlags = [
"PREFIX=${placeholder "out"}"
"TARGET=${if withGTK3 then "gtk" else "cli"}"
];
installPhase = lib.optionalString (!withGTK3) ''
runHook preInstall
install -Dm755 flips -t $out/bin
runHook postInstall
'';
meta = {
description = "Patcher for IPS and BPS files";
homepage = "https://github.com/Alcaro/Flips";
license = lib.licenses.gpl3Plus;
maintainers = with lib.maintainers; [ aleksana ];
platforms = lib.platforms.linux;
platforms = lib.platforms.unix;
mainProgram = "flips";
};
}