diff options
author | Robin Burchell <robin+git@viroteck.net> | 2019-05-28 01:25:29 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-05-28 02:45:54 +0200 |
commit | 19afcfe03c0c331fb6854e6ae9f2a949fd327258 (patch) | |
tree | 2fa5d6364c7e5d94c298a61464c8bbc16df6b96b /Ports | |
parent | 5c82d141287666588d135a884144b2b12d62f416 (diff) | |
download | serenity-19afcfe03c0c331fb6854e6ae9f2a949fd327258.zip |
port_include: Various updates
* Prints what is run, which is useful for trace purposes.
* Fix autotools configure to respect arguments
* Add run_patch for applying patches
Diffstat (limited to 'Ports')
-rwxr-xr-x[-rw-r--r--] | Ports/.port_include.sh | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/Ports/.port_include.sh b/Ports/.port_include.sh index b8033bbb6b..c197bcd651 100644..100755 --- a/Ports/.port_include.sh +++ b/Ports/.port_include.sh @@ -19,57 +19,65 @@ if [ -z "$PORT_DIR" ]; then exit 1 fi +function run_command() { + echo "+ $@" + (cd "$PORT_DIR" && "$@") + echo "+ FINISHED: $@" +} + function run_fetch_git() { if [ -d "$PORT_DIR/.git" ]; then - (cd "$PORT_DIR" && git fetch && git reset --hard FETCH_HEAD) + run_command git fetch + run_command git reset --hard FETCH_HEAD else - git clone "$1" "$PORT_DIR" + run_command git clone "$1" "$PORT_DIR" fi } +function run_patch() { + echo "+ Applying patch $1" + run_command patch "$2" < "$1" +} + function run_configure_cmake() { - ( - cd "$PORT_DIR" - cmake -DCMAKE_TOOLCHAIN_FILE="$SERENITY_ROOT/Toolchain/CMakeToolchain.txt" . - ) + run_command cmake -DCMAKE_TOOLCHAIN_FILE="$SERENITY_ROOT/Toolchain/CMakeToolchain.txt" . } function run_configure_autotools() { - ( - cd "$PORT_DIR" - ./configure --host=i686-pc-serenity - ) + run_command ./configure --host=i686-pc-serenity "$@" } function run_make() { - ( - cd "$PORT_DIR" - make $MAKEOPTS "$@" - ) + run_command make $MAKEOPTS "$@" } function run_make_install() { - ( - cd "$PORT_DIR" - make $INSTALLOPTS install "$@" - ) + run_command make $INSTALLOPTS install "$@" } if [ -z "$1" ]; then + echo "+ Fetching..." fetch + echo "+ Configuring..." configure + echo "+ Building..." build + echo "+ Installing..." install exit 0 fi if [ "$1" == "fetch" ]; then + echo "+ Fetching..." fetch elif [ "$1" == "configure" ]; then + echo "+ Configuring..." configure elif [ "$1" == "build" ]; then + echo "+ Building..." build elif [ "$1" == "install" ]; then + echo "+ Installing..." install else echo "Unknown verb: $1" |