diff --git a/toolchains/common/functions.sh b/toolchains/common/functions.sh index c552830..0720fc6 100755 --- a/toolchains/common/functions.sh +++ b/toolchains/common/functions.sh @@ -52,6 +52,17 @@ __do_http_fetch () { do_patch } +__do_git_fetch () { + if [ -d "$1"*/ ]; then + rm -rf "$1"*/ + fi + git clone "$2" "$1" + cd "$1"*/ + git checkout "$3" + git submodule update --init + do_patch +} + __do_configure () { ./configure --prefix=$PREFIX --host=$HOST --disable-shared "$@" } @@ -82,7 +93,7 @@ __error () { # but still use base function (Poor man's inheritance) # Aliases are expanded at definition time so that's not the good way for f in do_make_bdir do_clean_bdir do_patch do_pkg_fetch do_http_fetch \ - do_configure do_cmake do_make log error; do + do_git_fetch do_configure do_cmake do_make log error; do eval "$f () { __$f \"\$@\"; }" done diff --git a/toolchains/common/prepare.sh b/toolchains/common/prepare.sh index 5fd54b1..66f5c69 100755 --- a/toolchains/common/prepare.sh +++ b/toolchains/common/prepare.sh @@ -12,6 +12,7 @@ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ cmake \ debhelper \ dpkg-dev \ + git \ gnupg \ libtool \ make \ diff --git a/toolchains/devkit3ds/Dockerfile.m4 b/toolchains/devkit3ds/Dockerfile.m4 index 7c4cc1e..895f3a6 100644 --- a/toolchains/devkit3ds/Dockerfile.m4 +++ b/toolchains/devkit3ds/Dockerfile.m4 @@ -12,12 +12,9 @@ FROM toolchains/devkitarm RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \ g++ \ - git \ zip && \ rm -rf /var/lib/apt/lists/* -COPY functions-platform.sh lib-helpers/ - # We need to compile tools before setting environment for all other packages # We do this now ! local_package(bannertool) diff --git a/toolchains/devkit3ds/functions-platform.sh b/toolchains/devkit3ds/functions-platform.sh deleted file mode 100644 index 9dffb3e..0000000 --- a/toolchains/devkit3ds/functions-platform.sh +++ /dev/null @@ -1,10 +0,0 @@ -do_git_fetch () { - if [ -d "$1"*/ ]; then - rm -rf "$1"*/ - fi - git clone "$2" "$1" - cd "$1"*/ - git checkout "$3" - git submodule update --init - do_patch -}