summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--build.subr13
-rw-r--r--build.vars5
-rw-r--r--pkg.build2
3 files changed, 14 insertions, 6 deletions
diff --git a/build.subr b/build.subr
index 32b4f4c4..168e9721 100644
--- a/build.subr
+++ b/build.subr
@@ -34,11 +34,18 @@ fetch() {
};
fetch_git() {
- _fg_subdir="${1}"; _fg_url="${2}"; _fg_git_args_extra="${3}";
+ _fg_subdir="${1}"; _fg_url="${2}"; _fg_branch="${3}";
if [ -e "${DLCACHEDIR}/${_fg_subdir}" ]; then
- (cd ${DLCACHEDIR}/${_fg_subdir} && git pull origin main);
+ cd ${DLCACHEDIR}/${_fg_subdir} &&\
+ git pull origin ${_fg_branch:-main} && cd ${OLDPWD};
else
- git clone ${_fg_git_args_extra} ${_fg_url} ${DLCACHEDIR}/${_fg_subdir};
+ git clone ${_fg_url} ${DLCACHEDIR}/${_fg_subdir};
+ if [ -n "${_fg_branch}" -a \
+ \( -z "${_fg_branch#main}" \) -a \
+ \( -z "${_fg_branch#master}" \) ]; then
+ cd ${DLCACHEDIR}/${_fg_subdir} &&\
+ git checkout -b ${_fg_branch} && cd ${OLDPWD};
+ fi;
fi;
rm_if_exists ${_fg_subdir};
echo cp -pr ${DLCACHEDIR}/${_fg_subdir} .;
diff --git a/build.vars b/build.vars
index 6fc45a7b..24e92a7e 100644
--- a/build.vars
+++ b/build.vars
@@ -64,7 +64,7 @@ export PATH="${PREFIX}/bin${PATH:+:${PATH}}";
# pkg.build
#
DEFAULT_MAKEFLAGS_BUILD=-j${BUILD_CPUS:=1};
-PKG_BUILD_VARS="BUILD_CMDLINE BUILD_DIR BUILD_TYPE CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA CFLAGS_INSTALL_EXTRA CONFIG_CACHE_EXTRA CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA ENV_VARS_EXTRA FNAME GIT_ARGS_EXTRA INSTALL_FILES INSTALL_TARGET LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA NO_CLEAN NO_MAKE_INSTALL PREFIX_EXTRA SHA256SUM SLIBTOOL SUBDIR SUBDIR_CREATE URL URL_FNAME URL_TYPE VERSION";
+PKG_BUILD_VARS="BUILD_CMDLINE BUILD_DIR BUILD_TYPE CFLAGS_BUILD_EXTRA CFLAGS_CONFIGURE CFLAGS_CONFIGURE_EXTRA CFLAGS_INSTALL_EXTRA CONFIG_CACHE_EXTRA CONFIGURE_ARGS CONFIGURE_ARGS_EXTRA ENV_VARS_EXTRA FNAME GIT_BRANCH INSTALL_FILES INSTALL_TARGET LDFLAGS_BUILD_EXTRA LDFLAGS_CONFIGURE LDFLAGS_CONFIGURE_EXTRA LDFLAGS_INSTALL_EXTRA MAKEFLAGS_BUILD MAKEFLAGS_BUILD_EXTRA MAKEFLAGS_INSTALL MAKEFLAGS_INSTALL_EXTRA NO_CLEAN NO_MAKE_INSTALL PREFIX_EXTRA SHA256SUM SLIBTOOL SUBDIR SUBDIR_CREATE URL URL_FNAME URL_TYPE VERSION";
PKG_LVL0_PREFIX="${PREFIX_CROSS}";
PKG_LVL0_BUILD_TYPE="host";
PKG_LVL0_CFLAGS_CONFIGURE="${PKG_LVL0_CFLAGS_CONFIGURE_DEFAULT}";
@@ -346,7 +346,7 @@ PKG_LVL3_MAKEFLAGS_INSTALL="DESTDIR=${PREFIX_NATIVE}";
: ${PKG_CRON_URL_TYPE:=git};
: ${PKG_CRON_BUILD_DIR:=pkg-cron.git};
: ${PKG_CRON_ENV_VARS_EXTRA:="CC=${TARGET}-gcc:CFLAGS=${PKG_LVL3_CFLAGS_CONFIGURE} -D__GNU__"};
-: ${PKG_CRON_GIT_ARGS_EXTRA:="-b debian/3.0pl1-128"};
+: ${PKG_CRON_GIT_BRANCH:=debian/3.0pl1-128};
: ${PKG_CURL_VERSION:=7.47.1};
: ${PKG_CURL_SHA256SUM:=ddc643ab9382e24bbe4747d43df189a0a6ce38fcb33df041b9cb0b3cd47ae98f};
: ${PKG_CURL_URL:=https://curl.haxx.se/download/curl-${PKG_CURL_VERSION}.tar.bz2};
@@ -382,6 +382,7 @@ PKG_LVL3_MAKEFLAGS_INSTALL="DESTDIR=${PREFIX_NATIVE}";
: ${PKG_HEXCURSE_CFLAGS_CONFIGURE_EXTRA:=-I${PREFIX_NATIVE}/include/ncursesw};
: ${PKG_HEXCURSE_URL:=https://github.com/LonnyGomes/hexcurse};
: ${PKG_HEXCURSE_URL_TYPE:=git};
+: ${PKG_HEXCURSE_GIT_BRANCH:=master};
: ${PKG_HTOP_VERSION:=2.0.1};
: ${PKG_HTOP_SHA256SUM:=f410626dfaf6b70fdf73cd7bb33cae768869707028d847fed94a978e974f5666};
: ${PKG_HTOP_URL:=http://hisham.hm/htop/releases/${PKG_HTOP_VERSION}/htop-${PKG_HTOP_VERSION}.tar.gz};
diff --git a/pkg.build b/pkg.build
index 56d4e5f1..8d695535 100644
--- a/pkg.build
+++ b/pkg.build
@@ -25,7 +25,7 @@ if ! is_build_script_done fetch; then
if [ "${PKG_URL_TYPE:-wget}" = wget ]; then
fetch "${PKG_URL}" ${PKG_SHA256SUM};
else
- fetch_git ${PKG_SUBDIR} ${PKG_URL} "${PKG_GIT_ARGS_EXTRA}";
+ fetch_git ${PKG_SUBDIR} ${PKG_URL} ${PKG_GIT_BRANCH};
fi;
fi;
set_build_script_done fetch -extract;