public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/files/, sys-boot/refind/
@ 2020-12-07  7:36 Joonas Niilola
  0 siblings, 0 replies; 5+ messages in thread
From: Joonas Niilola @ 2020-12-07  7:36 UTC (permalink / raw
  To: gentoo-commits

commit:     1aa0c940ee1fc5a5efc5800ee69f676e3710d24a
Author:     Theo Anderson <telans <AT> posteo <DOT> de>
AuthorDate: Fri Nov 27 10:51:00 2020 +0000
Commit:     Joonas Niilola <juippis <AT> gentoo <DOT> org>
CommitDate: Mon Dec  7 07:30:20 2020 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1aa0c940

sys-boot/refind: add GCC 10 patch / custom-cflags fix

Closes: https://bugs.gentoo.org/723244
Package-Manager: Portage-3.0.10, Repoman-3.0.2
Signed-off-by: Theo Anderson <telans <AT> posteo.de>
Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>

 sys-boot/refind/files/refind-0.12.0-gcc10.patch | 11 +++++++++++
 sys-boot/refind/refind-0.12.0-r1.ebuild         | 12 ++++++++----
 2 files changed, 19 insertions(+), 4 deletions(-)

diff --git a/sys-boot/refind/files/refind-0.12.0-gcc10.patch b/sys-boot/refind/files/refind-0.12.0-gcc10.patch
new file mode 100644
index 00000000000..1f2e2bc0a5d
--- /dev/null
+++ b/sys-boot/refind/files/refind-0.12.0-gcc10.patch
@@ -0,0 +1,11 @@
+--- a/Make.common
++++ b/Make.common
+@@ -60,7 +60,7 @@
+ #
+ 
+ # ...for both GNU-EFI and TianoCore....
+-OPTIMFLAGS      = -Os -fno-strict-aliasing
++OPTIMFLAGS      = -Os -fno-strict-aliasing -fno-tree-loop-distribute-patterns
+ CFLAGS          = $(OPTIMFLAGS) -fno-stack-protector -fshort-wchar -Wall
+ 
+ # ...for GNU-EFI....

diff --git a/sys-boot/refind/refind-0.12.0-r1.ebuild b/sys-boot/refind/refind-0.12.0-r1.ebuild
index b595a111e7e..f63a0cbd324 100644
--- a/sys-boot/refind/refind-0.12.0-r1.ebuild
+++ b/sys-boot/refind/refind-0.12.0-r1.ebuild
@@ -15,10 +15,14 @@ KEYWORDS="~amd64 ~x86"
 FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
 IUSE="${FS_USE} custom-cflags doc"
 
-DEPEND=">=sys-boot/gnu-efi-3.0.2"
+DEPEND="sys-boot/gnu-efi"
 
-DOCS=(README.txt)
-PATCHES=("${FILESDIR}/makefile.patch")
+PATCHES=(
+	"${FILESDIR}/makefile.patch"
+	"${FILESDIR}/${P}-gcc10.patch" # Bug 723244
+)
+
+DOCS=( README.txt )
 
 pkg_pretend() {
 	if use custom-cflags; then
@@ -78,7 +82,7 @@ src_compile() {
 		FILESYSTEMS_GNUEFI="${fs_names[@]}"
 	)
 	if use custom-cflags; then
-		make_flags=(CFLAGS="${CFLAGS}" "${make_flags[@]}")
+		make_flags=(CFLAGS="${CFLAGS} -fno-tree-loop-distribute-patterns" "${make_flags[@]}")
 	fi
 
 	emake "${make_flags[@]}" all_gnuefi


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

* [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/files/, sys-boot/refind/
@ 2021-11-19 10:25 Sam James
  0 siblings, 0 replies; 5+ messages in thread
From: Sam James @ 2021-11-19 10:25 UTC (permalink / raw
  To: gentoo-commits

commit:     a53c6c338d72c8ddd2e517c69bbd901afe5a367d
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Nov 19 10:24:44 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Nov 19 10:25:05 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a53c6c33

sys-boot/refind: fix build with gnu-efi-3.0.14

Seems to build fine with older versions too.

Closes: https://bugs.gentoo.org/810907
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../refind/files/refind-0.13.2-gnuefi-3.0.14.patch | 51 ++++++++++++++++++++++
 sys-boot/refind/refind-0.13.2.ebuild               |  4 ++
 2 files changed, 55 insertions(+)

diff --git a/sys-boot/refind/files/refind-0.13.2-gnuefi-3.0.14.patch b/sys-boot/refind/files/refind-0.13.2-gnuefi-3.0.14.patch
new file mode 100644
index 000000000000..751a8e838dfa
--- /dev/null
+++ b/sys-boot/refind/files/refind-0.13.2-gnuefi-3.0.14.patch
@@ -0,0 +1,51 @@
+https://bugs.gentoo.org/810907
+https://sources.debian.org/patches/refind/0.13.2-1/gnu-efi.patch/
+
+Origin: https://sourceforge.net/p/refind/code/ci/10f838a4cd132a5595acaf3c54c15782151a61df
+Applied-Upstream: 0.13.3
+From 10f838a4cd132a5595acaf3c54c15782151a61df Mon Sep 17 00:00:00 2001
+From: Rod Smith <rodsmith@rodsbooks.com>
+Date: Sat, 23 Oct 2021 10:17:23 -0400
+Subject: [PATCH] Fix compile problems with recent GNU-EFI versions
+
+---
+ EfiLib/DevicePathUtilities.h | 13 -------------
+ EfiLib/gnuefi-helper.c       |  1 -
+ NEWS.txt                     |  3 +++
+ include/version.h            |  2 +-
+ 4 files changed, 4 insertions(+), 15 deletions(-)
+
+diff --git a/EfiLib/DevicePathUtilities.h b/EfiLib/DevicePathUtilities.h
+index b559671..14ed797 100644
+--- a/EfiLib/DevicePathUtilities.h
++++ b/EfiLib/DevicePathUtilities.h
+@@ -217,17 +217,4 @@ EFIAPI
+ --*/
+ ;
+ 
+-typedef struct {
+-  EFI_DEVICE_PATH_UTILS_GET_DEVICE_PATH_SIZE GetDevicePathSize;
+-  EFI_DEVICE_PATH_UTILS_DUP_DEVICE_PATH      DuplicateDevicePath;
+-  EFI_DEVICE_PATH_UTILS_APPEND_PATH          AppendDevicePath;
+-  EFI_DEVICE_PATH_UTILS_APPEND_NODE          AppendDeviceNode;
+-  EFI_DEVICE_PATH_UTILS_APPEND_INSTANCE      AppendDevicePathInstance;
+-  EFI_DEVICE_PATH_UTILS_GET_NEXT_INSTANCE    GetNextDevicePathInstance;
+-  EFI_DEVICE_PATH_UTILS_IS_MULTI_INSTANCE    IsDevicePathMultiInstance;
+-  EFI_DEVICE_PATH_UTILS_CREATE_NODE          CreateDeviceNode;
+-} EFI_DEVICE_PATH_UTILITIES_PROTOCOL;
+-
+-extern EFI_GUID gEfiDevicePathUtilitiesProtocolGuid;
+-
+ #endif
+diff --git a/EfiLib/gnuefi-helper.c b/EfiLib/gnuefi-helper.c
+index 246c261..8730403 100644
+--- a/EfiLib/gnuefi-helper.c
++++ b/EfiLib/gnuefi-helper.c
+@@ -20,7 +20,6 @@
+ #include "refit_call_wrapper.h"
+ #include "LegacyBios.h"
+ 
+-EFI_GUID gEfiDevicePathUtilitiesProtocolGuid = { 0x09576E91, 0x6D3F, 0x11D2, { 0x8E, 0x39, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B }};
+ EFI_GUID gEfiLegacyBiosProtocolGuid = { 0xdb9a1e3d, 0x45cb, 0x4abb, { 0x85, 0x3b, 0xe5, 0x38, 0x7f, 0xdb, 0x2e, 0x2d }};
+ 
+ /**

diff --git a/sys-boot/refind/refind-0.13.2.ebuild b/sys-boot/refind/refind-0.13.2.ebuild
index 6ac73e61dca8..ce3ba933229e 100644
--- a/sys-boot/refind/refind-0.13.2.ebuild
+++ b/sys-boot/refind/refind-0.13.2.ebuild
@@ -19,6 +19,10 @@ DEPEND="sys-boot/gnu-efi"
 
 DOCS=( README.txt )
 
+PATCHES=(
+	"${FILESDIR}"/${P}-gnuefi-3.0.14.patch
+)
+
 pkg_pretend() {
 	if use custom-cflags; then
 		ewarn


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

* [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/files/, sys-boot/refind/
@ 2023-08-27 10:12 Viorel Munteanu
  0 siblings, 0 replies; 5+ messages in thread
From: Viorel Munteanu @ 2023-08-27 10:12 UTC (permalink / raw
  To: gentoo-commits

commit:     cca9476ec9f09c82613acfcc86b6baa150577c4a
Author:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Sun Aug 27 09:17:42 2023 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Sun Aug 27 10:10:37 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cca9476e

sys-boot/refind: add 0.14.0.2

Closes: https://bugs.gentoo.org/910238
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>

 sys-boot/refind/Manifest                           |   1 +
 .../refind/files/refind-sbat-gentoo-0.14.0.2.csv   |   3 +
 sys-boot/refind/metadata.xml                       |   4 +
 sys-boot/refind/refind-0.14.0.2.ebuild             | 146 +++++++++++++++++++++
 4 files changed, 154 insertions(+)

diff --git a/sys-boot/refind/Manifest b/sys-boot/refind/Manifest
index 9d884c1c9c9d..d538cc085ff8 100644
--- a/sys-boot/refind/Manifest
+++ b/sys-boot/refind/Manifest
@@ -1,2 +1,3 @@
 DIST refind-src-0.13.2.tar.gz 4554759 BLAKE2B 2c3b1daf5fa100dcd4e1c801aa625e269ae9c1a99b567a271d7cdd30f95fa1e041e22984623b9a0e61f8af45966919f4b9f3a5b6c2026271d1bc37c6925f1e70 SHA512 e671d44385297295c143824dd95593f2e7bc8e282745d127b041a645aa27003467a3a23f368fd30297f33faa06bd914540d7bdc3c71ec42f6b7a38d7ee8e0ddb
 DIST refind-src-0.13.3.1.tar.gz 4550242 BLAKE2B ab8dd27f82954ea6f9831f827550f27b5ca426b7783e918311ba7e178fc3509698a0107f61d0394a7893318528cb3e0c8491f4522de0a4aca6a40e0749f5a6f9 SHA512 7966df5dd8dc66cc49a329ed722a567672da8e2fa3f2334d53db65357cea17cba5a4dc5459e358de1079a938da3c63dc626d096ce28b6bf1fa2964be7359dbd1
+DIST refind-src-0.14.0.2.tar.gz 4648958 BLAKE2B 02019ddb872ce44d2a2119902edebd633f925d49634e3bcc6bfb2c9dedb8ce213166909395a333d3a37e95c67720e31b1f5fcf25083801c17d645372aa54a06a SHA512 41c120c1afec37c508aa5c0ec09a6563c3047ef84932308c91701795b950431dfad17d25cf664039b490a302d475add98441b75f90ff71cadce41febedc68a9e

diff --git a/sys-boot/refind/files/refind-sbat-gentoo-0.14.0.2.csv b/sys-boot/refind/files/refind-sbat-gentoo-0.14.0.2.csv
new file mode 100644
index 000000000000..1062bd271dd1
--- /dev/null
+++ b/sys-boot/refind/files/refind-sbat-gentoo-0.14.0.2.csv
@@ -0,0 +1,3 @@
+sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
+refind,1,Roderick W. Smith,refind,0.14.0,https://www.rodsbooks.com/refind
+refind.gentoo,1,Gentoo Linux,refind,0.14.0,https://packages.gentoo.org/packages/sys-boot/refind

diff --git a/sys-boot/refind/metadata.xml b/sys-boot/refind/metadata.xml
index c4b2438447a5..7a3d471b5fed 100644
--- a/sys-boot/refind/metadata.xml
+++ b/sys-boot/refind/metadata.xml
@@ -5,6 +5,10 @@
 		<email>sveyret@gmail.com</email>
 		<name>Stéphane Veyret</name>
 	</maintainer>
+	<maintainer type="person">
+		<email>ceamac@gentoo.org</email>
+		<name>Viorel Munteanu</name>
+	</maintainer>
 	<maintainer type="project" proxied="proxy">
 		<email>proxy-maint@gentoo.org</email>
 		<name>Proxy Maintainers</name>

diff --git a/sys-boot/refind/refind-0.14.0.2.ebuild b/sys-boot/refind/refind-0.14.0.2.ebuild
new file mode 100644
index 000000000000..3193d0592d07
--- /dev/null
+++ b/sys-boot/refind/refind-0.14.0.2.ebuild
@@ -0,0 +1,146 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs secureboot
+
+DESCRIPTION="The UEFI Boot Manager by Rod Smith"
+HOMEPAGE="https://www.rodsbooks.com/refind/"
+SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
+
+LICENSE="BSD GPL-2 GPL-3 FDL-1.3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
+IUSE="${FS_USE} custom-cflags doc"
+
+DEPEND="sys-boot/gnu-efi"
+
+DOCS=( README.txt )
+
+pkg_pretend() {
+	if use custom-cflags; then
+		ewarn
+		ewarn "You have enabled building with USE=custom-cflags. Be aware that"
+		ewarn "using this can result in EFI binaries that fail to run and may"
+		ewarn "fail to build at all. This is strongly advised against by upstream."
+		ewarn
+		ewarn "See https://bugs.gentoo.org/598587#c3 for more information"
+		ewarn
+	fi
+}
+
+pkg_setup() {
+	if use x86; then
+		export EFIARCH=ia32
+		export BUILDARCH=ia32
+	elif use amd64; then
+		export EFIARCH=x64
+		export BUILDARCH=x86_64
+	fi
+	secureboot_pkg_setup
+}
+
+src_prepare() {
+	default
+
+	# bug 598647 - PIE not supported
+	sed -e '/^CFLAGS/s/$/ -fno-PIE/' -i Make.common || die
+	sed -e '1 i\.NOTPARALLEL:' -i filesystems/Makefile || die
+
+	cp "${FILESDIR}"/refind-sbat-gentoo-${PV}.csv refind-sbat-gentoo.csv || die
+}
+
+src_compile() {
+	# Update fs targets depending on uses
+	local fs fs_names=()
+	for fs in ${FS_USE}; do
+		fs=${fs#+}
+		if use "${fs}"; then
+			fs_names+=(${fs})
+		fi
+	done
+	fs_names=("${fs_names[@]/%/_gnuefi}")
+
+	# Prepare flags
+	local make_flags=(
+		ARCH="${BUILDARCH}"
+		CC="$(tc-getCC)"
+		AS="$(tc-getAS)"
+		LD="$(tc-getLD)"
+		AR="$(tc-getAR)"
+		RANLIB="$(tc-getRANLIB)"
+		OBJCOPY="$(tc-getOBJCOPY)"
+		GNUEFILIB="/usr/$(get_libdir)"
+		EFILIB="/usr/$(get_libdir)"
+		EFICRT0="/usr/$(get_libdir)"
+		FILESYSTEMS="${fs_names[*]}"
+		FILESYSTEMS_GNUEFI="${fs_names[*]}"
+		REFIND_SBAT_CSV=refind-sbat-gentoo.csv
+	)
+	if use custom-cflags; then
+		make_flags=(CFLAGS="${CFLAGS} -fno-tree-loop-distribute-patterns" "${make_flags[@]}")
+	fi
+
+	emake "${make_flags[@]}" all_gnuefi
+}
+
+src_install() {
+	exeinto "/usr/$(get_libdir)/${PN}"
+	doexe refind-install
+	dosym "../$(get_libdir)/${PN}/refind-install" "/usr/sbin/refind-install"
+
+	if use doc; then
+		doman "docs/man/"*
+		DOCS+=(NEWS.txt docs/refind docs/Styles)
+	fi
+	einstalldocs
+
+	insinto "/usr/$(get_libdir)/${PN}/refind"
+	doins "refind/refind_${EFIARCH}.efi"
+	doins "refind.conf-sample"
+	doins -r images icons fonts banners
+
+	if [[ -d "drivers_${EFIARCH}" ]]; then
+		doins -r "drivers_${EFIARCH}"
+	fi
+
+	insinto "/usr/$(get_libdir)/${PN}/refind/tools_${EFIARCH}"
+	doins "gptsync/gptsync_${EFIARCH}.efi"
+
+	insinto "/etc/refind.d"
+	doins -r "keys"
+
+	dosbin "mkrlconf"
+	dosbin "mvrefind"
+	dosbin "refind-mkdefault"
+
+	secureboot_auto_sign --in-place
+}
+
+pkg_postinst() {
+	elog "rEFInd has been built and installed into ${EROOT}/usr/$(get_libdir)/${PN}"
+	elog "You will need to use the command 'refind-install' to install"
+	elog "the binaries into your EFI System Partition"
+	elog ""
+	elog "refind-install requires additional packages to be fully functional:"
+	elog " app-crypt/sbsigntools for binary signing for use with SecureBoot"
+	elog " sys-boot/efibootmgr for writing to NVRAM"
+	elog " sys-apps/gptfdisk for ESP management"
+	elog ""
+	elog "refind-mkdefault requires >=dev-lang/python-3"
+	elog ""
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		elog "A sample configuration can be found at"
+		elog "${EROOT}/usr/$(get_libdir)/${PN}/refind/refind.conf-sample"
+	else
+		if ver_test "${REPLACING_VERSIONS}" -lt "0.12.0"; then
+			ewarn "This new version uses sys-apps/gptfdisk instead of sys-block/parted"
+			ewarn "to manage ESP"
+			ewarn ""
+		fi
+		ewarn "Note that this installation will not update any EFI binaries"
+		ewarn "on your EFI System Partition - this needs to be done manually"
+	fi
+}


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

* [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/files/, sys-boot/refind/
@ 2023-09-14  4:43 Viorel Munteanu
  0 siblings, 0 replies; 5+ messages in thread
From: Viorel Munteanu @ 2023-09-14  4:43 UTC (permalink / raw
  To: gentoo-commits

commit:     797977a54c63876d010635d5d8431798396e9b15
Author:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Sun Sep 10 12:29:17 2023 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Thu Sep 14 04:39:01 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=797977a5

sys-boot/refind: fix compilation with clang

Compiling with clang works.
Linking with lld produces broken executables (including the drivers).
llvm-objcopy does not support the output format needed by refind.

Try to force ld.bfd and binutils objcopy.  Fail otherwise.

Bug: https://bugs.gentoo.org/732256
Bug: https://bugs.gentoo.org/832018
Bug: https://bugs.gentoo.org/881131
Closes: https://github.com/gentoo/gentoo/pull/32710
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>

 sys-boot/refind/files/refind-0.14.0.2-clang.patch |  62 +++++++++
 sys-boot/refind/refind-0.14.0.2-r1.ebuild         | 160 ++++++++++++++++++++++
 2 files changed, 222 insertions(+)

diff --git a/sys-boot/refind/files/refind-0.14.0.2-clang.patch b/sys-boot/refind/files/refind-0.14.0.2-clang.patch
new file mode 100644
index 000000000000..fe2323390355
--- /dev/null
+++ b/sys-boot/refind/files/refind-0.14.0.2-clang.patch
@@ -0,0 +1,62 @@
+Fix compilation with clang.
+
+Clang does not support nested functions (a gcc extension), so move it outside.
+
+Compiling with _FORTIFY_SOURCE and -ffreestanding results in
+nanojpeg.c:(.text+0xa28): undefined reference to `__memset_chk'
+
+See also: https://bugs.gentoo.org/881131
+
+--- a/filesystems/crc32c.c
++++ b/filesystems/crc32c.c
+@@ -22,25 +22,24 @@
+ 
+ static uint32_t crc32c_table [256];
+ 
+-static void
+-init_crc32c_table (void)
++uint32_t reflect (uint32_t ref, int len)
+ {
+-  auto uint32_t reflect (uint32_t ref, int len);
+-  uint32_t reflect (uint32_t ref, int len)
+-    {
+-      uint32_t result = 0;
+-      int i;
++  uint32_t result = 0;
++  int i;
+ 
+-      for (i = 1; i <= len; i++)
+-        {
+-          if (ref & 1)
+-            result |= 1 << (len - i);
+-          ref >>= 1;
+-        }
+-
+-      return result;
++  for (i = 1; i <= len; i++)
++    {
++      if (ref & 1)
++        result |= 1 << (len - i);
++      ref >>= 1;
+     }
+ 
++  return result;
++}
++
++static void
++init_crc32c_table (void)
++{
+   static int crc32c_table_inited;
+   if(crc32c_table_inited)
+ 	  return;
+--- a/libeg/nanojpeg.c
++++ b/libeg/nanojpeg.c
+@@ -112,6 +112,8 @@
+ #ifndef _NANOJPEG_H
+ #define _NANOJPEG_H
+ 
++#undef _FORTIFY_SOURCE
++
+ // Modified: Map libc-style free() and malloc() to their EFI equivalents....
+ #define free MyFreePool
+ #define malloc AllocatePool

diff --git a/sys-boot/refind/refind-0.14.0.2-r1.ebuild b/sys-boot/refind/refind-0.14.0.2-r1.ebuild
new file mode 100644
index 000000000000..c7dad8ce3707
--- /dev/null
+++ b/sys-boot/refind/refind-0.14.0.2-r1.ebuild
@@ -0,0 +1,160 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit optfeature secureboot toolchain-funcs
+
+DESCRIPTION="The UEFI Boot Manager by Rod Smith"
+HOMEPAGE="https://www.rodsbooks.com/refind/"
+SRC_URI="mirror://sourceforge/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
+
+LICENSE="BSD GPL-2 GPL-3 FDL-1.3"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
+IUSE="${FS_USE} doc"
+
+DEPEND="sys-boot/gnu-efi"
+
+# for ld.bfd and objcopy
+BDEPEND="sys-devel/binutils"
+
+DOCS=( README.txt NEWS.txt )
+
+PATCHES=( "${FILESDIR}"/${P}-clang.patch )
+
+checktools() {
+	if [[ ${MERGE_TYPE} != "binary" ]]; then
+		# bug #832018
+		tc-export LD
+		tc-ld-force-bfd
+		# the makefile calls LD directly, so try to fix LD too
+		LD="${LD/.lld/.bfd}"
+		tc-ld-is-lld "${LD}" && die "Linking with lld produces broken executables and may lead to unbootable system"
+
+		# bug #732256
+		# llvm-objcopy does not support EFI target, try to use binutils objcopy or fail
+		tc-export OBJCOPY
+		OBJCOPY="${OBJCOPY/llvm-/}"
+		LANG=C LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' || die "${OBJCOPY} (objcopy) does not support EFI target"
+	fi
+}
+
+pkg_pretend() {
+	checktools
+}
+
+pkg_setup() {
+	if use x86; then
+		export EFIARCH=ia32
+		export BUILDARCH=ia32
+	elif use amd64; then
+		export EFIARCH=x64
+		export BUILDARCH=x86_64
+	fi
+	secureboot_pkg_setup
+
+	# this does not only check, but also exports LD and OBJCOPY
+	checktools
+}
+
+src_prepare() {
+	default
+
+	# bug #598647 - PIE not supported
+	sed -e '/^CFLAGS/s/$/ -fno-PIE/' -i Make.common || die
+	sed -e '1 i\.NOTPARALLEL:' -i filesystems/Makefile || die
+
+	# bug #881131, bug #832018
+	sed -e 's/-fno-tree-loop-distribute-patterns/-ffreestanding/' -i Make.common || die
+
+	cp "${FILESDIR}"/refind-sbat-gentoo-${PV}.csv refind-sbat-gentoo.csv || die
+}
+
+src_compile() {
+	# Update fs targets depending on uses
+	local fs fs_names=()
+	for fs in ${FS_USE}; do
+		fs=${fs#+}
+		if use "${fs}"; then
+			fs_names+=( ${fs} )
+		fi
+	done
+	fs_names=( "${fs_names[@]/%/_gnuefi}" )
+
+	# Prepare flags
+	local make_flags=(
+		ARCH="${BUILDARCH}"
+		CC="$(tc-getCC)"
+		AS="$(tc-getAS)"
+		LD="${LD}"
+		AR="$(tc-getAR)"
+		RANLIB="$(tc-getRANLIB)"
+		OBJCOPY="${OBJCOPY}"
+		GNUEFILIB="${ESYSROOT}/usr/$(get_libdir)"
+		EFILIB="${ESYSROOT}/usr/$(get_libdir)"
+		EFICRT0="${ESYSROOT}/usr/$(get_libdir)"
+		FILESYSTEMS="${fs_names[*]}"
+		FILESYSTEMS_GNUEFI="${fs_names[*]}"
+		REFIND_SBAT_CSV=refind-sbat-gentoo.csv
+	)
+
+	emake "${make_flags[@]}" all_gnuefi
+}
+
+src_install() {
+	exeinto "/usr/$(get_libdir)/${PN}"
+	doexe refind-install
+	dosym -r "/usr/$(get_libdir)/${PN}/refind-install" "/usr/sbin/refind-install"
+
+	doman "docs/man/"*
+	use doc && DOCS+=( docs/refind docs/Styles )
+	einstalldocs
+
+	insinto "/usr/$(get_libdir)/${PN}/refind"
+	doins "refind/refind_${EFIARCH}.efi"
+	doins "refind.conf-sample"
+	doins -r images icons fonts banners
+
+	if [[ -d "drivers_${EFIARCH}" ]]; then
+		doins -r "drivers_${EFIARCH}"
+	fi
+
+	insinto "/usr/$(get_libdir)/${PN}/refind/tools_${EFIARCH}"
+	doins "gptsync/gptsync_${EFIARCH}.efi"
+
+	insinto "/etc/refind.d"
+	doins -r "keys"
+
+	dosbin "mkrlconf"
+	dosbin "mvrefind"
+	dosbin "refind-mkdefault"
+
+	secureboot_auto_sign --in-place
+}
+
+pkg_postinst() {
+	elog "rEFInd has been built and installed into ${EROOT}/usr/$(get_libdir)/${PN}"
+	elog "You will need to use the command 'refind-install' to install"
+	elog "the binaries into your EFI System Partition"
+
+	optfeature_header "refind-install requires additional packages to be fully functional:"
+	optfeature "binary signing for use with SecureBoot" app-crypt/sbsigntools
+	optfeature "writing to NVRAM" sys-boot/efibootmgr
+	optfeature "ESP management" sys-apps/gptfdisk
+	elog ""
+
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		elog "A sample configuration can be found at"
+		elog "${EROOT}/usr/$(get_libdir)/${PN}/refind/refind.conf-sample"
+	else
+		if ver_test "${REPLACING_VERSIONS}" -lt "0.12.0"; then
+			ewarn "This new version uses sys-apps/gptfdisk instead of sys-block/parted"
+			ewarn "to manage ESP"
+			ewarn ""
+		fi
+		ewarn "Note that this installation will not update any EFI binaries"
+		ewarn "on your EFI System Partition - this needs to be done manually"
+	fi
+}


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

* [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/files/, sys-boot/refind/
@ 2024-06-17 19:01 Viorel Munteanu
  0 siblings, 0 replies; 5+ messages in thread
From: Viorel Munteanu @ 2024-06-17 19:01 UTC (permalink / raw
  To: gentoo-commits

commit:     51b5ed3142c7572c7549c90684cc08ce494f027b
Author:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
AuthorDate: Mon Jun 17 18:52:53 2024 +0000
Commit:     Viorel Munteanu <ceamac <AT> gentoo <DOT> org>
CommitDate: Mon Jun 17 19:01:08 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=51b5ed31

sys-boot/refind: add 0.14.2

Adding it unkeyworded for now because of bug #934474

Bug: https://bugs.gentoo.org/934320
Signed-off-by: Viorel Munteanu <ceamac <AT> gentoo.org>

 sys-boot/refind/Manifest                           |   1 +
 .../refind/files/refind-sbat-gentoo-0.14.2.csv     |   3 +
 sys-boot/refind/refind-0.14.2.ebuild               | 178 +++++++++++++++++++++
 3 files changed, 182 insertions(+)

diff --git a/sys-boot/refind/Manifest b/sys-boot/refind/Manifest
index f0f404269fa8..e094b5aa4c3a 100644
--- a/sys-boot/refind/Manifest
+++ b/sys-boot/refind/Manifest
@@ -1 +1,2 @@
 DIST refind-src-0.14.0.2.tar.gz 4648958 BLAKE2B 02019ddb872ce44d2a2119902edebd633f925d49634e3bcc6bfb2c9dedb8ce213166909395a333d3a37e95c67720e31b1f5fcf25083801c17d645372aa54a06a SHA512 41c120c1afec37c508aa5c0ec09a6563c3047ef84932308c91701795b950431dfad17d25cf664039b490a302d475add98441b75f90ff71cadce41febedc68a9e
+DIST refind-src-0.14.2.tar.gz 4628173 BLAKE2B 987acb29d4d81c01db245cd8e1c9761072e34cf3dfaa3e4fa77e549ee2c1dc4c3f8cbd9218f42e4eb77478df3453095dba8b36324c289c6a10b81f1ecb202743 SHA512 76a52ed422ab3d431e6530fae4d13a51e8ed100568d4290207aaee87a84700b077bb79c4f4917027f5286de422954e1872fca288252ec756072d6c075b102e1e

diff --git a/sys-boot/refind/files/refind-sbat-gentoo-0.14.2.csv b/sys-boot/refind/files/refind-sbat-gentoo-0.14.2.csv
new file mode 100644
index 000000000000..2b1814c82c87
--- /dev/null
+++ b/sys-boot/refind/files/refind-sbat-gentoo-0.14.2.csv
@@ -0,0 +1,3 @@
+sbat,1,SBAT Version,sbat,1,https://github.com/rhboot/shim/blob/main/SBAT.md
+refind,1,Roderick W. Smith,refind,0.14.2,https://www.rodsbooks.com/refind
+refind.gentoo,1,Gentoo Linux,refind,0.14.2,https://packages.gentoo.org/packages/sys-boot/refind

diff --git a/sys-boot/refind/refind-0.14.2.ebuild b/sys-boot/refind/refind-0.14.2.ebuild
new file mode 100644
index 000000000000..f280380cf1c4
--- /dev/null
+++ b/sys-boot/refind/refind-0.14.2.ebuild
@@ -0,0 +1,178 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit optfeature secureboot toolchain-funcs
+
+DESCRIPTION="The UEFI Boot Manager by Rod Smith"
+HOMEPAGE="https://www.rodsbooks.com/refind/"
+SRC_URI="https://downloads.sourceforge.net/project/${PN}/${PV}/${PN}-src-${PV}.tar.gz"
+
+LICENSE="BSD CC-BY-SA-3.0 CC-BY-SA-4.0 FDL-1.3 GPL-2+ GPL-3+ LGPL-3+"
+SLOT="0"
+# Unkeyworded for now because of bug #934474
+#KEYWORDS="~amd64 ~x86"
+FS_USE="btrfs +ext2 +ext4 hfs +iso9660 ntfs reiserfs"
+IUSE="${FS_USE} doc"
+
+DEPEND="sys-boot/gnu-efi"
+
+# for ld.bfd and objcopy
+BDEPEND="sys-devel/binutils"
+
+DOCS=( README.txt NEWS.txt )
+
+PATCHES=( "${FILESDIR}"/${PN}-0.14.0.2-clang.patch )
+
+checktools() {
+	if [[ ${MERGE_TYPE} != "binary" ]]; then
+		# bug #832018
+		tc-export LD
+		tc-ld-force-bfd
+		# the makefile calls LD directly, so try to fix LD too
+		LD="${LD/.lld/.bfd}"
+		tc-ld-is-lld "${LD}" && die "Linking with lld produces broken executables and may lead to unbootable system"
+
+		# bug #732256
+		# llvm-objcopy does not support EFI target, try to use binutils objcopy or fail
+		tc-export OBJCOPY
+		OBJCOPY="${OBJCOPY/llvm-/}"
+		LANG=C LC_ALL=C "${OBJCOPY}" --help | grep -q '\<pei-' || die "${OBJCOPY} (objcopy) does not support EFI target"
+	fi
+}
+
+check-gnu-efi() {
+	if [[ ${MERGE_TYPE} != "binary" ]]; then
+		local efi=sys-boot/gnu-efi
+
+		local broken=3.0.18-r1
+		has_version -d "=${efi}-${broken}" && die "This version of refind does not boot if compiled with =${efi}-${broken}"
+
+		broken=3.0.18
+		if has_version -d ">=${efi}-${broken}"; then
+			ewarn "This version of refind does not display jpegs correctly if compiled with >=${efi}-${broken} (bug #934474)"
+		fi
+	fi
+}
+
+pkg_pretend() {
+	check-gnu-efi
+	checktools
+}
+
+pkg_setup() {
+	check-gnu-efi
+
+	if use x86; then
+		export EFIARCH=ia32
+		export BUILDARCH=ia32
+	elif use amd64; then
+		export EFIARCH=x64
+		export BUILDARCH=x86_64
+	fi
+	secureboot_pkg_setup
+
+	# this does not only check, but also exports LD and OBJCOPY
+	checktools
+}
+
+src_prepare() {
+	default
+
+	# bug #598647 - PIE not supported
+	sed -e '/^CFLAGS/s/$/ -fno-PIE/' -i Make.common || die
+	sed -e '1 i\.NOTPARALLEL:' -i filesystems/Makefile || die
+
+	# bug #881131, bug #832018
+	sed -e 's/-fno-tree-loop-distribute-patterns/-ffreestanding/' -i Make.common || die
+
+	cp "${FILESDIR}"/refind-sbat-gentoo-${PV}.csv refind-sbat-gentoo.csv || die
+}
+
+src_compile() {
+	# Update fs targets depending on uses
+	local fs fs_names=()
+	for fs in ${FS_USE}; do
+		fs=${fs#+}
+		if use "${fs}"; then
+			fs_names+=( ${fs} )
+		fi
+	done
+	fs_names=( "${fs_names[@]/%/_gnuefi}" )
+
+	# Prepare flags
+	local make_flags=(
+		ARCH="${BUILDARCH}"
+		CC="$(tc-getCC)"
+		AS="$(tc-getAS)"
+		LD="${LD}"
+		AR="$(tc-getAR)"
+		RANLIB="$(tc-getRANLIB)"
+		OBJCOPY="${OBJCOPY}"
+		GNUEFILIB="${ESYSROOT}/usr/$(get_libdir)"
+		EFILIB="${ESYSROOT}/usr/$(get_libdir)"
+		EFICRT0="${ESYSROOT}/usr/$(get_libdir)"
+		FILESYSTEMS="${fs_names[*]}"
+		FILESYSTEMS_GNUEFI="${fs_names[*]}"
+		REFIND_SBAT_CSV=refind-sbat-gentoo.csv
+	)
+
+	emake "${make_flags[@]}" all_gnuefi
+}
+
+src_install() {
+	exeinto "/usr/$(get_libdir)/${PN}"
+	doexe refind-install
+	dosym -r "/usr/$(get_libdir)/${PN}/refind-install" "/usr/sbin/refind-install"
+
+	doman "docs/man/"*
+	use doc && DOCS+=( docs/refind docs/Styles )
+	einstalldocs
+
+	insinto "/usr/$(get_libdir)/${PN}/refind"
+	doins "refind/refind_${EFIARCH}.efi"
+	doins "refind.conf-sample"
+	doins -r images icons fonts banners
+
+	if [[ -d "drivers_${EFIARCH}" ]]; then
+		doins -r "drivers_${EFIARCH}"
+	fi
+
+	insinto "/usr/$(get_libdir)/${PN}/refind/tools_${EFIARCH}"
+	doins "gptsync/gptsync_${EFIARCH}.efi"
+
+	insinto "/etc/refind.d"
+	doins -r "keys"
+
+	dosbin "mkrlconf"
+	dosbin "mvrefind"
+	dosbin "refind-mkdefault"
+
+	secureboot_auto_sign --in-place
+}
+
+pkg_postinst() {
+	elog "rEFInd has been built and installed into ${EROOT}/usr/$(get_libdir)/${PN}"
+	elog "You will need to use the command 'refind-install' to install"
+	elog "the binaries into your EFI System Partition"
+
+	optfeature_header "refind-install requires additional packages to be fully functional:"
+	optfeature "binary signing for use with SecureBoot" app-crypt/sbsigntools
+	optfeature "writing to NVRAM" sys-boot/efibootmgr
+	optfeature "ESP management" sys-apps/gptfdisk
+	elog ""
+
+	if [[ -z "${REPLACING_VERSIONS}" ]]; then
+		elog "A sample configuration can be found at"
+		elog "${EROOT}/usr/$(get_libdir)/${PN}/refind/refind.conf-sample"
+	else
+		if ver_test "${REPLACING_VERSIONS}" -lt "0.12.0"; then
+			ewarn "This new version uses sys-apps/gptfdisk instead of sys-block/parted"
+			ewarn "to manage ESP"
+			ewarn ""
+		fi
+		ewarn "Note that this installation will not update any EFI binaries"
+		ewarn "on your EFI System Partition - this needs to be done manually"
+	fi
+}


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

end of thread, other threads:[~2024-06-17 19:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-12-07  7:36 [gentoo-commits] repo/gentoo:master commit in: sys-boot/refind/files/, sys-boot/refind/ Joonas Niilola
  -- strict thread matches above, loose matches on Subject: below --
2021-11-19 10:25 Sam James
2023-08-27 10:12 Viorel Munteanu
2023-09-14  4:43 Viorel Munteanu
2024-06-17 19:01 Viorel Munteanu

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