# Copyright 1999-2009 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 inherit autotools mount-boot eutils flag-o-matic toolchain-funcs bzr EBZR_REPO_URI="lp:burg" SRC_URI="" DESCRIPTION="Brand-new Universal loadeR from Grub" HOMEPAGE="https://code.launchpad.net/burg" LICENSE="GPL-3" SLOT="0" KEYWORDS="~x86 ~amd64" IUSE="efi macos custom-cflags debug static" RDEPEND=">=sys-libs/ncurses-5.2-r5 dev-libs/lzo" DEPEND="${RDEPEND} media-libs/freetype:2 dev-lang/ruby" PROVIDE="virtual/bootloader" export STRIP_MASK="*/grub/*/*.mod" QA_EXECSTACK="sbin/grub-probe sbin/grub-setup" src_unpack() { bzr_src_unpack cd "${S}" epatch "${FILESDIR}"/${PN}-genkernel.patch #256335 epatch_user # autogen.sh does more than just run autotools sed -i -e 's:^auto:eauto:' autogen.sh (. ./autogen.sh) || die } src_compile() { use custom-cflags || unset CFLAGS CPPFLAGS LDFLAGS use static && append-ldflags -static # --disable-mm-debug breaks the compilation at the moment, so we don't use # use_enable with it... # The USE flag macos is provided for testing purposes, but may not be really # useful. Setting this flag will prevent the installation of the grub-mkconfig # helper script /etc/grub.d/10_linux econf \ --sbindir=/sbin \ --bindir=/bin \ --libdir=/$(get_libdir) \ --disable-werror \ --enable-grub-mkfont \ $(use efi && echo --with-platform=efi) \ $(use macos && echo --host=$(uname -m)-apple) \ $(use_enable !efi efiemu) \ $(use debug && echo --enable-mm-debug) \ $(use_enable debug grub-emu) \ $(use_enable debug grub-emu-usb) \ $(use_enable debug grub-fstest) emake || die "making regular stuff" } src_install() { emake DESTDIR="${D}" install || die dodoc AUTHORS ChangeLog NEWS README THANKS TODO cat <<-EOF >> "${D}"/lib*/grub/grub-mkconfig_lib GRUB_DISTRIBUTOR="Gentoo" EOF } setup_boot_dir() { local boot_dir=$1 local dir=${boot_dir}/grub if [[ ! -e ${dir}/grub.cfg ]] ; then einfo "Running: grub-mkconfig -o '${dir}/grub.cfg'" grub-mkconfig -o "${dir}/grub.cfg" fi #local install=grub-install #use multislot && install="grub2-install --grub-setup=/bin/true" #einfo "Running: ${install} " #${install} } pkg_postinst() { setup_boot_dir "${ROOT}"boot }