aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYiFei Zhu <zhuyifei1999@gmail.com>2023-12-25 08:47:12 -0800
committerYiFei Zhu <zhuyifei1999@gmail.com>2023-12-25 09:35:54 -0800
commit790bd705db98c8a7eb3f626b9a0e70e2de9c05e6 (patch)
tree65b18bebd63c7f3af49758227d9257534ea6220e /dev-libs/libcli
parentgui-libs/xdg-desktop-portal-hyprland: add 1.2.6 (diff)
downloadguru-790bd705db98c8a7eb3f626b9a0e70e2de9c05e6.tar.gz
guru-790bd705db98c8a7eb3f626b9a0e70e2de9c05e6.tar.bz2
guru-790bd705db98c8a7eb3f626b9a0e70e2de9c05e6.zip
dev-libs/libcli: new package, add 1.10.7
Signed-off-by: YiFei Zhu <zhuyifei1999@gmail.com>
Diffstat (limited to 'dev-libs/libcli')
-rw-r--r--dev-libs/libcli/Manifest1
-rw-r--r--dev-libs/libcli/files/libcli-1.10.7-makefile.patch65
-rw-r--r--dev-libs/libcli/libcli-1.10.7.ebuild38
-rw-r--r--dev-libs/libcli/metadata.xml11
4 files changed, 115 insertions, 0 deletions
diff --git a/dev-libs/libcli/Manifest b/dev-libs/libcli/Manifest
new file mode 100644
index 000000000..40b1ba880
--- /dev/null
+++ b/dev-libs/libcli/Manifest
@@ -0,0 +1 @@
+DIST libcli-1.10.7.tar.gz 55713 BLAKE2B bbb156d564dabf5198d99b92b32edc9cd7a34e399a8cc39e57c387ddceda6c3f00d89ee110863d35194c35bf5f93ff6d96c149c65a7e55b39b2bb846fbd1c7eb SHA512 4c341260e554d7e7a4181bbc85fd2e4cd57cb3fd4304cd423af63a407950f394a318ea69588e12b1ffc845e14d836409dc087cd737b29861c62bf2e14c702a63
diff --git a/dev-libs/libcli/files/libcli-1.10.7-makefile.patch b/dev-libs/libcli/files/libcli-1.10.7-makefile.patch
new file mode 100644
index 000000000..78e803176
--- /dev/null
+++ b/dev-libs/libcli/files/libcli-1.10.7-makefile.patch
@@ -0,0 +1,65 @@
+From 2e86f55dd594dd176c1ade2ce58918900e011391 Mon Sep 17 00:00:00 2001
+From: YiFei Zhu <zhuyifei1999@gmail.com>
+Date: Mon, 25 Dec 2023 08:40:21 -0800
+Subject: [PATCH] Gentoo Makefile changes
+
+- Apply $(LIBSUBDIR) instead of hardcoding "lib"
+- Use env vars for $(CC) $(AR) and $(PREFIX)
+- Delete $(DEBUG) $(OPTIM); we don't want package to override CFLAGS
+ in make.conf
+---
+ Makefile | 19 +++++++++----------
+ 1 file changed, 9 insertions(+), 10 deletions(-)
+
+diff --git a/Makefile b/Makefile
+index d365952..951fc85 100644
+--- a/Makefile
++++ b/Makefile
+@@ -7,7 +7,8 @@ TESTS ?= 1
+
+ UNAME = $(shell sh -c 'uname -s 2>/dev/null || echo not')
+ DESTDIR =
+-PREFIX = /usr/local
++PREFIX ?= /usr/local
++LIBSUBDIR ?= lib
+
+ MAJOR = 1
+ MINOR = 10
+@@ -15,12 +16,10 @@ REVISION = 7
+ LIB = libcli.so
+ LIB_STATIC = libcli.a
+
+-CC = gcc
+-AR = ar
++CC ?= gcc
++AR ?= ar
+ ARFLAGS = rcs
+-DEBUG = -g
+-OPTIM = -O3
+-override CFLAGS += $(DEBUG) $(OPTIM) -Wall -std=c99 -pedantic -Wformat-security -Wno-format-zero-length -Werror -Wwrite-strings -Wformat -fdiagnostics-show-option -Wextra -Wsign-compare -Wcast-align -Wno-unused-parameter
++override CFLAGS += -Wall -std=c99 -pedantic -Wformat-security -Wno-format-zero-length -Werror -Wwrite-strings -Wformat -fdiagnostics-show-option -Wextra -Wsign-compare -Wcast-align -Wno-unused-parameter
+ override LDFLAGS += -shared
+ override LIBPATH += -L.
+
+@@ -64,14 +63,14 @@ clean:
+ rm -f *.o $(LIB)* $(LIB_STATIC) clitest libcli-$(MAJOR).$(MINOR).$(REVISION).tar.gz
+
+ install: $(TARGET_LIBS)
+- install -d $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/lib
++ install -d $(DESTDIR)$(PREFIX)/include $(DESTDIR)$(PREFIX)/$(LIBSUBDIR)
+ install -m 0644 libcli.h $(DESTDIR)$(PREFIX)/include
+ ifeq (1,$(STATIC_LIB))
+- install -m 0644 $(LIB_STATIC) $(DESTDIR)$(PREFIX)/lib
++ install -m 0644 $(LIB_STATIC) $(DESTDIR)$(PREFIX)/$(LIBSUBDIR)
+ endif
+ ifeq (1,$(DYNAMIC_LIB))
+- install -m 0755 $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(DESTDIR)$(PREFIX)/lib
+- cd $(DESTDIR)$(PREFIX)/lib && \
++ install -m 0755 $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(DESTDIR)$(PREFIX)/$(LIBSUBDIR)
++ cd $(DESTDIR)$(PREFIX)/$(LIBSUBDIR) && \
+ ln -fs $(LIB).$(MAJOR).$(MINOR).$(REVISION) $(LIB).$(MAJOR).$(MINOR) && \
+ ln -fs $(LIB).$(MAJOR).$(MINOR) $(LIB)
+ endif
+--
+2.43.0
+
diff --git a/dev-libs/libcli/libcli-1.10.7.ebuild b/dev-libs/libcli/libcli-1.10.7.ebuild
new file mode 100644
index 000000000..c144ff0d8
--- /dev/null
+++ b/dev-libs/libcli/libcli-1.10.7.ebuild
@@ -0,0 +1,38 @@
+# Copyright 2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+DESCRIPTION="Shared C library to include Cisco-like CLI into other software"
+HOMEPAGE="https://dparrish.com/pages/libcli"
+SRC_URI="https://github.com/dparrish/${PN}/archive/V${PV}.tar.gz -> ${P}.tar.gz"
+
+LICENSE="LGPL-2.1"
+SLOT="0/${PV}"
+KEYWORDS="~amd64"
+IUSE="test static-libs"
+
+# Test disabled for being an interactive test
+# RESTRICT="!test? ( test )"
+RESTRICT="test"
+
+DEPEND="virtual/libcrypt:="
+RDEPEND="${DEPEND}"
+
+PATCHES=(
+ "${FILESDIR}"/libcli-1.10.7-makefile.patch
+)
+
+src_configure() {
+ tc-export CC AR
+ export LIBSUBDIR="$(get_libdir)"
+ export PREFIX=/usr
+ export STATIC_LIB="$(usex static-libs 1 0)"
+ export TESTS="$(usex test 1 0)"
+}
+
+src_test() {
+ LD_LIBRARY_PATH=. ./clitest
+}
diff --git a/dev-libs/libcli/metadata.xml b/dev-libs/libcli/metadata.xml
new file mode 100644
index 000000000..d0501cd32
--- /dev/null
+++ b/dev-libs/libcli/metadata.xml
@@ -0,0 +1,11 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+ <maintainer type="person">
+ <email>zhuyifei1999@gmail.com</email>
+ <name>YiFei Zhu</name>
+ </maintainer>
+ <upstream>
+ <remote-id type="github">dparrish/libcli</remote-id>
+ </upstream>
+</pkgmetadata>