summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Kuhn (Wuodan) <wuodan-gentoo@hispeed.ch>2012-09-04 00:42:03 +0200
committerStefan Kuhn (Wuodan) <wuodan-gentoo@hispeed.ch>2012-09-04 00:42:03 +0200
commitae1210c027c577f544c59b7144c5b3b9fbd45b74 (patch)
treefdf8e34c4a8e4d32051c615de90b9ee444ca2381
parentsys-firmware/edk2 : work in progress, but compiles/runs here (diff)
downloadwuodan-ae1210c027c577f544c59b7144c5b3b9fbd45b74.tar.gz
wuodan-ae1210c027c577f544c59b7144c5b3b9fbd45b74.tar.bz2
wuodan-ae1210c027c577f544c59b7144c5b3b9fbd45b74.zip
sys-firmware/edk2 : tested update
-rw-r--r--sys-firmware/edk2/.edk2-0.ebuild.swpbin0 -> 20480 bytes
-rw-r--r--sys-firmware/edk2/Manifest4
-rw-r--r--sys-firmware/edk2/edk2-0.ebuild94
-rw-r--r--sys-firmware/edk2/metadata.xml1
4 files changed, 56 insertions, 43 deletions
diff --git a/sys-firmware/edk2/.edk2-0.ebuild.swp b/sys-firmware/edk2/.edk2-0.ebuild.swp
new file mode 100644
index 0000000..c974705
--- /dev/null
+++ b/sys-firmware/edk2/.edk2-0.ebuild.swp
Binary files differ
diff --git a/sys-firmware/edk2/Manifest b/sys-firmware/edk2/Manifest
index daf33a6..ff83e67 100644
--- a/sys-firmware/edk2/Manifest
+++ b/sys-firmware/edk2/Manifest
@@ -1,2 +1,2 @@
-EBUILD edk2-0.ebuild 6237 SHA256 f423e0d4cf707316399b09f5e3ec9a325943ee831d10468f614be070e99ec886 SHA512 1b991d1916f1fe5dca976c5d0242281dd8bb2b3ed3696624e5fac2c17ee15862524537545f3c92f8ff4afbd8e751d3282d1b2879968b0186cb7067dcd7453b69 WHIRLPOOL 1c3fda85a8c39eed60a8bdd83532de92664df8b12e30d43b9f9060eba4e1f96f9742c41f780d0b7bd884e43026145ae96ea259fba5e3584732861c4bbb2123a5
-MISC metadata.xml 634 SHA256 926504f700c193cd127263da7e38869bbc5a79260811fd0ebb49097d576e5191 SHA512 184cbcc668a57b07238e13fa7a4c3a15cb9c277265bd3071324e97d7f9c89a7a5eff37e393335a338381d7ee3cdb2626495f9e91b53b3fc06cf77b0fc36d45a8 WHIRLPOOL 7dc634a6befd693939988d936abb225861b2a6077084edfa64df1150e9b2054f11c33ee108faa5588395dfcdefe6056ab74f16ddd46cec096b04731afbe7b0da
+EBUILD edk2-0.ebuild 6593 SHA256 fd4de6f4bda7617cf2ee6a1bd206f6f02427b5ea1e03da8a4cb276ca5769172f SHA512 6b28c198b9d43214b7fec44e4e8e9da3884fbc041e17f93c9a401761a06d0d027eb70e724357f6f7d2905e0688b2290cfecbf43349690d822344e1838485a97c WHIRLPOOL 3bbe22583f99e73b83b173d96cad25e40fabb335a945d3d7ddccebb862a3e6e80031d4b911d9ba1f6c122afecbae392cf73387961c365612796d8a439a1a9ce8
+MISC metadata.xml 713 SHA256 370cd2807e54e5596c488a0511e6b99d39934b44aa8b51a31fb4bd180cbb9bc2 SHA512 1cdf87a9e05d880568438e4b20c2500bae285aa7d98c98b925149344e8b2521385e06099d27caeb8c2bb05803cf9579f067c8c3810e999c05594151c01dfb464 WHIRLPOOL 554c7163858f7b63793fbdaae8fede3453043a53288858f2c15ccc813edf357992ce987032523e56c3cf629311c8e526e6ebce6df349a1d55f9fbade6e01a744
diff --git a/sys-firmware/edk2/edk2-0.ebuild b/sys-firmware/edk2/edk2-0.ebuild
index 2f5c80e..ce2a9ce 100644
--- a/sys-firmware/edk2/edk2-0.ebuild
+++ b/sys-firmware/edk2/edk2-0.ebuild
@@ -15,28 +15,12 @@ REPO_REV="@11337"
# REPO_REV="@13452"
# REPO_REV="@13692"
ESVN_REPO_URI="http://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2"
-REPO_PKG="
- MdePkg
- MdeModulePkg
-"
-use kvm && REPO_PKG+="
- OvmfPkg
- OptionRomPkg
- UefiCpuPkg
- IntelFrameworkModulePkg
- PcAtChipsetPkg
- FatBinPkg
- EdkShellBinPkg
- IntelFrameworkPkg
- "
-( use kvm || use shell ) && REPO_PKG+="
- ShellPkg
- "
LICENSE="BSD"
SLOT="0"
KEYWORDS="~amd64"
-IUSE="hello-world kvm shell"
+IUSE="+hello-world kvm shell development"
+REQUIRED_USE="|| ( hello-world kvm shell )"
DEPEND="
app-arch/unzip
@@ -51,6 +35,7 @@ RDEPEND="kvm? ( >=app-emulation/qemu-kvm-0.9.1 )"
S="$(dirname ${S})"
+TAGNAME="GCC$(gcc-major-version)$(gcc-minor-version)"
# TODO:
# fix this:
# In function ‘void* memset(void*, int, size_t)’,
@@ -61,13 +46,35 @@ S="$(dirname ${S})"
# /usr/include/bits/string3.h:85:70: warning: call to void* __builtin___memset_chk(void*, int, long unsigned int, long unsigned int) will always overflow destination buffer
pkg_setup() {
- if use !hello-world && use !kvm && use !shell; then
- die "Select at least one module to be built!"
- fi
python_set_active_version 2
}
src_unpack(){
+ # for debugging, the download takes to long
+ if use development; then
+ cp -ar "${FILESDIR}/../../edk-src" . || die "cp failed"
+ mv edk-src/* . || die "mv failed"
+ rmdir edk-src || die "rmdir failed"
+ return
+ fi
+
+ local repo_pkg="
+ MdePkg
+ MdeModulePkg
+ "
+ use kvm && repo_pkg+="
+ OvmfPkg
+ OptionRomPkg
+ UefiCpuPkg
+ IntelFrameworkModulePkg
+ PcAtChipsetPkg
+ FatBinPkg
+ EdkShellBinPkg
+ IntelFrameworkPkg
+ "
+ ( use kvm || use shell ) && repo_pkg+="
+ ShellPkg
+ "
einfo "### Be patient! ###"
einfo "Downloading individual folders is slow, but really decreases total download size."
einfo "### Be patient! ###"
@@ -81,7 +88,7 @@ src_unpack(){
subversion_fetch "${ESVN_REPO_URI}/${dir}${REPO_REV}" "${dir}"
done
- for dir in ${REPO_PKG}; do
+ for dir in ${repo_pkg}; do
subversion_fetch "${ESVN_REPO_URI}/${dir}${REPO_REV}" "${dir}"
done
}
@@ -89,25 +96,32 @@ src_unpack(){
src_prepare(){
# errors occur with -O -O1 -O2 but not with -O3
filter-flags -O*
+ # TODO AS=gcc ...why I don't know
# patch compiler flags
- sed -i -r -e "s/^(CC = ).*$/\1`tc-getCC`/" \
+ sed -i -r \
+ -e "s/^(CC = ).*$/\1`tc-getCC`/" \
-e "s/^(CXX = ).*$/\1`tc-getCXX`/" \
-e "s/^(AS = ).*$/\1`tc-getAS`/" \
-e "s/^(AR = ).*$/\1`tc-getAR`/" \
-e "s/^(LD = ).*$/\1`tc-getLD`/" \
- -e "s/^(CFLAGS = ).*$/\1`echo "${CFLAGS}"`/" \
- -e "s/^(LFLAGS = ).*$/\1`echo "${LFLAGS}"`/" \
+ -e "s/ -Werror//" \
+ -e "s/^(CFLAGS = )/\1`echo "${CFLAGS}"` /" \
+ -e "s/^(LFLAGS = )/\1`echo "${LFLAGS}"` /" \
BaseTools/Source/C/Makefiles/header.makefile || die "Failed to patch compiler flags"
for file in dlg/makefile antlr/makefile support/genmk/makefile; do
- sed -i -r -e "s/^(CC *= *).*$/\1`tc-getCC`/" \
+ sed -i -r \
+ -e "s/^(CC *= *).*$/\1`tc-getCC`/" \
-e "s/^(CXX *= *).*$/\1`echo "${CFLAGS}"`/" \
"BaseTools/Source/C/VfrCompile/Pccts/${file}" || die "Failed to patch compiler flags in ${file}"
done
- sed -i -r -e "s/^(DEFINE GCC44_ALL_CC_FLAGS *=.*) -Werror /\1 `echo "${CFLAGS}"` /" \
- -e "s/gcc$/`tc-getCC`/" \
- -e "s/as$/`tc-getAS`/" \
- -e "s/ar$/`tc-getAR`/" \
- -e "s/ld$/`tc-getLD`/" \
+ # filter our -march, building for kvm guest!
+ filter-flags -march*
+ sed -i -r \
+ -e "s/gcc[[:space:]]*$/`tc-getCC`/" \
+ -e "s/as[[:space:]]*$/`tc-getAS`/" \
+ -e "s/ar[[:space:]]*$/`tc-getAR`/" \
+ -e "s/ld[[:space:]]*$/`tc-getLD`/" \
+ -e "s/^(DEFINE GCC44_ALL_CC_FLAGS *=)(.*) -Werror /\1 `echo "${CFLAGS}"` \2 /" \
BaseTools/Conf/tools_def.template || die "Failed to patch compiler flags"
}
@@ -117,8 +131,8 @@ src_compile(){
local oldARCH="${ARCH}"
ARCH='X64'
- # build the cross-compiler
- emake -C BaseTools
+ # build the BaseTools
+ MAKEOPTS+="-j1" emake -C BaseTools
export EDK_TOOLS_PATH="${S}"/BaseTools
# this mainly appends to $PATH
@@ -127,9 +141,8 @@ src_compile(){
# build using the generated cross-compiler
# for a list of options, run 'build --help' or look at BaseTools/Source/Python/build/build.py MyOptionParser()
# TODO: -n X should be number of CPU+1. See no effect of it so far
- local tagname="GCC$(gcc-major-version)$(gcc-minor-version)"
if use hello-world; then
- build --arch "${ARCH}" --platform MdeModulePkg/MdeModulePkg.dsc --tagname "${tagname}" \
+ build --arch "${ARCH}" --platform MdeModulePkg/MdeModulePkg.dsc --tagname "${TAGNAME}" \
--module MdeModulePkg/Application/HelloWorld/HelloWorld.inf \
--buildtarget RELEASE || die "Failed to build HelloWorld"
# create startup.nsh for kvm testing
@@ -138,12 +151,12 @@ src_compile(){
fi
if use kvm; then
- build --arch "${ARCH}" --platform OvmfPkg/OvmfPkgX64.dsc --tagname "${tagname}" \
+ build --arch "${ARCH}" --platform OvmfPkg/OvmfPkgX64.dsc --tagname "${TAGNAME}" \
--buildtarget RELEASE || die "Failed to build UEFI-shell"
fi
if use shell; then
- build --arch "${ARCH}" --platform ShellPkg/ShellPkg.dsc --tagname "${tagname}" \
+ build --arch "${ARCH}" --platform ShellPkg/ShellPkg.dsc --tagname "${TAGNAME}" \
--module ShellPkg/Application/Shell/Shell.inf \
--buildtarget RELEASE || die "Failed to build UEFI-shell"
fi
@@ -155,8 +168,8 @@ src_compile(){
src_install(){
if use hello-world; then
insinto "/usr/share/${PN}/hello-world"
- doins Build/MdeModule/RELEASE_GCC45/X64/HelloWorld.efi
- doins Build/MdeModule/RELEASE_GCC45/X64/startup.nsh
+ doins "Build/MdeModule/RELEASE_${TAGNAME}/X64/HelloWorld.efi"
+ doins "Build/MdeModule/RELEASE_${TAGNAME}/X64/startup.nsh"
fi
if use shell; then
@@ -168,8 +181,7 @@ src_install(){
insinto "/usr/share/${PN}/kvm"
newins Build/OvmfX64/RELEASE_GCC45/FV/OVMF.fd uefibios.bin
newins Build/OvmfX64/RELEASE_GCC45/FV/CirrusLogic5446.rom vgabios-cirrus.bin
- # insinto /usr/share/qemu
- dosym "../${PN}/kvm/uefibios.bin" /usr/share/qemu/uefibios.bin || die "WTF"
+ dosym "../${PN}/kvm/uefibios.bin" /usr/share/qemu/uefibios.bin
fi
}
diff --git a/sys-firmware/edk2/metadata.xml b/sys-firmware/edk2/metadata.xml
index 3dbd636..507939d 100644
--- a/sys-firmware/edk2/metadata.xml
+++ b/sys-firmware/edk2/metadata.xml
@@ -13,5 +13,6 @@ environment for the UEFI and PI specifications.
<pkg>app-emulation/qemu-kvm</pkg>.</flag>
<flag name="kvm">Creates the uefi-bios for <pkg>app-emulation/qemu-kvm</pkg>.</flag>
<flag name="shell">Creates the uefi-shell.</flag>
+<flag name="development">DO NOT SET THIS. FOR EBUILD DEVELOPMENT ONLY !</flag>
</use>
</pkgmetadata>