summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcin Deranek <marcin.deranek@slonko.net>2023-12-09 23:08:15 +0100
committerMarcin Deranek <marcin.deranek@slonko.net>2023-12-09 23:08:15 +0100
commitcfc4522f94ffcfc2b06856dcbb0b60fb892f1ea4 (patch)
tree3340a4e74c558219d382e0244f30ad10a47741f3
parentb33c8acd3c045a6a548a6d726b8f69a09e944d34 (diff)
downloadportage-cfc4522f94ffcfc2b06856dcbb0b60fb892f1ea4.tar.gz
portage-cfc4522f94ffcfc2b06856dcbb0b60fb892f1ea4.tar.bz2
portage-cfc4522f94ffcfc2b06856dcbb0b60fb892f1ea4.zip
media-libs/zxing-cpp Initial ebuild with python support
-rw-r--r--media-libs/zxing-cpp/Manifest3
-rw-r--r--media-libs/zxing-cpp/metadata.xml12
-rw-r--r--media-libs/zxing-cpp/zxing-cpp-2.2.0.ebuild60
3 files changed, 75 insertions, 0 deletions
diff --git a/media-libs/zxing-cpp/Manifest b/media-libs/zxing-cpp/Manifest
new file mode 100644
index 0000000..ee23ab9
--- /dev/null
+++ b/media-libs/zxing-cpp/Manifest
@@ -0,0 +1,3 @@
+DIST zxing-cpp-2.2.0.tar.gz 893257 BLAKE2B 9cd685720aa91db172832bda0c9f16cd1fc854f9153048c80b2cd66b10779169a2dd419bd153e1b2ee03a43554187f40dd77751891d4527a6aad83064c2e7418 SHA512 f88bd032fbb849d52d5f2f02621f92c97b54f6d9e8c09dca60c18109d40af507ece22e064a8a2061dcd069ec71f7200b8f2ff9bb3b20b97e2f0401ca72640e69
+EBUILD zxing-cpp-2.2.0.ebuild 1396 BLAKE2B 97fdd0abf9e35043d8652e04e6c72e7db593dd4494c5ca0109d14be8daf445dccaa2aff46ff44d8d299ddc75b113e03fbdf58092eecd4e3b2cfaf54cde3471d0 SHA512 d2b53e1daae9730ec8f650007db24b7cc538a2559016eec3b0b2af904400535c4fe04a05d70c35ec71eba6b4270842367dcbf1a104aaafb9c441f8807772c38d
+MISC metadata.xml 407 BLAKE2B ae4a26bc82d20868dd61f22f73f8c5dfcde69bea9c92292ef2693f5cb47bedb9c4040359aa47c70931bf2aad0d8bc534ced6314bcd68930da0903dd9b6380087 SHA512 8a65fb82f176a0897f68c78bd47ce28cdf967de9fdd320dbcd2ce203fd6a01cdc23595e2ae7707d0e3bd8a1dd11395217d3940d567e361493c5c2612f9ece5c5
diff --git a/media-libs/zxing-cpp/metadata.xml b/media-libs/zxing-cpp/metadata.xml
new file mode 100644
index 0000000..17d8fcd
--- /dev/null
+++ b/media-libs/zxing-cpp/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>marcin.deranek@slonko.net</email>
+ <name>Marcin Deranek</name>
+ </maintainer>
+ <upstream>
+ <bugs-to>https://github.com/zxing-cpp/zxing-cpp/issues</bugs-to>
+ <remote-id type="github">zxing-cpp/zxing-cpp</remote-id>
+ </upstream>
+</pkgmetadata>
diff --git a/media-libs/zxing-cpp/zxing-cpp-2.2.0.ebuild b/media-libs/zxing-cpp/zxing-cpp-2.2.0.ebuild
new file mode 100644
index 0000000..6f0d20e
--- /dev/null
+++ b/media-libs/zxing-cpp/zxing-cpp-2.2.0.ebuild
@@ -0,0 +1,60 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{10..12} pypy3 )
+
+inherit cmake python-single-r1
+
+DESCRIPTION="C++ Multi-format 1D/2D barcode image processing library"
+HOMEPAGE="https://github.com/zxing-cpp/zxing-cpp"
+SRC_URI="https://github.com/zxing-cpp/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="Apache-2.0"
+SLOT="0/3"
+KEYWORDS="amd64 ~arm arm64 ~loong ~ppc64 ~riscv x86"
+IUSE="python test"
+REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
+RESTRICT="!test? ( test )"
+
+RDEPEND="
+ python? (
+ ${PYTHON_DEPS}
+ $(python_gen_cond_dep 'dev-python/pybind11[${PYTHON_USEDEP}]')
+ )
+"
+DEPEND="
+ ${RDEPEND}
+"
+BDEPEND="
+ ${RDEPEND}
+ test? (
+ dev-cpp/gtest
+ >=dev-libs/stb-20231115
+ )
+"
+
+pkg_setup() {
+ use python && python-single-r1_pkg_setup
+}
+
+src_prepare() {
+ sed -i \
+ -e "s#\${CMAKE_INSTALL_LIBDIR}#$(python_get_sitedir)#g" \
+ wrappers/python/CMakeLists.txt || die "sed failed"
+ sed -i \
+ -e 's#zxing_add_package_stb.*#include_directories(/usr/include/stb)#' \
+ -e 's#stb::stb##g' \
+ example/CMakeLists.txt || die "sed failed"
+ cmake_src_prepare
+}
+
+src_configure() {
+ local mycmakeargs=(
+ -DBUILD_EXAMPLES=$(usex test ON OFF)
+ -DBUILD_BLACKBOX_TESTS=OFF # Require test/samples
+ -DBUILD_UNIT_TESTS=$(usex test ON OFF)
+ -DBUILD_PYTHON_MODULE=$(usex python ON OFF)
+ )
+ cmake_src_configure
+}