From dd3b8dd21957d4a5d9f2c68a547e984bdf465b63 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Fri, 27 Jan 2017 02:50:22 +0300 Subject: In packages move branch name into DEFAULT_BRANCH variable. By default this variable set to "master". --- packages/SDL.sh | 3 ++- packages/SDL_gfx.sh | 3 ++- packages/SDL_image.sh | 3 ++- packages/SDL_mixer.sh | 3 ++- packages/SDL_net.sh | 3 ++- packages/SDL_ttf.sh | 3 ++- packages/cmake.sh | 2 +- packages/cppcheck.sh | 2 +- packages/curl.sh | 2 +- packages/libpng.sh | 2 +- packages/libxml2.sh | 2 +- packages/manaplus.sh | 2 +- packages/physfs.sh | 3 ++- packages/qemu.sh | 2 +- packages/virglrenderer.sh | 2 +- packages/zlib.sh | 3 ++- scripts/include/common.sh | 15 +++++++++++++-- 17 files changed, 37 insertions(+), 18 deletions(-) diff --git a/packages/SDL.sh b/packages/SDL.sh index f1da105..fc1fd9b 100755 --- a/packages/SDL.sh +++ b/packages/SDL.sh @@ -2,6 +2,7 @@ SRCTYPE=hg SRCURL=http://hg.libsdl.org/SDL/ +DEFAULT_BRANCH="SDL-1.2" ENV_PATH="bin" ENV_LD_LIBRARY_PATH="lib" @@ -9,7 +10,7 @@ ENV_PKG_CONFIG_PATH="lib/pkgconfig" ENV_MANPATH="share/man" function package_build { - run_switch_branch SDL-1.2 + run_switch_branch run_src_script ./autogen.sh run_configure --disable-rpath --enable-sdl-dlopen --disable-loadso \ --disable-video-ggi \ diff --git a/packages/SDL_gfx.sh b/packages/SDL_gfx.sh index 2cdfbb3..cc09550 100755 --- a/packages/SDL_gfx.sh +++ b/packages/SDL_gfx.sh @@ -1,12 +1,13 @@ #!/bin/bash SRCURL=https://github.com/ferzkopp/SDL_gfx.git +DEFAULT_BRANCH="SDL-1.2" ENV_LD_LIBRARY_PATH="lib" ENV_PKG_CONFIG_PATH="lib/pkgconfig" function package_build { - run_switch_branch master + run_switch_branch run_src_script ./autogen.sh run_configure diff --git a/packages/SDL_image.sh b/packages/SDL_image.sh index 1fd81d0..525bc94 100755 --- a/packages/SDL_image.sh +++ b/packages/SDL_image.sh @@ -2,12 +2,13 @@ SRCTYPE=hg SRCURL=http://hg.libsdl.org/SDL_image/ +DEFAULT_BRANCH="SDL-1.2" ENV_LD_LIBRARY_PATH="lib" ENV_PKG_CONFIG_PATH="lib/pkgconfig" function package_build { - run_switch_branch SDL-1.2 + run_switch_branch run_src_script ./autogen.sh run_configure --disable-jpg-shared --disable-tif-shared --disable-png-shared --disable-webp-shared diff --git a/packages/SDL_mixer.sh b/packages/SDL_mixer.sh index e49c7cf..0db9f2b 100755 --- a/packages/SDL_mixer.sh +++ b/packages/SDL_mixer.sh @@ -2,12 +2,13 @@ SRCTYPE=hg SRCURL=http://hg.libsdl.org/SDL_mixer/ +DEFAULT_BRANCH="SDL-1.2" ENV_LD_LIBRARY_PATH="lib" ENV_PKG_CONFIG_PATH="lib/pkgconfig" function package_build { - run_switch_branch SDL-1.2 + run_switch_branch run_src_script ./autogen.sh run_configure --disable-music-mp3 \ --disable-music-mod-shared --disable-music-ogg-shared --disable-music-mp3-shared --disable-music-flac-shared --disable-music-fluidsynth-shared diff --git a/packages/SDL_net.sh b/packages/SDL_net.sh index a535f8c..f7af9f5 100755 --- a/packages/SDL_net.sh +++ b/packages/SDL_net.sh @@ -2,12 +2,13 @@ SRCTYPE=hg SRCURL=http://hg.libsdl.org/SDL_net/ +DEFAULT_BRANCH="SDL-1.2" ENV_LD_LIBRARY_PATH="lib" ENV_PKG_CONFIG_PATH="lib/pkgconfig" function package_build { - run_switch_branch SDL-1.2 + run_switch_branch run_src_script ./autogen.sh run_configure --disable-gui diff --git a/packages/SDL_ttf.sh b/packages/SDL_ttf.sh index 42c881c..c837db4 100755 --- a/packages/SDL_ttf.sh +++ b/packages/SDL_ttf.sh @@ -2,12 +2,13 @@ SRCTYPE=hg SRCURL=http://hg.libsdl.org/SDL_ttf/ +DEFAULT_BRANCH="SDL-1.2" ENV_LD_LIBRARY_PATH="lib" ENV_PKG_CONFIG_PATH="lib/pkgconfig" function package_build { - run_switch_branch SDL-1.2 + run_switch_branch run_src_script ./autogen.sh run_configure --disable-gui diff --git a/packages/cmake.sh b/packages/cmake.sh index f94b528..27bd1da 100755 --- a/packages/cmake.sh +++ b/packages/cmake.sh @@ -5,7 +5,7 @@ SRCURL=git://cmake.org/cmake.git ENV_PATH="bin" function package_build { - run_switch_branch master + run_switch_branch run_cmake run_make diff --git a/packages/cppcheck.sh b/packages/cppcheck.sh index 5087c95..77de5f8 100755 --- a/packages/cppcheck.sh +++ b/packages/cppcheck.sh @@ -5,7 +5,7 @@ SRCURL=https://github.com/danmar/cppcheck.git ENV_PATH="bin:share/CppCheck" function package_build { - run_switch_branch master + run_switch_branch run_cmake -DHAVE_RULES=ON diff --git a/packages/curl.sh b/packages/curl.sh index 6e3496c..853dcd4 100755 --- a/packages/curl.sh +++ b/packages/curl.sh @@ -8,7 +8,7 @@ ENV_PKG_CONFIG_PATH="lib/pkgconfig" ENV_MANPATH="share/man" function package_build { - run_switch_branch master + run_switch_branch # this need because out of source tree compilation is broken run_enable_same_dir_build diff --git a/packages/libpng.sh b/packages/libpng.sh index bdeff84..534fc39 100755 --- a/packages/libpng.sh +++ b/packages/libpng.sh @@ -8,7 +8,7 @@ ENV_PKG_CONFIG_PATH="lib/pkgconfig" ENV_MANPATH="share/man" function package_build { - run_switch_branch master + run_switch_branch run_autoreconf -i run_configure diff --git a/packages/libxml2.sh b/packages/libxml2.sh index 84cb391..4b20964 100755 --- a/packages/libxml2.sh +++ b/packages/libxml2.sh @@ -8,7 +8,7 @@ ENV_PKG_CONFIG_PATH="lib/pkgconfig" ENV_MANPATH="share/man" function package_build { - run_switch_branch master + run_switch_branch run_autoreconf -i run_configure --with-python-install-dir="${bindir}/lib/python" diff --git a/packages/manaplus.sh b/packages/manaplus.sh index f191af5..ed7bdc1 100755 --- a/packages/manaplus.sh +++ b/packages/manaplus.sh @@ -6,7 +6,7 @@ ENV_PATH="bin" ENV_MANPATH="share/man" function package_build { - run_switch_branch master + run_switch_branch run_autoreconf -i run_configure diff --git a/packages/physfs.sh b/packages/physfs.sh index dacdbd6..34bda75 100755 --- a/packages/physfs.sh +++ b/packages/physfs.sh @@ -2,13 +2,14 @@ SRCTYPE=hg SRCURL=https://hg.icculus.org/icculus/physfs/ +DEFAULT_BRANCH="stable-2.0" ENV_PATH="bin:lib:include" ENV_LD_LIBRARY_PATH="lib" ENV_PKG_CONFIG_PATH="lib/pkgconfig" function package_build { - run_switch_branch stable-2.0 + run_switch_branch run_cmake run_make diff --git a/packages/qemu.sh b/packages/qemu.sh index d8369b5..019cdc5 100755 --- a/packages/qemu.sh +++ b/packages/qemu.sh @@ -6,7 +6,7 @@ ENV_PATH="bin" ENV_MANPATH="share/man" function package_build { - run_switch_branch master + run_switch_branch run_configure \ --target-list=x86_64-linux-user,x86_64-softmmu \ --disable-nettle \ diff --git a/packages/virglrenderer.sh b/packages/virglrenderer.sh index fc91a33..5505829 100755 --- a/packages/virglrenderer.sh +++ b/packages/virglrenderer.sh @@ -8,7 +8,7 @@ ENV_PKG_CONFIG_PATH="lib/pkgconfig" ENV_MANPATH="share/man" function package_build { - run_switch_branch master + run_switch_branch run_autoreconf -v --install run_configure run_make diff --git a/packages/zlib.sh b/packages/zlib.sh index 8e25f37..10aea40 100755 --- a/packages/zlib.sh +++ b/packages/zlib.sh @@ -1,6 +1,7 @@ #!/bin/bash SRCURL=https://github.com/madler/zlib.git +DEFAULT_BRANCH="v1.2.11" ENV_PATH="bin:lib:include" ENV_LD_LIBRARY_PATH="lib" @@ -8,7 +9,7 @@ ENV_PKG_CONFIG_PATH="lib/pkgconfig" ENV_MANPATH="share/man" function package_build { - run_switch_branch v1.2.11 + run_switch_branch run_configure run_make diff --git a/scripts/include/common.sh b/scripts/include/common.sh index 2afe31c..d4a7ec8 100644 --- a/scripts/include/common.sh +++ b/scripts/include/common.sh @@ -56,6 +56,7 @@ function common_package_init { export packagefile="${package}.sh" export SRCTYPE="git" + export DEFAULT_BRANCH="master" if [ ! -f "../packages/${packagefile}" ]; then echo "Error: Package '${package}' not exists." @@ -190,14 +191,24 @@ function run_hg_switch_branch { } function run_switch_branch { + branch="$1" + if [[ "${DEFAULT_BRANCH}" == "" ]]; then + echo "Error: source branch not set." + exit 1 + fi + if [[ "${branch}" == "" ]]; then + branch="${DEFAULT_BRANCH}" + fi + if [[ "${SRCTYPE}" == "git" ]]; then - run_git_switch_branch $1 + run_git_switch_branch ${branch} elif [[ "${SRCTYPE}" == "hg" ]]; then - run_hg_switch_branch $1 + run_hg_switch_branch ${branch} else echo "Error: unknown SRCTYPE: ${SRCTYPE}" exit 1 fi + unset branch } function repack_paths { -- cgit v1.2.3-70-g09d2