summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2023-04-18 05:03:14 +0100
committerSam James <sam@gentoo.org>2023-04-18 05:03:14 +0100
commit6aae086aadec1c30eb0186d54952548df1d7d41f (patch)
tree3fa37f00f2450e81c46bec78627a57cd8c7acb8d /net-misc/trurl
parentnet-misc/trurl: drop 0.2, 0.3 (diff)
downloadgentoo-6aae086aadec1c30eb0186d54952548df1d7d41f.tar.gz
gentoo-6aae086aadec1c30eb0186d54952548df1d7d41f.tar.bz2
gentoo-6aae086aadec1c30eb0186d54952548df1d7d41f.zip
net-misc/trurl: add 0.5
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'net-misc/trurl')
-rw-r--r--net-misc/trurl/Manifest1
-rw-r--r--net-misc/trurl/files/trurl-0.5-fix-makefile.patch22
-rw-r--r--net-misc/trurl/trurl-0.5.ebuild52
-rw-r--r--net-misc/trurl/trurl-9999.ebuild22
4 files changed, 90 insertions, 7 deletions
diff --git a/net-misc/trurl/Manifest b/net-misc/trurl/Manifest
index ef7b691cf43f..25e2f1333270 100644
--- a/net-misc/trurl/Manifest
+++ b/net-misc/trurl/Manifest
@@ -1 +1,2 @@
DIST trurl-0.4.tar.gz 23602 BLAKE2B c780fc52010f868fddbe1a06feb1ed1df627eb9ff8916d0212c8196c1efeb282b06900d2259dbaa4abdbc3c68002b1f3dfeb308c4ae2202578c40c112120b77c SHA512 7d106bf7dd39fb39316a9890bc562a5824dc046acfa50b97954e87ba455b479a2b86cfbf09a130dd39000abbc2e0fdc7038109410cf44c97812489d410693a01
+DIST trurl-0.5.tar.gz 28792 BLAKE2B e552d04599628ea17e19627a1aa24871bf71fb100253f6eb945a9062ad0db98ea0a87125cc2c6a5f05f8c0296953c972b8fc9a6d5c01bdbc74d9ab9e28b9094c SHA512 1bf81030e8c904e551180b5c51f37ebe382345f397165695b47554e3c712c568351a53a7527891807f89127ea270b72632b24388db4c8efee3e9994cae1def47
diff --git a/net-misc/trurl/files/trurl-0.5-fix-makefile.patch b/net-misc/trurl/files/trurl-0.5-fix-makefile.patch
new file mode 100644
index 000000000000..66a152991ca4
--- /dev/null
+++ b/net-misc/trurl/files/trurl-0.5-fix-makefile.patch
@@ -0,0 +1,22 @@
+See https://github.com/curl/trurl/pull/158#issuecomment-1512397801.
+--- a/Makefile
++++ b/Makefile
+@@ -1,8 +1,6 @@
+ TARGET = trurl
+ OBJS = trurl.o
+-LDLIBS != curl-config --libs
+-CFLAGS != curl-config --cflags
+-CFLAGS += -W -Wall -pedantic -g
++LDLIBS = $(shell curl-config --libs)
+ MANUAL = trurl.1
+
+ PREFIX ?= /usr/local
+@@ -13,7 +11,7 @@ INSTALL ?= install
+ PYTHON3 ?= python3
+
+ $(TARGET): $(OBJS)
+- $(CC) $(OBJS) -o $(TARGET) $(LDLIBS) $(LDFLAGS)
++ $(CC) $(CPPFLAGS) $(CFLAGS) -Wall $(shell curl-config --cflags) $(LDFLAGS) $(OBJS) -o $(TARGET) $(LDLIBS)
+
+ trurl.o:trurl.c version.h
+
diff --git a/net-misc/trurl/trurl-0.5.ebuild b/net-misc/trurl/trurl-0.5.ebuild
new file mode 100644
index 000000000000..fe0c58e18fdd
--- /dev/null
+++ b/net-misc/trurl/trurl-0.5.ebuild
@@ -0,0 +1,52 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+PYTHON_COMPAT=( python3_{9..11} )
+inherit toolchain-funcs python-any-r1
+
+DESCRIPTION="Command line tool for URL parsing and manipulation"
+HOMEPAGE="https://curl.se/trurl/ https://daniel.haxx.se/blog/2023/04/03/introducing-trurl/"
+
+if [[ ${PV} == 9999 ]] ; then
+ EGIT_REPO_URI="https://github.com/curl/trurl"
+ inherit git-r3
+else
+ SRC_URI="https://github.com/curl/trurl/archive/refs/tags/${P}.tar.gz"
+ S="${WORKDIR}"/${PN}-${P}
+
+ KEYWORDS="~amd64"
+fi
+
+LICENSE="curl"
+SLOT="0"
+IUSE="test"
+RESTRICT="!test? ( test )"
+
+# Older curls may work but not all features will be present
+DEPEND=">=net-misc/curl-7.81.0"
+RDEPEND="${DEPEND}"
+BDEPEND="test? ( ${PYTHON_DEPS} )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.5-fix-makefile.patch
+)
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
+
+src_compile() {
+ tc-export CC
+
+ default
+}
+
+src_test() {
+ emake PYTHON3="${EPYTHON}" test
+}
+
+src_install() {
+ emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
+}
diff --git a/net-misc/trurl/trurl-9999.ebuild b/net-misc/trurl/trurl-9999.ebuild
index 78443cfb2991..fe0c58e18fdd 100644
--- a/net-misc/trurl/trurl-9999.ebuild
+++ b/net-misc/trurl/trurl-9999.ebuild
@@ -3,7 +3,8 @@
EAPI=8
-inherit toolchain-funcs
+PYTHON_COMPAT=( python3_{9..11} )
+inherit toolchain-funcs python-any-r1
DESCRIPTION="Command line tool for URL parsing and manipulation"
HOMEPAGE="https://curl.se/trurl/ https://daniel.haxx.se/blog/2023/04/03/introducing-trurl/"
@@ -26,12 +27,15 @@ RESTRICT="!test? ( test )"
# Older curls may work but not all features will be present
DEPEND=">=net-misc/curl-7.81.0"
RDEPEND="${DEPEND}"
-BDEPEND="
- test? (
- dev-lang/perl
- virtual/perl-JSON-PP
- )
-"
+BDEPEND="test? ( ${PYTHON_DEPS} )"
+
+PATCHES=(
+ "${FILESDIR}"/${PN}-0.5-fix-makefile.patch
+)
+
+pkg_setup() {
+ use test && python-any-r1_pkg_setup
+}
src_compile() {
tc-export CC
@@ -39,6 +43,10 @@ src_compile() {
default
}
+src_test() {
+ emake PYTHON3="${EPYTHON}" test
+}
+
src_install() {
emake DESTDIR="${D}" PREFIX="${EPREFIX}"/usr install
}