mirror of
https://github.com/ivabus/pantry
synced 2024-11-26 18:25:08 +03:00
Tidy virtual-env creation script
This commit is contained in:
parent
a55998598f
commit
fea7d8ad6d
2 changed files with 11 additions and 12 deletions
|
@ -10,8 +10,7 @@ dependencies:
|
||||||
gnu.org/bash: '>=2' # for our venv/relocation scripts: feel free to fix that
|
gnu.org/bash: '>=2' # for our venv/relocation scripts: feel free to fix that
|
||||||
|
|
||||||
build:
|
build:
|
||||||
script: |
|
python-venv.sh "{{prefix}}/bin/meson"
|
||||||
python-venv.sh meson mesonbuild.com {{version}} {{prefix}} {{deps.python.org.version}} {{deps.python.org.version.major}} {{deps.python.org.version.minor}}
|
|
||||||
|
|
||||||
test:
|
test:
|
||||||
dependencies:
|
dependencies:
|
||||||
|
|
|
@ -1,12 +1,12 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
CMD_NAME=$1
|
CMD_NAME=$(basename "$1")
|
||||||
PROJECT_NAME=$2
|
PREFIX="$(dirname "$(dirname "$1")")"
|
||||||
VERSION=$3
|
PROJECT_NAME=$(basename "$(dirname "$PREFIX")")
|
||||||
PREFIX=$4
|
VERSION=$(basename "$PREFIX")
|
||||||
PYTHON_VERSION=$5
|
PYTHON_VERSION=$(python --version | cut -d' ' -f2)
|
||||||
PYTHON_VERSION_MAJ=$6
|
PYTHON_VERSION_MAJ=$(echo $PYTHON_VERSION | cut -d. -f1)
|
||||||
PYTHON_VERSION_MIN=$7
|
PYTHON_VERSION_MIN=$(echo $PYTHON_VERSION | cut -d. -f1,2)
|
||||||
|
|
||||||
python -m venv $PREFIX/libexec
|
python -m venv $PREFIX/libexec
|
||||||
|
|
||||||
|
@ -23,7 +23,7 @@ ln -s ../libexec/bin/$CMD_NAME $CMD_NAME
|
||||||
cd ../libexec/bin
|
cd ../libexec/bin
|
||||||
fix-shebangs.ts *
|
fix-shebangs.ts *
|
||||||
|
|
||||||
cat <<EOF>$CMD_NAME
|
cat <<EOF >$CMD_NAME
|
||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
self="\${BASH_SOURCE[0]}"
|
self="\${BASH_SOURCE[0]}"
|
||||||
if test -L "\$self"; then
|
if test -L "\$self"; then
|
||||||
|
@ -44,7 +44,7 @@ sed -i.bak 's|VIRTUAL_ENV=".*"|VIRTUAL_ENV="$(cd "$(dirname "${BASH_SOURCE[0]}")
|
||||||
rm activate.bak
|
rm activate.bak
|
||||||
|
|
||||||
# FIXME a lot: this "updates" the `venv` on each run for relocatability
|
# FIXME a lot: this "updates" the `venv` on each run for relocatability
|
||||||
cat <<EOF>>activate
|
cat <<EOF >>activate
|
||||||
|
|
||||||
sed -i.bak \\
|
sed -i.bak \\
|
||||||
-e "s|$TEA_PREFIX/python.org/v$PYTHON_VERSION|\$TEA_PREFIX/python.org/v$PYTHON_VERSION_MAJ|" \\
|
-e "s|$TEA_PREFIX/python.org/v$PYTHON_VERSION|\$TEA_PREFIX/python.org/v$PYTHON_VERSION_MAJ|" \\
|
||||||
|
|
Loading…
Reference in a new issue