2013-05-10 22:36:35 +04:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# Copyright © 2013 Vincent Sanders <vince@netsurf-browser.org>
|
|
|
|
#
|
|
|
|
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
# of this software and associated documentation files (the "Software"), to deal
|
|
|
|
# in the Software without restriction, including without limitation the rights
|
|
|
|
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
# copies of the Software, and to permit persons to whom the Software is
|
|
|
|
# furnished to do so, subject to the following conditions:
|
|
|
|
#
|
|
|
|
# * The above copyright notice and this permission notice shall be included in
|
|
|
|
# all copies or substantial portions of the Software.
|
|
|
|
#
|
|
|
|
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
|
|
# THE SOFTWARE.
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
# NetSurf continuous integration build script for jenkins
|
2013-05-10 22:36:35 +04:00
|
|
|
#
|
|
|
|
# This script is executed by jenkins to build netsurf itself
|
|
|
|
#
|
|
|
|
# Usage: jenkins-build.sh
|
|
|
|
#
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
# TARGET is set to the frontend target to build
|
2014-12-19 16:29:12 +03:00
|
|
|
# HOST is set to the identifier of the toolchain doing the building
|
2013-11-04 22:50:45 +04:00
|
|
|
# CC is the compiler (gcc or clang)
|
|
|
|
# BUILD_NUMBER is the CI build number
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-11-04 23:02:55 +04:00
|
|
|
#####
|
|
|
|
|
|
|
|
# set defaults - this is not retrivable from the jenkins environment
|
|
|
|
OLD_ARTIFACT_COUNT=25
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
################# Parameter and environment setup #####################
|
2013-05-10 22:36:35 +04:00
|
|
|
|
|
|
|
#identifier for this specific build
|
2016-09-20 00:02:51 +03:00
|
|
|
IDENTIFIER="$CC-${BUILD_NUMBER}"
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-11-04 23:02:55 +04:00
|
|
|
# Identifier for build which will be cleaned
|
2016-09-20 00:02:51 +03:00
|
|
|
OLD_IDENTIFIER="$CC-$((BUILD_NUMBER - ${OLD_ARTIFACT_COUNT}))"
|
2013-11-04 23:02:55 +04:00
|
|
|
|
2013-05-10 22:36:35 +04:00
|
|
|
# default atari architecture - bletch
|
|
|
|
ATARIARCH=68020-60
|
|
|
|
|
2014-05-02 14:08:01 +04:00
|
|
|
# make tool
|
|
|
|
MAKE=make
|
|
|
|
|
2020-05-25 10:57:09 +03:00
|
|
|
# NetSurf version number haiku needs it for package name
|
|
|
|
NETSURF_VERSION="3.11"
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
# Ensure the combination of target and toolchain works and set build
|
|
|
|
# specific parameters too
|
|
|
|
case ${TARGET} in
|
|
|
|
"riscos")
|
2014-12-19 16:29:12 +03:00
|
|
|
case ${HOST} in
|
2013-05-11 13:45:19 +04:00
|
|
|
"arm-unknown-riscos")
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
*)
|
2014-12-19 16:29:12 +03:00
|
|
|
echo "Target \"${TARGET}\" cannot be built on \"${HOST})\""
|
2013-05-11 13:45:19 +04:00
|
|
|
exit 1
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
esac
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
PKG_SRC=netsurf
|
|
|
|
PKG_SFX=.zip
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2014-09-05 16:18:39 +04:00
|
|
|
"haiku")
|
2014-12-19 16:29:12 +03:00
|
|
|
case ${HOST} in
|
2014-09-05 03:49:30 +04:00
|
|
|
"i586-pc-haiku")
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2014-12-19 16:29:12 +03:00
|
|
|
echo "Target \"${TARGET}\" cannot be built on \"${HOST})\""
|
2014-09-05 03:49:30 +04:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
2020-05-25 10:57:09 +03:00
|
|
|
PKG_SRC="netsurf_x86-${NETSURF_VERSION}-1-x86_gcc2"
|
2018-08-15 18:24:03 +03:00
|
|
|
PKG_SFX=.hpkg
|
2014-09-05 03:49:30 +04:00
|
|
|
;;
|
|
|
|
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
"windows")
|
2014-12-19 16:29:12 +03:00
|
|
|
case ${HOST} in
|
2013-05-11 13:45:19 +04:00
|
|
|
"i686-w64-mingw32")
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
*)
|
2014-12-19 16:29:12 +03:00
|
|
|
echo "Target \"${TARGET}\" cannot be built on \"${HOST})\""
|
2013-05-11 13:45:19 +04:00
|
|
|
exit 1
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
esac
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
PKG_SRC=netsurf-installer
|
|
|
|
PKG_SFX=.exe
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
"cocoa")
|
2014-12-19 16:29:12 +03:00
|
|
|
case ${HOST} in
|
2016-02-08 00:59:28 +03:00
|
|
|
"x86_64-apple-darwin14.5.0")
|
2016-02-08 01:10:35 +03:00
|
|
|
PATH=/opt/local/bin:/opt/local/sbin:${PATH}
|
2016-02-08 00:59:28 +03:00
|
|
|
;;
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
"i686-apple-darwin10")
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
"powerpc-apple-darwin9")
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
*)
|
2014-12-19 16:29:12 +03:00
|
|
|
echo "Target \"${TARGET}\" cannot be built on \"${HOST})\""
|
2013-05-11 13:45:19 +04:00
|
|
|
exit 1
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
esac
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2015-07-13 15:31:28 +03:00
|
|
|
IDENTIFIER="${HOST}-${IDENTIFIER}"
|
|
|
|
OLD_IDENTIFIER="${HOST}-${OLD_IDENTIFIER}"
|
2013-05-11 13:45:19 +04:00
|
|
|
PKG_SRC=NetSurf
|
|
|
|
PKG_SFX=.dmg
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
"amiga")
|
2014-12-19 16:29:12 +03:00
|
|
|
case ${HOST} in
|
2013-05-11 13:45:19 +04:00
|
|
|
"ppc-amigaos")
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2017-12-11 16:17:14 +03:00
|
|
|
*)
|
|
|
|
echo "Target \"${TARGET}\" cannot be built on \"${HOST})\""
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
PKG_SRC=NetSurf_Amiga/netsurf
|
|
|
|
PKG_SFX=.lha
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
|
|
"amigaos3")
|
|
|
|
case ${HOST} in
|
2017-12-11 15:48:28 +03:00
|
|
|
"m68k-unknown-amigaos")
|
|
|
|
;;
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
*)
|
2014-12-19 16:29:12 +03:00
|
|
|
echo "Target \"${TARGET}\" cannot be built on \"${HOST})\""
|
2013-05-11 13:45:19 +04:00
|
|
|
exit 1
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
esac
|
|
|
|
|
|
|
|
PKG_SRC=NetSurf_Amiga/netsurf
|
|
|
|
PKG_SFX=.lha
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
|
|
"atari")
|
2014-12-19 16:29:12 +03:00
|
|
|
case ${HOST} in
|
2013-05-11 13:45:19 +04:00
|
|
|
"m68k-atari-mint")
|
|
|
|
PKG_SRC=ns020
|
|
|
|
PKG_SFX=.zip
|
|
|
|
;;
|
|
|
|
|
|
|
|
"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
|
|
|
|
PKG_SRC=nsv4e
|
|
|
|
PKG_SFX=.zip
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2014-12-19 16:29:12 +03:00
|
|
|
echo "Target \"${TARGET}\" cannot be built on \"${HOST})\""
|
2013-05-11 13:45:19 +04:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
2015-07-13 15:31:28 +03:00
|
|
|
IDENTIFIER="${HOST}-${IDENTIFIER}"
|
|
|
|
OLD_IDENTIFIER="${HOST}-${OLD_IDENTIFIER}"
|
2013-05-11 13:45:19 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
|
2019-12-02 17:29:51 +03:00
|
|
|
"gtk2")
|
2014-12-19 16:29:12 +03:00
|
|
|
case ${HOST} in
|
2013-05-12 21:40:53 +04:00
|
|
|
"x86_64-linux-gnu")
|
2015-07-13 15:31:28 +03:00
|
|
|
;;
|
|
|
|
|
|
|
|
"arm-linux-gnueabihf")
|
2013-05-11 13:45:19 +04:00
|
|
|
;;
|
|
|
|
|
2016-02-01 19:27:58 +03:00
|
|
|
"aarch64-linux-gnu")
|
|
|
|
;;
|
|
|
|
|
2014-12-21 17:15:58 +03:00
|
|
|
amd64-unknown-openbsd*)
|
2014-05-02 14:08:01 +04:00
|
|
|
MAKE=gmake
|
2014-05-02 14:03:43 +04:00
|
|
|
;;
|
|
|
|
|
2014-12-21 17:15:58 +03:00
|
|
|
x86_64-unknown-freebsd*)
|
2014-12-21 16:55:23 +03:00
|
|
|
MAKE=gmake
|
|
|
|
;;
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
*)
|
2014-12-19 16:29:12 +03:00
|
|
|
echo "Target \"${TARGET}\" cannot be built on \"${HOST}\""
|
2013-05-11 13:45:19 +04:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
2015-07-13 15:31:28 +03:00
|
|
|
IDENTIFIER="${HOST}-${IDENTIFIER}"
|
|
|
|
OLD_IDENTIFIER="${HOST}-${OLD_IDENTIFIER}"
|
2019-12-02 17:29:51 +03:00
|
|
|
PKG_SRC=nsgtk2
|
2013-05-11 13:45:19 +04:00
|
|
|
PKG_SFX=
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
2016-10-08 22:32:15 +03:00
|
|
|
"gtk3")
|
|
|
|
case ${HOST} in
|
|
|
|
"x86_64-linux-gnu")
|
|
|
|
;;
|
|
|
|
|
|
|
|
"arm-linux-gnueabihf")
|
|
|
|
;;
|
|
|
|
|
|
|
|
"aarch64-linux-gnu")
|
|
|
|
;;
|
|
|
|
|
|
|
|
amd64-unknown-openbsd*)
|
|
|
|
MAKE=gmake
|
|
|
|
;;
|
|
|
|
|
|
|
|
x86_64-unknown-freebsd*)
|
|
|
|
MAKE=gmake
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Target \"${TARGET}\" cannot be built on \"${HOST}\""
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
IDENTIFIER="${HOST}-${IDENTIFIER}"
|
|
|
|
OLD_IDENTIFIER="${HOST}-${OLD_IDENTIFIER}"
|
|
|
|
PKG_SRC=nsgtk3
|
|
|
|
PKG_SFX=
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
"framebuffer")
|
2014-12-19 16:29:12 +03:00
|
|
|
case ${HOST} in
|
2013-05-12 21:40:53 +04:00
|
|
|
"x86_64-linux-gnu")
|
2015-07-13 15:31:28 +03:00
|
|
|
;;
|
|
|
|
|
|
|
|
arm-linux-gnueabihf)
|
2013-05-11 13:45:19 +04:00
|
|
|
;;
|
|
|
|
|
2016-02-01 19:27:58 +03:00
|
|
|
"aarch64-linux-gnu")
|
|
|
|
;;
|
|
|
|
|
2013-05-12 21:40:53 +04:00
|
|
|
"i686-apple-darwin10")
|
|
|
|
;;
|
|
|
|
|
|
|
|
"powerpc-apple-darwin9")
|
|
|
|
;;
|
|
|
|
|
2014-12-21 17:15:58 +03:00
|
|
|
amd64-unknown-openbsd*)
|
2014-12-21 16:55:23 +03:00
|
|
|
MAKE=gmake
|
|
|
|
;;
|
|
|
|
|
2014-12-21 17:15:58 +03:00
|
|
|
x86_64-unknown-freebsd*)
|
2014-12-21 16:55:23 +03:00
|
|
|
MAKE=gmake
|
|
|
|
;;
|
|
|
|
|
2013-05-12 21:40:53 +04:00
|
|
|
"arm-unknown-riscos")
|
2014-12-19 16:29:12 +03:00
|
|
|
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
|
|
|
|
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
|
2013-05-12 21:40:53 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
"m68k-atari-mint")
|
2014-12-19 16:29:12 +03:00
|
|
|
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
|
|
|
|
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
|
2013-05-12 21:40:53 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
"m5475-atari-mint")
|
|
|
|
ATARIARCH=v4e
|
2014-12-19 16:29:12 +03:00
|
|
|
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
|
|
|
|
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
|
2013-05-12 21:40:53 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
"i686-w64-mingw32")
|
2014-12-19 16:29:12 +03:00
|
|
|
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
|
|
|
|
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
|
2013-05-12 21:40:53 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
"ppc-amigaos")
|
2014-12-19 16:29:12 +03:00
|
|
|
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
|
|
|
|
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
|
2013-05-12 21:40:53 +04:00
|
|
|
;;
|
|
|
|
|
2017-12-11 15:48:28 +03:00
|
|
|
"m68k-unknown-amigaos")
|
|
|
|
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
|
|
|
|
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
|
|
|
|
;;
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
*)
|
2014-12-19 16:29:12 +03:00
|
|
|
echo "Target \"${TARGET}\" cannot be built on \"${HOST})\""
|
2013-05-11 13:45:19 +04:00
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
2015-07-13 15:31:28 +03:00
|
|
|
IDENTIFIER="${HOST}-${IDENTIFIER}"
|
|
|
|
OLD_IDENTIFIER="${HOST}-${OLD_IDENTIFIER}"
|
2013-05-11 13:45:19 +04:00
|
|
|
PKG_SRC=nsfb
|
|
|
|
PKG_SFX=
|
|
|
|
;;
|
|
|
|
|
|
|
|
|
|
|
|
"monkey")
|
2016-02-12 17:16:31 +03:00
|
|
|
# monkey target can be built anywhere
|
2014-12-19 16:29:12 +03:00
|
|
|
case ${HOST} in
|
2014-12-21 17:15:58 +03:00
|
|
|
amd64-unknown-openbsd*)
|
2014-12-21 16:55:23 +03:00
|
|
|
MAKE=gmake
|
|
|
|
;;
|
|
|
|
|
2014-12-21 17:15:58 +03:00
|
|
|
x86_64-unknown-freebsd*)
|
2014-12-21 16:55:23 +03:00
|
|
|
MAKE=gmake
|
|
|
|
;;
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
"arm-unknown-riscos")
|
2014-12-19 16:29:12 +03:00
|
|
|
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
|
|
|
|
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
|
2016-02-15 18:16:23 +03:00
|
|
|
# headers and compiler combination throw these warnings
|
|
|
|
export CFLAGS="-Wno-redundant-decls -Wno-parentheses"
|
|
|
|
export LDFLAGS=-lcares
|
2013-05-11 13:45:19 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
"m68k-atari-mint")
|
2014-12-19 16:29:12 +03:00
|
|
|
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
|
|
|
|
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
|
2013-05-11 13:45:19 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
"m5475-atari-mint")
|
|
|
|
ATARIARCH=v4e
|
2014-12-19 16:29:12 +03:00
|
|
|
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
|
|
|
|
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
|
2013-05-11 13:45:19 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
"i686-w64-mingw32")
|
2014-12-19 16:29:12 +03:00
|
|
|
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
|
|
|
|
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
|
2013-05-11 13:45:19 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
"ppc-amigaos")
|
2014-12-19 16:29:12 +03:00
|
|
|
export GCCSDK_INSTALL_ENV=/opt/netsurf/${HOST}/env
|
|
|
|
export GCCSDK_INSTALL_CROSSBIN=/opt/netsurf/${HOST}/cross/bin
|
2013-05-11 13:45:19 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
2016-02-12 17:16:31 +03:00
|
|
|
echo "Target \"${TARGET}\" generic build on \"${HOST})\""
|
2013-05-11 13:45:19 +04:00
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2014-12-19 16:29:12 +03:00
|
|
|
IDENTIFIER="${HOST}-${IDENTIFIER}"
|
|
|
|
OLD_IDENTIFIER="${HOST}-${OLD_IDENTIFIER}"
|
2013-05-11 13:45:19 +04:00
|
|
|
PKG_SRC=nsmonkey
|
|
|
|
PKG_SFX=
|
|
|
|
;;
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
*)
|
|
|
|
# TARGET must be in the environment and set correctly
|
|
|
|
echo "Unkown TARGET \"${TARGET}\""
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
2013-05-10 22:36:35 +04:00
|
|
|
|
|
|
|
# setup environment
|
2014-12-19 16:29:12 +03:00
|
|
|
export PREFIX=${JENKINS_HOME}/artifacts-${HOST}
|
2013-05-10 22:36:35 +04:00
|
|
|
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig
|
|
|
|
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${PREFIX}/lib
|
|
|
|
export PATH=${PATH}:${PREFIX}/bin
|
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
# configure ccache for clang
|
2013-05-10 22:36:35 +04:00
|
|
|
if [ "${CC}" = "clang" ];then
|
2013-05-11 13:45:19 +04:00
|
|
|
export CCACHE_CPP2=yes
|
|
|
|
export CC="clang -Qunused-arguments"
|
2013-05-10 22:36:35 +04:00
|
|
|
fi
|
|
|
|
|
2015-08-12 16:50:54 +03:00
|
|
|
########### Use distcc if present ######
|
|
|
|
|
|
|
|
DISTCC=distcc
|
|
|
|
PARALLEL=1
|
2015-08-12 17:04:35 +03:00
|
|
|
HAVE_DISTCC=$(${DISTCC} --version >/dev/null 2>&1 && echo "true" || echo "false")
|
|
|
|
if [ ${HAVE_DISTCC} = "true" ];then
|
2015-08-12 16:50:54 +03:00
|
|
|
PARALLEL=$(${DISTCC} -j)
|
|
|
|
export PATH=/usr/lib/distcc:${PATH}
|
2015-08-12 17:04:35 +03:00
|
|
|
export DISTCC_DIR=${JENKINS_HOME}
|
2015-08-12 16:50:54 +03:00
|
|
|
fi
|
2013-05-11 13:45:19 +04:00
|
|
|
|
|
|
|
|
2018-07-28 16:10:26 +03:00
|
|
|
########### Prepare a Makefile.config ##################
|
|
|
|
|
|
|
|
rm -f Makefile.config
|
|
|
|
cat > Makefile.config <<EOF
|
|
|
|
override NETSURF_LOG_LEVEL := DEBUG
|
|
|
|
EOF
|
2013-05-11 13:45:19 +04:00
|
|
|
|
2018-08-15 18:52:54 +03:00
|
|
|
########### Additional environment info ########
|
|
|
|
|
|
|
|
uname -a
|
|
|
|
|
2018-08-21 21:55:08 +03:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
########### Build from source ##################
|
|
|
|
|
|
|
|
# Clean first
|
2016-09-20 00:02:51 +03:00
|
|
|
${MAKE} clean
|
2013-05-10 22:36:35 +04:00
|
|
|
|
|
|
|
# Do the Build
|
2016-09-20 00:02:51 +03:00
|
|
|
${MAKE} -j ${PARALLEL} -k CI_BUILD=${BUILD_NUMBER} ATARIARCH=${ATARIARCH} Q=
|
2013-05-11 13:45:19 +04:00
|
|
|
|
|
|
|
|
|
|
|
############ Package artifact construction ################
|
2013-05-10 22:36:35 +04:00
|
|
|
|
|
|
|
# build the package file
|
2018-08-21 21:55:08 +03:00
|
|
|
${MAKE} -k CI_BUILD=${BUILD_NUMBER} ATARIARCH=${ATARIARCH} PACKAGER="NetSurf Developers <support@netsurf-browser.org>" Q= package
|
2013-05-10 22:36:35 +04:00
|
|
|
|
|
|
|
if [ ! -f "${PKG_SRC}${PKG_SFX}" ]; then
|
|
|
|
# unable to find package file
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2018-10-05 01:12:57 +03:00
|
|
|
# create package checksum files
|
2018-10-05 01:49:31 +03:00
|
|
|
|
|
|
|
# find md5sum binary
|
|
|
|
MD5SUM=md5sum;
|
|
|
|
command -v ${MD5SUM} >/dev/null 2>&1 || MD5SUM=md5
|
|
|
|
command -v ${MD5SUM} >/dev/null 2>&1 || MD5SUM=echo
|
|
|
|
|
|
|
|
# find sha256 binary name
|
|
|
|
SHAR256SUM=sha256sum
|
2018-10-05 02:11:08 +03:00
|
|
|
command -v ${SHAR256SUM} >/dev/null 2>&1 || SHAR256SUM=sha256
|
2018-10-05 01:49:31 +03:00
|
|
|
command -v ${SHAR256SUM} >/dev/null 2>&1 || SHAR256SUM=echo
|
|
|
|
|
|
|
|
${MD5SUM} "${PKG_SRC}${PKG_SFX}" > ${PKG_SRC}.md5
|
2018-10-05 02:00:16 +03:00
|
|
|
${SHAR256SUM} "${PKG_SRC}${PKG_SFX}" > ${PKG_SRC}.sha256
|
2018-10-05 01:12:57 +03:00
|
|
|
|
2013-05-11 13:45:19 +04:00
|
|
|
|
|
|
|
############ Package artifact deployment ################
|
|
|
|
|
2013-11-04 22:50:45 +04:00
|
|
|
#destination for package artifacts
|
|
|
|
DESTDIR=/srv/ci.netsurf-browser.org/html/builds/${TARGET}/
|
|
|
|
|
2018-10-05 01:12:57 +03:00
|
|
|
NEW_ARTIFACT_TARGET="NetSurf-${IDENTIFIER}"
|
2018-10-05 01:49:31 +03:00
|
|
|
OLD_ARTIFACT_TARGETS=""
|
2013-05-10 22:36:35 +04:00
|
|
|
|
2018-10-05 01:49:31 +03:00
|
|
|
for SUFFIX in "${PKG_SFX}" .md5 .sha256;do
|
2018-10-05 01:12:57 +03:00
|
|
|
# copy the file to the output - always use scp as it works local or remote
|
|
|
|
scp "${PKG_SRC}${SUFFIX}" netsurf@ci.netsurf-browser.org:${DESTDIR}/${NEW_ARTIFACT_TARGET}${SUFFIX}
|
2013-11-04 22:50:45 +04:00
|
|
|
|
2018-10-05 01:12:57 +03:00
|
|
|
# remove the local file artifact
|
|
|
|
rm -f "${PKG_SRC}${SUFFIX}"
|
2018-10-05 01:49:31 +03:00
|
|
|
|
2018-10-05 01:54:14 +03:00
|
|
|
OLD_ARTIFACT_TARGETS="${OLD_ARTIFACT_TARGETS} ${DESTDIR}/NetSurf-${OLD_IDENTIFIER}${SUFFIX}"
|
2018-10-05 01:12:57 +03:00
|
|
|
done
|
2013-11-04 22:50:45 +04:00
|
|
|
|
|
|
|
|
2018-10-05 01:12:57 +03:00
|
|
|
############ Expired package artifact removal and latest linking ##############
|
2013-11-04 22:50:45 +04:00
|
|
|
|
|
|
|
|
2018-10-05 01:49:31 +03:00
|
|
|
ssh netsurf@ci.netsurf-browser.org "rm -f ${OLD_ARTIFACT_TARGETS} ${DESTDIR}/LATEST && echo "${NEW_ARTIFACT_TARGET}${PKG_SFX}" > ${DESTDIR}/LATEST"
|