buildMix: copy package.json to support phoenix builds

authored by Adam Stephens and committed by Yt fcbfef1e de3946fe

Changed files
+27
pkgs
development
+6
pkgs/development/beam-modules/build-mix.nix
··· 87 87 fi 88 88 done 89 89 90 + # Copy the source so it can be used by dependent packages. For example, 91 + # phoenix applications need the source of phoenix and phoenix_html to 92 + # build javascript and css assets. 93 + mkdir -p $out/src 94 + cp -r $src/* "$out/src" 95 + 90 96 runHook postInstall 91 97 ''; 92 98
+21
pkgs/development/beam-modules/mix-release.nix
··· 81 81 # Phoenix projects for example will need compile.phoenix 82 82 mix deps.compile --no-deps-check --skip-umbrella-children 83 83 84 + # Symlink dependency sources. This is needed for projects that require 85 + # access to the source of their dependencies. For example, Phoenix 86 + # applications need javascript assets to build asset bundles. 87 + ${lib.optionalString (mixNixDeps != { }) '' 88 + mkdir -p deps 89 + 90 + ${lib.concatMapStringsSep "\n" (dep: '' 91 + dep_name=$(basename ${dep} | cut -d '-' -f2) 92 + dep_path="deps/$dep_name" 93 + if [ -d "${dep}/src" ]; then 94 + ln -s ${dep}/src $dep_path 95 + fi 96 + '') (builtins.attrValues mixNixDeps)} 97 + ''} 98 + 99 + # Symlink deps to build root. Similar to above, but allows for mixFodDeps 100 + # Phoenix projects to find javascript assets. 101 + ${lib.optionalString (mixFodDeps != null) '' 102 + ln -s ../deps ./ 103 + ''} 104 + 84 105 runHook postConfigure 85 106 ''; 86 107