summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorruki <[email protected]>2019-08-24 00:36:52 +0800
committerruki <[email protected]>2019-08-23 21:41:16 +0800
commit09d493cd32648a61cf8999386ffd767df53912ee (patch)
tree1297a20cd4a2084f743e77e4b7a67830fd851402 /scripts
parent863b2c74551f802b460b228e341bd96aa8aeaba1 (diff)
improve build scripts
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/archive-all.sh32
-rwxr-xr-xscripts/makeself/build-runfile.sh41
2 files changed, 46 insertions, 27 deletions
diff --git a/scripts/archive-all.sh b/scripts/archive-all.sh
index 287052a6b..ace51da9f 100755
--- a/scripts/archive-all.sh
+++ b/scripts/archive-all.sh
@@ -2,17 +2,31 @@
# ./scripts/archive-all.sh v2.2.7
tag=$1
-format="tar.gz"
-projectdir=/tmp/.xmake_archive
-outputfile=`pwd`/xmake-$tag.$format
-if [ -d $projectdir ]; then
- rm -rf $projectdir
+tmpdir=/tmp/.xmake_archive
+xmakeroot=`pwd`
+outputfile=$xmakeroot/xmake-$tag
+if [ -d $tmpdir ]; then
+ rm -rf $tmpdir
fi
-git clone --depth=1 -b "$tag" "https://github.com/xmake-io/xmake.git" --recursive $projectdir
-cd $projectdir
+mkdir $tmpdir
+
+# copy xmake repo to temproot/xmake-repo, remove git ignored files
+cp -r $xmakeroot $tmpdir/repo
+cd $tmpdir/repo
+git clean -dfX
+git submodule foreach git clean -dfX
+
+# clean some unused files
+xmake l private.utils.bcsave -s -o $tmpdir/output $tmpdir/repo/xmake
+rm -rf $tmpdir/repo/xmake
+mv $tmpdir/output $tmpdir/repo/xmake
+cd $tmpdir/repo
rm -rf tests
+rm -rf core/src/tbox/tbox/src/demo
git add .
git commit -a -m "..."
git tag "$tag-1"
-git archive --format $format -o $outputfile "$tag-1"
-shasum -a 256 $outputfile
+git archive --format "zip" -9 -o "$outputfile.zip" "$tag-1"
+git archive --format "tar.gz" -9 -o "$outputfile.tar.gz" "$tag-1"
+shasum -a 256 "$outputfile.zip"
+shasum -a 256 "$outputfile.tar.gz"
diff --git a/scripts/makeself/build-runfile.sh b/scripts/makeself/build-runfile.sh
index dda90d9e5..1b7d0412d 100755
--- a/scripts/makeself/build-runfile.sh
+++ b/scripts/makeself/build-runfile.sh
@@ -1,37 +1,24 @@
#!/usr/bin/env bash
-# compress algorithm: gzip, bzip2, xz
-algo=$1
-if [ -z $algo ]; then
- algo="gzip"
-fi
-suffix=$algo
-if [ $algo = "gzip" ]; then
- suffix="gz"
-elif [ $algo = "bzip2" ]; then
- suffix="bz2"
-fi
-
# path constants
cd "$(dirname "$0")/../.."
xmakeroot=`pwd`
buildroot=$xmakeroot/scripts/makeself
temproot=/tmp/xmake-makeself
-# prepare files to pack
-# clean up temproot
+# clean up temproot
if [ -d $temproot ]; then
rm -rf $temproot
fi
mkdir -p $temproot
-# copy xmake repo to temproot/xmake-repo, remove git ignored files
+# copy xmake repo to temproot/xmake-repo, remove git ignored files
cp -r $xmakeroot $temproot/xmake-repo
cd $temproot/xmake-repo
git clean -dfX
git submodule foreach git clean -dfX
-# copy files to temproot/xmake
+# copy files to temproot/xmake
mkdir -p $temproot/xmake/scripts
cd $temproot/xmake-repo
cp -r ./core $temproot/xmake
@@ -56,11 +43,29 @@ cd $temproot
wget https://github.com/megastep/makeself/releases/download/release-2.4.0/makeself-2.4.0.run -O ./makeself-2.4.0.run
sh ./makeself-2.4.0.run
./makeself-2.4.0/makeself.sh \
- --$algo \
+ --gzip \
+ --sha256 \
+ --lsm ./lsm \
+ --help-header ./header \
+ ./xmake \
+ $buildroot/xmake.gz.run \
+ xmake-v$version-runfile \
+ ./scripts/get.sh __local__
+./makeself-2.4.0/makeself.sh \
+ --bzip2 \
+ --sha256 \
+ --lsm ./lsm \
+ --help-header ./header \
+ ./xmake \
+ $buildroot/xmake.bz2.run \
+ xmake-v$version-runfile \
+ ./scripts/get.sh __local__
+./makeself-2.4.0/makeself.sh \
+ --xz \
--sha256 \
--lsm ./lsm \
--help-header ./header \
./xmake \
- $buildroot/xmake.$suffix.run \
+ $buildroot/xmake.xz.run \
xmake-v$version-runfile \
./scripts/get.sh __local__