taisei: on darwin now! (#521761)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
lib,
|
||||
stdenv,
|
||||
fetchFromGitHub,
|
||||
|
||||
# Build depends
|
||||
docutils,
|
||||
meson,
|
||||
@@ -13,10 +14,14 @@
|
||||
gamemode,
|
||||
shaderc,
|
||||
makeWrapper,
|
||||
cmake,
|
||||
mimalloc,
|
||||
glslang,
|
||||
libogg,
|
||||
makeBinaryWrapper,
|
||||
|
||||
# Runtime depends
|
||||
glfw,
|
||||
sdl3,
|
||||
SDL2_mixer,
|
||||
cglm,
|
||||
freetype,
|
||||
libpng,
|
||||
@@ -24,10 +29,10 @@
|
||||
zlib,
|
||||
zstd,
|
||||
spirv-cross,
|
||||
mimalloc,
|
||||
|
||||
gamemodeSupport ? stdenv.hostPlatform.isLinux,
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "taisei";
|
||||
version = "1.4.4";
|
||||
@@ -49,12 +54,12 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
python3Packages.zstandard
|
||||
shaderc
|
||||
makeWrapper
|
||||
makeBinaryWrapper
|
||||
cmake
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
glfw
|
||||
sdl3
|
||||
SDL2_mixer
|
||||
cglm
|
||||
freetype
|
||||
libpng
|
||||
@@ -63,30 +68,48 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
zstd
|
||||
opusfile
|
||||
openssl
|
||||
spirv-cross
|
||||
mimalloc
|
||||
libogg
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
glslang
|
||||
spirv-cross
|
||||
]
|
||||
++ lib.optional gamemodeSupport gamemode;
|
||||
|
||||
# Forced to use builtin-sincos because the symbol isn't available otherwise
|
||||
env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isDarwin " -Dsincos=__builtin_sincos";
|
||||
|
||||
mesonFlags = [
|
||||
(lib.mesonBool "b_lto" false)
|
||||
(lib.mesonEnable "install_macos_bundle" false)
|
||||
(lib.mesonEnable "install_relocatable" false)
|
||||
(lib.mesonEnable "shader_transpiler" false)
|
||||
(lib.mesonEnable "shader_transpiler_dxbc" false)
|
||||
(lib.mesonEnable "gamemode" gamemodeSupport)
|
||||
(lib.mesonEnable "package_data" false)
|
||||
(lib.mesonEnable "vfs_zip" false)
|
||||
(lib.mesonEnable "shader_transpiler_dxbc" false)
|
||||
(lib.mesonEnable "package_data" false)
|
||||
(lib.mesonBool "b_lto" false)
|
||||
(lib.mesonEnable "gamemode" gamemodeSupport)
|
||||
(lib.mesonEnable "install_freedesktop" stdenv.hostPlatform.isLinux)
|
||||
(lib.mesonEnable "install_macos_bundle" stdenv.hostPlatform.isDarwin)
|
||||
(lib.mesonEnable "install_relocatable" stdenv.hostPlatform.isDarwin)
|
||||
(lib.mesonEnable "shader_transpiler" stdenv.hostPlatform.isDarwin)
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
patchShebangs .
|
||||
'';
|
||||
|
||||
postInstall = lib.optionalString gamemodeSupport ''
|
||||
wrapProgram $out/bin/taisei \
|
||||
--set LD_LIBRARY_PATH ${lib.makeLibraryPath [ gamemode ]}
|
||||
'';
|
||||
postInstall =
|
||||
lib.optionalString (stdenv.hostPlatform.isLinux && gamemodeSupport) ''
|
||||
wrapProgram $out/bin/taisei \
|
||||
--prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath [ gamemode ]}"
|
||||
''
|
||||
+
|
||||
|
||||
lib.optionalString stdenv.hostPlatform.isDarwin ''
|
||||
mkdir -p $out/Applications $out/bin
|
||||
|
||||
mv $out/Taisei.app $out/Applications/
|
||||
# regular symlink will fail here due to resources being missed
|
||||
makeBinaryWrapper $out/Applications/Taisei.app/Contents/MacOS/Taisei $out/bin/taisei
|
||||
'';
|
||||
|
||||
strictDeps = true;
|
||||
|
||||
@@ -106,7 +129,9 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
maintainers = with lib.maintainers; [
|
||||
lambda-11235
|
||||
Gliczy
|
||||
philocalyst
|
||||
];
|
||||
platforms = lib.platforms.all;
|
||||
changelog = "https://github.com/taisei-project/taisei/releases/tag/${finalAttrs.src.tag}";
|
||||
};
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user