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 C31DB138890 for ; Tue, 5 Feb 2013 20:20:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4F2B421C040; Tue, 5 Feb 2013 20:19:39 +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 34EE721C03C for ; Tue, 5 Feb 2013 20:19:33 +0000 (UTC) Received: from pomiocik.lan (213-238-96-111.adsl.inetia.pl [213.238.96.111]) (using TLSv1 with cipher ECDHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: mgorny) by smtp.gentoo.org (Postfix) with ESMTPSA id 675F633DEB8; Tue, 5 Feb 2013 20:19:31 +0000 (UTC) From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= To: gentoo-dev@lists.gentoo.org Cc: kde@gentoo.org, =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= Subject: [gentoo-dev] [PATCH 2/3] Introduce cmake-multilib wrapper for cmake-utils. Date: Tue, 5 Feb 2013 21:19:23 +0100 Message-Id: <1360095564-18154-3-git-send-email-mgorny@gentoo.org> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1360095564-18154-1-git-send-email-mgorny@gentoo.org> References: <1360095564-18154-1-git-send-email-mgorny@gentoo.org> Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: e7357931-c8bc-4222-b590-9837d71a7dfa X-Archives-Hash: b36648aa8b724624becb65dd48018df4 --- gx86/eclass/cmake-multilib.eclass | 83 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 gx86/eclass/cmake-multilib.eclass diff --git a/gx86/eclass/cmake-multilib.eclass b/gx86/eclass/cmake-multilib.eclass new file mode 100644 index 0000000..9f41e5c --- /dev/null +++ b/gx86/eclass/cmake-multilib.eclass @@ -0,0 +1,83 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/eclass/cmake-multilib.eclass,v 1.8 2013/02/01 21:39:50 mgorny Exp $ + +# @ECLASS: cmake-multilib.eclass +# @MAINTAINER: +# Michał Górny +# @BLURB: cmake-utils wrapper for multilib builds +# @DESCRIPTION: +# The cmake-multilib.eclass is a cmake-utils.eclass(5) wrapper +# introducing support for building for more than one ABI (multilib). +# +# Inheriting this eclass sets IUSE and exports cmake-utils phase +# function wrappers which build the package for each supported ABI +# if the appropriate flag is enabled. +# +# Note that the multilib support requires out-of-source builds to be +# enabled. Thus, it is impossible to use CMAKE_IN_SOURCE_BUILD with +# it. + +# EAPI=5 is required for meaningful MULTILIB_USEDEP. +case ${EAPI:-0} in + 5) ;; + *) die "EAPI=${EAPI} is not supported" ;; +esac + +if [[ ${CMAKE_IN_SOURCE_BUILD} ]]; then + die "${ECLASS}: multilib support requires out-of-source builds." +fi + +inherit cmake-utils multilib-build + +EXPORT_FUNCTIONS src_configure src_compile src_test src_install + +cmake-multilib_src_configure() { + multilib_parallel_foreach_abi cmake-utils_src_configure +} + +cmake-multilib_src_compile() { + multilib_foreach_abi cmake-utils_src_compile +} + +cmake-multilib_src_test() { + multilib_foreach_abi cmake-utils_src_test +} + +cmake-multilib_src_install() { + cmake-multilib_secure_install() { + cmake-utils_src_install + + # Make sure all headers are the same for each ABI. + cmake-multilib_cksum() { + find "${ED}"usr/include -type f \ + -exec cksum {} + | sort -k2 + } + + local cksum=$(cmake-multilib_cksum) + local cksum_file=${T}/.cmake-multilib_cksum + + if [[ -f ${cksum_file} ]]; then + local cksum_prev=$(< "${cksum_file}") + + if [[ ${cksum} != ${cksum_prev} ]]; then + echo "${cksum}" > "${cksum_file}.new" + + eerror "Header files have changed between ABIs." + + if type -p diff &>/dev/null; then + eerror "$(diff -du "${cksum_file}" "${cksum_file}.new")" + else + eerror "Old checksums in: ${cksum_file}" + eerror "New checksums in: ${cksum_file}.new" + fi + + die "Header checksum mismatch, aborting." + fi + else + echo "${cksum}" > "${cksum_file}" + fi + } + + multilib_foreach_abi cmake-multilib_secure_install +} -- 1.8.1.2