From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.105.134.102] (helo=robin.gentoo.org) by nuthatch.gentoo.org with esmtp (Exim 4.43) id 1Dl4iV-0006H8-M3 for garchives@archives.gentoo.org; Wed, 22 Jun 2005 12:52:32 +0000 Received: from robin.gentoo.org (localhost [127.0.0.1]) by robin.gentoo.org (8.13.4/8.13.4) with SMTP id j5MCpwFh028596; Wed, 22 Jun 2005 12:51:58 GMT Received: from mta09-winn.ispmail.ntl.com (mta09-winn.ispmail.ntl.com [81.103.221.49]) by robin.gentoo.org (8.13.4/8.13.4) with ESMTP id j5MCpvkn000132 for ; Wed, 22 Jun 2005 12:51:57 GMT Received: from aamta11-winn.ispmail.ntl.com ([81.103.221.35]) by mta09-winn.ispmail.ntl.com with ESMTP id <20050622125229.QLGD11649.mta09-winn.ispmail.ntl.com@aamta11-winn.ispmail.ntl.com> for ; Wed, 22 Jun 2005 13:52:29 +0100 Received: from zog.reactivated.net ([81.99.81.161]) by aamta11-winn.ispmail.ntl.com with ESMTP id <20050622125229.TZQH11226.aamta11-winn.ispmail.ntl.com@zog.reactivated.net> for ; Wed, 22 Jun 2005 13:52:29 +0100 Received: from [192.168.0.2] (dsd [192.168.0.2]) by zog.reactivated.net (Postfix) with ESMTP id B823273A000 for ; Wed, 22 Jun 2005 14:12:53 +0100 (BST) Message-ID: <42B95F0D.1040408@gentoo.org> Date: Wed, 22 Jun 2005 13:52:29 +0100 From: Daniel Drake User-Agent: Mozilla Thunderbird 1.0.2 (X11/20050403) X-Accept-Language: en-us, en Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-kernel@gentoo.org Reply-to: gentoo-kernel@lists.gentoo.org MIME-Version: 1.0 To: gentoo-kernel@lists.gentoo.org Subject: [gentoo-kernel] kernel-2.eclass: Easier way to use genpatches in ebuilds X-Enigmail-Version: 0.90.2.0 X-Enigmail-Supports: pgp-inline, pgp-mime Content-Type: multipart/mixed; boundary="------------050908090502050900050008" X-Archives-Salt: a114edb8-7fc4-4295-85d7-6c173ed574b8 X-Archives-Hash: a81bddbc658570c003aab7e2d5c565c8 This is a multi-part message in MIME format. --------------050908090502050900050008 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit This provides an easier way for kernel-2 users to apply genpatches. In the attached ebuild example, ck-sources-2.6.12_p2.ebuild, all that is needed is: K_WANT_GENPATCHES="base" K_GENPATCHES_VER="1" The above will translate to genpatches-2.6.12-1.base.tar.bz2 The only other thing you need to do is add $GENPATCHES_URI to SRC_URI and then you will get genpatches applied with unipatch. Any comments? --------------050908090502050900050008 Content-Type: text/x-patch; name="k2.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="k2.patch" Index: kernel-2.eclass =================================================================== RCS file: /var/cvsroot/gentoo-x86/eclass/kernel-2.eclass,v retrieving revision 1.125 diff -u -B -p -r1.125 kernel-2.eclass --- kernel-2.eclass 15 May 2005 20:30:04 -0000 1.125 +++ kernel-2.eclass 22 Jun 2005 12:49:35 -0000 @@ -36,6 +36,11 @@ # # K_DEFCONFIG - Allow specifying a different defconfig target. # If length zero, defaults to "defconfig". +# K_WANT_GENPATCHES - Apply genpatches to kernel source. Provide any +# combination of "base" and "extras" +# K_GENPATCHES_VER - The version of the genpatches tarball(s) to apply. +# A value of "5" would apply genpatches-2.6.12-5 to +# my-sources-2.6.12.ebuild # H_SUPPORTEDARCH - this should be a space separated list of ARCH's which # can be supported by the headers ebuild @@ -71,6 +76,17 @@ LICENSE="GPL-2" #Eclass functions only from here onwards ... #============================================================== +handle_genpatches() { + local tarball + [[ -z ${K_WANT_GENPATCHES} || -z ${K_GENPATCHES_VER} ]] && return -1 + + for i in ${K_WANT_GENPATCHES} ; do + tarball="genpatches-${OKV}-${K_GENPATCHES_VER}.${i}.tar.bz2" + GENPATCHES_URI="${GENPATCHES_URI} mirror://gentoo/${tarball}" + UNIPATCH_LIST_GENPATCHES="${UNIPATCH_LIST_GENPATCHES} ${DISTDIR}/${tarball}" + done +} + detect_version() { # this function will detect and set # - OKV: Original Kernel Version (2.6.0/2.6.0-test11) @@ -185,6 +201,8 @@ detect_version() { mirror://kernel/linux/kernel/v${KV_MAJOR}.${KV_MINOR}/linux-${OKV}.tar.bz2" UNIPATCH_LIST_DEFAULT="${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE/-bk*}.bz2 ${DISTDIR}/patch-${KV_MAJOR}.${KV_MINOR}.${KV_PATCH}${RELEASE}.bz2" fi + + handle_genpatches } kernel_is() { @@ -865,8 +883,8 @@ headers___fix() { kernel-2_src_unpack() { universal_unpack - [[ -n ${UNIPATCH_LIST} ]] || [[ -n ${UNIPATCH_LIST_DEFAULT} ]] && \ - unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST}" + [[ -n ${UNIPATCH_LIST} || -n ${UNIPATCH_LIST_DEFAULT} || -n ${UNIPATCH_LIST_GENPATCHES} ]] && \ + unipatch "${UNIPATCH_LIST_DEFAULT} ${UNIPATCH_LIST_GENPATCHES} ${UNIPATCH_LIST}" [[ -z ${K_NOSETEXTRAVERSION} ]] && unpack_set_extraversion unpack_fix_docbook --------------050908090502050900050008 Content-Type: text/plain; name="ck-sources-2.6.12_p2.ebuild" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ck-sources-2.6.12_p2.ebuild" # Copyright 1999-2005 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/sys-kernel/ck-sources/ck-sources-2.6.11_p10.ebuild,v 1.1 2005/06/13 02:07:56 marineam Exp $ K_PREPATCHED="yes" UNIPATCH_STRICTORDER="yes" K_NOUSENAME="yes" K_WANT_GENPATCHES="base" K_GENPATCHES_VER="1" ETYPE="sources" inherit kernel-2 detect_version # A few hacks to set ck version via _p instead of -r MY_P=${P/_p*/} MY_PR=${PR/r/-r} MY_PR=${MY_PR/-r0/} EXTRAVERSION=-ck${PV/*_p/}${MY_PR} KV_FULL=${OKV}${EXTRAVERSION} KV_CK=${KV_FULL/-r*/} detect_version IUSE="ck-server" if use ck-server; then CK_PATCH="patch-${KV_CK}-server.bz2" else CK_PATCH="patch-${KV_CK}.bz2" fi UNIPATCH_LIST="${DISTDIR}/${CK_PATCH}" DESCRIPTION="Full sources for the Stock Linux kernel and Con Kolivas's high performance patchset" HOMEPAGE="http://members.optusnet.com.au/ckolivas/kernel/" SRC_URI="${KERNEL_URI} ${GENPATCHES_URI} ck-server? ( http://ck.kolivas.org/patches/2.6/${OKV}/${KV_CK}/patch-${KV_CK}-server.bz2 ) !ck-server? ( http://ck.kolivas.org/patches/2.6/${OKV}/${KV_CK}/patch-${KV_CK}.bz2 )" KEYWORDS="~x86 ~amd64" pkg_postinst() { postinst_sources einfo "The ck patchset is tuned for desktop usage." einfo "To better tune the kernel for server applications add" einfo "ck-server to your use flags and reemerge ck-sources" } --------------050908090502050900050008-- -- gentoo-kernel@gentoo.org mailing list