diff options
author | 2011-05-30 15:20:20 +0200 | |
---|---|---|
committer | 2011-05-30 15:20:20 +0200 | |
commit | f636811e4dcdd14a9196d36e04fa4cc742ac83d2 (patch) | |
tree | 2eccc72b8d9d81a6e365e212ef508e32df24e9c4 | |
parent | [sys-boot/grub] Rework the default file for the grub. (diff) | |
download | scarabeus-f636811e4dcdd14a9196d36e04fa4cc742ac83d2.tar.gz scarabeus-f636811e4dcdd14a9196d36e04fa4cc742ac83d2.tar.bz2 scarabeus-f636811e4dcdd14a9196d36e04fa4cc742ac83d2.zip |
[sys-boot/grub] Add USE_EXPAND for platform. TODO: somehow make it not fail so we detect what useflag is possible on what cpu.
-rw-r--r-- | sys-boot/grub/Manifest | 4 | ||||
-rw-r--r-- | sys-boot/grub/grub-1.99.ebuild | 104 | ||||
-rw-r--r-- | sys-boot/grub/grub-9999.ebuild | 104 |
3 files changed, 176 insertions, 36 deletions
diff --git a/sys-boot/grub/Manifest b/sys-boot/grub/Manifest index e99e876..31425b7 100644 --- a/sys-boot/grub/Manifest +++ b/sys-boot/grub/Manifest @@ -1,5 +1,5 @@ AUX grub.default 1127 RMD160 a884e842cb203687cac4cac6551b0feed58d3b7a SHA1 5878147845b5d4b4aac34ce046ead60b93c3170c SHA256 32664f2e0bdd05cf9579f8e098aa0add76ef7bf7b37eb103c6d0f625204f44d3 DIST grub-1.99.tar.xz 2639224 RMD160 d59a47fa40b2be0d5ea5b2b00ff5538cfa147747 SHA1 a5ae9558f30ce7757a76aa130088b053a87e2fb6 SHA256 f308148d4c83c6f16a73b58a0cd39381656edb740929028cae7ad5f0d651021b -EBUILD grub-1.99.ebuild 4015 RMD160 35212619b0ec881a665bcd481062e7e640071cfe SHA1 bdff1287700e0da8a16f7d079dd04ed9c75e96e5 SHA256 8a312c21f31e6dda4c80fd52b3178b28a9284c186015f430483779637088d922 -EBUILD grub-9999.ebuild 4015 RMD160 35212619b0ec881a665bcd481062e7e640071cfe SHA1 bdff1287700e0da8a16f7d079dd04ed9c75e96e5 SHA256 8a312c21f31e6dda4c80fd52b3178b28a9284c186015f430483779637088d922 +EBUILD grub-1.99.ebuild 5608 RMD160 7d5fc5f793e025bc271077c02d5942f19a2f2a61 SHA1 7a6087fd1c58d6566b5eab0faecf4b192b1502dd SHA256 b68ca2209a986c683177e8abb2f5c98d25820a919388880e52eeb82b5f339c9e +EBUILD grub-9999.ebuild 5608 RMD160 7d5fc5f793e025bc271077c02d5942f19a2f2a61 SHA1 7a6087fd1c58d6566b5eab0faecf4b192b1502dd SHA256 b68ca2209a986c683177e8abb2f5c98d25820a919388880e52eeb82b5f339c9e MISC metadata.xml 264 RMD160 3cb995676f964b9637fbfc0027a81b9409802608 SHA1 c4d35e3a71c545cdf1aae525de803126bf54f596 SHA256 9bd1ce830cf1b821978ab90c81b2e369177a8d7c1bfe2dd2868419872c097f64 diff --git a/sys-boot/grub/grub-1.99.ebuild b/sys-boot/grub/grub-1.99.ebuild index a00a605..2d41728 100644 --- a/sys-boot/grub/grub-1.99.ebuild +++ b/sys-boot/grub/grub-1.99.ebuild @@ -2,9 +2,6 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: $ -# FIXME: somehow depend on python-2 only; using python eclass maybe? -# NOTE: good idea would be to move grub-2 to new package called grub2 - EAPI=4 if [[ ${PV} == "9999" ]] ; then @@ -29,6 +26,12 @@ SLOT="0" [[ ${PV} != "9999" ]] && KEYWORDS="~amd64 ~x86" IUSE="custom-cflags debug device-mapper nls static sdl truetype" +GRUB_PLATFORMS="coreboot efi emu ieee1275 pc qemu yeeloong" +for i in ${GRUB_PLATFORMS}; do + IUSE+=" grub_platform_${i}" +done +unset i + # os-prober: Used on runtime to detect other OSes # xorriso (dev-libs/libisoburn): Used on runtime for mkrescue RDEPEND=" @@ -59,23 +62,34 @@ QA_EXECSTACK=" bin/grub-fstest " -DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) +grub_run_phase() { + local phase=$1 + local platform=$2 + [[ -z ${phase} ]] && die "${FUNCNAME}: Phase is undefined" + [[ -z ${platform} ]] && die "${FUNCNAME}: Platform is undefined" -src_prepare() { - epatch_user + [[ -d "${WORKDIR}/build-${platform}" ]] || \ + { mkdir "${WORKDIR}/build-${platform}" || die ; } + pushd "${WORKDIR}/build-${platform}" > /dev/null || die - # autogen.sh does more than just run autotools - if [[ ${PV} == "9999" ]] ; then - sed -i -e '/^autoreconf/ d' autogen.sh || die - (. ./autogen.sh) || die - eautoreconf - fi + echo ">>> Running ${phase} for platform \"${platform}\"" + echo ">>> Working in: \"${WORKDIR}/build-${platform}\"" + + grub_${phase} ${platform} + + popd > /dev/null || die } -src_configure() { - use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS - use static && append-ldflags -static +grub_src_configure() { + local platform=$1 + [[ -z ${platform} ]] && die "${FUNCNAME}: Platform is undefined" + + [[ ${platform} == "guessed" ]] \ + && platform="" \ + || platform="--with-platform=${platform}" + + ECONF_SOURCE="${WORKDIR}/${P}/" \ econf \ --disable-werror \ --sbindir=/sbin \ @@ -87,12 +101,68 @@ src_configure() { $(use_enable nls) \ $(use_enable debug mm-debug) \ $(use sdl && use_enable debug grub-emu-sdl) \ - $(use_enable debug grub-emu-usb) + $(use_enable debug grub-emu-usb) \ + ${platform} +} + +grub_src_compile() { + default_src_compile +} + +grub_src_install() { + default_src_install +} + +src_prepare() { + local i + + epatch_user + + # autogen.sh does more than just run autotools + if [[ ${PV} == "9999" ]] ; then + sed -i -e '/^autoreconf/ d' autogen.sh || die + (. ./autogen.sh) || die + eautoreconf + fi + + # get enabled platforms + GRUB_ENABLED_PLATFORMS="" + for i in ${GRUB_PLATFORMS}; do + use grub_platform_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}" + done +} + +src_configure() { + local i + + use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS + use static && append-ldflags -static + + [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed + for i in ${GRUB_ENABLED_PLATFORMS}; do + grub_run_phase ${FUNCNAME} ${i} + done +} + +src_compile() { + local i + + [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed + for i in ${GRUB_ENABLED_PLATFORMS}; do + grub_run_phase ${FUNCNAME} ${i} + done } src_install() { - default + local i + + [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed + for i in ${GRUB_ENABLED_PLATFORMS}; do + grub_run_phase ${FUNCNAME} ${i} + done + # can't be in docs array as we use defualt_src_install in different builddir + dodoc AUTHORS ChangeLog NEWS README THANKS TODO insinto /etc/default newins "${FILESDIR}"/grub.default grub cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib diff --git a/sys-boot/grub/grub-9999.ebuild b/sys-boot/grub/grub-9999.ebuild index a00a605..2d41728 100644 --- a/sys-boot/grub/grub-9999.ebuild +++ b/sys-boot/grub/grub-9999.ebuild @@ -2,9 +2,6 @@ # Distributed under the terms of the GNU General Public License v2 # $Header: $ -# FIXME: somehow depend on python-2 only; using python eclass maybe? -# NOTE: good idea would be to move grub-2 to new package called grub2 - EAPI=4 if [[ ${PV} == "9999" ]] ; then @@ -29,6 +26,12 @@ SLOT="0" [[ ${PV} != "9999" ]] && KEYWORDS="~amd64 ~x86" IUSE="custom-cflags debug device-mapper nls static sdl truetype" +GRUB_PLATFORMS="coreboot efi emu ieee1275 pc qemu yeeloong" +for i in ${GRUB_PLATFORMS}; do + IUSE+=" grub_platform_${i}" +done +unset i + # os-prober: Used on runtime to detect other OSes # xorriso (dev-libs/libisoburn): Used on runtime for mkrescue RDEPEND=" @@ -59,23 +62,34 @@ QA_EXECSTACK=" bin/grub-fstest " -DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO ) +grub_run_phase() { + local phase=$1 + local platform=$2 + [[ -z ${phase} ]] && die "${FUNCNAME}: Phase is undefined" + [[ -z ${platform} ]] && die "${FUNCNAME}: Platform is undefined" -src_prepare() { - epatch_user + [[ -d "${WORKDIR}/build-${platform}" ]] || \ + { mkdir "${WORKDIR}/build-${platform}" || die ; } + pushd "${WORKDIR}/build-${platform}" > /dev/null || die - # autogen.sh does more than just run autotools - if [[ ${PV} == "9999" ]] ; then - sed -i -e '/^autoreconf/ d' autogen.sh || die - (. ./autogen.sh) || die - eautoreconf - fi + echo ">>> Running ${phase} for platform \"${platform}\"" + echo ">>> Working in: \"${WORKDIR}/build-${platform}\"" + + grub_${phase} ${platform} + + popd > /dev/null || die } -src_configure() { - use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS - use static && append-ldflags -static +grub_src_configure() { + local platform=$1 + [[ -z ${platform} ]] && die "${FUNCNAME}: Platform is undefined" + + [[ ${platform} == "guessed" ]] \ + && platform="" \ + || platform="--with-platform=${platform}" + + ECONF_SOURCE="${WORKDIR}/${P}/" \ econf \ --disable-werror \ --sbindir=/sbin \ @@ -87,12 +101,68 @@ src_configure() { $(use_enable nls) \ $(use_enable debug mm-debug) \ $(use sdl && use_enable debug grub-emu-sdl) \ - $(use_enable debug grub-emu-usb) + $(use_enable debug grub-emu-usb) \ + ${platform} +} + +grub_src_compile() { + default_src_compile +} + +grub_src_install() { + default_src_install +} + +src_prepare() { + local i + + epatch_user + + # autogen.sh does more than just run autotools + if [[ ${PV} == "9999" ]] ; then + sed -i -e '/^autoreconf/ d' autogen.sh || die + (. ./autogen.sh) || die + eautoreconf + fi + + # get enabled platforms + GRUB_ENABLED_PLATFORMS="" + for i in ${GRUB_PLATFORMS}; do + use grub_platform_${i} && GRUB_ENABLED_PLATFORMS+=" ${i}" + done +} + +src_configure() { + local i + + use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS + use static && append-ldflags -static + + [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed + for i in ${GRUB_ENABLED_PLATFORMS}; do + grub_run_phase ${FUNCNAME} ${i} + done +} + +src_compile() { + local i + + [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed + for i in ${GRUB_ENABLED_PLATFORMS}; do + grub_run_phase ${FUNCNAME} ${i} + done } src_install() { - default + local i + + [[ -z ${GRUB_ENABLED_PLATFORMS} ]] && grub_run_phase ${FUNCNAME} guessed + for i in ${GRUB_ENABLED_PLATFORMS}; do + grub_run_phase ${FUNCNAME} ${i} + done + # can't be in docs array as we use defualt_src_install in different builddir + dodoc AUTHORS ChangeLog NEWS README THANKS TODO insinto /etc/default newins "${FILESDIR}"/grub.default grub cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib |