mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-11-22 14:31:20 +03:00
improve script to use case statements as appropriate and fail correctly for unsupported usage
This commit is contained in:
parent
29086c377f
commit
e6eecc098b
@ -20,19 +20,17 @@
|
||||
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
# THE SOFTWARE.
|
||||
|
||||
# NetSurf continuius integration build script for jenkins
|
||||
# NetSurf continuous integration build script for jenkins
|
||||
#
|
||||
# This script is executed by jenkins to build netsurf itself
|
||||
#
|
||||
# Usage: jenkins-build.sh
|
||||
#
|
||||
|
||||
# TARGET is set to the frontend target to build
|
||||
# label is set to the identifier of the toolchain doing the building
|
||||
|
||||
# TARGET must be in the environment and set correctly
|
||||
if [ "x${TARGET}" = "x" ];then
|
||||
echo "TARGET unset"
|
||||
exit 1
|
||||
fi
|
||||
################# Parameter and environment setup #####################
|
||||
|
||||
#identifier for this specific build
|
||||
IDENTIFIER="$CC-${BUILD_JS}-${BUILD_NUMBER}"
|
||||
@ -40,135 +38,216 @@ IDENTIFIER="$CC-${BUILD_JS}-${BUILD_NUMBER}"
|
||||
# default atari architecture - bletch
|
||||
ATARIARCH=68020-60
|
||||
|
||||
if [ "${TARGET}" = "riscos" ];then
|
||||
|
||||
# Ensure the combination of target and toolchain works and set build
|
||||
# specific parameters too
|
||||
case ${TARGET} in
|
||||
"riscos")
|
||||
case ${label} in
|
||||
"arm-unknown-riscos")
|
||||
ARTIFACT_TARGET=riscos
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Target \"${TARGET}\" cannot be built on \"${label})\""
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
PKG_SRC=netsurf
|
||||
PKG_SFX=.zip
|
||||
;;
|
||||
|
||||
elif [ "${TARGET}" = "windows" ];then
|
||||
|
||||
"windows")
|
||||
case ${label} in
|
||||
"i686-w64-mingw32")
|
||||
ARTIFACT_TARGET=windows
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Target \"${TARGET}\" cannot be built on \"${label})\""
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
PKG_SRC=netsurf-installer
|
||||
PKG_SFX=.exe
|
||||
;;
|
||||
|
||||
elif [ "${TARGET}" = "cocoa" ];then
|
||||
|
||||
if [ "${label}" = "i686-apple-darwin10" ]; then
|
||||
"cocoa")
|
||||
case ${label} in
|
||||
"i686-apple-darwin10")
|
||||
ARTIFACT_TARGET=Darwin
|
||||
IDENTIFIER="${label}-${IDENTIFIER}"
|
||||
;;
|
||||
|
||||
elif [ "${label}" = "powerpc-apple-darwin9" ]; then
|
||||
"powerpc-apple-darwin9")
|
||||
ARTIFACT_TARGET=powerpc-apple-darwin9
|
||||
IDENTIFIER="${ARTIFACT_TARGET}-${IDENTIFIER}"
|
||||
;;
|
||||
|
||||
else
|
||||
echo "Bad cocoa label"
|
||||
*)
|
||||
echo "Target \"${TARGET}\" cannot be built on \"${label})\""
|
||||
exit 1
|
||||
;;
|
||||
|
||||
fi
|
||||
esac
|
||||
|
||||
PKG_SRC=NetSurf
|
||||
PKG_SFX=.dmg
|
||||
;;
|
||||
|
||||
elif [ "${TARGET}" = "amiga" ];then
|
||||
|
||||
"amiga")
|
||||
case ${label} in
|
||||
"ppc-amigaos")
|
||||
ARTIFACT_TARGET=amiga
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Target \"${TARGET}\" cannot be built on \"${label})\""
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
PKG_SRC=NetSurf_Amiga/netsurf
|
||||
PKG_SFX=.lha
|
||||
;;
|
||||
|
||||
|
||||
elif [ "${TARGET}" = "atari" ];then
|
||||
|
||||
if [ "${label}" = "m68k-atari-mint" ]; then
|
||||
"atari")
|
||||
case ${label} in
|
||||
"m68k-atari-mint")
|
||||
ARTIFACT_TARGET=m68k-atari-mint
|
||||
IDENTIFIER="${ARTIFACT_TARGET}-${IDENTIFIER}"
|
||||
PKG_SRC=ns020
|
||||
PKG_SFX=.zip
|
||||
;;
|
||||
|
||||
elif [ "${label}" = "m5475-atari-mint" ]; then
|
||||
"m5475-atari-mint")
|
||||
ARTIFACT_TARGET=m5475-atari-mint
|
||||
export GCCSDK_INSTALL_ENV=/opt/netsurf/m5475-atari-mint/env
|
||||
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/m5475-atari-mint/cross/bin
|
||||
ATARIARCH=v4e
|
||||
IDENTIFIER="${ARTIFACT_TARGET}-${IDENTIFIER}"
|
||||
PKG_SRC=nsv4e
|
||||
PKG_SFX=.zip
|
||||
;;
|
||||
|
||||
else
|
||||
|
||||
echo "Bad atari label"
|
||||
*)
|
||||
echo "Target \"${TARGET}\" cannot be built on \"${label})\""
|
||||
exit 1
|
||||
;;
|
||||
|
||||
fi
|
||||
esac
|
||||
|
||||
elif [ "${TARGET}" = "gtk" ];then
|
||||
IDENTIFIER="${ARTIFACT_TARGET}-${IDENTIFIER}"
|
||||
;;
|
||||
|
||||
|
||||
"gtk")
|
||||
case ${label} in
|
||||
"linux")
|
||||
ARTIFACT_TARGET=Linux
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Target \"${TARGET}\" cannot be built on \"${label})\""
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
PKG_SRC=nsgtk
|
||||
PKG_SFX=
|
||||
|
||||
elif [ "${TARGET}" = "framebuffer" ];then
|
||||
;;
|
||||
|
||||
|
||||
"framebuffer")
|
||||
case ${label} in
|
||||
"linux")
|
||||
ARTIFACT_TARGET=Linux
|
||||
;;
|
||||
|
||||
*)
|
||||
echo "Target \"${TARGET}\" cannot be built on \"${label})\""
|
||||
exit 1
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
PKG_SRC=nsfb
|
||||
PKG_SFX=
|
||||
;;
|
||||
|
||||
elif [ "${TARGET}" = "monkey" ];then
|
||||
|
||||
if [ "${label}" = "linux" ]; then
|
||||
"monkey")
|
||||
# monkey target can be built on most of the supported architectures
|
||||
case ${label} in
|
||||
"linux")
|
||||
ARTIFACT_TARGET=Linux
|
||||
;;
|
||||
|
||||
elif [ "${label}" = "i686-apple-darwin10" ]; then
|
||||
"i686-apple-darwin10")
|
||||
ARTIFACT_TARGET=Darwin
|
||||
;;
|
||||
|
||||
elif [ "${label}" = "powerpc-apple-darwin9" ]; then
|
||||
"powerpc-apple-darwin9")
|
||||
ARTIFACT_TARGET=powerpc-apple-darwin9
|
||||
;;
|
||||
|
||||
elif [ "${label}" = "arm-unknown-riscos" ]; then
|
||||
"arm-unknown-riscos")
|
||||
ARTIFACT_TARGET=riscos
|
||||
export GCCSDK_INSTALL_ENV=/opt/netsurf/${label}/env
|
||||
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${label}/cross/bin
|
||||
;;
|
||||
|
||||
elif [ "${label}" = "m68k-atari-mint" ]; then
|
||||
"m68k-atari-mint")
|
||||
ARTIFACT_TARGET=m68k-atari-mint
|
||||
export GCCSDK_INSTALL_ENV=/opt/netsurf/${label}/env
|
||||
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${label}/cross/bin
|
||||
;;
|
||||
|
||||
elif [ "${label}" = "m5475-atari-mint" ]; then
|
||||
"m5475-atari-mint")
|
||||
ATARIARCH=v4e
|
||||
ARTIFACT_TARGET=m5475-atari-mint
|
||||
export GCCSDK_INSTALL_ENV=/opt/netsurf/${label}/env
|
||||
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${label}/cross/bin
|
||||
;;
|
||||
|
||||
elif [ "${label}" = "i686-w64-mingw32" ]; then
|
||||
"i686-w64-mingw32")
|
||||
ARTIFACT_TARGET=windows
|
||||
export GCCSDK_INSTALL_ENV=/opt/netsurf/${label}/env
|
||||
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${label}/cross/bin
|
||||
;;
|
||||
|
||||
elif [ "${label}" = "ppc-amigaos" ]; then
|
||||
"ppc-amigaos")
|
||||
ARTIFACT_TARGET=amiga
|
||||
export GCCSDK_INSTALL_ENV=/opt/netsurf/${label}/env
|
||||
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${label}/cross/bin
|
||||
;;
|
||||
|
||||
else
|
||||
echo "Bad monkey label"
|
||||
*)
|
||||
echo "Target \"${TARGET}\" cannot be built on \"${label})\""
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
|
||||
esac
|
||||
|
||||
IDENTIFIER="${label}-${IDENTIFIER}"
|
||||
PKG_SRC=nsmonkey
|
||||
PKG_SFX=
|
||||
;;
|
||||
|
||||
else
|
||||
|
||||
# unkown target
|
||||
*)
|
||||
# TARGET must be in the environment and set correctly
|
||||
echo "Unkown TARGET \"${TARGET}\""
|
||||
exit 1
|
||||
;;
|
||||
|
||||
fi
|
||||
|
||||
########### Build from source ##################
|
||||
esac
|
||||
|
||||
# setup environment
|
||||
export PREFIX=${JENKINS_HOME}/artifacts-${ARTIFACT_TARGET}
|
||||
@ -176,10 +255,10 @@ export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
|
||||
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PREFIX}/lib
|
||||
export PATH=${PATH}:${PREFIX}/bin
|
||||
|
||||
# disable ccache for clang
|
||||
# configure ccache for clang
|
||||
if [ "${CC}" = "clang" ];then
|
||||
export CCACHE_CPP2=yes
|
||||
export CC="clang -Qunused-arguments"
|
||||
export CCACHE_CPP2=yes
|
||||
export CC="clang -Qunused-arguments"
|
||||
fi
|
||||
|
||||
# convert javascript parameters
|
||||
@ -191,12 +270,22 @@ else
|
||||
BUILD_MOZJS=NO
|
||||
fi
|
||||
|
||||
|
||||
|
||||
|
||||
########### Build from source ##################
|
||||
|
||||
# Clean first
|
||||
make NETSURF_USE_JS=${BUILD_JS} NETSURF_USE_MOZJS=${BUILD_MOZJS} clean
|
||||
|
||||
# Do the Build
|
||||
make -k NETSURF_USE_JS=${BUILD_JS} NETSURF_USE_MOZJS=${BUILD_MOZJS} CI_BUILD=${BUILD_NUMBER} ATARIARCH=${ATARIARCH} Q=
|
||||
|
||||
############ Package artifact construction and deployment ################
|
||||
|
||||
|
||||
|
||||
|
||||
############ Package artifact construction ################
|
||||
|
||||
#destination for package artifacts
|
||||
DESTDIR=/srv/ci.netsurf-browser.org/html/builds/${TARGET}/
|
||||
@ -209,6 +298,10 @@ if [ ! -f "${PKG_SRC}${PKG_SFX}" ]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
|
||||
|
||||
############ Package artifact deployment ################
|
||||
|
||||
# copy the file into the output - always use scp as it works local or remote
|
||||
scp "${PKG_SRC}${PKG_SFX}" netsurf@ci.netsurf-browser.org:${DESTDIR}/NetSurf-${IDENTIFIER}${PKG_SFX}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user