diff --git a/srcpkgs/efivar/files/bswap_constant.h b/srcpkgs/efivar/files/bswap_constant.h deleted file mode 100644 index 8985fb9ac25..00000000000 --- a/srcpkgs/efivar/files/bswap_constant.h +++ /dev/null @@ -1,13 +0,0 @@ -#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_ */ diff --git a/srcpkgs/efivar/files/makeguids.patch b/srcpkgs/efivar/files/makeguids.patch deleted file mode 100644 index c40d7ef41c3..00000000000 --- a/srcpkgs/efivar/files/makeguids.patch +++ /dev/null @@ -1,10 +0,0 @@ ---- 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 \n"); - fprintf(symout, "#include \n"); -+ fprintf(symout, "#include \"bswap_constant.h\"\n"); - fprintf(symout, """\n\ - #if BYTE_ORDER == BIG_ENDIAN\n\ - #define cpu_to_be32(n) (n)\n\ diff --git a/srcpkgs/efivar/patches/fix-efivar_h-location.patch b/srcpkgs/efivar/patches/fix-efivar_h-location.patch new file mode 100644 index 00000000000..05dc1c0a36a --- /dev/null +++ b/srcpkgs/efivar/patches/fix-efivar_h-location.patch @@ -0,0 +1,15 @@ +When other bits of the source got fixed to use a different include path +for efivars, the test directory did not. + +--- src/test/tester.c ++++ src/test/tester.c +@@ -26,7 +26,7 @@ + #include + #include + +-#include ++#include + + #define TEST_GUID EFI_GUID(0x84be9c3e,0x8a32,0x42c0,0x891c,0x4c,0xd3,0xb0,0x72,0xbe,0xcc) + + diff --git a/srcpkgs/efivar/patches/musl-bswap.patch b/srcpkgs/efivar/patches/musl-bswap.patch new file mode 100644 index 00000000000..e8b66d5b628 --- /dev/null +++ b/srcpkgs/efivar/patches/musl-bswap.patch @@ -0,0 +1,32 @@ +From c9b54ee2cd504542cac4ed95fa7842bd14b39f9c Mon Sep 17 00:00:00 2001 +From: "A. Wilcox" +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 does not provide these macros, use our own. + +This fixes issue #84. +--- + src/makeguids.c | 9 +++++++++ + 1 file changed, 9 insertions(+) + +--- src/makeguids.c ++++ src/makeguids.c +@@ -152,6 +152,15 @@ main(int argc, char *argv[]) + fprintf(symout, "#include \n"); + fprintf(symout, "#include \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\ + diff --git a/srcpkgs/efivar/template b/srcpkgs/efivar/template index 8761cf74b9c..6800bc3a8fe 100644 --- a/srcpkgs/efivar/template +++ b/srcpkgs/efivar/template @@ -1,7 +1,12 @@ # Template file for 'efivar' pkgname=efivar -version=31 -revision=2 +version=32 +revision=1 +build_style=gnu-makefile +make_build_args="libdir=/usr/lib" +make_build_target="all test" +make_install_args="libdir=/usr/lib" +hostmakedepends="pkg-config" makedepends="popt-devel" short_desc="Tools to manipulate EFI variables" maintainer="Juan RP " @@ -9,23 +14,15 @@ 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/archive/${version}/${version}.tar.gz>${pkgname}-${version}.tar.gz" -checksum=fa9331b762ab9f0749dd8d58a218701f33e4ea515ac57a120657447e046e6568 +checksum=44e3db4241c14dfc167dd5bf8c399ef41a7bf966cbc49519694d605f3c843420 CFLAGS="-D_GNU_SOURCE" -do_build() { - 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/" +post_build() { + make -C src/test } -do_install() { - make DESTDIR=${DESTDIR} libdir="/usr/lib/" install + +post_install() { vbin src/test/tester efivar-tester }