summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2017-08-19 01:45:24 +0000
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2017-08-19 01:45:24 +0000
commit0e68a11830ace5651f942c9c4ff830ce0b42d5b8 (patch)
tree75d8e8df3921a1d1774439f3359864f83e9d56a1
parent680084dab5a7a6639d4d3977d91c65f062b40e0e (diff)
downloadpackages-0e68a11830ace5651f942c9c4ff830ce0b42d5b8.tar.gz
packages-0e68a11830ace5651f942c9c4ff830ce0b42d5b8.tar.bz2
packages-0e68a11830ace5651f942c9c4ff830ce0b42d5b8.tar.xz
packages-0e68a11830ace5651f942c9c4ff830ce0b42d5b8.zip
user/efivar: new package
-rw-r--r--user/efivar/0001-makeguids-Ensure-compatibility-with-other-libcs.patch36
-rw-r--r--user/efivar/APKBUILD33
-rw-r--r--user/efivar/musl-strndupa.patch13
3 files changed, 82 insertions, 0 deletions
diff --git a/user/efivar/0001-makeguids-Ensure-compatibility-with-other-libcs.patch b/user/efivar/0001-makeguids-Ensure-compatibility-with-other-libcs.patch
new file mode 100644
index 000000000..1577d306b
--- /dev/null
+++ b/user/efivar/0001-makeguids-Ensure-compatibility-with-other-libcs.patch
@@ -0,0 +1,36 @@
+From c9b54ee2cd504542cac4ed95fa7842bd14b39f9c Mon Sep 17 00:00:00 2001
+From: "A. Wilcox" <AWilcox@Wilcox-Tech.com>
+Date: Fri, 18 Aug 2017 20:36:03 -0500
+Subject: [PATCH] makeguids: Ensure compatibility with other libcs
+
+The musl libc does not provide __bswap_constant_XX.
+If <endian.h> does not provide these macros, use our own.
+
+This fixes issue #84.
+---
+ src/makeguids.c | 9 +++++++++
+ 1 file changed, 9 insertions(+)
+
+diff --git a/src/makeguids.c b/src/makeguids.c
+index ec75a86..6b0d80e 100644
+--- a/src/makeguids.c
++++ b/src/makeguids.c
+@@ -152,6 +152,15 @@ main(int argc, char *argv[])
+ fprintf(symout, "#include <efivar/efivar.h>\n");
+ fprintf(symout, "#include <endian.h>\n");
+ fprintf(symout, """\n\
++#ifndef __bswap_constant_16\n\
++#define __bswap_constant_16(x)\\\n\
++ ((unsigned short int) ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8)))\n\
++#endif\n\
++#ifndef __bswap_constant_32\n\
++#define __bswap_constant_32(x)\\\n\
++ ((((x) & 0xff000000) >> 24) | (((x) & 0x00ff0000) >> 8) | \\\n\
++ (((x) & 0x0000ff00) << 8) | (((x) & 0x000000ff) << 24))\n\
++#endif\n\
+ #if BYTE_ORDER == BIG_ENDIAN\n\
+ #define cpu_to_be32(n) (n)\n\
+ #define cpu_to_be16(n) (n)\n\
+--
+2.10.0
+
diff --git a/user/efivar/APKBUILD b/user/efivar/APKBUILD
new file mode 100644
index 000000000..815fca910
--- /dev/null
+++ b/user/efivar/APKBUILD
@@ -0,0 +1,33 @@
+# Contributor: A. Wilcox <awilfox@adelielinux.org>
+# Maintainer: A. Wilcox <awilfox@adelielinux.org>
+pkgname=efivar
+pkgver=31
+pkgrel=0
+pkgdesc="Tools and library to manipulate EFI variables"
+url="https://github.com/rhboot/efivar"
+arch="all"
+license="LGPL-2.1"
+depends=""
+depends_dev="popt-dev"
+makedepends="$depends_dev"
+install=""
+options="!check" # "WARNING: You should probably not run tests /ever/. This is not a joke."
+subpackages="$pkgname-dev $pkgname-doc"
+source="https://github.com/rhboot/$pkgname/releases/download/$pkgver/$pkgname-$pkgver.tar.bz2
+ 0001-makeguids-Ensure-compatibility-with-other-libcs.patch
+ musl-strndupa.patch
+ "
+
+build() {
+ cd "$builddir"
+ make prefix="/usr" libdir="/usr/lib"
+}
+
+package() {
+ cd "$builddir"
+ make DESTDIR="$pkgdir" prefix="/usr" libdir="/usr/lib" install
+}
+
+sha512sums="5055f690fd99cf59895dcf3d11103494d917d4923567626f0bee816ea5e4dd56cec23627ede5f21bdc57b7306522471ad19cc8ab22ae94591dbd1925c084f163 efivar-31.tar.bz2
+8a47abad5d6d2ceffb5effdd177d3e678256961294ff66df1158084e3f45f0bcb07105a1c3df35b3a5c503742c4e59148df740c40fa3b7149b1f609f8b51ebd3 0001-makeguids-Ensure-compatibility-with-other-libcs.patch
+4dd340861cac6d6617b2547db14aa85140f1d2cf8d7e4b709b4b01671170d4ebc66439d91ade926ad5eb67300696226f1382731ff2aaa728511abef6e83f0cf6 musl-strndupa.patch"
diff --git a/user/efivar/musl-strndupa.patch b/user/efivar/musl-strndupa.patch
new file mode 100644
index 000000000..fc32d9740
--- /dev/null
+++ b/user/efivar/musl-strndupa.patch
@@ -0,0 +1,13 @@
+--- efivar-31/src/linux.c 2017-02-13 17:52:14.000000000 +0100
++++ efivar-31/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"