public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Georgy Yakovlev" <gyakovlev@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-boot/udk/
Date: Wed,  1 May 2019 21:42:00 +0000 (UTC)	[thread overview]
Message-ID: <1556746886.f9c41f936caf99abb18910db5c68ff68a49c50f9.gyakovlev@gentoo> (raw)

commit:     f9c41f936caf99abb18910db5c68ff68a49c50f9
Author:     Stéphane Veyret <sveyret <AT> gmail <DOT> com>
AuthorDate: Tue Apr  9 13:34:10 2019 +0000
Commit:     Georgy Yakovlev <gyakovlev <AT> gentoo <DOT> org>
CommitDate: Wed May  1 21:41:26 2019 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f9c41f93

sys-boot/udk: Correct issues with latest compiler versions

Signed-off-by: Stéphane VEYRET <sveyret <AT> gmail.com>
Closes: https://bugs.gentoo.org/633946
Closes: https://bugs.gentoo.org/639080
Package-Manager: Portage-2.3.62, Repoman-2.3.11
Signed-off-by: Georgy Yakovlev <gyakovlev <AT> gentoo.org>

 .../udk/{udk-2015.ebuild => udk-2015-r1.ebuild}    | 124 +++++++--------------
 1 file changed, 40 insertions(+), 84 deletions(-)

diff --git a/sys-boot/udk/udk-2015.ebuild b/sys-boot/udk/udk-2015-r1.ebuild
similarity index 57%
rename from sys-boot/udk/udk-2015.ebuild
rename to sys-boot/udk/udk-2015-r1.ebuild
index 877b99c94eb..fbb8ad18187 100644
--- a/sys-boot/udk/udk-2015.ebuild
+++ b/sys-boot/udk/udk-2015-r1.ebuild
@@ -1,14 +1,14 @@
-# Copyright 1999-2017 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
-EAPI=6
+EAPI=7
 
 PYTHON_COMPAT=( python2_7 )
 PYTHON_REQ_USE="sqlite"
 
-inherit flag-o-matic multiprocessing python-single-r1 toolchain-funcs versionator
+inherit flag-o-matic multiprocessing python-single-r1 toolchain-funcs
 
-MY_V="${PN^^}$(get_version_component_range 1)"
+MY_V="${PN^^}${PV}"
 
 DESCRIPTION="Tianocore UEFI Development kit"
 HOMEPAGE=" https://github.com/tianocore/tianocore.github.io/wiki/EDK-II"
@@ -19,6 +19,7 @@ SLOT="0"
 KEYWORDS="~amd64 ~x86"
 IUSE="doc examples"
 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+RESTRICT="strip"
 
 RDEPEND="${PYTHON_DEPS}"
 DEPEND="${RDEPEND}
@@ -27,18 +28,20 @@ DEPEND="${RDEPEND}
 
 S="${WORKDIR}/MyWorkSpace"
 
+# Generated libs for EFI can contain WX sections
+QA_EXECSTACK="usr/lib*/libBaseLib.a:*"
+
 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}
+	if [[ ${ARCH} == "amd64" ]]; then
+		ARCH=X64
+	elif [[ ${ARCH} == "x86" ]]; then
+		ARCH=IA32
 	fi
 
 	# We will create a custom toolchain with user defined settings
-	export TOOLCHAIN_TAG="CUSTOM"
+	TOOLCHAIN_TAG="CUSTOM"
 }
 
 src_unpack() {
@@ -54,10 +57,11 @@ src_unpack() {
 		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:')
+			doc_name=${f##*/}
+			doc_name=${doc_name% Document.zip}
 			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
+				mv "html" "${doc_name}" || die
 			fi
 		done
 		popd >/dev/null || die
@@ -67,14 +71,16 @@ src_unpack() {
 }
 
 src_configure() {
+	# Patch source file for permissive error (issue #639080)
+	sed -e "s/\(mStringFileName == \)'\\\\0'/\1NULL/" \
+		-i "${S}/BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp" \
+		|| die "Failed to patch source file"
+	sed -e "s/\((StringPtr != \)L'\\\\0'/\1NULL/" \
+		-i "${S}/MdeModulePkg/Library/UefiHiiLib/HiiLib.c" \
+		|| 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
-	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}:" \
+	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=(
@@ -88,9 +94,7 @@ src_configure() {
 	. 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 -fshort-wchar -fno-strict-aliasing -c
 	append-cflags $(test-flags-CC -ffunction-sections)
 	append-cflags $(test-flags-CC -fdata-sections)
 	append-cflags $(test-flags-CC -fno-stack-protector)
@@ -117,14 +121,12 @@ src_configure() {
 }
 
 src_compile() {
-	local build_target
 	if use examples; then
-		build_target=all
-	else
-		build_target=libraries
+		ewarn "Examples installation does not work anymore"
+		ewarn "Try with a most recent version of the package"
 	fi
 
-	build ${build_target} || die "Failed to compile environment"
+	build libraries || die "Failed to compile environment"
 }
 
 src_install() {
@@ -132,24 +134,19 @@ src_install() {
 	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
+		local fn="lib${f##*/}"
+		newlib.a "${f}" "${fn%.lib}.a"
 	done
-	dolib "${S}/BaseTools/Scripts/GccBase.lds"
+	dolib.a "${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
+	insinto "/usr/include/${PN}"
+	doins "${S}/MdePkg/Include/"*.h
+	doins -r "${S}/MdePkg/Include/"{${ARCH}/.,Guid,IndustryStandard,Library,Pi,Ppi,Protocol,Uefi}
 	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
+	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"
 
@@ -157,52 +154,11 @@ src_install() {
 		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"
+			ebegin "Install documentation for ${f##*/}"
 			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
 }
 
 ##
@@ -213,7 +169,7 @@ copySourceFiles() {
 	local dest_file
 	while read -d '' -r filename; do
 		dest_file="${2}${filename#${1}}"
-		mkdir -p $(dirname "${dest_file}") || die
+		mkdir -p "${dest_file%/*}" || die
 		mv "${filename}" "${dest_file}" || die
 	done < <(find "${1}" -name '*.h' -print0 -o -name '*.c' -print0)
 }


             reply	other threads:[~2019-05-01 21:42 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-01 21:42 Georgy Yakovlev [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-04-30 12:00 [gentoo-commits] repo/gentoo:master commit in: sys-boot/udk/ Joonas Niilola
2020-04-30 12:00 Joonas Niilola
2020-04-30 12:00 Joonas Niilola
2019-12-30 22:55 Sergei Trofimovich
2017-08-13 12:53 Patrice Clement
2017-04-23 21:01 David Seifert
2016-11-06 16:24 Göktürk Yüksek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1556746886.f9c41f936caf99abb18910db5c68ff68a49c50f9.gyakovlev@gentoo \
    --to=gyakovlev@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox