1
0
mirror of https://github.com/lxsang/DiyaSDK.git synced 2024-11-16 18:18:22 +01:00
DiyaSDK/bin/build_base_image_diya.sh
Dany LE cc81dd2b66
All checks were successful
gitea-sync/DiyaSDK/pipeline/head This commit looks good
Add support for basic Graphic primitives
2022-08-12 12:28:18 +02:00

40 lines
1.2 KiB
Bash
Executable File

#! /bin/bash
set -e
set -x
[ -z "$1" ] && echo "Please specify 32 or 64 bits architectuure" && exit 1
echo "[Compiler] Adding more Kernel packages"
ARCH="$1"
W=$(realpath "$(dirname "$(realpath "$0")")/../")
BASE_DIR="$W/$ARCH"
rm "$BASE_DIR/tmp" -rf
mkdir -p "$BASE_DIR/tmp/"
cp "$BASE_DIR/bootstrap/bootstrap.image" "$BASE_DIR/tmp/diya.image"
cp "$W"/unicode/* "$BASE_DIR/tmp/"
cp -rf "$W"/fonts "$BASE_DIR"/tmp/
VM="$BASE_DIR/builder/pharo"
IMG="$BASE_DIR/tmp/diya.image"
SRC_IMG="$BASE_DIR/builder/Pharo.image"
if [ ! -e "$SRC_IMG" ]; then
mkdir -p "$BASE_DIR/builder/"
cd "$BASE_DIR/builder/"
curl "https://get.pharo.org/$ARCH/70+vm" | bash
cd "$W"
#find . -name "*SDL*.so*" -exec rm -f {} \;
fi
cp -rf "$W/fonts" "$BASE_DIR/builder/"
# chmod -R a+rw $BASE_DIR
$VM "$SRC_IMG" "$W/install.st" --quit
NAME="Diya-Bootstrap"
$VM "$SRC_IMG" "$W/export.st" "$BASE_DIR/tmp" "$NAME" --quit
echo "Creating image...."
$VM "$IMG"
$VM "$IMG" loadHermes "$BASE_DIR/bootstrap/Hermes-Extensions.hermes" \
"$BASE_DIR/bootstrap/TraitsV2.hermes" \
"$BASE_DIR/tmp/$NAME.hermes" --on-duplication=replace \
--no-fail-on-undeclared --save --quit
#init the image
$VM "$IMG" init --save