mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-05-23 21:30:19 +00:00
libghostty-vt: support building nix derivation on darwin
This commit is contained in:
@@ -7,7 +7,10 @@
|
||||
runCommand,
|
||||
stdenv,
|
||||
testers,
|
||||
fixDarwinDylibNames,
|
||||
versionCheckHook,
|
||||
darwin,
|
||||
xcbuild,
|
||||
zig_0_15,
|
||||
revision ? "dirty",
|
||||
optimize ? "Debug",
|
||||
@@ -18,10 +21,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
version = "0.1.0-dev+${revision}-nix";
|
||||
|
||||
# We limit source like this to try and reduce the amount of rebuilds as possible
|
||||
# thus we only provide the source that is needed for the build
|
||||
#
|
||||
# NOTE: as of the current moment only linux files are provided,
|
||||
# since darwin support is not finished
|
||||
# thus we only provide the source that is needed for the build.
|
||||
src = lib.fileset.toSource {
|
||||
root = ../.;
|
||||
fileset = lib.fileset.intersection (lib.fileset.fromSource (lib.sources.cleanSource ../.)) (
|
||||
@@ -39,27 +39,37 @@ stdenv.mkDerivation (finalAttrs: {
|
||||
|
||||
deps = callPackage ../build.zig.zon.nix {name = "${finalAttrs.pname}-cache-${finalAttrs.version}";};
|
||||
|
||||
nativeBuildInputs = [
|
||||
git
|
||||
pkg-config
|
||||
zig_0_15
|
||||
];
|
||||
nativeBuildInputs =
|
||||
[
|
||||
git
|
||||
pkg-config
|
||||
zig_0_15
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
darwin.cctools
|
||||
fixDarwinDylibNames
|
||||
xcbuild
|
||||
];
|
||||
|
||||
buildInputs = [];
|
||||
|
||||
doCheck = false;
|
||||
dontSetZigDefaultFlags = true;
|
||||
|
||||
zigBuildFlags = [
|
||||
"--system"
|
||||
"${finalAttrs.deps}"
|
||||
"-Dlib-version-string=${finalAttrs.version}"
|
||||
"-Dcpu=baseline"
|
||||
"-Doptimize=${optimize}"
|
||||
"-Dapp-runtime=none"
|
||||
"-Demit-lib-vt=true"
|
||||
"-Dsimd=${lib.boolToString simd}"
|
||||
];
|
||||
zigBuildFlags =
|
||||
[
|
||||
"--system"
|
||||
"${finalAttrs.deps}"
|
||||
"-Dlib-version-string=${finalAttrs.version}"
|
||||
"-Dcpu=baseline"
|
||||
"-Doptimize=${optimize}"
|
||||
"-Dapp-runtime=none"
|
||||
"-Demit-lib-vt=true"
|
||||
"-Dsimd=${lib.boolToString simd}"
|
||||
]
|
||||
++ lib.optionals stdenv.hostPlatform.isDarwin [
|
||||
"-Demit-xcframework=false"
|
||||
];
|
||||
zigCheckFlags = finalAttrs.zigBuildFlags ++ ["test-lib-vt"];
|
||||
|
||||
outputs = [
|
||||
|
||||
Reference in New Issue
Block a user