Commit 9c1f3b30 authored by sunder's avatar sunder Committed by Peter Hoeg
Browse files

buildCrystalPackage: add copyShardDeps flag

parent a0692d3b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -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" ]