Skip to content

Commit

Permalink
Merge pull request #499 from OpportunityLiu/makeself
Browse files Browse the repository at this point in the history
Add runfile
  • Loading branch information
waruqi authored Jul 19, 2019
2 parents 2745737 + bc68969 commit ae533cd
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 0 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ tags
winenv/
*.exe
*.zip
*.run

# Makefile generation
/core/xmake.config.h
Expand Down
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@ script:
- cp core/build/xmake "$XMAKE_PROGRAM_DIR" || sudo cp core/build/xmake "$XMAKE_PROGRAM_DIR"
- xmake --version
- travis_wait 60 xmake lua -v -D tests/run.lua
- scripts/makeself/build-runfile.sh
- ls -l scripts/makeself/xmake.run
- scripts/makeself/xmake.run --info

50 changes: 50 additions & 0 deletions scripts/makeself/build-runfile.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#! /usr/bin/env bash

# path constants
cd "$(dirname "$0")/../.."
xmakeroot=`pwd`
buildroot=$xmakeroot/scripts/makeself
temproot=/tmp/xmake-makeself

# prepare files to pack
# clean up temproot
rm -rf $temproot
mkdir -p $temproot

# copy xmake repo to temproot/xmake-repo, remove git ignored files
cp -Tr $xmakeroot $temproot/xmake-repo
cd $temproot/xmake-repo
git clean -dfX
git submodule foreach git clean -dfX

# copy files to temproot/xmake
mkdir -p $temproot/xmake/scripts
cd $temproot/xmake-repo
cp -r ./core $temproot/xmake
cp -r ./xmake $temproot/xmake
cp ./scripts/get.sh $temproot/xmake/scripts
cp ./*.md $temproot/xmake
cp makefile $temproot/xmake
cd $temproot/xmake
rm -rf ./core/src/tbox/tbox/src/demo
rm -rf ./core/src/pdcurses

# prepare info texts
cd $temproot
cp $buildroot/* .
version=`cat ./xmake/core/xmake.lua | grep -E "^set_version" | grep -oE "[0-9]*\.[0-9]*\.[0-9]*"`
sed -i "s/#xmake-version#/$version/g" ./header
sed -i "s/#xmake-version#/$version/g" ./lsm

# make run file
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 \
--sha256 \
--lsm ./lsm \
--help-header ./header \
./xmake \
$buildroot/xmake.run \
xmake-v$version-runfile \
./scripts/get.sh __local__
9 changes: 9 additions & 0 deletions scripts/makeself/header
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
xmake v#xmake-version#, A cross-platform build utility based on Lua
Copyright (C) 2015-2019 Ruki Wang, tboox.org, xmake.io
Copyright (C) 2005-2015 Mike Pall, luajit.org
_
__ ___ __ __ __ _| | ______
\ \/ / | \/ |/ _ | |/ / __ \
> < | \__/ | /_| | < ___/
/_/\_\_|_| |_|\__ \|_|\_\____|
by ruki, tboox.org
15 changes: 15 additions & 0 deletions scripts/makeself/lsm
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
Begin3
Title: xmake
Version: #xmake-version#
Description: xmake is a cross-platform build utility based on lua.
The project focuses on making development and building easier and
provides many features (e.g package, install, plugin, macro, action, option, task ...),
so that any developer can quickly pick it up and
enjoy a productivity boost when developing and building projects.
Keywords: make build
Author: ruki ([email protected])
Maintained-by: ruki ([email protected])
Original-site: https://xmake.io/
Platform: Unix; Windows
Copying-policy: Apache-2.0
End

0 comments on commit ae533cd

Please sign in to comment.