summaryrefslogtreecommitdiff
path: root/sys-boot/udk
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2020-05-14 11:09:11 +0100
committerV3n3RiX <venerix@redcorelinux.org>2020-05-14 11:09:11 +0100
commitdeba8115d2c2af26df42966b91ef04ff4dd79cde (patch)
tree9a48f42594e1a9e6b2020d5535a784314434d7a7 /sys-boot/udk
parent38423c67c8a23f6a1bc42038193182e2da3116eb (diff)
gentoo resync : 14.05.2020
Diffstat (limited to 'sys-boot/udk')
-rw-r--r--sys-boot/udk/Manifest7
-rw-r--r--sys-boot/udk/metadata.xml8
-rw-r--r--sys-boot/udk/udk-2015-r1.ebuild54
-rw-r--r--sys-boot/udk/udk-2018-r1.ebuild20
-rw-r--r--sys-boot/udk/udk-2018.ebuild212
5 files changed, 40 insertions, 261 deletions
diff --git a/sys-boot/udk/Manifest b/sys-boot/udk/Manifest
index 656ef712a595..ee441487417d 100644
--- a/sys-boot/udk/Manifest
+++ b/sys-boot/udk/Manifest
@@ -5,7 +5,6 @@ AUX udk-workspace.template 1426 BLAKE2B b35a6e0e73c6724a29db2ad93ebceb35416d6d94
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 6459 BLAKE2B 156f86b1ae91125ca9c8609254539d971dd2f2ab495dad3611817460905192d6cb33e1261ea5555096e28a33aff480bb60bae4b882cb26ee92d45363db8b4ae2 SHA512 2bafe8e4c63cf02e2c3eeb245c45587d6b8ef2e4e419fdda92dc6bbea563250542024fc9367470c5fe37bb40a9ba088abc209311a9a95ccd8dd7d24d084df60f
-EBUILD udk-2018-r1.ebuild 4057 BLAKE2B 4827f3a1ead937529d78d729f70232bbcd85c43f9eae59010542c23e5baa3ef9757885ca175b094028f978e615acf76f33c60b59a605fafefe437e663597cd28 SHA512 a38b8c3c7594be5eddee9a300991648937cf5aadea74bedae84581596d38e4bc1990c8e58db6b676a2e35d8916a1674925d740d0320dbef24b6bc45a2aadb4a3
-EBUILD udk-2018.ebuild 6560 BLAKE2B f13fac8ea6ab8fbd2ed9677f95f33f5668d4c54b52b13ba342019a45087a4b0193744dd0db93b89a45a9a5e075e847c37a3dcb41fd8fde72a2c529026679e254 SHA512 fc6442e1791aa3ab4b10a28923433d26092ed92fcce9b09aec08ab1ca6ceb16e40fca028def9a3b5424c0b7e93f8d831ac0dd7138ee158d33568f2d9659a2be1
-MISC metadata.xml 721 BLAKE2B 863e21fdb7ac310469efdddbbbff0f1b23aa8b6cb6cdb27d6bfa1b024e795ef3b86e72d9dd7b6bca8a5326755615710bc0a59a6f4e3b53149490402d10c24d42 SHA512 20ac00286729ab06e607513002f2bcfe75866108914015d11a3139f95073b393c62046832fd3295f4e849a5cc810b996f0ca8b589cc6639e726563110e1c60fe
+EBUILD udk-2015-r1.ebuild 6459 BLAKE2B f98205320c34e634a65459931c3cf353144e86365acae48b5895ad917b87b1dc9b2cf9ddb6c610a790fcc171073b77cfef475b6a7e36aeffc32543d56204017e SHA512 2e559bd885767f9757fc73c8c9fa5b4740b6309c0f9835b0900a4893037d55d5540e4bb8259e4f64635fb4dddd1143a16d3e51a6546ea4eb82ab1051fef28ac9
+EBUILD udk-2018-r1.ebuild 4057 BLAKE2B 7fc6019dc7b84a19556165c1274a2d6f0c62b29f13362a43dd0a6089c7f3ef7fe23cb29b09f47d80b1758372b0443155ffd2baddbb57d6cc6d8de26942176ae8 SHA512 7f43b879d8eb6e8676d49e2b050d2fb4851997899fe35bdbe86dcc086eb2e067b20d724c9e2b0e5ca332e81a109ea61bb9d2ce1af8746b2a54c371db04a0024d
+MISC metadata.xml 444 BLAKE2B f9590f3f08c942d077fb67fbcc9d73c8808924df563f68a14ebff404b21224d38f9ea91d7f23ae155b755143dd7b929cb09794e26568f9fbae58b88bac0e0d4b SHA512 445f26815ac9e103e9f6bbe0f783b5ffff32b855d4e01b11958c18c33a3a4ea705844464bc08a7115e4f55ffc7fae3e5ab0b34da4fe4feaebcf4290386b90249
diff --git a/sys-boot/udk/metadata.xml b/sys-boot/udk/metadata.xml
index 422810daaa88..a9f04df71ec4 100644
--- a/sys-boot/udk/metadata.xml
+++ b/sys-boot/udk/metadata.xml
@@ -9,14 +9,6 @@
<email>proxy-maint@gentoo.org</email>
<name>Proxy Maintainers</name>
</maintainer>
- <longdescription lang="fr">
- Kit de développement UEFI Tianocore, une version stable de portions du
- projet EDK II.
- </longdescription>
- <longdescription lang="en">
- Tianocore UEFI Development Kit, a stable release of portions of the
- EDK II project.
- </longdescription>
<upstream>
<remote-id type="github">tianocore/udk</remote-id>
</upstream>
diff --git a/sys-boot/udk/udk-2015-r1.ebuild b/sys-boot/udk/udk-2015-r1.ebuild
index ec568865288f..0e6388c5e43c 100644
--- a/sys-boot/udk/udk-2015-r1.ebuild
+++ b/sys-boot/udk/udk-2015-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -80,7 +80,7 @@ src_configure() {
|| die "Failed to patch source file"
# Compile of Base Tools is required for further setting up the environment
# Base tools does not like parallel make
- sed -e "s:^\(CFLAGS\s*=\).*$:\1 ${CFLAGS} -MD -fshort-wchar -fno-strict-aliasing -nostdlib -c -fPIC:" \
+ sed -e "s|^\(CFLAGS\s*=\).*$|\1 ${CFLAGS} -MD -fshort-wchar -fno-strict-aliasing -nostdlib -c -fPIC|" \
-i "${S}/BaseTools/Source/C/Makefiles/header.makefile" \
|| die "Failed to update makefile header"
local make_flags=(
@@ -105,17 +105,17 @@ src_configure() {
else
append-cflags $(test-flags-CC -m32) $(test-flags-CC -malign-double)
fi
- sed -e "s:^\(ACTIVE_PLATFORM\s*=\).*$:\1 MdeModulePkg/MdeModulePkg.dsc:" \
- -e "s:^\(TARGET\s*=\).*$:\1 RELEASE:" \
- -e "s:^\(TARGET_ARCH\s*=\).*$:\1 ${ARCH}:" \
- -e "s:^\(TOOL_CHAIN_TAG\s*=\).*$:\1 ${TOOLCHAIN_TAG}:" \
- -e "s:^\(MAX_CONCURRENT_THREAD_NUMBER\s*=\).*$:\1 $(makeopts_jobs):" \
+ sed -e "s|^\(ACTIVE_PLATFORM\s*=\).*$|\1 MdeModulePkg/MdeModulePkg.dsc|" \
+ -e "s|^\(TARGET\s*=\).*$|\1 RELEASE|" \
+ -e "s|^\(TARGET_ARCH\s*=\).*$|\1 ${ARCH}|" \
+ -e "s|^\(TOOL_CHAIN_TAG\s*=\).*$|\1 ${TOOLCHAIN_TAG}|" \
+ -e "s|^\(MAX_CONCURRENT_THREAD_NUMBER\s*=\).*$|\1 $(makeopts_jobs)|" \
-i "${S}/Conf/target.txt" || die "Failed to configure target file"
- sed -e "s:«CC»:$(tc-getCC):" \
- -e "s:«AR»:$(tc-getAR):" \
- -e "s:«LD»:$(tc-getLD):" \
- -e "s:«OBJCOPY»:$(tc-getOBJCOPY):" \
- -e "s:«CFLAGS»:${CFLAGS}:" \
+ sed -e "s|«CC»|$(tc-getCC)|" \
+ -e "s|«AR»|$(tc-getAR)|" \
+ -e "s|«LD»|$(tc-getLD)|" \
+ -e "s|«OBJCOPY»|$(tc-getOBJCOPY)|" \
+ -e "s|«CFLAGS»|${CFLAGS}|" \
"${FILESDIR}/${PV}-tools_def.template" >>"${S}/Conf/tools_def.txt" \
|| die "Failed to prepare tools definition file"
}
@@ -181,23 +181,23 @@ copySourceFiles() {
# 3 - Path of the generated Makefile.
createMakefile() {
local static_libs=$(sed -n '/^STATIC_LIBRARY_FILES\s*=/,/^\s*\$(OUTPUT_DIR)/{/^\s*\$(OUTPUT_DIR)/b;p}' ${3} \
- | sed -e 's:^\s*\$(BIN_DIR).*/\([^/]*\)\.lib:\t-l\1:' -e 's:\\$:\\\\\\n:' | tr --delete '\n')
+ | sed -e 's|^\s*\$(BIN_DIR).*/\([^/]*\)\.lib|\t-l\1|' -e 's|\\$|\\\\\\n|' | tr --delete '\n')
local pecoff_header_size;
[[ $ARCH == X64 ]] && pecoff_header_size='0x228' || pecoff_header_size='0x220'
- sed -e "s:«MODULE»:${2}:" \
- -e "s:«PACKAGE_NAME»:${PN}:" \
- -e "s:«STATIC_LIBS»:${static_libs}:" \
- -e "s:«MODULE_TYPE»:$(grep -e '^MODULE_TYPE\s*=' ${3} | tail -1):" \
- -e "s:«IMAGE_ENTRY_POINT»:$(grep -e '^IMAGE_ENTRY_POINT\s*=' ${3}):" \
- -e "s:«CP»:$(grep -e '^CP\s*=' ${3}):" \
- -e "s:«RM»:$(grep -e '^RM\s*=' ${3}):" \
- -e "s:«CC»:$(grep -e '^CC\s*=' ${3}):" \
- -e "s:«DLINK»:$(grep -e '^DLINK\s*=' ${3}):" \
- -e "s:«OBJCOPY»:$(grep -e '^OBJCOPY\s*=' ${3}):" \
- -e "s:«GENFW»:$(grep -e '^GENFW\s*=' ${3}):" \
- -e "s:«PECOFF_HEADER_SIZE»:${pecoff_header_size}:" \
- -e "s:«OBJCOPY_FLAGS»:$(grep -e '^OBJCOPY_FLAGS\s*=' ${3}):" \
- -e "s:«GENFW_FLAGS»:$(grep -e '^GENFW_FLAGS\s*=' ${3}):" \
+ sed -e "s|«MODULE»|${2}|" \
+ -e "s|«PACKAGE_NAME»|${PN}|" \
+ -e "s|«STATIC_LIBS»|${static_libs}|" \
+ -e "s|«MODULE_TYPE»|$(grep -e '^MODULE_TYPE\s*=' ${3} | tail -1)|" \
+ -e "s|«IMAGE_ENTRY_POINT»|$(grep -e '^IMAGE_ENTRY_POINT\s*=' ${3})|" \
+ -e "s|«CP»|$(grep -e '^CP\s*=' ${3})|" \
+ -e "s|«RM»|$(grep -e '^RM\s*=' ${3})|" \
+ -e "s|«CC»|$(grep -e '^CC\s*=' ${3})|" \
+ -e "s|«DLINK»|$(grep -e '^DLINK\s*=' ${3})|" \
+ -e "s|«OBJCOPY»|$(grep -e '^OBJCOPY\s*=' ${3})|" \
+ -e "s|«GENFW»|$(grep -e '^GENFW\s*=' ${3})|" \
+ -e "s|«PECOFF_HEADER_SIZE»|${pecoff_header_size}|" \
+ -e "s|«OBJCOPY_FLAGS»|$(grep -e '^OBJCOPY_FLAGS\s*=' ${3})|" \
+ -e "s|«GENFW_FLAGS»|$(grep -e '^GENFW_FLAGS\s*=' ${3})|" \
"${FILESDIR}/${PV}-makefile.template" >${1} \
|| die "Failed to create Makefile"
}
diff --git a/sys-boot/udk/udk-2018-r1.ebuild b/sys-boot/udk/udk-2018-r1.ebuild
index 89f40f3e1a5c..3ad3971c96a4 100644
--- a/sys-boot/udk/udk-2018-r1.ebuild
+++ b/sys-boot/udk/udk-2018-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
@@ -84,9 +84,9 @@ src_unpack() {
}
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:" \
+ 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"
}
@@ -103,11 +103,11 @@ src_compile() {
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):" \
+ 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
@@ -118,7 +118,7 @@ src_compile() {
rm "${S}/EmulatorPkg/Unix/Host/X11IncludeHack" || die
# Create workspace script file
- sed -e "s:{EDK_BASE}:${EPREFIX}/usr/lib/${P}:" \
+ sed -e "s|{EDK_BASE}|${EPREFIX}/usr/lib/${P}|" \
"${FILESDIR}"/udk-workspace.template \
> "${T}/udk-workspace" || die "Failed to build udk-workspace"
}
diff --git a/sys-boot/udk/udk-2018.ebuild b/sys-boot/udk/udk-2018.ebuild
deleted file mode 100644
index 66b0fc8e9e9c..000000000000
--- a/sys-boot/udk/udk-2018.ebuild
+++ /dev/null
@@ -1,212 +0,0 @@
-# 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 flag-o-matic 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 examples"
-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"
-
-# Generated libs for EFI can contain WX sections
-QA_EXECSTACK="
- usr/lib*/libBaseLib.a:*
- usr/lib*/libBaseIoLibIntrinsic.a:*
-"
-
-pkg_setup() {
- if [[ ${ARCH} == "amd64" ]]; then
- ARCH=X64
- elif [[ ${ARCH} == "x86" ]]; then
- ARCH=IA32
- 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() {
- # Compile of Base Tools is required for further setting up the environment
- # Base tools does not like parallel make
- sed -e "s:^\(BUILD_CFLAGS\s*=\).*$:\1 ${CFLAGS} -MD -fshort-wchar -fno-strict-aliasing -nostdlib -c -fPIC:" \
- -i "BaseTools/Source/C/Makefiles/header.makefile" \
- || die "Failed to update makefile header"
- 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)"
- )
- emake "${make_flags[@]}" -j1 -C BaseTools
- . edksetup.sh
-
- # Update UDK parameter files
- sed -e "s:^\(ACTIVE_PLATFORM\s*=\).*$:\1 MdeModulePkg/MdeModulePkg.dsc:" \
- -e "s:^\(TARGET\s*=\).*$:\1 RELEASE:" \
- -e "s:^\(TARGET_ARCH\s*=\).*$:\1 ${ARCH}:" \
- -e "s:^\(TOOL_CHAIN_TAG\s*=\).*$:\1 ${TOOLCHAIN_TAG}:" \
- -e "s:^\(MAX_CONCURRENT_THREAD_NUMBER\s*=\).*$:\1 $(makeopts_jobs):" \
- -i "Conf/target.txt" || die "Failed to configure target file"
- sed -e "s:\(_\(CC\|ASM\|PP\|VFRPP\|ASLCC\|ASLPP\|DLINK\)_PATH\s*=\).*$:\1 $(tc-getCC):" \
- -e "s:\(_ASLDLINK_PATH\s*=\).*$:\1 $(tc-getLD):" \
- -e "s:\(_OBJCOPY_PATH\s*=\).*$:\1 $(tc-getOBJCOPY):" \
- -e "s:\(_RC_PATH\s*=\).*$:\1 $(tc-getOBJCOPY):" \
- -e "s:\(_SLINK_PATH\s*=\).*$:\1 $(tc-getAR):" \
- -i "Conf/tools_def.txt" \
- || die "Failed to prepare tools definition file"
-}
-
-src_compile() {
- build $(usex examples all libraries) || die "Failed to compile environment"
-
-# TODO * /var/tmp/portage/sys-apps/sandbox-2.10-r1/work/sandbox-2.10/libsandbox/trace.c:_do_ptrace():74: failure (Operation not permitted):
-# TODO * ISE:_do_ptrace: ptrace(PTRACE_TRACEME, ..., 0x0000000000000000, 0x0000000000000000): Operation not permitted
-}
-
-src_install() {
- local f
- local build_dir="${S}/Build/MdeModule/RELEASE_${TOOLCHAIN_TAG}/${ARCH}"
-
- for f in "${build_dir}"/*/Library/*/*/OUTPUT/*.lib; do
- local fn="lib${f##*/}"
- newlib.a "${f}" "${fn%.lib}.a"
- done
-
- insinto "/usr/share/${P}"
- doins "${S}/BaseTools/Scripts/GccBase.lds"
-
- insinto "/usr/include/${PN}"
- doins "${S}/MdePkg/Include/"*.h
- doins -r "${S}/MdePkg/Include/"{${ARCH}/.,Guid,IndustryStandard,Library,Pi,Ppi,Protocol,Uefi}
- local hfile
- while read -d '' -r hfile; do
- doins -r "${hfile}/."
- done < <(find "${S}" -name 'BaseTools' -prune -o -name 'MdePkg' -prune -o \
- -name 'CryptoPkg' -prune -o -type d -name Include -print0)
-
- dobin "${S}/BaseTools/Source/C/bin/GenFw"
-
- local HTML_DOCS
- use doc && HTML_DOCS=( "${DOCDIR}"/. )
- einstalldocs
-
- local ex_rebuild_dir
- local ex_name
- local ex_build_dir
- if use examples; then
- ex_rebuild_dir="${S}/${P}-exemples"
- for f in "${S}/MdeModulePkg/Application"/*; do
- ex_name="${f##*/}"
- ebegin "Install ${ex_name} example"
- mkdir -p "${ex_rebuild_dir}/${ex_name}" || die
- ex_build_dir="${build_dir}/MdeModulePkg/Application"
- ex_build_dir="${ex_build_dir}/${ex_name}/${ex_name}"
-
- copySourceFiles "${f}" "${ex_rebuild_dir}/${ex_name}"
- copySourceFiles "${ex_build_dir}/DEBUG" "${ex_rebuild_dir}/${ex_name}"
- createMakefile "${ex_rebuild_dir}/${ex_name}/Makefile" \
- "${ex_name}" "${ex_build_dir}/GNUmakefile"
-
- tar -C "${ex_rebuild_dir}" -cf "${ex_rebuild_dir}/${ex_name}.tar" \
- "${ex_name}" || die
-
- eend $?
- done
- docinto "examples"
- dodoc "${ex_rebuild_dir}"/*.tar
- fi
-}
-
-##
-# Parameters:
-# 1 - Path where to search for source files.
-# 2 - Path where source files must be copied.
-copySourceFiles() {
- local dest_file
- while read -d '' -r filename; do
- dest_file="${2}${filename#${1}}"
- mkdir -p "${dest_file%/*}" || die
- mv "${filename}" "${dest_file}" || die
- done < <(find "${1}" \( -name '*.h' -o -name '*.c' \) -print0)
-}
-
-##
-# Parameters:
-# 1 - Path of the file to create.
-# 2 - Name of the module.
-# 3 - Path of the generated Makefile.
-createMakefile() {
- local static_libs=$(sed -n '/^STATIC_LIBRARY_FILES\s*=/,/^\s*\$(OUTPUT_DIR)/{/^\s*\$(OUTPUT_DIR)/b;p}' ${3} \
- | sed -e 's:^\s*\$(BIN_DIR).*/\([^/]*\)\.lib:\t-l\1:' -e 's:\\$:\\\\\\n:' \
- | tr --delete '\n')
- local pecoff_header_size=$(grep -e '--defsym=PECOFF_HEADER_SIZE=' ${3} \
- | sed -e 's/^.*--defsym=PECOFF_HEADER_SIZE=\(\S*\).*$/\1/')
- local variables=$(grep -e '^IMAGE_ENTRY_POINT\s*=' -e '^CP\s*=' \
- -e '^RM\s*=' -e '^CC\s*=' -e '^DLINK\s*=' -e '^OBJCOPY\s*=' \
- -e '^GENFW\s*=' -e '^CC_FLAGS\s*=' -e '^DLINK_FLAGS\s*=' \
- -e '^OBJCOPY_FLAGS\s*=' -e '^GENFW_FLAGS\s*=' ${3} \
- | sed -e 's:$:\\n:' | tr --delete '\n')
- sed -e "s:«MODULE»:${2}:" \
- -e "s:«PACKAGE_NAME»:${PN}:" \
- -e "s:«LIB_DIR»:$(get_libdir):" \
- -e "s:«EFI_LDS»:/usr/share/${P}/GccBase.lds:" \
- -e "s:«STATIC_LIBS»:${static_libs}:" \
- -e "s:«MODULE_TYPE»:$(grep -e '^MODULE_TYPE\s*=' ${3} | tail -1):" \
- -e "s:«VARIABLES»:${variables}:" \
- -e "s:«PECOFF_HEADER_SIZE»:${pecoff_header_size}:" \
- "${FILESDIR}/${PV}-makefile.template" >${1} \
- || die "Failed to create Makefile"
-}