summaryrefslogtreecommitdiff
path: root/sys-boot/udk
diff options
context:
space:
mode:
Diffstat (limited to 'sys-boot/udk')
-rw-r--r--sys-boot/udk/Manifest2
-rw-r--r--sys-boot/udk/files/udk-workspace.template63
-rw-r--r--sys-boot/udk/udk-2018-r1.ebuild146
3 files changed, 211 insertions, 0 deletions
diff --git a/sys-boot/udk/Manifest b/sys-boot/udk/Manifest
index 9cc7ba308e60..496e197e4836 100644
--- a/sys-boot/udk/Manifest
+++ b/sys-boot/udk/Manifest
@@ -1,9 +1,11 @@
AUX 2015-makefile.template 1543 BLAKE2B 6f16a0e3c726a99a30b68cc24f7a85267b1748c4822e1970c498f877d22195989022ddd1e1d2496744b5a8b1dde1d9dc2ebcb7dfe336b01c7258430938d05531 SHA512 c09aca05b07dbd5d2ac1979b98d889e0a2a44e6c12292cca5c6033e1c094acbf155ef1649a7f0b923e3062f4f2fd8f650f57523625628a29828c22ef1f95b405
AUX 2015-tools_def.template 2575 BLAKE2B 9666cb1b6d225eec6e6ca3762b6c5b10332f045035787585805485b9d7ba54a54543855adda8253ecd451674d00c4beaf153a94dd3ff4c8b5ab1fa5b72d92610 SHA512 7bf9e23434ec6e4abaf525a857719d5ddf3c355a4dd2f2f6666db62cfb9b9f981180a4886d9e98f43b82b2b4a397a862201ded196ed12726b2f813d5a61bbc86
AUX 2018-makefile.template 1059 BLAKE2B 6dda7de8a85fc2d8a55078ee298d622618da72f486a3453193dd0c0f5db1494433af6295909dbeb357aa967b58f640820d2f4790a4bec9304db0ce6e49ba2fb4 SHA512 527242cb30b23c3f2f9d6409f28d02bc41367e5cf15484819d0d8eb894b10252c0fedd4f0b11e8b5383216584846495946aad22a5ed7d25ddde511701e13b0cd
+AUX udk-workspace.template 1426 BLAKE2B b35a6e0e73c6724a29db2ad93ebceb35416d6d940b49ce6a6ec04e474e795afeaa4cf290dcb5e935f2e8e4f8dcd724619ddc3aa2b73e417e119db1cc523976d9 SHA512 6a28aa21e75ce7aecf35f469fada37591c4077749746a45153ab98bc91a09757582e5fa4813af657fba4c54ae382bf8d1ce52057b51fe10744b30b1e8a8bae6b
DIST UDK2015.Complete.MyWorkSpace.zip 121736982 BLAKE2B b37bd9ead6ce2c665128199249483ecbcb0f410077d0ca61820bdccb7ae71f6dad870a3cf2dad79f997ad9114678fab3c15a17227ae33aa1ff66f9187aa3a568 SHA512 7856a8f29296f817e8fd09d8eaf7207f4e25a13faa10936d1ceb10cb6a900be265379722c0ade0ef93b1c640fef8693667d2567962e3288b20ae77f607f03d39
DIST udk-2018-docs.zip 79352781 BLAKE2B 9d08579d4645121cabb7ac52850de6492f9990240da9236064352df0595867bfc6952c9858865a8ce1d81982ec0e2440dc19930a75595454257294462adc60d6 SHA512 6ba2d961f20267cafb94bd020e8fe71e1392f1f2cdbc5c9f0a43212253ddf137b3e12cc789299dfd1ea099bb1541703b995ae20d28f0275395f5f85ed0656954
DIST udk-2018.tar.gz 38642782 BLAKE2B a10171659451d7d3df737066ec0471db1e5055bd52556d4d0654b244e827512db8d88e2b74b4dfe0189f768e0eab7a705aa32a720e047555995cf339ea50c62f SHA512 8fd9316f08a5c30f8684b2fde73906a943bb067ec91699f41796e27679af73dbc38efaa100a57d4b835656b402d9c08896abc5c10fd0d607a7e0173b3d7a60b2
EBUILD udk-2015-r1.ebuild 6463 BLAKE2B 9d2d5d482c35424338626729380a231fc080e48a309c80c128b87b64fd7206cc594b1f7e2a20a1ca5a8015cd267916629b18454a5564c3ba5ca2636c5f21b04d SHA512 868d1c3fb22683772fea293d1dc4961438dde5f6df247b6895fc5709291283c1807fcd15f4d8c557a28ee3cb98e1501476c159574fed0bd2549e0e4ad88aae75
+EBUILD udk-2018-r1.ebuild 4057 BLAKE2B 4827f3a1ead937529d78d729f70232bbcd85c43f9eae59010542c23e5baa3ef9757885ca175b094028f978e615acf76f33c60b59a605fafefe437e663597cd28 SHA512 a38b8c3c7594be5eddee9a300991648937cf5aadea74bedae84581596d38e4bc1990c8e58db6b676a2e35d8916a1674925d740d0320dbef24b6bc45a2aadb4a3
EBUILD udk-2018.ebuild 6564 BLAKE2B 627ae99e97b02669348217286cc0345b3e0bfcc6ebab6f33d822742ff64cd704c0b87db82077d39eff3e3b978c8653665a167d7bfe5ec0d9474536c38e92f6ee SHA512 db785921a62a5cd0d4089114a3b1a9ad678c4ba6eadf099eaeed4888bae9cf1e77354458ca279ffbc15aaa9ce73490602fa18af4457dfd5594ddcd7960f6327f
MISC metadata.xml 721 BLAKE2B 863e21fdb7ac310469efdddbbbff0f1b23aa8b6cb6cdb27d6bfa1b024e795ef3b86e72d9dd7b6bca8a5326755615710bc0a59a6f4e3b53149490402d10c24d42 SHA512 20ac00286729ab06e607513002f2bcfe75866108914015d11a3139f95073b393c62046832fd3295f4e849a5cc810b996f0ca8b589cc6639e726563110e1c60fe
diff --git a/sys-boot/udk/files/udk-workspace.template b/sys-boot/udk/files/udk-workspace.template
new file mode 100644
index 000000000000..e119c3ae1a36
--- /dev/null
+++ b/sys-boot/udk/files/udk-workspace.template
@@ -0,0 +1,63 @@
+#!/bin/bash
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+SCRIPT_NAME='udk-workspace'
+[ -n "${BASH_SOURCE}" ] && SCRIPT_NAME="${BASH_SOURCE}"
+
+show_usage() {
+ if [ ! -z "${1}" ]; then
+ echo "${1}" >&2
+ echo >&2
+ fi
+ echo "Usage:"
+ echo ". ${SCRIPT_NAME} [folder]"
+ echo "where folder is the workspace folder - current directory is used if unspecified"
+}
+
+create_workspace() {
+ local workspace_dir="${PWD}"
+ if [ ! -z "${1}" ]; then
+ workspace_dir="${1}"
+ if ! mkdir -p "${1}"; then
+ show_usage "Cannot create directory ${1}"
+ return 1
+ fi
+ fi
+
+ pushd "${workspace_dir}" >/dev/null
+ if ! mkdir -p Conf; then
+ show_usage "Cannot create configuration directory"
+ return 1
+ fi
+ export WORKSPACE="${PWD}"
+ popd >/dev/null
+}
+
+if [ "${1}" = "-h" ] || [ "${1}" = "--help" ]; then
+ show_usage
+ # Script may have been sourced
+ return 0 2>/dev/null
+ exit 0
+elif [ "${SCRIPT_NAME}" = "${0}" ]; then
+ show_usage "Script must be sourced"
+ exit 1
+elif [ $# -gt 1 ]; then
+ show_usage "Too many arguments"
+ return 1
+fi
+
+if ! create_workspace "${1}"; then
+ return 1
+fi
+unset -f show_usage
+unset -f create_workspace
+shift $#
+
+export EDK_TOOLS_PATH="{EDK_BASE}/BaseTools"
+. "{EDK_BASE}/edksetup.sh"
+
+echo "Do not forget to call this script each time you open a new terminal or work on"
+echo "another workspace."
+echo "For more information, type:"
+echo "${SCRIPT_NAME} --help"
diff --git a/sys-boot/udk/udk-2018-r1.ebuild b/sys-boot/udk/udk-2018-r1.ebuild
new file mode 100644
index 000000000000..89f40f3e1a5c
--- /dev/null
+++ b/sys-boot/udk/udk-2018-r1.ebuild
@@ -0,0 +1,146 @@
+# Copyright 1999-2019 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+inherit multiprocessing python-single-r1 toolchain-funcs
+
+DESCRIPTION="Tianocore UEFI Development kit"
+HOMEPAGE="https://github.com/tianocore/tianocore.github.io/wiki/EDK-II"
+
+if [[ ${PV} == *9999* ]]; then
+ inherit git-r3
+ EGIT_REPO_URI="https://github.com/tianocore/edk2.git"
+ KEYWORDS=""
+else
+ MY_V="${PN^^}${PV}"
+ SRC_URI="https://github.com/tianocore/edk2/archive/v${MY_V}.tar.gz -> ${P}.tar.gz
+ doc? ( https://github.com/tianocore/edk2/releases/download/v${MY_V}/${MY_V}.Documents.zip -> ${P}-docs.zip )"
+ S="${WORKDIR}/edk2-v${MY_V}"
+ KEYWORDS="~amd64 ~x86"
+fi
+
+LICENSE="BSD-2"
+SLOT="0"
+IUSE="doc"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="strip"
+
+RDEPEND="${PYTHON_DEPS}"
+DEPEND="${RDEPEND}
+ >=dev-lang/nasm-2.14.02
+ >=sys-power/iasl-20160729
+ doc? ( app-arch/unzip )"
+
+DOCDIR="${WORKDIR}/Documents"
+
+# EFI pre-build libs
+QA_PREBUILT="
+ usr/lib/${P}/BeagleBoardPkg/Debugger_scripts/rvi_dummy.axf
+ usr/lib/${P}/ArmPkg/Library/GccLto/*.a
+"
+# GenBiosId is built upstream
+# VfrCompile does not use LDFLAGS but next upsteam version should change this
+QA_FLAGS_IGNORED="
+ usr/lib/udk-2018/BaseTools/Source/C/bin/VfrCompile
+ usr/lib/${P}/Vlv2TbltDevicePkg/GenBiosId
+"
+
+pkg_setup() {
+ if use x86; then
+ EFIARCH=IA32
+ elif use amd64; then
+ EFIARCH=X64
+ fi
+
+ # Select toolchain within predefined ones
+ if tc-is-gcc; then
+ TOOLCHAIN_TAG="GCC5"
+ elif tc-is-clang; then
+ TOOLCHAIN_TAG="CLANG38"
+ else
+ TOOLCHAIN_TAG="ELFGCC"
+ fi
+}
+
+src_unpack() {
+ default
+
+ local doc_name
+ local f
+ if use doc; then
+ pushd "${DOCDIR}" >/dev/null || die
+ rm -f *.chm || die
+ for f in *.zip; do
+ unpack "${DOCDIR}/${f}"
+ mv html "${f%.zip}" || die
+ done
+ rm -f *.zip || die
+ popd >/dev/null || die
+ fi
+}
+
+src_configure() {
+ sed -e "s:^\(BUILD_CFLAGS\s*=\).*$:\1 ${CFLAGS} -MD -fshort-wchar -fno-strict-aliasing -nostdlib -c -fPIC:" \
+ -e "s:^\(BUILD_LFLAGS\s*=\).*$:\1 ${LDFLAGS}:" \
+ -e "s:^\(BUILD_CXXFLAGS\s*=\).*$:\1 ${CXXFLAGS} -Wno-unused-result:" \
+ -i "BaseTools/Source/C/Makefiles/header.makefile" \
+ || die "Failed to update makefile header"
+}
+
+src_compile() {
+ local make_flags=(
+ BUILD_CC="$(tc-getBUILD_CC)"
+ BUILD_CXX="$(tc-getBUILD_CXX)"
+ BUILD_AS="$(tc-getBUILD_AS)"
+ BUILD_AR="$(tc-getBUILD_AR)"
+ BUILD_LD="$(tc-getBUILD_LD)"
+ )
+ # Base tools does not like parallel make
+ emake "${make_flags[@]}" -j1 -C BaseTools
+
+ # Update template parameter files
+ sed -e "s:^\(ACTIVE_PLATFORM\s*=\).*$:\1 MdeModulePkg/MdeModulePkg.dsc:" \
+ -e "s:^\(TARGET\s*=\).*$:\1 RELEASE:" \
+ -e "s:^\(TARGET_ARCH\s*=\).*$:\1 ${EFIARCH}:" \
+ -e "s:^\(TOOL_CHAIN_TAG\s*=\).*$:\1 ${TOOLCHAIN_TAG}:" \
+ -e "s:^\(MAX_CONCURRENT_THREAD_NUMBER\s*=\).*$:\1 $(makeopts_jobs):" \
+ -i "BaseTools/Conf/target.template" || die "Failed to configure target file"
+
+ # Clean unneeded files
+ find . -name '*.bat' -o -name '*.exe' -exec rm -f {} \; || die
+ find ./BaseTools/Source/C -mindepth 1 -maxdepth 1 \! -name 'bin' -exec rm -rf {} \; || die
+
+ # Upsteam hack (symbolic link) should only be created if needed
+ rm "${S}/EmulatorPkg/Unix/Host/X11IncludeHack" || die
+
+ # Create workspace script file
+ sed -e "s:{EDK_BASE}:${EPREFIX}/usr/lib/${P}:" \
+ "${FILESDIR}"/udk-workspace.template \
+ > "${T}/udk-workspace" || die "Failed to build udk-workspace"
+}
+
+src_install() {
+ dobin "${T}/udk-workspace"
+
+ # Use mkdir && cp here as doins does not preserve execution bits
+ mkdir -p "${ED}/usr/lib/${P}" || die
+ cp -pR "${S}"/* "${D}/usr/lib/${P}" || die
+ dosym "${P}" "/usr/lib/${PN}"
+
+ local HTML_DOCS
+ use doc && HTML_DOCS=( "${DOCDIR}"/. )
+ einstalldocs
+}
+
+pkg_postinst() {
+ elog "To create a new workspace, execute:"
+ elog " . udk-workspace [workspace_dir]"
+ elog "You can link appropriate packages to your workspace. For example,"
+ elog "in order to build MdeModulePkg and examples, you can try:"
+ elog " ln -s \"${EROOT}/usr/lib/${P}/\"Mde{Module,}Pkg ."
+ elog " build -a ${EFIARCH} all"
+}