buildCrystalPackage: add copyShardDeps flag

This commit is contained in:
sunder 2024-04-03 20:59:22 +03:00 committed by Peter Hoeg
parent a0692d3b21
commit 9c1f3b305a

View file

@ -26,6 +26,9 @@
# The default `crystal build` options can be overridden with { foo.options = [ "--optionname" ]; }
, crystalBinaries ? { }
, enableParallelBuilding ? true
# Copy all shards dependencies instead of symlinking and add write permissions
# to make environment more local-like
, copyShardDeps ? false
, ...
}@args:
@ -78,7 +81,8 @@ stdenv.mkDerivation (mkDerivationArgs // {
++ lib.optional (lockFile != null) "cp ${lockFile} ./shard.lock"
++ lib.optionals (shardsFile != null) [
"test -e lib || mkdir lib"
"for d in ${crystalLib}/*; do ln -s $d lib/; done"
(if copyShardDeps then "for d in ${crystalLib}/*; do cp -r $d/ lib/; done; chmod -R +w lib/"
else "for d in ${crystalLib}/*; do ln -s $d lib/; done")
"cp shard.lock lib/.shards.info"
]
++ [ "runHook postConfigure" ]