aboutsummaryrefslogtreecommitdiffstats
path: root/testing/edk2
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2016-11-16 16:47:07 +0200
committerTimo Teräs <timo.teras@iki.fi>2016-11-16 15:05:59 +0000
commit06c4742ba83f61aedb7ac5ceadcd501cfd65b934 (patch)
tree59f198fafe2da9734c2320e6742551475ecabb4d /testing/edk2
parent4a3a8807fb455042bc4cc8641583511ada295222 (diff)
downloadaports-06c4742ba83f61aedb7ac5ceadcd501cfd65b934.tar.bz2
aports-06c4742ba83f61aedb7ac5ceadcd501cfd65b934.tar.xz
testing/edk2: new aport
EFI Development Kit II + Open Virtual Machine Firmware http://www.tianocore.org/edk2/
Diffstat (limited to 'testing/edk2')
-rw-r--r--testing/edk2/APKBUILD84
-rw-r--r--testing/edk2/build-hack.patch26
2 files changed, 110 insertions, 0 deletions
diff --git a/testing/edk2/APKBUILD b/testing/edk2/APKBUILD
new file mode 100644
index 0000000000..d610081452
--- /dev/null
+++ b/testing/edk2/APKBUILD
@@ -0,0 +1,84 @@
+# Contributor: Timo Teräs <timo.teras@iki.fi>
+# Maintainer:
+pkgname=edk2
+pkgver=0.0.20161115
+_commitid=e242cdfb307a6dfe2c0f75c4719f5c1f6b418625
+pkgrel=0
+pkgdesc="EFI Development Kit II"
+url="http://www.tianocore.org/edk2/"
+arch="x86_64"
+license="BSD"
+depends=""
+makedepends="bash python2 iasl nasm util-linux-dev"
+install=""
+subpackages="ovmf"
+source="$pkgname-$pkgver.tar.gz::https://github.com/tianocore/$pkgname/archive/$_commitid.tar.gz
+ build-hack.patch"
+builddir="$srcdir/$pkgname-$_commitid"
+
+case "$CARCH" in
+x86) TARGET_ARCH=IA32; OVMFPKG=OvmfPkgIa32.dsc;;
+x86_64) TARGET_ARCH=X64; OVMFPKG=OvmfPkgX64.dsc;;
+esac
+
+# use GCC49 instead of GCC5 until gcc 6.3 (see: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70955)
+TOOLCHAIN=GCC49
+RELEASE=DEBUG
+
+prepare() {
+ cd "$builddir"
+ # unix line endings for the files to be patched
+ sed -e 's/\r$//' -i BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp BaseTools/Source/C/VolInfo/VolInfo.c
+ default_prepare
+}
+
+build() {
+ cd "$builddir"
+ bash -c ". edksetup.sh" || return 1
+ make -j1 -C BaseTools || return 1
+
+ export WORKSPACE=$PWD
+ export PACKAGES_PATH=$PWD
+ export EDK_TOOLS_PATH=$PWD/BaseTools/
+ export PATH=$PWD/BaseTools/BinWrappers/PosixLike/:$PATH
+
+ msg "Building OVMF"
+ command build -b ${RELEASE} -a ${TARGET_ARCH} -p OvmfPkg/${OVMFPKG} -t ${TOOLCHAIN} -n ${JOBS:-2} || return 1
+}
+
+package() {
+ cd "$builddir"
+ mkdir -p "$pkgdir"/usr/bin \
+ "$pkgdir"/usr/share/$pkgname/Conf \
+ "$pkgdir"/usr/share/$pkgname/Scripts
+
+ install BaseTools/Source/C/bin/* BaseTools/BinWrappers/PosixLike/LzmaF86Compress \
+ "$pkgdir"/usr/bin
+ install BaseTools/BuildEnv "$pkgdir"/usr/share/$pkgname/
+ install BaseTools/Conf/*.template "$pkgdir"/usr/share/$pkgname/Conf
+ install BaseTools/Scripts/GccBase.lds "$pkgdir"/usr/share/$pkgname/Scripts
+
+ cp -R BaseTools/Source/Python "$pkgdir"/usr/share/$pkgname/Python
+ for i in build BPDG Ecc GenDepex GenFds GenPatchPcdTable PatchPcdValue TargetTool Trim UPT; do
+ echo '#!/bin/sh
+export PYTHONPATH=/usr/share/$pkgname/Python
+exec python '/usr/share/$pkgname/Python/$i/$i.py' "$@"' > "$pkgdir"/usr/bin/$i
+ chmod +x "$pkgdir"/usr/bin/$i
+ done
+}
+
+ovmf() {
+ pkgdesc="Open Virtual Machine Firmware (OVMF) BIOS"
+ license="BSD MIT"
+
+ cd "$builddir"
+ mkdir -p "$subpkgdir"/usr/share/$subpkgname/
+ install Build/Ovmf${TARGET_ARCH}/${RELEASE}_${TOOLCHAIN}/FV/OVMF.fd "$subpkgdir"/usr/share/$subpkgname/bios.bin
+}
+
+md5sums="6e6a28fbdcc4062108da9df348d69240 edk2-0.0.20161115.tar.gz
+63def07e68b1fad4062c99406bde7c0a build-hack.patch"
+sha256sums="e71586a0f335412a834b6720d88ec9d0a5d33621bbb6d87decdc2ee84b8d6e0e edk2-0.0.20161115.tar.gz
+d493fd3d711a96229b9fba8de81ba42c236af14e508f8090d3e9dd74d90e2371 build-hack.patch"
+sha512sums="7b1de6c5aa08ba6ab0897b59c5f0eab654062c01c0a9bcdf182a5fd695eb8639b8cc418b2d2e0ebb35855b2bf7294947335d49c0c790fa05830f783ddaea6414 edk2-0.0.20161115.tar.gz
+29158db1d54922f32215892bec0542176d64de4501fcdb1535508bb48b25e1f364ccd57b58aca07f2415c4654f76409dd64e40f5066db3fb9284a7217bbc2230 build-hack.patch"
diff --git a/testing/edk2/build-hack.patch b/testing/edk2/build-hack.patch
new file mode 100644
index 0000000000..5573717b0d
--- /dev/null
+++ b/testing/edk2/build-hack.patch
@@ -0,0 +1,26 @@
+VfrCompile seg.faults with fortify enabled. It's probably broken.
+VolInfo does not compile due to -fshort-wchar not being supported by musl. The only major problem is the printf, so comment it out.
+
+diff -ru a/edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp b/edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
+--- edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp 2016-11-16 10:01:14.000000000 +0200
++++ edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp 2016-11-16 14:47:30.211978076 +0200
+@@ -13,6 +13,7 @@
+
+ **/
+
++#define _FORTIFY_SOURCE 0
+ #include "stdio.h"
+ #include "stdlib.h"
+ #include "CommonLib.h"
+diff -ru a/edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VolInfo/VolInfo.c b/edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VolInfo/VolInfo.c
+--- edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VolInfo/VolInfo.c 2016-11-16 10:01:14.000000000 +0200
++++ edk2-e242cdfb307a6dfe2c0f75c4719f5c1f6b418625/BaseTools/Source/C/VolInfo/VolInfo.c 2016-11-16 11:12:40.182415584 +0200
+@@ -1714,7 +1714,7 @@
+ break;
+
+ case EFI_SECTION_USER_INTERFACE:
+- printf (" String: %ls\n", (wchar_t *) &((EFI_USER_INTERFACE_SECTION *) Ptr)->FileNameString);
++ //printf (" String: %ls\n", (wchar_t *) &((EFI_USER_INTERFACE_SECTION *) Ptr)->FileNameString);
+ break;
+
+ case EFI_SECTION_FIRMWARE_VOLUME_IMAGE: