net-libs/libpsl: Add from Gentoo

It's from Gentoo commit 3d94a878ce4e17eb03183cad27db3e29e9a447ba.
This commit is contained in:
Krzesimir Nowak 2024-01-30 14:59:47 +01:00
parent 925961be01
commit aa69842797
5 changed files with 177 additions and 0 deletions

View File

@ -0,0 +1,2 @@
DIST libpsl-0.21.2.tar.gz 7617025 BLAKE2B b50f805bb467dc3284bc91645a37a2208098ad809d3771c74ef13c3b8f6029a07ad80a56702c7e3d1a1125d272403c85dd97b64a28465b9ff2d095eaf94b9a4d SHA512 f1df72220bf4391d4701007100b0df66c833a2cbcb7481c9d13f0b9e0cad3b66d2d15d4b976e5bad60d2ad1540355112fa1acb07aa925c241d2d7cd20681c71d
DIST libpsl-0.21.5.tar.gz 7624251 BLAKE2B a0076f622b85df99f866de6707850ac216b764bdb68c6d516f4603da42dac8eae3ee4c53d68dbb6af6f779c2c7f1b9caab74c8b558209b1f6823f95c13fc3ceb SHA512 c14d575cecc0f1693894dd79565b6b9220084ddfa43b908a1cefe16d147cdd5ec47796eb0c2135e2f829a951abaf39d8a371ab5c1352f57b36e610e25adf91f5

View File

@ -0,0 +1,39 @@
https://github.com/rockdaboot/libpsl/commit/fb6b75317ab669c255906fa4db256837332eb1ed
From fb6b75317ab669c255906fa4db256837332eb1ed Mon Sep 17 00:00:00 2001
From: Vincent Torri <vtorri@outlook.fr>
Date: Sat, 14 Jan 2023 17:25:31 +0100
Subject: [PATCH] add 'tests' option to disable tests and fuzzers
---
meson.build | 6 ++++--
meson_options.txt | 3 +++
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/meson.build b/meson.build
index d96748d..4492354 100644
--- a/meson.build
+++ b/meson.build
@@ -132,6 +132,8 @@ endif
subdir('include')
subdir('src')
subdir('tools')
-subdir('tests')
-subdir('fuzz')
+if get_option('tests')
+ subdir('tests')
+ subdir('fuzz')
+endif
subdir(join_paths('docs', 'libpsl'))
diff --git a/meson_options.txt b/meson_options.txt
index e9d6a23..d66f256 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -17,3 +17,6 @@ option('psl_testfile', type : 'string', value : '',
option('docs', type: 'boolean', value: false,
description: 'Build the API reference (requires gtk-doc)')
+
+option('tests', type: 'boolean', value: true,
+ description: 'Build the tests and fuzzers')

View File

@ -0,0 +1,66 @@
# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..11} )
inherit meson-multilib python-any-r1
DESCRIPTION="C library for the Public Suffix List"
HOMEPAGE="https://github.com/rockdaboot/libpsl"
SRC_URI="https://github.com/rockdaboot/${PN}/releases/download/${PV}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha amd64 arm arm64 hppa ~ia64 ~loong ~m68k ~mips ppc ppc64 ~riscv ~s390 sparc x86"
IUSE="icu +idn test"
RESTRICT="!test? ( test )"
RDEPEND="
icu? ( !idn? ( dev-libs/icu:=[${MULTILIB_USEDEP}] ) )
idn? (
dev-libs/libunistring:=[${MULTILIB_USEDEP}]
net-dns/libidn2:=[${MULTILIB_USEDEP}]
)
"
DEPEND="${RDEPEND}"
BDEPEND="
${PYTHON_DEPS}
sys-devel/gettext
virtual/pkgconfig
"
PATCHES=(
"${FILESDIR}"/${P}-tests-optional.patch
)
pkg_pretend() {
if use icu && use idn ; then
ewarn "\"icu\" and \"idn\" USE flags are enabled. Using \"idn\"."
fi
}
multilib_src_configure() {
local emesonargs=(
$(meson_use test tests)
)
# Prefer idn even if icu is in USE as well
if use idn ; then
emesonargs+=(
-Druntime=libidn2
-Dbuiltin=true
)
elif use icu ; then
emesonargs+=(
-Druntime=libicu
-Dbuiltin=true
)
else
emesonargs+=(
-Druntime=no
)
fi
meson_src_configure
}

View File

@ -0,0 +1,62 @@
# Copyright 1999-2024 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=8
PYTHON_COMPAT=( python3_{10..12} )
inherit meson-multilib python-any-r1
DESCRIPTION="C library for the Public Suffix List"
HOMEPAGE="https://github.com/rockdaboot/libpsl"
SRC_URI="https://github.com/rockdaboot/${PN}/releases/download/${PV}/${P}.tar.gz"
LICENSE="MIT"
SLOT="0"
KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~arm64-macos ~ppc-macos ~x64-macos ~x64-solaris"
IUSE="icu +idn test"
RESTRICT="!test? ( test )"
RDEPEND="
icu? ( !idn? ( dev-libs/icu:=[${MULTILIB_USEDEP}] ) )
idn? (
dev-libs/libunistring:=[${MULTILIB_USEDEP}]
net-dns/libidn2:=[${MULTILIB_USEDEP}]
)
"
DEPEND="${RDEPEND}"
BDEPEND="
${PYTHON_DEPS}
sys-devel/gettext
virtual/pkgconfig
"
pkg_pretend() {
if use icu && use idn ; then
ewarn "\"icu\" and \"idn\" USE flags are enabled. Using \"idn\"."
fi
}
multilib_src_configure() {
local emesonargs=(
$(meson_use test tests)
)
# Prefer idn even if icu is in USE as well
if use idn ; then
emesonargs+=(
-Druntime=libidn2
-Dbuiltin=true
)
elif use icu ; then
emesonargs+=(
-Druntime=libicu
-Dbuiltin=true
)
else
emesonargs+=(
-Druntime=no
)
fi
meson_src_configure
}

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<!-- maintainer-needed -->
<upstream>
<remote-id type="github">rockdaboot/libpsl</remote-id>
</upstream>
</pkgmetadata>