fix(nix flake): Fix Nix build phase errors

- postUnpack: use $sourceRoot instead of hardcoded "source/" so subprojects are copied into the actual unpacked directory
- installPhase: call makeWrapper directly, it is a setup hook injected by nativeBuildInputs, not a bin/ binary
- nativeBuildInputs: add makeWrapper and unzip
This commit is contained in:
milomc123
2026-03-28 09:59:48 +00:00
parent d2f127349b
commit f195fc555f
+11 -9
View File
@@ -58,15 +58,15 @@
# 4jcraft - Meson expects this subprojects structure # 4jcraft - Meson expects this subprojects structure
postUnpack = '' postUnpack = ''
mkdir -p source/subprojects mkdir -p $sourceRoot/subprojects
cp -r ${inputs.shiggy} source/subprojects/shiggy cp -r ${inputs.shiggy} $sourceRoot/subprojects/shiggy
cp -r ${inputs."4jlibs"} source/subprojects/4jlibs cp -r ${inputs."4jlibs"} $sourceRoot/subprojects/4jlibs
cp -r ${inputs.stb} source/subprojects/stb cp -r ${inputs.stb} $sourceRoot/subprojects/stb
cp -r ${inputs.simdutf} source/subprojects/simdutf cp -r ${inputs.simdutf} $sourceRoot/subprojects/simdutf
cp -r ${inputs.miniaudio} source/subprojects/miniaudio cp -r ${inputs.miniaudio} $sourceRoot/subprojects/miniaudio
chmod -R u+w source/subprojects chmod -R u+w $sourceRoot/subprojects
''; '';
# 4jcraft - `stb` and `simdutf` patches # 4jcraft - `stb` and `simdutf` patches
@@ -75,7 +75,7 @@
cp subprojects/packagefiles/simdutf/meson.build subprojects/simdutf/meson.build cp subprojects/packagefiles/simdutf/meson.build subprojects/simdutf/meson.build
cp subprojects/packagefiles/simdutf/meson.options subprojects/simdutf/meson.options cp subprojects/packagefiles/simdutf/meson.options subprojects/simdutf/meson.options
${pkgs.unzip} ${inputs.miniaudio-patch} -d miniaudio-patch-tmp unzip ${inputs.miniaudio-patch} -d miniaudio-patch-tmp
cp -r miniaudio-patch-tmp/*/. subprojects/miniaudio/ cp -r miniaudio-patch-tmp/*/. subprojects/miniaudio/
cat > subprojects/miniaudio.wrap <<EOF cat > subprojects/miniaudio.wrap <<EOF
@@ -88,10 +88,12 @@
nativeBuildInputs = with pkgs; [ nativeBuildInputs = with pkgs; [
lld lld
makeWrapper
meson meson
ninja ninja
pkg-config pkg-config
python3 python3
unzip
]; ];
buildInputs = with pkgs; [ buildInputs = with pkgs; [
@@ -107,7 +109,7 @@
cp -r Minecraft.Client/. $out/share/4jcraft/ cp -r Minecraft.Client/. $out/share/4jcraft/
mkdir -p $out/bin mkdir -p $out/bin
${pkgs.makeWrapper} $out/share/4jcraft/Minecraft.Client $out/bin/4jcraft \ makeWrapper $out/share/4jcraft/Minecraft.Client $out/bin/4jcraft \
--run "cd $out/share/4jcraft" --run "cd $out/share/4jcraft"
''; '';