summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2016-10-20 11:48:23 +0200
committerNatanael Copa <ncopa@alpinelinux.org>2016-10-20 11:49:34 +0200
commite5a00b5350376280d561149c290fb0519ed684a7 (patch)
treea01d818de75fe23726686c423d30f77727b0c935 /testing
parent60dc4be870fa1d8f3e174620bdb695026388630b (diff)
downloadaports-e5a00b5350376280d561149c290fb0519ed684a7.zip
testing/acme-client: build without libbsd
Diffstat (limited to 'testing')
-rw-r--r--testing/acme-client/APKBUILD20
-rw-r--r--testing/acme-client/musl-fixes.patch78
2 files changed, 91 insertions, 7 deletions
diff --git a/testing/acme-client/APKBUILD b/testing/acme-client/APKBUILD
index e95b04e9c62..5549a5a15bc 100644
--- a/testing/acme-client/APKBUILD
+++ b/testing/acme-client/APKBUILD
@@ -3,16 +3,19 @@
pkgname=acme-client
pkgver=0.1.11
_ver=${pkgver//./_}
-pkgrel=0
+pkgrel=1
pkgdesc="An ACME client for Let's Encrypt written in C"
url="https://github.com/kristapsdz/acme-client-portable"
-arch="x86 x86_64"
+arch="all"
license="ISC"
depends=""
-makedepends="libbsd-dev bsd-compat-headers libressl-dev"
+makedepends="bsd-compat-headers libressl-dev"
install=""
subpackages="$pkgname-doc"
-source="https://github.com/kristapsdz/acme-client-portable/archive/VERSION_$_ver.tar.gz"
+source="https://github.com/kristapsdz/acme-client-portable/archive/VERSION_$_ver.tar.gz
+ musl-fixes.patch
+ "
+
builddir="$srcdir/acme-client-portable-VERSION_$_ver"
build() {
@@ -26,6 +29,9 @@ package() {
|| return 1
}
-md5sums="7cba9c27c78db90820b2213dfe26455e VERSION_0_1_11.tar.gz"
-sha256sums="666270aae33f9ae2332a7847cc127d28a075801415e23570ceab5dc2beca1be2 VERSION_0_1_11.tar.gz"
-sha512sums="8fb0a73076ddcfd6a0a8da9a810d2f65e1cace051a8841fca7f466c9a6488307239be669a951c95481a2bb1c703e9e53e3149c4369a9fd71cfe6af4f5a31736f VERSION_0_1_11.tar.gz"
+md5sums="7cba9c27c78db90820b2213dfe26455e VERSION_0_1_11.tar.gz
+cff25a3cd6dacf36ee45cee8c7e1ffac musl-fixes.patch"
+sha256sums="666270aae33f9ae2332a7847cc127d28a075801415e23570ceab5dc2beca1be2 VERSION_0_1_11.tar.gz
+9555157ed40ea9d7a2d3868504f41e37f68623aa11e7b971a56536af85992921 musl-fixes.patch"
+sha512sums="8fb0a73076ddcfd6a0a8da9a810d2f65e1cace051a8841fca7f466c9a6488307239be669a951c95481a2bb1c703e9e53e3149c4369a9fd71cfe6af4f5a31736f VERSION_0_1_11.tar.gz
+39c0942d49db644ca1698f1d68d2f71b48f82b4192e654ec7dcbe61d7dd30cc0596b9a6cd0845bc2abe1ee360a4f24a551b071bcc5ad5a47f26d185282ccf014 musl-fixes.patch"
diff --git a/testing/acme-client/musl-fixes.patch b/testing/acme-client/musl-fixes.patch
new file mode 100644
index 00000000000..3feae82f48e
--- /dev/null
+++ b/testing/acme-client/musl-fixes.patch
@@ -0,0 +1,78 @@
+From aa0f79a965bf54351ff2d86f1d7a8c36d7f59c62 Mon Sep 17 00:00:00 2001
+From: Natanael Copa <ncopa@alpinelinux.org>
+Date: Thu, 20 Oct 2016 11:37:47 +0200
+Subject: [PATCH] Support musl libc without libbsd
+
+libbsd is not very portable and does not work with musl libc on arm.
+When on linux we only require libbsd if GNU libc is detected.
+---
+ GNUmakefile | 4 ++++
+ config.h | 18 ++++++++++++++++--
+ extern.h | 2 ++
+ 3 files changed, 22 insertions(+), 2 deletions(-)
+
+diff --git a/GNUmakefile b/GNUmakefile
+index c6a605d..af2b815 100644
+--- a/GNUmakefile
++++ b/GNUmakefile
+@@ -25,7 +25,11 @@ OBJS = acctproc.o \
+
+ ifeq ($(shell uname), Linux)
+ # Compiling on Linux.
++ifeq ($(shell $(CC) -dM -E - < /dev/null | grep __GLIBC__),__GLIBC__)
++# require libbsd for GNU libc, but not for musl libc
++CFLAGS += -DHAVE_LIBBSD
+ LIBBSD = -lbsd
++endif
+ CFLAGS += -I/usr/local/include/libressl
+ LDFLAGS += -L/usr/local/lib
+ OBJS += util-portable.o \
+diff --git a/config.h b/config.h
+index 3aa6563..423382f 100644
+--- a/config.h
++++ b/config.h
+@@ -17,8 +17,21 @@
+ */
+ #ifdef __linux__
+ # define _GNU_SOURCE
+-# include <bsd/stdlib.h>
+-# include <bsd/string.h>
++# ifdef HAVE_LIBBSD
++# include <bsd/stdlib.h>
++# include <bsd/string.h>
++# else
++# ifndef __BEGIN_DECLS
++# define __BEGIN_DECLS
++# endif
++# ifndef __END_DECLS
++# define __END_DECLS
++# endif
++# include <errno.h>
++ static inline const char *getprogname() {
++ return program_invocation_short_name;
++ }
++# endif
+ # include <grp.h>
+ #endif
+
+@@ -41,3 +54,4 @@ int setresuid(gid_t, gid_t, gid_t);
+ #include <netinet/in.h>
+ #include <resolv.h>
+ #endif
++
+diff --git a/extern.h b/extern.h
+index ada0063..ebf38aa 100644
+--- a/extern.h
++++ b/extern.h
+@@ -17,6 +17,8 @@
+ #ifndef EXTERN_H
+ #define EXTERN_H
+
++#include <unistd.h> /* for pid_t */
++
+ #ifndef PATH_VAR_EMPTY
+ #define PATH_VAR_EMPTY "/var/empty"
+ #endif
+--
+2.10.1
+