This commit is contained in:
Jeffrey C. Ollie 2024-05-14 16:48:09 -05:00
parent 93a7ad9211
commit de8eaf2519
No known key found for this signature in database
GPG key ID: F936E4DCB7E25F15

View file

@ -83,17 +83,19 @@
pkgs.stdenvNoCC.mkDerivation {
inherit src;
name = "hostapps-zig-cache";
buildInputs = [
pkgs.zig_0_12
];
dontUseZigInstall = true;
dontUseZigBuild = true;
nativeBuildInputs = [pkgs.git pkgs.zig_0_12.hook];
# buildInputs = [
# pkgs.zig_0_12
# ];
dontConfigure = true;
dontUseZigBuild = true;
dontUseZigInstall = true;
dontFixup = true;
preBuild = ''
export ZIG_GLOBAL_CACHE_DIR=$(mktemp -d)
'';
# preBuild = ''
# export ZIG_GLOBAL_CACHE_DIR=$(mktemp -d)
# '';
buildPhase = ''
runHook preBuild
@ -103,7 +105,7 @@
installPhase = ''
runHook preInstall
cp -r --reflink=auto $ZIG_GLOBAL_CACHE_DIR/p $out
cp -r --reflink=auto $ZIG_GLOBAL_CACHE_DIR $out
runHook postInstall
'';
outputHash = "sha256-1RX8LJCu8jfGOfHj0uQrVk4ltjVm/q7YyH4EfDmsG1c=";
@ -117,28 +119,33 @@
src = ./.;
buildInputs = [
pkgs.zig_0_12
nativeBuildInputs = [
pkgs.git
pkgs.zig_0_12.hook
];
# buildInputs = [
# pkgs.zig_0_12
# ];
preBuild = ''
export ZIG_GLOBAL_CACHE_DIR=$(mktemp -d)
cp -r --reflink=auto ${cache attrs.src} $ZIG_GLOBAL_CACHE_DIR/p
rm -rf $ZIG_GLOBAL_CACHE_DIR
cp -r --reflink=auto ${cache attrs.src} $ZIG_GLOBAL_CACHE_DIR
chmod -R u+rwX $ZIG_GLOBAL_CACHE_DIR
'';
buildPhase = ''
runHook preBuild
zig build -Doptimize=ReleaseSafe
runHook postBuild
'';
# buildPhase = ''
# runHook preBuild
# zig build -Doptimize=ReleaseSafe
# runHook postBuild
# '';
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp zig-out/bin/hostapps $out/bin
runHook postInstall
'';
# installPhase = ''
# runHook preInstall
# mkdir -p $out/bin
# cp zig-out/bin/hostapps $out/bin
# runHook postInstall
# '';
}
);
};