diff --git a/srcpkgs/anjuta/template b/srcpkgs/anjuta/template index 12deac37b1..046037880b 100644 --- a/srcpkgs/anjuta/template +++ b/srcpkgs/anjuta/template @@ -28,8 +28,7 @@ fi CFLAGS="-O2 -Wno-deprecated-declarations" -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CFLAGS+=" -Wno-error=format-nonliteral -Wno-error=format-y2k -Wno-error=missing-include-dirs" fi CXXFLAGS="${CFLAGS}" diff --git a/srcpkgs/brasero/template b/srcpkgs/brasero/template index 03fb185fbd..f4e507170b 100644 --- a/srcpkgs/brasero/template +++ b/srcpkgs/brasero/template @@ -25,8 +25,7 @@ if [ -z "$CROSS_BUILD" ]; then build_options_default="gir" fi -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CFLAGS="-Wno-error=format-nonliteral -Wno-error=format-y2k" CXXFLAGS="-Wno-error=format-nonliteral -Wno-error=format-y2k" fi diff --git a/srcpkgs/cinnamon-session/template b/srcpkgs/cinnamon-session/template index 9a3371f995..791158afcc 100644 --- a/srcpkgs/cinnamon-session/template +++ b/srcpkgs/cinnamon-session/template @@ -16,8 +16,7 @@ homepage="http://cinnamon.linuxmint.com/" distfiles="https://github.com/linuxmint/${pkgname}/archive/${version}.tar.gz" checksum=306eb9448500b15b0d06826b66f438d767d001b706fd345c53b4a91d308ae4a9 -_gccver=$(gcc --version|awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then # Fix gcc6 build for -Wformat-nonliteral CFLAGS="-Wno-error=format-nonliteral" fi diff --git a/srcpkgs/elfutils/template b/srcpkgs/elfutils/template index 54ebf0bc83..9976475051 100644 --- a/srcpkgs/elfutils/template +++ b/srcpkgs/elfutils/template @@ -15,8 +15,7 @@ checksum=3f300087c42b6f35591163b48246b4098ce39c4c6f5d55a83023c903c5776553 # Suppress certain warnings to not fail for -Werror CFLAGS="-Wno-unused-result -Wno-format-nonliteral" -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CFLAGS+=" -Wno-null-dereference" fi diff --git a/srcpkgs/espeak/template b/srcpkgs/espeak/template index 8897739555..69c100e60a 100644 --- a/srcpkgs/espeak/template +++ b/srcpkgs/espeak/template @@ -14,8 +14,7 @@ build_wrksrc="src" checksum="bf9a17673adffcc28ff7ea18764f06136547e97bbd9edf2ec612f09b207f0659" build_style="gnu-makefile" -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CXXFLAGS="-Wno-error=narrowing" fi diff --git a/srcpkgs/fbreader/template b/srcpkgs/fbreader/template index 2cbe966679..ece4aca391 100644 --- a/srcpkgs/fbreader/template +++ b/srcpkgs/fbreader/template @@ -12,8 +12,7 @@ homepage="http://www.fbreader.org/" distfiles="http://www.fbreader.org/files/desktop/${pkgname}-sources-${version}.tgz" checksum=3d7c31d5ea314589d2a963290ad16f4d3d631a41e802b8b39f8be0c9f71eb8e9 -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CFLAGS="-Wno-error=narrowing" CXXFLAGS="-Wno-error=narrowing" fi diff --git a/srcpkgs/firebird/template b/srcpkgs/firebird/template index 44066514d5..c7dd663d27 100644 --- a/srcpkgs/firebird/template +++ b/srcpkgs/firebird/template @@ -17,8 +17,7 @@ distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}/${version%.*}-Release/${pkg checksum=8e416f2f9a8f1fce2aa872925ca2016010878265ec56fe0a32a73e0080378826 disable_parallel_build=yes -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CXXFLAGS="-Wno-error=narrowing -fcheck-new -fno-delete-null-pointer-checks -fno-lifetime-dse" fi diff --git a/srcpkgs/firefox-esr/template b/srcpkgs/firefox-esr/template index ca8abc3669..7ea62c46e8 100644 --- a/srcpkgs/firefox-esr/template +++ b/srcpkgs/firefox-esr/template @@ -29,8 +29,7 @@ conflicts="firefox>=0" CXXFLAGS="-std=c++11" -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then # Append CFLAGS and CXXFLAGS to set work around code which gcc6 would # otherwise regard as out-of-specification and allow it to produce a # working program. diff --git a/srcpkgs/firefox/template b/srcpkgs/firefox/template index e2e6c7a5b6..ba2efe0050 100644 --- a/srcpkgs/firefox/template +++ b/srcpkgs/firefox/template @@ -34,8 +34,7 @@ case "$XBPS_TARGET_MACHINE" in x86_64*) build_options_default+=" rust" ;; esac -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then # Append CFLAGS and CXXFLAGS to set work around code which gcc6 would # otherwise regard as out-of-specification and allow it to produce a # working program. diff --git a/srcpkgs/icecat/template b/srcpkgs/icecat/template index 9840868de4..26e4a08a54 100644 --- a/srcpkgs/icecat/template +++ b/srcpkgs/icecat/template @@ -30,8 +30,7 @@ CFLAGS+="\ -I${XBPS_CROSS_BASE}/usr/include/nss" CXXFLAGS="${CFLAGS}" -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then # Append CFLAGS and CXXFLAGS to set work around code which gcc6 would # otherwise regard as out-of-specification and allow it to produce a # working program. diff --git a/srcpkgs/irrlicht/template b/srcpkgs/irrlicht/template index 89180f4e53..d8b1c5b1a7 100644 --- a/srcpkgs/irrlicht/template +++ b/srcpkgs/irrlicht/template @@ -11,8 +11,7 @@ homepage="http://irrlicht.sourceforge.net" distfiles="${SOURCEFORGE_SITE}/${pkgname}/${pkgname}-${version}.zip" checksum=9e7be44277bf2004d73580a8585e7bd3c9ce9a3c801691e4f4aed030ac68931c -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CXXFLAGS="-Wno-error=narrowing" fi diff --git a/srcpkgs/libdvbpsi/template b/srcpkgs/libdvbpsi/template index 64c615cedb..5c84665cb8 100644 --- a/srcpkgs/libdvbpsi/template +++ b/srcpkgs/libdvbpsi/template @@ -11,8 +11,7 @@ distfiles="http://download.videolan.org/pub/libdvbpsi/${version}/${pkgname}-${ve checksum=22436366beaa1bff27b3f6d80e43de1012b16d3b63b1e22d37d4a6fcb5db8933 CFLAGS="-Wno-error=cast-qual" -_gccver=$(gcc --version|awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then # Disable error for gcc6 warning -Wmisleading-indentation CFLAGS+=" -Wno-error=misleading-indentation" fi diff --git a/srcpkgs/libogre/template b/srcpkgs/libogre/template index 6bdc5ecd78..e20b522004 100644 --- a/srcpkgs/libogre/template +++ b/srcpkgs/libogre/template @@ -23,8 +23,7 @@ checksum=e14c80e7d6e3f6af8176f79009db6f7c6b5a32d951da6ecb745f505e13889bc6 wrksrc="sinbad-ogre-${_hgrev:0:12}" make_build_target="all OgreDoc" -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CXXFLAGS="-fcheck-new -fno-delete-null-pointer-checks -fno-lifetime-dse" fi diff --git a/srcpkgs/nautilus-sendto/template b/srcpkgs/nautilus-sendto/template index 37a11702ec..6d13a9a183 100644 --- a/srcpkgs/nautilus-sendto/template +++ b/srcpkgs/nautilus-sendto/template @@ -19,8 +19,7 @@ if [ -z "$CROSS_BUILD" ]; then build_options_default="gir" fi -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CFLAGS="-Wno-error=format-nonliteral" fi diff --git a/srcpkgs/nautilus/template b/srcpkgs/nautilus/template index ccdc81d1d5..1e7617aee6 100644 --- a/srcpkgs/nautilus/template +++ b/srcpkgs/nautilus/template @@ -21,8 +21,7 @@ if [ -z "$CROSS_BUILD" ]; then build_options_default="gir" fi -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CFLAGS="-Wno-error=format-nonliteral" fi diff --git a/srcpkgs/network-manager-applet/template b/srcpkgs/network-manager-applet/template index 0ebb66ec1c..2eb83ae39a 100644 --- a/srcpkgs/network-manager-applet/template +++ b/srcpkgs/network-manager-applet/template @@ -29,8 +29,7 @@ if [ -z "$CROSS_BUILD" ]; then fi CFLAGS="-O2 -pipe" -_gccver=$(gcc --version|awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then # Fix gcc6 build error for warning -Wmisleading-indentation CFLAGS+=" -Wno-error=misleading-indentation" fi diff --git a/srcpkgs/openexr/template b/srcpkgs/openexr/template index 8f14211fbc..8377aa16cb 100644 --- a/srcpkgs/openexr/template +++ b/srcpkgs/openexr/template @@ -14,8 +14,7 @@ checksum="36a012f6c43213f840ce29a8b182700f6cf6b214bea0d5735594136b44914231" LDFLAGS="-lrt" -_gccver="$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }')" -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then case "$XBPS_TARGET_MACHINE" in *-musl) # gcc6 fails with internal error CFLAGS="-Os" diff --git a/srcpkgs/openjdk/template b/srcpkgs/openjdk/template index 5983df8a54..cc4a752c8b 100644 --- a/srcpkgs/openjdk/template +++ b/srcpkgs/openjdk/template @@ -129,8 +129,7 @@ alternatives=" " CFLAGS="-Wno-error=deprecated-declarations" -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then # Append CFLAGS to set work around code which gcc6 would # otherwise regard as out-of-specification and allow it # to produce a working program. diff --git a/srcpkgs/pkg-config/template b/srcpkgs/pkg-config/template index b6b3890433..a6053f0947 100644 --- a/srcpkgs/pkg-config/template +++ b/srcpkgs/pkg-config/template @@ -14,7 +14,6 @@ license="GPL-2" distfiles="http://pkgconfig.freedesktop.org/releases/$pkgname-$version.tar.gz" checksum=beb43c9e064555469bd4390dcfd8030b1536e0aa103f08d7abf7ae8cac0cb001 -_gccver=$(gcc --version | awk '/gcc \(GCC\)/{ print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CFLAGS="-Wno-error=format-nonliteral" fi diff --git a/srcpkgs/qt5-webkit/template b/srcpkgs/qt5-webkit/template index e970f74717..9472962578 100644 --- a/srcpkgs/qt5-webkit/template +++ b/srcpkgs/qt5-webkit/template @@ -16,8 +16,7 @@ homepage="https://www.qt.io/" distfiles="https://download.qt.io/community_releases/${version%.*}/${version}/qtwebkit-opensource-src-${version}.tar.xz" checksum=528a6b8b1c5095367b26e8ce4f3a46bb739e2e9913ff4dfc6ef58a04fcd73966 -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CXXFLAGS="-fno-delete-null-pointer-checks" fi diff --git a/srcpkgs/qt5/template b/srcpkgs/qt5/template index 9195041cb0..173e58c9c0 100644 --- a/srcpkgs/qt5/template +++ b/srcpkgs/qt5/template @@ -130,8 +130,7 @@ _create_config() { } pre_configure() { - local _gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') - if [ "${_gccver%%.*}" -gt 5 ]; then + if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then CXXFLAGS+=" -fno-delete-null-pointer-checks" fi diff --git a/srcpkgs/thunderbird/template b/srcpkgs/thunderbird/template index bedc89cd78..9ffca702b4 100644 --- a/srcpkgs/thunderbird/template +++ b/srcpkgs/thunderbird/template @@ -22,8 +22,7 @@ makedepends=" libSM-devel libXScrnSaver-devel libXt-devel libXdamage-devel" depends="desktop-file-utils hicolor-icon-theme" -_gccver=$(gcc --version | awk '/^gcc \(GCC\)/ { print $3 }') -if [ "${_gccver%%.*}" -gt 5 ]; then +if [ ${XBPS_GCC_VERSION_MAJOR} -gt 5 ]; then # Append CFLAGS and CXXFLAGS to set work around code which gcc6 would # otherwise regard as out-of-specification and allow it to produce a # working program. diff --git a/xbps-src b/xbps-src index 0dd85e8dc3..03ac79d3be 100755 --- a/xbps-src +++ b/xbps-src @@ -403,6 +403,10 @@ readonly XBPS_VERSION_REQ="0.46" readonly XBPS_VERSION=$(xbps-uhelper -V|awk '{print $2}') readonly XBPS_SRC_VERSION="113" export XBPS_MACHINE=$(xbps-uhelper arch) +readonly XBPS_GCC_VERSION_MAJOR=4 +readonly XBPS_GCC_VERSION_MINOR=9 +readonly XBPS_GCC_VERSION_BUILD=4 +readonly XBPS_GCC_VERSION=${XBPS_GCC_VERSION_MAJOR}.${XBPS_GCC_VERSION_MINOR}.${XBPS_GCC_VERSION_BUILD} # # main()