-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
53 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/.idea/ | ||
/.venv/ | ||
/tmp/ | ||
/dist/ | ||
/requirements.txt # generated during actions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
THIS=$(dirname "$(realpath "$0")") | ||
PARENT=$(dirname "$THIS") | ||
PYTHON3=$(which python3) | ||
|
||
PYTHONPATH="$PYTHONPATH:$THIS/_deps/:$PARENT" "$PYTHON3" -X utf8 -BO -m jarklin "$@" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
shopt -s nullglob # dont return the glob-pattern if nothing found | ||
shopt -s globstar # allow recursive globs | ||
cd "$(realpath "$(dirname "$(realpath "$0")")/..")" | ||
|
||
if [ ! -f requirements.txt ]; then | ||
echo "requirements.txt is missing" | ||
exit 1 | ||
fi | ||
|
||
# create clean dist directory | ||
mkdir -p "dist/" | ||
[ -d "dist/jarklin/" ] && rm -rf "dist/jarklin/" | ||
|
||
# copy source code | ||
echo "Copying code..." | ||
cp -Lr "src/jarklin/" "dist/jarklin/" | ||
cp README.md "dist/jarklin/" | ||
|
||
# cleanup of copied | ||
find dist/jarklin -type d -iname __pycache__ -prune -exec rm -rf "{}" \; | ||
|
||
# install dependencies into (new) copied source-code directory | ||
echo "Installing dependencies..." | ||
mkdir -p "dist/jarklin/_deps/" | ||
python3 -m pip install -r "requirements.txt" -t "dist/jarklin/_deps/" --no-compile --disable-pip-version-check | ||
dist_infos=$(find dist/jarklin/_deps/*.dist-info -maxdepth 0 -printf '%f\n') | ||
|
||
echo "Installing scripts and other files..." | ||
echo "Jarklin v$(./jarklin.sh --version | tr -d '\0') build | ||
Python: $(python3 -V | awk '{print $2}') | ||
pip: $(pip3 --version | awk '{print $2}') | ||
Dependencies Installed: | ||
$(echo "$dist_infos" | sed 's/\.dist-info$//' | awk -F- '{print $1,$2}' | column -t | sed 's/^/ - /') | ||
OS Detail: | ||
$(sed 's/^/ /' /etc/os-release) | ||
" > "dist/jarklin/meta.info" | ||
|
||
cp build-files/jarklin.run dist/jarklin/jarklin | ||
chmod +x dist/jarklin/jarklin | ||
|
||
echo "Build successful" |