Subject: [PATCH] main/bearssl: add pkg-config file

From: Drew DeVault <[email-masked]>
Date: Fri, 17 Dec 2021 10:07:02 +0100

---
 main/bearssl/APKBUILD      | 16 ++++++++++++----
 main/bearssl/libbearssl.pc |  9 +++++++++
 2 files changed, 21 insertions(+), 4 deletions(-)
 create mode 100644 main/bearssl/libbearssl.pc

diff --git a/main/bearssl/APKBUILD b/main/bearssl/APKBUILD
index 305432c088..8e224b6c04 100644
--- a/main/bearssl/APKBUILD
+++ b/main/bearssl/APKBUILD
@@ -2,13 +2,17 @@
 # Contributor: Laurent Bercot <[email-masked]>
 pkgname=bearssl
 pkgver=0.6
-pkgrel=0
+pkgrel=1
 pkgdesc="The BearSSL implementation of the SSL/TLS protocol"
 url="https://bearssl.org/"
 arch="all"
 license="MIT"
 subpackages="$pkgname-dev"
-source="https://bearssl.org/$pkgname-$pkgver.tar.gz bearssl-brssl-dynamic.patch"
+source="
+	https://bearssl.org/$pkgname-$pkgver.tar.gz
+	bearssl-brssl-dynamic.patch
+	libbearssl.pc
+"
 builddir="$srcdir/$pkgname-$pkgver"
 
 build() {
@@ -31,6 +35,7 @@ package() {
 	cp -f "$builddir/build/libbearssl.so.$pkgver" "$pkgdir/lib/"
 	ln -sf "libbearssl.so.$pkgver" "$pkgdir/lib/libbearssl.so.${pkgver%%.*}"
 	ln -sf "libbearssl.so.${pkgver%%.*}" "$pkgdir/lib/libbearssl.so"
+	install -D -m644 "$srcdir"/libbearssl.pc "$pkgdir"/lib/pkgconfig/libbearssl.pc
 }
 
 check() {
@@ -39,5 +44,8 @@ check() {
 	./testcrypto all
 }
 
-sha512sums="f9ed25683cfc6c4abe7f1203a2b82ed101ee4c9e0f9ab60755b6a09c8d1e8e4f64d413624e7bb9c4b0033f909a2e4568a1d916cc6ce4736222900691e1f8359a  bearssl-0.6.tar.gz
-f5fe047862eb355a662ccb1b95c2ca4a870ac0f8d3f4cada5396d2f6a6635647db53fbeb038f9a7651b84d6cda32b6415ce0f69a8da92636d3b3b76578114d5c  bearssl-brssl-dynamic.patch"
+sha512sums="
+f9ed25683cfc6c4abe7f1203a2b82ed101ee4c9e0f9ab60755b6a09c8d1e8e4f64d413624e7bb9c4b0033f909a2e4568a1d916cc6ce4736222900691e1f8359a  bearssl-0.6.tar.gz
+f5fe047862eb355a662ccb1b95c2ca4a870ac0f8d3f4cada5396d2f6a6635647db53fbeb038f9a7651b84d6cda32b6415ce0f69a8da92636d3b3b76578114d5c  bearssl-brssl-dynamic.patch
+d9cb508709909522a19142a2d8fc988fcb1f33796ace4e21908070925ec402c73fd0778a170a50d3d89bab1263e40a40401a9e593cb4f2a8e314fc52f9965696  libbearssl.pc
+"
diff --git a/main/bearssl/libbearssl.pc b/main/bearssl/libbearssl.pc
new file mode 100644
index 0000000000..5a2849c55b
--- /dev/null
+++ b/main/bearssl/libbearssl.pc
@@ -0,0 +1,9 @@
+prefix=/usr
+exec_prefix=${prefix}
+includedir=${prefix}/include
+libdir=${prefix}/lib
+Name: libbearssl
+Version: 0.6
+Description: The BearSSL implementation of the SSL/TLS protocol
+Cflags: -I${includedir}
+Libs: -L${libdir} -lbearssl
-- 
2.34.1