dev-libs/libjcat: new package
authorMarek Szuba <marecki@gentoo.org>
Mon, 30 Mar 2020 14:28:49 +0000 (15:28 +0100)
committerMarek Szuba <marecki@gentoo.org>
Mon, 30 Mar 2020 14:30:05 +0000 (15:30 +0100)
An upcoming dependency of sys-apps/fwupd.

Signed-off-by: Marek Szuba <marecki@gentoo.org>
dev-libs/libjcat/Manifest [new file with mode: 0644]
dev-libs/libjcat/files/libjcat-0.1.0-disable_installed_tests.patch [new file with mode: 0644]
dev-libs/libjcat/libjcat-0.1.0.ebuild [new file with mode: 0644]
dev-libs/libjcat/metadata.xml [new file with mode: 0644]

diff --git a/dev-libs/libjcat/Manifest b/dev-libs/libjcat/Manifest
new file mode 100644 (file)
index 0000000..12536fa
--- /dev/null
@@ -0,0 +1 @@
+DIST libjcat-0.1.0.tar.gz 60808 BLAKE2B 384e5a846fb7c49c8a6d6ace5f2b17715693d7e9ecfce020859c6fb5d96f9b9398606a2161a2c9f795c16c90e8b7a0e9d08970c1f81e4412783097f4ca599083 SHA512 2172fd621c86b3a2d507c3bb8fcc5f40a46656a5352f4963a014c76642bb2c34e316bb8608c121fa7d728d63dc2593ed28d3e3478e1ec5bcf32daeffc43627fd
diff --git a/dev-libs/libjcat/files/libjcat-0.1.0-disable_installed_tests.patch b/dev-libs/libjcat/files/libjcat-0.1.0-disable_installed_tests.patch
new file mode 100644 (file)
index 0000000..823d713
--- /dev/null
@@ -0,0 +1,45 @@
+--- a/data/tests/colorhug/meson.build
++++ b/data/tests/colorhug/meson.build
+@@ -1,9 +1,11 @@
++if false
+ install_data([
+     'firmware.bin',
+     'firmware.bin.asc',
+   ],
+   install_dir: installed_test_datadir,
+ )
++endif
+ if get_option('pkcs7')
+   # generate self-signed detached signature
+@@ -16,7 +18,7 @@
+                         '--load-certificate', pkcs7_certificate,
+                         '--infile', '@INPUT@',
+                         '--outfile', '@OUTPUT@'],
+-    install: true,
++    install: false,
+     install_dir: installed_test_datadir,
+   )
+ endif
+--- a/data/tests/meson.build
++++ b/data/tests/meson.build
+@@ -2,7 +2,7 @@
+   input : 'libjcat.test.in',
+   output : 'libjcat.test',
+   configuration : conf,
+-  install: true,
++  install: false,
+   install_dir: installed_test_datadir,
+ )
+--- a/libjcat/meson.build
++++ b/libjcat/meson.build
+@@ -225,7 +225,7 @@
+       '-DTESTDATADIR_SRC="' + testdatadir_src + '"',
+       '-DTESTDATADIR_DST="' + testdatadir_dst + '"',
+     ],
+-    install : true,
++    install : false,
+     install_dir : installed_test_bindir
+   )
+   test('jcat-self-test', e)
diff --git a/dev-libs/libjcat/libjcat-0.1.0.ebuild b/dev-libs/libjcat/libjcat-0.1.0.ebuild
new file mode 100644 (file)
index 0000000..3286314
--- /dev/null
@@ -0,0 +1,55 @@
+# Copyright 1999-2020 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=7
+
+inherit meson vala xdg-utils
+
+DESCRIPTION="Library and tool for reading and writing Jcat files "
+HOMEPAGE="https://github.com/hughsie/libjcat"
+SRC_URI="https://github.com/hughsie/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1+"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE="gpg gtk-doc +introspection +man pkcs7 test"
+
+RDEPEND="dev-libs/glib:2
+       dev-libs/json-glib:=
+       gpg? (
+               app-crypt/gpgme
+               dev-libs/libgpg-error
+       )
+       introspection? ( dev-libs/gobject-introspection:= )
+       pkcs7? ( net-libs/gnutls )
+       dev-lang/vala:="
+DEPEND="${RDEPEND}"
+BDEPEND="virtual/pkgconfig
+       gtk-doc? ( dev-util/gtk-doc )
+       man? ( sys-apps/help2man )
+       test? ( net-libs/gnutls[tools] )"
+
+RESTRICT="!test? ( test )"
+
+PATCHES=(
+       "${FILESDIR}"/${PN}-0.1.0-disable_installed_tests.patch
+)
+
+src_prepare() {
+       xdg_environment_reset
+# TODO: make vala optional
+       vala_src_prepare
+       default
+}
+
+src_configure() {
+       local emesonargs=(
+               $(meson_use gtk-doc gtkdoc)
+               $(meson_use gpg)
+               $(meson_use introspection)
+               $(meson_use man)
+               $(meson_use pkcs7)
+               $(meson_use test tests)
+       )
+       meson_src_configure
+}
diff --git a/dev-libs/libjcat/metadata.xml b/dev-libs/libjcat/metadata.xml
new file mode 100644 (file)
index 0000000..8d98279
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+       <maintainer type="person">
+               <email>marecki@gentoo.org</email>
+               <name>Marek Szuba</name>
+       </maintainer>
+       <longdescription lang="en">
+               This library allows reading and writing gzip-compressed JSON catalog files,
+               which can be used to store GPG, PKCS-7 and SHA-256 checksums for each file.
+
+               This provides equivalent functionality to the catalog files supported
+               in Microsoft Windows.
+       </longdescription>
+       <use>
+               <flag name="gpg">Enable GPG verification support via <pkg>app-crypt/gpgme</pkg></flag>
+               <flag name="man">Generate and install man pages</flag>
+               <flag name="pkcs7">Enable PKCS7 verification support via <pkg>net-libs/gnutls</pkg></flag>
+       </use>
+       <upstream>
+               <remote-id type="github">hughsie/libjcat</remote-id>
+       </upstream>
+</pkgmetadata>