From bc3689e565869516c5458fa2390d42e9fe2241cc Mon Sep 17 00:00:00 2001 From: c0dev0id Date: Wed, 8 Jul 2026 11:09:42 +0200 Subject: [PATCH] sysutils/libtree: new port, libtree 3.1.1 --- sysutils/libtree/Makefile | 27 +++++++++++++++++++ sysutils/libtree/distinfo | 2 ++ sysutils/libtree/patches/patch-libtree_c | 14 ++++++++++ ..._to_symlink_location_not_realpath_Makefile | 12 +++++++++ sysutils/libtree/pkg/DESCR | 2 ++ sysutils/libtree/pkg/PLIST | 2 ++ 6 files changed, 59 insertions(+) create mode 100644 sysutils/libtree/Makefile create mode 100644 sysutils/libtree/distinfo create mode 100644 sysutils/libtree/patches/patch-libtree_c create mode 100644 sysutils/libtree/patches/patch-tests_07_origin_is_relative_to_symlink_location_not_realpath_Makefile create mode 100644 sysutils/libtree/pkg/DESCR create mode 100644 sysutils/libtree/pkg/PLIST diff --git a/sysutils/libtree/Makefile b/sysutils/libtree/Makefile new file mode 100644 index 0000000..e30fade --- /dev/null +++ b/sysutils/libtree/Makefile @@ -0,0 +1,27 @@ +COMMENT = ldd as a tree + +GH_ACCOUNT = haampie +GH_PROJECT = libtree +GH_TAGNAME = v3.1.1 +REVISION = 1 + +CATEGORIES = sysutils + +MAINTAINER = Laurent Cheylus + +# MIT +PERMIT_PACKAGE = Yes + +WANTLIB = c + +USE_GMAKE = Yes + +TEST_TARGET = check + +do-install: + ${INSTALL_PROGRAM} ${WRKSRC}/libtree ${PREFIX}/bin + + ${INSTALL_MAN_DIR} ${PREFIX}/man/man1 + ${INSTALL_MAN} ${WRKSRC}/doc/libtree.1 ${PREFIX}/man/man1 + +.include diff --git a/sysutils/libtree/distinfo b/sysutils/libtree/distinfo new file mode 100644 index 0000000..0bab9aa --- /dev/null +++ b/sysutils/libtree/distinfo @@ -0,0 +1,2 @@ +SHA256 (libtree-3.1.1.tar.gz) = YUhDb1QpaUXSJCAlTdeOGCnWASS7L1uYgTIKZVD3P1w= +SIZE (libtree-3.1.1.tar.gz) = 79931 diff --git a/sysutils/libtree/patches/patch-libtree_c b/sysutils/libtree/patches/patch-libtree_c new file mode 100644 index 0000000..f915768 --- /dev/null +++ b/sysutils/libtree/patches/patch-libtree_c @@ -0,0 +1,14 @@ +Default library paths for OpenBSD + +Index: libtree.c +--- libtree.c.orig ++++ libtree.c +@@ -1532,7 +1532,7 @@ static void parse_ld_library_path(struct libtree_state + static void set_default_paths(struct libtree_state_t *s) { + s->default_paths_offset = s->string_table.n; + // TODO: how to retrieve this list properly at runtime? +- string_table_store(&s->string_table, "/lib:/lib64:/usr/lib:/usr/lib64"); ++ string_table_store(&s->string_table, "/usr/lib:/usr/local/lib:/usr/X11R6/lib"); + } + + static void libtree_state_init(struct libtree_state_t *s) { diff --git a/sysutils/libtree/patches/patch-tests_07_origin_is_relative_to_symlink_location_not_realpath_Makefile b/sysutils/libtree/patches/patch-tests_07_origin_is_relative_to_symlink_location_not_realpath_Makefile new file mode 100644 index 0000000..855a8cb --- /dev/null +++ b/sysutils/libtree/patches/patch-tests_07_origin_is_relative_to_symlink_location_not_realpath_Makefile @@ -0,0 +1,12 @@ +Index: tests/07_origin_is_relative_to_symlink_location_not_realpath/Makefile +--- tests/07_origin_is_relative_to_symlink_location_not_realpath/Makefile.orig ++++ tests/07_origin_is_relative_to_symlink_location_not_realpath/Makefile +@@ -18,7 +18,7 @@ a/libg.so: a/libf.so + + b/libg.so: a/libg.so + mkdir -p $(@D) +- ln -vs ../a/libg.so $@ ++ ln -s ../a/libg.so $@ + + exe: a/libg.so b/libg.so + echo 'extern int g(); int _start(){return g();};' | $(CC) -Wl,-soname,$(@F) '-Wl,-rpath,$${ORIGIN}/b' -o $@ -x c - -La -lg -nostdlib diff --git a/sysutils/libtree/pkg/DESCR b/sysutils/libtree/pkg/DESCR new file mode 100644 index 0000000..b49c987 --- /dev/null +++ b/sysutils/libtree/pkg/DESCR @@ -0,0 +1,2 @@ +libtree is a tool that turns ldd into a tree and can explain how shared +libraries are found or why they cannot be located. diff --git a/sysutils/libtree/pkg/PLIST b/sysutils/libtree/pkg/PLIST new file mode 100644 index 0000000..1317d4b --- /dev/null +++ b/sysutils/libtree/pkg/PLIST @@ -0,0 +1,2 @@ +@bin bin/libtree +@man man/man1/libtree.1