[arch-commits] Commit in efivar/trunk (PKGBUILD efivar-38-linker.patch)

David Runge dvzrv at gemini.archlinux.org
Sat Jan 15 13:35:56 UTC 2022


    Date: Saturday, January 15, 2022 @ 13:35:56
  Author: dvzrv
Revision: 434492

upgpkg: efivar 38-1: Upgrade to 38.

Add libefisec.so to provides.
Add mandoc to makedepends and grub to checkdepends.
Use upstream provided ERRORS parameter to not use -Werror by default.
Add patch to fix linker issues due to a file containing output sections:
https://github.com/rhboot/efivar/pull/195
Add check() and run (unfortunately flaky) tests.
Do not build and install the tester binary (the build system is broken and
upstream also doesn't use it).
Simplify calls to make.
Simplify quoting in file.

Added:
  efivar/trunk/efivar-38-linker.patch
Modified:
  efivar/trunk/PKGBUILD

------------------------+
 PKGBUILD               |   67 +++++++++++++++++++++++------------------------
 efivar-38-linker.patch |   32 ++++++++++++++++++++++
 2 files changed, 66 insertions(+), 33 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2022-01-15 13:25:57 UTC (rev 434491)
+++ PKGBUILD	2022-01-15 13:35:56 UTC (rev 434492)
@@ -4,48 +4,49 @@
 
 pkgname=efivar
 pkgdesc="Tools and libraries to work with EFI variables"
-pkgver=37
-pkgrel=4
-arch=('x86_64')
+pkgver=38
+pkgrel=1
+arch=(x86_64)
 url="https://github.com/rhboot/efivar"
-license=('LGPL2.1')
-makedepends=('git')
-depends=('glibc')
-provides=('libefiboot.so' 'libefivar.so')
-source=("git+https://github.com/rhinstaller/efivar.git#tag=${pkgver}?signed")
-sha512sums=('SKIP')
+license=(LGPL2.1)
+depends=(glibc)
+makedepends=(git mandoc)
+checkdepends=(grub)
+provides=(libefiboot.so libefisec.so libefivar.so)
+# LTO has the linker segfaulting with binutils < 2.38.0: https://github.com/rhboot/efivar/issues/196
+options=(!lto)
+source=(
+  "git+https://github.com/rhinstaller/efivar.git#tag=${pkgver}?signed"
+  "${pkgname}-38-linker.patch"
+)
+sha512sums=('SKIP'
+            'd870de5a44e3a718acea5aa87b53a2a955dc35d8f04a30fbb440edb6f68b1890ec5767c5a6439201567866af319a7fddde8acb181111bcb2c7acb6c70b262a76')
+b2sums=('SKIP'
+        'f41f0b04f5b3840e49ce07fc444a0119d06f31fcf9d2be9e065832a13d3906827025447a7147870082545c14871b23d099b394751815def4ed8ef0946cb76426')
 validpgpkeys=('B00B48BC731AA8840FED9FB0EED266B70F4FEF10') # Peter Jones <pjones at redhat.com>
 
 prepare() {
-  mv -v "${pkgname}" "${pkgname}-${pkgver}"
-  cd "${pkgname}-${pkgver}"
-  # -Werror, not even once
-  sed -e 's/-Werror//g' -i gcc.specs
-  # remove insecure rpath in efivar-tester
-  sed 's|-rpath,$(TOPDIR)/src|-rpath,$(libdir)|g' -i src/test/Makefile
+  cd "${pkgname}"
+  # fix issues with linker scripts: https://github.com/rhboot/efivar/pull/195
+  patch -Np1 -i ../"${pkgname}-38-linker.patch"
 }
 
 build() {
-  cd "${pkgname}-${pkgver}"
-  make libdir="/usr/lib/" \
-       bindir="/usr/bin/" \
-       mandir="/usr/share/man/" \
-       includedir="/usr/include/"
-  # build efivar-tester
-  make libdir="/usr/lib/" \
-       bindir="/usr/bin/" \
-       mandir="/usr/share/man/" \
-       includedir="/usr/include/" \
-       -C src/test
+  # disable -Werror by default by setting ERRORS to empty string
+  make ERRORS='' all -C "${pkgname}"
 }
 
+check() {
+  make GRUB_PREFIX=grub test -k -C "${pkgname}" || echo "grub related tests are flaky"
+}
+
 package() {
-  cd "${pkgname}-${pkgver}"
   make DESTDIR="${pkgdir}/" \
-       libdir="/usr/lib/" \
-       bindir="/usr/bin/" \
-       mandir="/usr/share/man/" \
-       includedir="/usr/include/" install -j1 V=1
-  install -vDm 755 "src/test/tester" "${pkgdir}/usr/bin/efivar-tester"
-  install -vDm 644 {README.md,TODO} -t "${pkgdir}/usr/share/doc/${pkgname}"
+       libdir=/usr/lib/ \
+       bindir=/usr/bin/ \
+       mandir=/usr/share/man/ \
+       includedir=/usr/include/ \
+       install -j1 V=1 \
+       -C "${pkgname}"
+  install -vDm 644 "${pkgname}/"{README.md,TODO} -t "${pkgdir}/usr/share/doc/${pkgname}"
 }

Added: efivar-38-linker.patch
===================================================================
--- efivar-38-linker.patch	                        (rev 0)
+++ efivar-38-linker.patch	2022-01-15 13:35:56 UTC (rev 434492)
@@ -0,0 +1,32 @@
+From 3d6e168c7ffa8bcebfc2b9965e4af4b86e9384fa Mon Sep 17 00:00:00 2001
+From: David Runge <dave at sleepmap.de>
+Date: Sat, 15 Jan 2022 13:23:17 +0100
+Subject: [PATCH] Add script flag for files containing output sections
+
+src/include/rules.mk:
+Extend foreach loop that populates LDS with the linker scriptfile flag
+(`-T`), as linking otherwise fails on LDSCRIPTS providing files with
+output sections:
+
+```
+/usr/bin/ld: warning: guids.lds contains output sections; did you forget -T?
+```
+
+Signed-off-by: David Runge <dave at sleepmap.de>
+---
+ src/include/rules.mk | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/include/rules.mk b/src/include/rules.mk
+index f309f863..12986dee 100644
+--- a/src/include/rules.mk
++++ b/src/include/rules.mk
+@@ -37,7 +37,7 @@ family = $(foreach FAMILY_SUFFIX,$(FAMILY_SUFFIXES),$($(1)_$(FAMILY_SUFFIX)))
+ 
+ %.so :
+ 	$(CCLD) $(CCLDFLAGS) $(CPPFLAGS) $(SOFLAGS) \
+-		$(foreach LDS,$(LDSCRIPTS),$(LD_DASH_T) $(LDS)) \
++		$(foreach LDS,$(LDSCRIPTS),$(LD_DASH_T) -T $(LDS)) \
+ 		-o $@ $^ $(LDLIBS)
+ 	ln -vfs $@ $@.1
+ 



More information about the arch-commits mailing list