public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/udk/, sys-boot/udk/files/
@ 2016-10-25  2:48 Göktürk Yüksek
  0 siblings, 0 replies; 3+ messages in thread
From: Göktürk Yüksek @ 2016-10-25  2:48 UTC (permalink / raw
  To: gentoo-commits

commit:     c797b0d1ab196a6d0fbdbfbd0334ac5d5faea750
Author:     Stéphane Veyret <stephane.veyret <AT> neptura <DOT> org>
AuthorDate: Sun Jul 17 14:57:43 2016 +0000
Commit:     Göktürk Yüksek <gokturk <AT> gentoo <DOT> org>
CommitDate: Tue Oct 25 02:46:18 2016 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c797b0d1

sys-boot/udk: New package, bug #588440

UEFI Development Kit is a stable release of the TianoCore EDK II project.
EDK II is a modern, feature-rich, cross-platform firmware development environment for the UEFI and PI specifications.

 sys-boot/udk/Manifest                      |   1 +
 sys-boot/udk/files/2015-makefile.template  |  54 +++++++
 sys-boot/udk/files/2015-tools_def.template |  42 +++++
 sys-boot/udk/metadata.xml                  |  28 ++++
 sys-boot/udk/udk-2015.ebuild               | 246 +++++++++++++++++++++++++++++
 5 files changed, 371 insertions(+)

diff --git a/sys-boot/udk/Manifest b/sys-boot/udk/Manifest
new file mode 100644
index 00000000..ca2feeb
--- /dev/null
+++ b/sys-boot/udk/Manifest
@@ -0,0 +1 @@
+DIST UDK2015.Complete.MyWorkSpace.zip 121736982 SHA256 ff11e68feafae13510ad5ee951bf7b219b3483ab335c1d0c85f45a5b7ba48b5e SHA512 7856a8f29296f817e8fd09d8eaf7207f4e25a13faa10936d1ceb10cb6a900be265379722c0ade0ef93b1c640fef8693667d2567962e3288b20ae77f607f03d39 WHIRLPOOL 8b1e283e0ae3ec422eea609a418784260119410a87c5397803730f1c73be0b113eec41ed4cd1920d32735a23377acd80bedf1867518733be6d698c3891775276

diff --git a/sys-boot/udk/files/2015-makefile.template b/sys-boot/udk/files/2015-makefile.template
new file mode 100644
index 00000000..c8ae8b6
--- /dev/null
+++ b/sys-boot/udk/files/2015-makefile.template
@@ -0,0 +1,54 @@
+TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
+EXEC = «MODULE».efi
+SRC = $(shell find $(TOP) -type f -name '*.c')
+OBJ = $(SRC:.c=.o)
+INC_DIR = /usr/include/«PACKAGE_NAME»
+LIB_DIR = /usr/lib
+«STATIC_LIBS»
+
+EFI_LDS = $(LIB_DIR)/GccBase.lds
+
+«MODULE_TYPE»
+«IMAGE_ENTRY_POINT»
+
+«CP»
+«RM»
+«CC»
+«DLINK»
+«OBJCOPY»
+«GENFW»
+
+CC_FLAGS = -g -fshort-wchar -fno-strict-aliasing -Wall -Werror \
+	-Wno-array-bounds -ffunction-sections -fdata-sections -c -iquote$(TOP) \
+	-include AutoGen.h -I$(INC_DIR) -DSTRING_ARRAY_NAME=«MODULE»Strings -m64 \
+	-fno-stack-protector "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS \
+	-mno-red-zone -Wno-address -mcmodel=large -Wno-address \
+	-Wno-unused-but-set-variable
+DLINK_FLAGS=-nostdlib -n -q --gc-sections --entry $(IMAGE_ENTRY_POINT) \
+	-u $(IMAGE_ENTRY_POINT) -melf_x86_64 --oformat=elf64-x86-64 -L $(LIB_DIR) \
+	--script=$(EFI_LDS) --defsym=PECOFF_HEADER_SIZE=«PECOFF_HEADER_SIZE»
+«OBJCOPY_FLAGS»
+«GENFW_FLAGS»
+
+all:	$(EXEC)
+
+%.efi:	$(OBJ)
+	$(DLINK) -o $(@:.efi=.dll) $(DLINK_FLAGS) \
+		--start-group $(STATIC_LIBRARY_FILES) $^ --end-group
+	$(OBJCOPY) $(OBJCOPY_FLAGS) $(@:.efi=.dll)
+	$(CP) $(@:.efi=.dll) $(@:.efi=.debug)
+	$(OBJCOPY) --strip-unneeded -R .eh_frame $(@:.efi=.dll)
+	$(OBJCOPY) --add-gnu-debuglink=$(@:.efi=.debug) $(@:.efi=.dll)
+	$(GENFW) -e $(MODULE_TYPE) -o $@ $(@:.efi=.dll) $(GENFW_FLAGS)
+	$(RM) $(@:.efi=.dll)
+
+%.o:	%.c
+	$(CC) $(CC_FLAGS) -o $@ $^
+
+clean:
+	$(RM) *.o
+
+mrproper: clean
+	$(RM) $(EXEC) $(EXEC:.efi=.debug)
+
+.PHONY: all clean mrproper

diff --git a/sys-boot/udk/files/2015-tools_def.template b/sys-boot/udk/files/2015-tools_def.template
new file mode 100644
index 00000000..5c86635
--- /dev/null
+++ b/sys-boot/udk/files/2015-tools_def.template
@@ -0,0 +1,42 @@
+
+#################
+# My custom toolchain
+#################
+*_CUSTOM_*_*_FAMILY          = GCC
+*_CUSTOM_*_MAKE_PATH         = make
+*_CUSTOM_*_ASL_PATH          = DEF(UNIX_IASL_BIN)
+*_CUSTOM_*_OBJCOPY_PATH      = «OBJCOPY»
+*_CUSTOM_*_CC_PATH           = «CC»
+*_CUSTOM_*_SLINK_PATH        = «AR»
+*_CUSTOM_*_DLINK_PATH        = «LD»
+*_CUSTOM_*_ASLDLINK_PATH     = «LD»
+*_CUSTOM_*_ASM_PATH          = «CC»
+*_CUSTOM_*_PP_PATH           = «CC»
+*_CUSTOM_*_VFRPP_PATH        = «CC»
+*_CUSTOM_*_ASLCC_PATH        = «CC»
+*_CUSTOM_*_ASLPP_PATH        = «CC»
+*_CUSTOM_*_RC_PATH           = «OBJCOPY»
+*_CUSTOM_*_PP_FLAGS          = DEF(GCC_PP_FLAGS)
+*_CUSTOM_*_ASLPP_FLAGS       = DEF(GCC_ASLPP_FLAGS)
+*_CUSTOM_*_ASLCC_FLAGS       = DEF(GCC_ASLCC_FLAGS)
+*_CUSTOM_*_VFRPP_FLAGS       = DEF(GCC_VFRPP_FLAGS)
+*_CUSTOM_*_APP_FLAGS         =
+*_CUSTOM_*_ASL_FLAGS         = DEF(IASL_FLAGS)
+*_CUSTOM_*_ASL_OUTFLAGS      = DEF(IASL_OUTFLAGS)
+*_CUSTOM_*_OBJCOPY_FLAGS     =
+*_CUSTOM_IA32_ASLCC_FLAGS    = DEF(GCC_ASLCC_FLAGS) -m32
+*_CUSTOM_IA32_ASM_FLAGS      = DEF(GCC_ASM_FLAGS) -m32 -march=i386
+*_CUSTOM_IA32_CC_FLAGS       = «CFLAGS» -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings -D EFI32
+*_CUSTOM_IA32_ASLDLINK_FLAGS = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry ReferenceAcpiTable -u ReferenceAcpiTable -m elf_i386
+*_CUSTOM_IA32_DLINK_FLAGS    = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map -m elf_i386 --oformat=elf32-i386
+*_CUSTOM_IA32_DLINK2_FLAGS   = DEF(GCC_DLINK2_FLAGS_COMMON) --defsym=PECOFF_HEADER_SIZE=0x220
+*_CUSTOM_IA32_RC_FLAGS       = DEF(GCC_IA32_RC_FLAGS)
+*_CUSTOM_IA32_NASM_FLAGS     = -f elf32
+*_CUSTOM_X64_ASLCC_FLAGS     = DEF(GCC_ASLCC_FLAGS) -m64
+*_CUSTOM_X64_ASM_FLAGS       = DEF(GCC_ASM_FLAGS) -m64
+*_CUSTOM_X64_CC_FLAGS        = «CFLAGS» -include AutoGen.h -DSTRING_ARRAY_NAME=$(BASE_NAME)Strings "-DEFIAPI=__attribute__((ms_abi))" -DNO_BUILTIN_VA_FUNCS
+*_CUSTOM_X64_ASLDLINK_FLAGS  = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry ReferenceAcpiTable -u ReferenceAcpiTable -m elf_x86_64
+*_CUSTOM_X64_DLINK_FLAGS     = -nostdlib -n -q --gc-sections -z common-page-size=0x40 --entry $(IMAGE_ENTRY_POINT) -u $(IMAGE_ENTRY_POINT) -Map $(DEST_DIR_DEBUG)/$(BASE_NAME).map -m elf_x86_64 --oformat=elf64-x86-64
+*_CUSTOM_X64_DLINK2_FLAGS    = DEF(GCC_DLINK2_FLAGS_COMMON) --defsym=PECOFF_HEADER_SIZE=0x228
+*_CUSTOM_X64_RC_FLAGS        = DEF(GCC_X64_RC_FLAGS)
+*_CUSTOM_X64_NASM_FLAGS      = -f elf64

diff --git a/sys-boot/udk/metadata.xml b/sys-boot/udk/metadata.xml
new file mode 100644
index 00000000..c07291a
--- /dev/null
+++ b/sys-boot/udk/metadata.xml
@@ -0,0 +1,28 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+	<maintainer type="person">
+		<email>sveyret@gmail.com</email>
+		<name>Stéphane Veyret</name>
+	</maintainer>
+	<maintainer type="project">
+		<email>proxy-maint@gentoo.org</email>
+		<name>Proxy Maintainers</name>
+	</maintainer>
+	<longdescription lang="en">
+		Tianocore UEFI Development Kit, a stable release of portions of the
+		EDK II project.
+	</longdescription>
+	<longdescription lang="fr">
+		Kit de développement UEFI Tianocore, une version stable de portions du
+		projet EDK II.
+	</longdescription>
+	<use lang="en">
+		<flag name="doc">Install EDK II documentation.</flag>
+		<flag name="examples">Install usage examples.</flag>
+	</use>
+	<use lang="fr">
+		<flag name="doc">Installer la documentation EDK II.</flag>
+		<flag name="examples">Installer les exemples d'utilisation.</flag>
+	</use>
+</pkgmetadata>

diff --git a/sys-boot/udk/udk-2015.ebuild b/sys-boot/udk/udk-2015.ebuild
new file mode 100644
index 00000000..45a5e54
--- /dev/null
+++ b/sys-boot/udk/udk-2015.ebuild
@@ -0,0 +1,246 @@
+# Copyright 1999-2016 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Id$
+
+EAPI=6
+
+PYTHON_COMPAT=( python2_7 )
+PYTHON_REQ_USE="sqlite"
+
+inherit flag-o-matic multiprocessing python-single-r1 toolchain-funcs versionator
+
+DESCRIPTION="Tianocore UEFI Development kit"
+HOMEPAGE="http://www.tianocore.org/edk2/"
+MY_V="${PN^^}$(get_version_component_range 1)"
+SRC_URI="https://github.com/tianocore/${PN}/releases/download/${MY_V}/${MY_V}.Complete.MyWorkSpace.zip"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+IUSE="doc examples"
+
+DEPEND="app-arch/unzip
+	dev-lang/nasm
+	${PYTHON_DEPS}"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+S="${WORKDIR}/MyWorkSpace"
+
+pkg_setup() {
+	python_setup 'python2.7'
+
+	local uname_arch=$(uname -m | sed -e 's:i[3456789]86:IA32:')
+	if [[ ${uname_arch} == "x86_64" ]] || [[ ${uname_arch} == "amd64" ]] ; then
+		export ARCH=X64
+	else
+		export ARCH=${uname_arch}
+	fi
+
+	# We will create a custom toolchain with user defined settings
+	export TOOLCHAIN_TAG="CUSTOM"
+}
+
+src_unpack() {
+	unpack ${A}
+	unpack "${WORKDIR}/${MY_V}.MyWorkSpace.zip"
+
+	pushd "${S}" || die
+	unpack "${WORKDIR}/BaseTools(Unix).tar"
+
+	local doc_name
+	local f
+	if use doc; then
+		mkdir -p "${S}/doc" || die
+		pushd "${S}/doc" >/dev/null || die
+		for f in "${WORKDIR}/Documents/"*" Document.zip"; do
+			doc_name=$(echo ${f} | sed -e 's:^.*/\([^/]*\) Document[.]zip$:\1:')
+			if [[ -f "${WORKDIR}/Documents/${doc_name} Document.zip" ]]; then
+				unpack "${WORKDIR}/Documents/${doc_name} Document.zip"
+				mv "${S}/doc/html" "${S}/doc/${doc_name}" || die
+			fi
+		done
+		popd >/dev/null || die
+	fi
+
+	popd >/dev/null || die
+}
+
+src_configure() {
+	# Compile of Base Tools is required for further setting up the environment
+	# Base tools does not like parallel make
+	local cflags_save=${CFLAGS}
+	append-cflags $(test-flags-CC -MD) $(test-flags-CC -fshort-wchar)
+	append-cflags $(test-flags-CC -fno-strict-aliasing)
+	append-cflags $(test-flags-CC -nostdlib) $(test-flags-CC -c)
+	append-cflags $(test-flags-CC -fPIC)
+	sed -e "s:^\(CFLAGS\s*=\).*$:\1 ${CFLAGS}:" \
+		-i "${S}/BaseTools/Source/C/Makefiles/header.makefile" \
+		|| die "Failed to update makefile header"
+	local make_flags=(
+		CC="$(tc-getCC)"
+		CXX="$(tc-getCXX)"
+		AS="$(tc-getAS)"
+		AR="$(tc-getAR)"
+		LD="$(tc-getLD)"
+	)
+	emake "${make_flags[@]}" -j1 -C BaseTools
+	. edksetup.sh BaseTools
+
+	# Update flags in UDK parameter files
+	CFLAGS=${cflags_save}
+	append-cflags $(test-flags-CC -fshort-wchar)
+	append-cflags $(test-flags-CC -fno-strict-aliasing) $(test-flags-CC -c)
+	append-cflags $(test-flags-CC -ffunction-sections)
+	append-cflags $(test-flags-CC -fdata-sections)
+	append-cflags $(test-flags-CC -fno-stack-protector)
+	append-cflags $(test-flags-CC -fno-asynchronous-unwind-tables)
+	if [[ "${ARCH}" == "X64" ]]; then
+		append-cflags $(test-flags-CC -m64) $(test-flags-CC -mno-red-zone)
+		append-cflags $(test-flags-CC -mcmodel=large)
+	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):" \
+		-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}:" \
+		"${FILESDIR}/${PV}-tools_def.template" >>"${S}/Conf/tools_def.txt" \
+		|| die "Failed to prepare tools definition file"
+}
+
+src_compile() {
+	local build_target
+	if use examples; then
+		build_target=all
+	else
+		build_target=libraries
+	fi
+
+	build ${build_target} || die "Failed to compile environment"
+}
+
+src_install() {
+	local f
+	local build_dir="${S}/Build/MdeModule/RELEASE_${TOOLCHAIN_TAG}/${ARCH}"
+
+	for f in "${build_dir}"/*/Library/*/*/OUTPUT/*.lib; do
+		newlib.a "${f}" lib$(basename "${f}" .lib).a
+	done
+	dolib "${S}/BaseTools/Scripts/GccBase.lds"
+
+	local include_dest="/usr/include/${PN}"
+	for f in "" /Guid /IndustryStandard /Library /Pi /Ppi /Protocol /Uefi; do
+		insinto "${include_dest}${f}"
+		doins "${S}/MdePkg/Include${f}"/*.h
+	done
+	insinto "${include_dest}"
+	doins "${S}/MdePkg/Include/${ARCH}"/*.h
+	local hfile
+	find "${S}" -name 'BaseTools' -prune -o -name 'MdePkg' -prune -o \
+		-name 'CryptoPkg' -prune -o -type d -name Include \
+		-exec find {} -maxdepth 0 \; \
+		| while read hfile; do
+		doins -r "${hfile}"/*
+	done
+
+	dobin "${S}/BaseTools/Source/C/bin/GenFw"
+
+	if use doc; then
+		docinto "html"
+		# Document installation may be very long, so split it and display message
+		for f in "${S}"/doc/*; do
+			ebegin "Installing documentation for $(basename ${f}), please wait"
+			dodoc -r "${f}"
+			eend $?
+		done
+	fi
+
+	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=$(basename "${f}")
+			ebegin "Preparing ${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 $? "Failed to create example file"
+		done
+		docinto "examples"
+		dodoc "${ex_rebuild_dir}"/*.tar
+	fi
+
+# TODO * QA Notice: The following files contain writable and executable sections
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:Thunk16.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:SwitchStack.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:SetJump.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:LongJump.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:EnableDisableInterrupts.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:DisablePaging64.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:CpuId.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:CpuIdEx.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:EnableCache.obj
+# TODO * !WX --- --- usr/lib64/libBaseLib.a:DisableCache.obj
+# TODO * QA Notice: Package triggers severe warnings which indicate that it
+# TODO *            may exhibit random runtime failures.
+# TODO * /usr/include/bits/string3.h:90:70: warning: call to void* __builtin___memset_chk(void*, int, long unsigned int, long unsigned int) will always overflow destination buffer
+}
+
+##
+# 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 $(dirname "${dest_file}") || die
+		mv "${filename}" "${dest_file}" || die
+	done < <(find "${1}" -name '*.h' -print0 -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;
+	[[ $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}):" \
+		"${FILESDIR}/${PV}-makefile.template" >${1} \
+		|| die "Failed to create Makefile"
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-boot/udk/, sys-boot/udk/files/
@ 2019-05-01 21:42 Georgy Yakovlev
  0 siblings, 0 replies; 3+ messages in thread
From: Georgy Yakovlev @ 2019-05-01 21:42 UTC (permalink / raw
  To: gentoo-commits

commit:     b1193c44d34f7af290c04f4aaf8df0781c1c9836
Author:     Stéphane Veyret <sveyret <AT> gmail <DOT> com>
AuthorDate: Wed Apr 10 15:29:29 2019 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Wed May  1 21:41:27 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b1193c44

sys-boot/udk: Bump to version 2018

Signed-off-by: Stéphane VEYRET <sveyret <AT> gmail.com>
Closes: https://bugs.gentoo.org/628300
Bug: https://bugs.gentoo.org/603986
Bug: https://bugs.gentoo.org/598042
Package-Manager: Portage-2.3.62, Repoman-2.3.11
Closes: https://github.com/gentoo/gentoo/pull/11655
Reviewed-by: Michał Górny <mgorny <AT> gentoo.org>
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 sys-boot/udk/Manifest                     |   2 +
 sys-boot/udk/files/2018-makefile.template |  41 ++++++
 sys-boot/udk/udk-2018.ebuild              | 212 ++++++++++++++++++++++++++++++
 3 files changed, 255 insertions(+)

diff --git a/sys-boot/udk/Manifest b/sys-boot/udk/Manifest
index e8605e43db6..5b45c5e5d81 100644
--- a/sys-boot/udk/Manifest
+++ b/sys-boot/udk/Manifest
@@ -1 +1,3 @@
 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

diff --git a/sys-boot/udk/files/2018-makefile.template b/sys-boot/udk/files/2018-makefile.template
new file mode 100644
index 00000000000..049a94facd8
--- /dev/null
+++ b/sys-boot/udk/files/2018-makefile.template
@@ -0,0 +1,41 @@
+TOP := $(abspath $(dir $(lastword $(MAKEFILE_LIST))))
+BASE_NAME = «MODULE»
+EXEC = «MODULE».efi
+SRC = $(shell find $(TOP) -type f -name '*.c')
+OBJ = $(SRC:.c=.o)
+INC_DIR = /usr/include/«PACKAGE_NAME»
+LIB_DIR = «LIB_DIR»
+DEST_DIR_DEBUG = .
+«STATIC_LIBS»
+
+EFI_LDS = «EFI_LDS»
+«MODULE_TYPE»
+«VARIABLES»
+
+comma:= ,
+empty:=
+space:= $(empty) $(empty)
+
+all:	$(EXEC)
+
+%.efi:	$(OBJ)
+	$(DLINK) -o $(@:.efi=.dll) $(DLINK_FLAGS) \
+		-Wl,--script,$(EFI_LDS) -Wl,--defsym=PECOFF_HEADER_SIZE=«PECOFF_HEADER_SIZE» \
+		-Wl,$(subst $(space),$(comma),--start-group $(STATIC_LIBRARY_FILES)$^ --end-group)
+	$(OBJCOPY) $(OBJCOPY_FLAGS) $(@:.efi=.dll)
+	$(CP) $(@:.efi=.dll) $(@:.efi=.debug)
+	$(OBJCOPY) --strip-unneeded -R .eh_frame $(@:.efi=.dll)
+	$(OBJCOPY) --add-gnu-debuglink=$(@:.efi=.debug) $(@:.efi=.dll)
+	$(GENFW) -e $(MODULE_TYPE) -o $@ $(@:.efi=.dll) $(GENFW_FLAGS)
+	$(RM) $(@:.efi=.dll)
+
+%.o:	%.c
+	$(CC) $(CC_FLAGS) -I$(INC_DIR) -iquote$(TOP) -c -o $@ $^
+
+clean:
+	$(RM) *.o
+
+mrproper: clean
+	$(RM) $(EXEC) $(EXEC:.efi=.debug)
+
+.PHONY: all clean mrproper

diff --git a/sys-boot/udk/udk-2018.ebuild b/sys-boot/udk/udk-2018.ebuild
new file mode 100644
index 00000000000..d89fdb55e27
--- /dev/null
+++ b/sys-boot/udk/udk-2018.ebuild
@@ -0,0 +1,212 @@
+# 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"
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: sys-boot/udk/, sys-boot/udk/files/
@ 2019-07-05 20:31 Michał Górny
  0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2019-07-05 20:31 UTC (permalink / raw
  To: gentoo-commits

commit:     6cc95d998b2ca6fc6972ff33794d04c81f2ee362
Author:     Stéphane Veyret <sveyret <AT> gmail <DOT> com>
AuthorDate: Sun Jun  2 18:23:32 2019 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Fri Jul  5 20:31:22 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6cc95d99

sys-boot/udk: Simplify udk installation

Signed-off-by: Stéphane VEYRET <sveyret <AT> gmail.com>
Closes: https://bugs.gentoo.org/687222
Package-Manager: Portage-2.3.66, Repoman-2.3.11
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 sys-boot/udk/files/udk-workspace.template |  63 +++++++++++++
 sys-boot/udk/udk-2018-r1.ebuild           | 146 ++++++++++++++++++++++++++++++
 2 files changed, 209 insertions(+)

diff --git a/sys-boot/udk/files/udk-workspace.template b/sys-boot/udk/files/udk-workspace.template
new file mode 100644
index 00000000000..e119c3ae1a3
--- /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 00000000000..89f40f3e1a5
--- /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"
+}


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-05 20:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-01 21:42 [gentoo-commits] repo/gentoo:master commit in: sys-boot/udk/, sys-boot/udk/files/ Georgy Yakovlev
  -- strict thread matches above, loose matches on Subject: below --
2019-07-05 20:31 Michał Górny
2016-10-25  2:48 Göktürk Yüksek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox