mirror of
https://github.com/ilyakooo0/nixpkgs.git
synced 2025-01-02 17:09:09 +03:00
bazel: add python to the runtime closure
This commit is contained in:
parent
6ad1271a4c
commit
25cd44063f
@ -125,9 +125,11 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
genericPatches = ''
|
genericPatches = ''
|
||||||
# Substitute python's stub shebang to plain python path. (see TODO add pr URL)
|
# Substitute python's stub shebang to plain python path. (see TODO add pr URL)
|
||||||
|
# See also `postFixup` where python is added to $out/nix-support
|
||||||
substituteInPlace src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt\
|
substituteInPlace src/main/java/com/google/devtools/build/lib/bazel/rules/python/python_stub_template.txt\
|
||||||
--replace "/usr/bin/env python" "${python}/bin/python" \
|
--replace "/usr/bin/env python" "${python}/bin/python" \
|
||||||
--replace "NIX_STORE_PYTHON_PATH" "${python}/bin/python" \
|
--replace "NIX_STORE_PYTHON_PATH" "${python}/bin/python" \
|
||||||
|
|
||||||
# substituteInPlace is rather slow, so prefilter the files with grep
|
# substituteInPlace is rather slow, so prefilter the files with grep
|
||||||
grep -rlZ /bin src/main/java/com/google/devtools | while IFS="" read -r -d "" path; do
|
grep -rlZ /bin src/main/java/com/google/devtools | while IFS="" read -r -d "" path; do
|
||||||
# If you add more replacements here, you must change the grep above!
|
# If you add more replacements here, you must change the grep above!
|
||||||
@ -262,7 +264,10 @@ stdenv.mkDerivation rec {
|
|||||||
# Save paths to hardcoded dependencies so Nix can detect them.
|
# Save paths to hardcoded dependencies so Nix can detect them.
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
mkdir -p $out/nix-support
|
mkdir -p $out/nix-support
|
||||||
echo "${customBash} ${defaultShellPath}" > $out/nix-support/depends
|
echo "${customBash} ${defaultShellPath}" >> $out/nix-support/depends
|
||||||
|
# The templates get tar’d up into a .jar,
|
||||||
|
# so nix can’t detect python is needed in the runtime closure
|
||||||
|
echo "${python}" >> $out/nix-support/depends
|
||||||
'';
|
'';
|
||||||
|
|
||||||
dontStrip = true;
|
dontStrip = true;
|
||||||
|
Loading…
Reference in New Issue
Block a user