commit:     5ef44690f8b033efb7a693437f7ee24958b09540
Author:     Guilherme Amadio <amadio <AT> gentoo <DOT> org>
AuthorDate: Thu Jun  8 07:55:18 2023 +0000
Commit:     Guilherme Amadio <amadio <AT> gentoo <DOT> org>
CommitDate: Thu Jun  8 11:58:48 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=5ef44690

dev-libs/libmacaroons: new package, add 0.3.0

Signed-off-by: Guilherme Amadio <amadio <AT> gentoo.org>

 dev-libs/libmacaroons/Manifest                     |  1 +
 .../files/libmacaroons-0.3.0-json-c.patch          | 38 +++++++++++++++++++++
 dev-libs/libmacaroons/libmacaroons-0.3.0.ebuild    | 39 ++++++++++++++++++++++
 dev-libs/libmacaroons/metadata.xml                 | 17 ++++++++++
 4 files changed, 95 insertions(+)

diff --git a/dev-libs/libmacaroons/Manifest b/dev-libs/libmacaroons/Manifest
new file mode 100644
index 000000000000..909446e451c7
--- /dev/null
+++ b/dev-libs/libmacaroons/Manifest
@@ -0,0 +1 @@
+DIST libmacaroons-0.3.0.tar.gz 47762 BLAKE2B 
69371bb69262a88c736121861d9b136fa444b912d2c3a5d603c5897c8af85e9f4af6a6733e35c126ea44c97cfdd1359e1f41ee97452fa7275850769f2134d825
 SHA512 
79ae2e515bd673949bc1338f06f5f811a0e853ca61ff995bb4cddaf95e5297e77b012c9975b0bb0dba96520b9a24619a4593e3722e64610f1147e131f8c96de0

diff --git a/dev-libs/libmacaroons/files/libmacaroons-0.3.0-json-c.patch 
b/dev-libs/libmacaroons/files/libmacaroons-0.3.0-json-c.patch
new file mode 100644
index 000000000000..f11071d3efff
--- /dev/null
+++ b/dev-libs/libmacaroons/files/libmacaroons-0.3.0-json-c.patch
@@ -0,0 +1,38 @@
+
+Fix build with JSON support enabled
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -62,7 +62,7 @@ Please install libjson to continue.
+ ----------------------------------------])
+     fi
+ 
+-    AC_CHECK_HEADER([json/json.h],,[AC_MSG_ERROR([
++    AC_CHECK_HEADER([json-c/json.h],,[AC_MSG_ERROR([
+ ----------------------------------------
+ Macaroons rely upon the libjson library.
+ Please install libjson to continue.
+diff --git a/macaroons.c b/macaroons.c
+index ab296c8..654edfc 100644
+--- a/macaroons.c
++++ b/macaroons.c
+@@ -32,12 +32,17 @@
+ 
+ /* C */
+ #include <assert.h>
++#include <stdbool.h>
+ #include <stdio.h>
+ #include <string.h>
+ 
++#define TRUE true
++#define FALSE false
++
+ /* json */
+ #ifdef MACAROONS_JSON_SUPPORT
+-#include <json/json.h>
++#include <json-c/json.h>
++#include <json-c/json_object.h>
+ #endif
+ 
+ /* macaroons */
+-- 

diff --git a/dev-libs/libmacaroons/libmacaroons-0.3.0.ebuild 
b/dev-libs/libmacaroons/libmacaroons-0.3.0.ebuild
new file mode 100644
index 000000000000..a5e65f40f211
--- /dev/null
+++ b/dev-libs/libmacaroons/libmacaroons-0.3.0.ebuild
@@ -0,0 +1,39 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit autotools
+
+DESCRIPTION="C library for generation and use of macaroons authorization 
credentials"
+HOMEPAGE="https://github.com/rescrv/libmacaroons";
+SRC_URI="https://github.com/rescrv/libmacaroons/archive/refs/tags/releases/${PV}.tar.gz
 -> ${P}.tar.gz"
+
+LICENSE="BSD"
+SLOT="0"
+KEYWORDS="~amd64 ~x86"
+
+DEPEND="
+       dev-libs/json-c
+       dev-libs/libsodium
+"
+RDEPEND="${DEPEND}"
+BDEPEND=""
+
+S="${WORKDIR}"/${PN}-releases-${PV}
+
+PATCHES=( "${FILESDIR}"/${P}-json-c.patch )
+
+src_prepare() {
+       default
+       eautoreconf
+}
+
+src_configure() {
+       econf --disable-python-bindings --enable-json-support
+}
+
+src_install() {
+       default
+       find "${ED}" -name '*.la' -delete || die
+}

diff --git a/dev-libs/libmacaroons/metadata.xml 
b/dev-libs/libmacaroons/metadata.xml
new file mode 100644
index 000000000000..5a6c5e0880cc
--- /dev/null
+++ b/dev-libs/libmacaroons/metadata.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd";>
+<pkgmetadata>
+  <maintainer type="person">
+    <email>[email protected]</email>
+    <name>Guilherme Amadio</name>
+  </maintainer>
+  <longdescription lang="en">
+  This library provides an implementation of macaroons, which are flexible
+  authorization tokens that work great in distributed systems. Like cookies,
+  macaroons are bearer tokens that enable applications to ascertain whether
+  their holders' actions are authorized.
+  </longdescription>
+  <upstream>
+    <remote-id type="github">rescrv/libmacaroons</remote-id>
+  </upstream>
+</pkgmetadata>

Reply via email to