Fix build-package script with the portable option
This commit is contained in:
parent
be189fda0d
commit
549ac806e9
|
@ -1,9 +1,16 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
|
# strip-components is normally set to 1 to strip the initial "data" from the
|
||||||
|
# directory path.
|
||||||
copy_directory_from_repo () {
|
copy_directory_from_repo () {
|
||||||
|
local tar_options=()
|
||||||
|
if [[ $1 == --strip-components=* ]]; then
|
||||||
|
tar_options+=($1)
|
||||||
|
shift
|
||||||
|
fi
|
||||||
local dirname="$1"
|
local dirname="$1"
|
||||||
local destdir="$2"
|
local destdir="$2"
|
||||||
git --work-tree="$destdir" checkout HEAD -f -- "$dirname"
|
git archive master "$dirname" --format=tar | tar xf - -C "$destdir" "${tar_options[@]}"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Check if build directory is ok to be used to build.
|
# Check if build directory is ok to be used to build.
|
||||||
|
@ -61,7 +68,7 @@ lite_build_package_windows () {
|
||||||
mkdir -p "$bindir"
|
mkdir -p "$bindir"
|
||||||
mkdir -p "$datadir"
|
mkdir -p "$datadir"
|
||||||
for module_name in core plugins colors fonts; do
|
for module_name in core plugins colors fonts; do
|
||||||
copy_directory_from_repo "data/$module_name" "$datadir"
|
copy_directory_from_repo --strip-components=1 "data/$module_name" "$datadir"
|
||||||
done
|
done
|
||||||
cp "$build/src/lite.exe" "$bindir"
|
cp "$build/src/lite.exe" "$bindir"
|
||||||
strip --strip-all "$bindir/lite.exe"
|
strip --strip-all "$bindir/lite.exe"
|
||||||
|
@ -91,7 +98,7 @@ lite_build_package_macosx () {
|
||||||
mkdir -p "$bindir"
|
mkdir -p "$bindir"
|
||||||
mkdir -p "$datadir"
|
mkdir -p "$datadir"
|
||||||
for module_name in core plugins colors fonts; do
|
for module_name in core plugins colors fonts; do
|
||||||
copy_directory_from_repo "data/$module_name" "$datadir"
|
copy_directory_from_repo --strip-components=1 "data/$module_name" "$datadir"
|
||||||
done
|
done
|
||||||
cp "$build/src/lite" "$bindir"
|
cp "$build/src/lite" "$bindir"
|
||||||
strip "$bindir/lite"
|
strip "$bindir/lite"
|
||||||
|
@ -121,7 +128,7 @@ lite_build_package_linux () {
|
||||||
mkdir -p "$bindir"
|
mkdir -p "$bindir"
|
||||||
mkdir -p "$datadir"
|
mkdir -p "$datadir"
|
||||||
for module_name in core plugins colors fonts; do
|
for module_name in core plugins colors fonts; do
|
||||||
copy_directory_from_repo "data/$module_name" "$datadir"
|
copy_directory_from_repo --strip-components=1 "data/$module_name" "$datadir"
|
||||||
done
|
done
|
||||||
cp "$build/src/lite" "$bindir"
|
cp "$build/src/lite" "$bindir"
|
||||||
strip "$bindir/lite"
|
strip "$bindir/lite"
|
||||||
|
@ -152,19 +159,24 @@ if [[ -z "$1" || -z "$2" ]]; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$1" == "-pgo" ]]; then
|
portable=false
|
||||||
pgo=true
|
while [ ! -z {$1+x} ]; do
|
||||||
shift
|
case $1 in
|
||||||
fi
|
-pgo)
|
||||||
|
pgo=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-portable)
|
||||||
|
portable=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
version="$1"
|
||||||
|
arch="$2"
|
||||||
|
break
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
portable="false"
|
|
||||||
if [ "$1" == "-portable" ]; then
|
|
||||||
portable="true"
|
|
||||||
shift
|
|
||||||
fi
|
|
||||||
|
|
||||||
version="$1"
|
|
||||||
arch="$2"
|
|
||||||
build_dir=".build-$arch"
|
build_dir=".build-$arch"
|
||||||
|
|
||||||
if [ -z ${pgo+set} ]; then
|
if [ -z ${pgo+set} ]; then
|
||||||
|
|
Loading…
Reference in New Issue