From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 9A3491385D1 for ; Mon, 21 Jan 2013 18:40:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 63AE521C0D0; Mon, 21 Jan 2013 18:39:41 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id E107421C0D0 for ; Mon, 21 Jan 2013 18:39:40 +0000 (UTC) Received: from flycatcher.gentoo.org (flycatcher.gentoo.org [81.93.255.6]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id BE3C933DA56 for ; Mon, 21 Jan 2013 18:39:39 +0000 (UTC) Received: by flycatcher.gentoo.org (Postfix, from userid 559) id 81BA72171D; Mon, 21 Jan 2013 18:39:38 +0000 (UTC) From: "Mike Frysinger (vapier)" To: gentoo-commits@lists.gentoo.org Reply-To: gentoo-dev@lists.gentoo.org, vapier@gentoo.org Subject: [gentoo-commits] gentoo-x86 commit in dev-libs/nss: nss-3.14.1.ebuild ChangeLog X-VCS-Repository: gentoo-x86 X-VCS-Files: nss-3.14.1.ebuild ChangeLog X-VCS-Directories: dev-libs/nss X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Message-Id: <20130121183938.81BA72171D@flycatcher.gentoo.org> Date: Mon, 21 Jan 2013 18:39:38 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 61a173e2-c372-4cb0-9406-c39bfde36461 X-Archives-Hash: a5d970d9b80a66470a94e66ca5f21133 vapier 13/01/21 18:39:38 Modified: nss-3.14.1.ebuild ChangeLog Log: Get cross-compiling working #436216 by Ambroz Bizjak. (Portage version: 2.2.0_alpha144/cvs/Linux x86_64, signed Manifest commit with key FB7C4156) Revision Changes Path 1.9 dev-libs/nss/nss-3.14.1.ebuild file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/nss/nss-3.14.1.ebuild?rev=1.9&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/nss/nss-3.14.1.ebuild?rev=1.9&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/nss/nss-3.14.1.ebuild?r1=1.8&r2=1.9 Index: nss-3.14.1.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/dev-libs/nss/nss-3.14.1.ebuild,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- nss-3.14.1.ebuild 21 Jan 2013 16:27:27 -0000 1.8 +++ nss-3.14.1.ebuild 21 Jan 2013 18:39:38 -0000 1.9 @@ -1,6 +1,6 @@ # Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/nss/nss-3.14.1.ebuild,v 1.8 2013/01/21 16:27:27 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/nss/nss-3.14.1.ebuild,v 1.9 2013/01/21 18:39:38 vapier Exp $ EAPI=3 inherit eutils flag-o-matic multilib toolchain-funcs @@ -40,7 +40,7 @@ cd "${S}"/mozilla/security/coreconf || die # hack nspr paths - echo 'INCLUDES += -I'"${EPREFIX}"'/usr/include/nspr -I$(DIST)/include/dbm' \ + echo 'INCLUDES += -I$(DIST)/include/dbm' \ >> headers.mk || die "failed to append include" # modify install path @@ -59,6 +59,13 @@ epatch "${FILESDIR}/nss-3.13.1-solaris-gcc.patch" + # use host shlibsign if need be #436216 + if tc-is-cross-compiler ; then + sed -i \ + -e 's:"${2}"/shlibsign:shlibsign:' \ + "${S}"/mozilla/security/nss/cmd/shlibsign/sign.sh || die + fi + # dirty hack cd "${S}"/mozilla/security/nss || die sed -i -e "/CRYPTOLIB/s:\$(SOFTOKEN_LIB_DIR):../freebl/\$(OBJDIR):" \ @@ -67,34 +74,78 @@ cmd/platlibs.mk || die } -src_compile() { - strip-flags +nssarch() { + # Most of the arches are the same as $ARCH + local t=${1:-${CHOST}} + case ${t} in + hppa*) echo "parisc";; + i?86*) echo "i686";; + x86_64*) echo "x86_64";; + *) tc-arch ${t};; + esac +} +nssbits() { echo > "${T}"/test.c || die - $(tc-getCC) ${CFLAGS} -c "${T}"/test.c -o "${T}"/test.o || die + ${!1} ${CPPFLAGS} ${CFLAGS} -c "${T}"/test.c -o "${T}"/test.o || die case $(file "${T}"/test.o) in - *32-bit*x86-64*) export USE_x32=1;; - *64-bit*|*ppc64*|*x86_64*) export USE_64=1;; + *32-bit*x86-64*) echo USE_x32=1;; + *64-bit*|*ppc64*|*x86_64*) echo USE_64=1;; *32-bit*|*ppc*|*i386*) ;; *) die "Failed to detect whether your arch is 64bits or 32bits, disable distcc if you're using it, please";; esac +} + +src_compile() { + strip-flags + + tc-export AR RANLIB {BUILD_,}{CC,PKG_CONFIG} + local makeargs=( + CC="${CC}" + AR="${AR} rc \$@" + RANLIB="${RANLIB}" + OPTIMIZER= + $(nssbits CC) + ) + + # Take care of nspr settings #436216 + append-cppflags $(${PKG_CONFIG} nspr --cflags) + append-ldflags $(${PKG_CONFIG} nspr --libs-only-L) + unset NSPR_INCLUDE_DIR + export NSPR_LIB_DIR=${T}/fake-dir + + # Do not let `uname` be used. + if use kernel_linux ; then + makeargs+=( + OS_TARGET=Linux + OS_RELEASE=2.6 + OS_TEST="$(nssarch)" + ) + fi - export NSPR_INCLUDE_DIR=`nspr-config --includedir` - export NSPR_LIB_DIR=`nspr-config --libdir` export BUILD_OPT=1 export NSS_USE_SYSTEM_SQLITE=1 export NSDISTMODE=copy export NSS_ENABLE_ECC=1 - export XCFLAGS="${CFLAGS}" + export XCFLAGS="${CFLAGS} ${CPPFLAGS}" export FREEBL_NO_DEPEND=1 export ASFLAGS="" - cd "${S}"/mozilla/security/coreconf || die - emake -j1 CC="$(tc-getCC)" || die "coreconf make failed" - cd "${S}"/mozilla/security/dbm || die - emake -j1 CC="$(tc-getCC)" || die "dbm make failed" - cd "${S}"/mozilla/security/nss || die - emake -j1 CC="$(tc-getCC)" || die "nss make failed" + local d + + # Build the host tools first. + LDFLAGS="${BUILD_LDFLAGS}" \ + XCFLAGS="${BUILD_CFLAGS}" \ + emake -j1 -C mozilla/security/coreconf \ + CC="${BUILD_CC}" \ + $(nssbits BUILD_CC) \ + || die + makeargs+=( NSINSTALL="${PWD}/$(find -type f -name nsinstall)" ) + + # Then build the target tools. + for d in dbm nss ; do + emake -j1 "${makeargs[@]}" -C mozilla/security/${d} || die "${d} make failed" + done } # Altering these 3 libraries breaks the CHK verification. @@ -118,6 +169,7 @@ local libdir="$2" einfo "Resigning core NSS libraries for FIPS validation" shift 2 + local i for i in ${NSS_CHK_SIGN_LIBS} ; do local libname=lib${i}.so local chkname=lib${i}.chk @@ -134,6 +186,7 @@ cleanup_chk() { local libdir="$1" shift 1 + local i for i in ${NSS_CHK_SIGN_LIBS} ; do local libfname="${libdir}/lib${i}.so" # If the major version has changed, then we have old chk files. @@ -162,7 +215,7 @@ insinto /usr/include/nss doins public/nss/*.h || die cd "${ED}"/usr/$(get_libdir) || die - local n= + local n file for file in *$(get_libname); do n=${file%$(get_libname)}$(get_libname ${MINOR_VERSION}) mv ${file} ${n} || die @@ -172,7 +225,7 @@ fi done - local nssutils + local f nssutils # Always enabled because we need it for chk generation. nssutils="shlibsign" if use utils; then @@ -192,7 +245,7 @@ # Prelink breaks the CHK files. We don't have any reliable way to run # shlibsign after prelink. - declare -a libs + local l libs=() for l in ${NSS_CHK_SIGN_LIBS} ; do libs+=("${EPREFIX}/usr/$(get_libdir)/lib${l}.so") done @@ -204,7 +257,13 @@ pkg_postinst() { # We must re-sign the libraries AFTER they are stripped. - generate_chk "${EROOT}"/usr/bin/shlibsign "${EROOT}"/usr/$(get_libdir) + local shlibsign="${EROOT}/usr/bin/shlibsign" + # See if we can execute it (cross-compiling & such). #436216 + "${shlibsign}" -h >&/dev/null + if [[ $? -gt 1 ]] ; then + shlibsign="shlibsign" + fi + generate_chk "${shlibsign}" "${EROOT}"/usr/$(get_libdir) } pkg_postrm() { 1.280 dev-libs/nss/ChangeLog file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/nss/ChangeLog?rev=1.280&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/nss/ChangeLog?rev=1.280&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/dev-libs/nss/ChangeLog?r1=1.279&r2=1.280 Index: ChangeLog =================================================================== RCS file: /var/cvsroot/gentoo-x86/dev-libs/nss/ChangeLog,v retrieving revision 1.279 retrieving revision 1.280 diff -u -r1.279 -r1.280 --- ChangeLog 21 Jan 2013 16:27:27 -0000 1.279 +++ ChangeLog 21 Jan 2013 18:39:38 -0000 1.280 @@ -1,6 +1,9 @@ # ChangeLog for dev-libs/nss # Copyright 1999-2013 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/dev-libs/nss/ChangeLog,v 1.279 2013/01/21 16:27:27 ago Exp $ +# $Header: /var/cvsroot/gentoo-x86/dev-libs/nss/ChangeLog,v 1.280 2013/01/21 18:39:38 vapier Exp $ + + 21 Jan 2013; Mike Frysinger nss-3.14.1.ebuild: + Get cross-compiling working #436216 by Ambroz Bizjak. 21 Jan 2013; Agostino Sarubbo nss-3.14.1.ebuild: Stable for sparc, wrt bug #450940