efivar: update to 31

This commit is contained in:
Jürgen Buchmüller 2017-02-18 03:50:51 +01:00
parent eda453827d
commit 7b7e497581
7 changed files with 52 additions and 111 deletions

View File

@ -1691,8 +1691,8 @@ libgtest.so gtest-1.7.0_1
libgtest_main.so gtest-1.7.0_1
libxmlsec1-gcrypt.so.1 xmlsec1-1.2.20_2
libxmlsec1-gnutls.so.1 xmlsec1-1.2.20_2
libefivar.so.0 libefivar-0.21_1
libefiboot.so.0 libefivar-0.21_1
libefivar.so.1 libefivar-31_1
libefiboot.so.1 libefivar-31_1
libportaudio.so.2 portaudio-19.20140130_1
libportaudiocpp.so.0 portaudio-cpp-19.20140130_1
libdar.so.5000 libdar-2.4.14_1

View File

@ -0,0 +1,13 @@
#ifndef _BSWAP_CONSTANT_H_
#define _BSWAP_CONSTANT_H_
/* Swap bytes in 16 bit value. */
#define __bswap_constant_16(x) \
((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))
/* Swap bytes in 32 bit value. */
#define __bswap_constant_32(x) \
((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))
#endif /* _BSWAP_CONSTANT_H_ */

View File

@ -0,0 +1,10 @@
--- src/makeguids.c 2017-02-13 17:52:14.000000000 +0100
+++ src/makeguids.c 2017-02-18 04:12:12.474373950 +0100
@@ -151,6 +151,7 @@
fprintf(symout, "#include <efivar.h>\n");
fprintf(symout, "#include <endian.h>\n");
+ fprintf(symout, "#include \"bswap_constant.h\"\n");
fprintf(symout, """\n\
#if BYTE_ORDER == BIG_ENDIAN\n\
#define cpu_to_be32(n) (n)\n\

View File

@ -1,39 +0,0 @@
From a3606c02fd271d32e364fcc540e34ba1899309f6 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Tue, 14 Jul 2015 09:33:54 -0400
Subject: [PATCH] Sometimes the compiler doesn't like { 0, } as an
initializer...
Because it really wants to be { {0, },} or something, and sometimes the
compiler, knowing full well what we're trying to do, likes to complain
about the rigor applied to our technique in doing it.
memset() the struct ifreq to 0 instead so I don't need to figure out its
internal structure just to zero it out.
Resolves #28
Signed-off-by: Peter Jones <pjones@redhat.com>
---
src/linux.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git src/linux.c src/linux.c
index 57f71f3..817b8e6 100644
--- src/linux.c
+++ src/linux.c
@@ -847,12 +847,13 @@ ssize_t
__attribute__((__visibility__ ("hidden")))
make_mac_path(uint8_t *buf, ssize_t size, const char * const ifname)
{
- struct ifreq ifr = { 0, };
+ struct ifreq ifr;
struct ethtool_drvinfo drvinfo = { 0, };
int fd, rc;
ssize_t ret = -1, sz, off=0;
char busname[PATH_MAX+1] = "";
+ memset(&ifr, 0, sizeof (ifr));
strncpy(ifr.ifr_name, ifname, IF_NAMESIZE);
drvinfo.cmd = ETHTOOL_GDRVINFO;
ifr.ifr_data = (caddr_t)&drvinfo;

View File

@ -0,0 +1,13 @@
--- src/linux.c 2017-02-13 17:52:14.000000000 +0100
+++ src/linux.c 2017-02-18 04:42:13.893911649 +0100
@@ -44,6 +44,10 @@
#include <efivar.h>
#include <efiboot.h>
+#if !defined(__GLIBC__)
+#define strndupa(x,s) strncpy(alloca(strlen(x)+1),x,s)
+#endif
+
#include "dp.h"
#include "linux.h"
#include "util.h"

View File

@ -1,62 +0,0 @@
From 262acfc7c4fbb4bbc76f4235220336fd41993ca8 Mon Sep 17 00:00:00 2001
From: Felix Janda <felix.janda@posteo.de>
Date: Tue, 14 Jul 2015 05:53:04 -0600
Subject: [PATCH 1/2] Remove -fshort-wchar from CFLAGS
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
-fshort-wchar makes wchar_t 16bit. We are not using wchar_t anywhere,
so we don't need it. Removing it fixes an compilation error with musl
libc:
In file included from dp-acpi.c:21:0:
/usr/ligcc/armv7a-hardfloat-linux-musleabi/4.7.4/include/stddef.h:325:24: error: conflicting types for wchar_t
In file included from /usr/include/inttypes.h:12:0,
from dp-acpi.c:20:
/usr/include/bits/alltypes.h:18:18: note: previous declaration of wchar_t was here
make[1]: *** [dp-acpi.o] Error 1
make: *** [src] Error 2
---
Make.defaults | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git Make.defaults Make.defaults
index cc2baa9..7f5ae5e 100644
--- Make.defaults
+++ Make.defaults
@@ -13,7 +13,7 @@ clang_cflags =
gcc_cflags = -Wmaybe-uninitialized
cflags := $(CFLAGS) \
-Werror -Wall -Wsign-compare -Wstrict-aliasing \
- -std=gnu11 -fshort-wchar -fPIC \
+ -std=gnu11 -fPIC \
-fvisibility=hidden \
-D_GNU_SOURCE -I${TOPDIR}/src/include/efivar/ \
$(if $(filter $(CC),clang),$(clang_cflags),) \
From 841ae2fc8c911dbac595cbd228be6bfed7881cad Mon Sep 17 00:00:00 2001
From: Felix Janda <felix.janda@posteo.de>
Date: Tue, 14 Jul 2015 05:56:05 -0600
Subject: [PATCH 2/2] Use the more portable major() instead of gnu_dev_major()
Do the same for minor() and gnu_dev_minor()
---
src/linux.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git src/linux.c src/linux.c
index c4d099e..0cbd94a 100644
--- src/linux.c
+++ src/linux.c
@@ -129,8 +129,8 @@ get_partition_number(const char *devpath)
return -1;
}
- maj = gnu_dev_major(statbuf.st_rdev);
- min = gnu_dev_minor(statbuf.st_rdev);
+ maj = major(statbuf.st_rdev);
+ min = minor(statbuf.st_rdev);
rc = sysfs_readlink(&linkbuf, "/sys/dev/block/%u:%u", maj, min);
if (rc < 0)

View File

@ -1,6 +1,6 @@
# Template file for 'efivar'
pkgname=efivar
version=0.21
version=31
revision=1
makedepends="popt-devel"
short_desc="Tools to manipulate EFI variables"
@ -8,15 +8,21 @@ maintainer="Juan RP <xtraeme@voidlinux.eu>"
license="LGPL-2.1"
homepage="https://github.com/rhinstaller/efivar"
only_for_archs="i686 i686-musl x86_64 x86_64-musl"
distfiles="https://github.com/rhinstaller/efivar/releases/download/${version}/efivar-${version}.tar.bz2"
checksum=04b9b9de9d9a1a013395400438a033daf4a4290f497ec5be04a120e2ac535094
distfiles="https://github.com/rhinstaller/efivar/archive/${version}/${version}.tar.gz>${pkgname}-${version}.tar.gz"
checksum=b825680dc8b2165cd71131277f5a9cd632f9e43a84a33756543b24e7a251b9e0
CFLAGS="-Wno-error -Wno-error=nonnull-compare -Wno-error=unused-const-variable=\
-Wno-error=deprecated-declarations -Wno-error=strict-aliasing"
CFLAGS="-D_GNU_SOURCE"
do_build() {
sed 's|-rpath=$(TOPDIR)/src/|-rpath=$(libdir)|g' -i src/test/Makefile
make CC=$CC libdir="/usr/lib/"
case "$XBPS_TARGET_MACHINE" in
*-musl)
cp ${FILESDIR}/bswap_constant.h src/include/efivar/
patch -p0 < ${FILESDIR}/makeguids.patch
;;
esac
sed -i Make.rules -e s';-o $@ $^ $(LDLIBS);-o $@ $^ $(LDLIBS) -lpopt;'
make ${makejobs} CC=$CC libdir="/usr/lib/"
make -C src/test ${makejobs} CC=$CC libdir="/usr/lib/"
}
do_install() {
make DESTDIR=${DESTDIR} libdir="/usr/lib/" install
@ -31,7 +37,7 @@ libefivar_package() {
}
libefivar-devel_package() {
short_desc="Library to manipulate EFI variables - development files"
depends="libefivar>=${version}_${revision}"
depends="${makedepends} libefivar>=${version}_${revision}"
pkg_install() {
vmove usr/include
vmove usr/lib/pkgconfig