On Tue May 11, 2021 at 12:36:18AM +0200, Jeremie Courreges-Anglas wrote:
> On Mon, May 10 2021, Rafael Sadowski <[email protected]> wrote:
> > Fix draw_lib_dependencies which is a handy to to create such kind of
> > graphs:
> >
> > https://sizeofvoid.org/pub/OpenBSD/libKF5Attica.so.5.0.png
> >
> > $ draw_lib_dependencies /usr/local/lib/libKF5Attica.so.5.0
> > /tmp/libKF5Attica.so.5.0.png
> > Analyzing dependencies of: /usr/local/lib/libKF5Attica.so.5.0
> > Creating output as: Downloads/libKF5Attica.so.5.0.png
> >
> > Parsing file: /usr/local/lib/libKF5Attica.so.5.0
> > Parsing file: /usr/local/lib/libQt5Network.so.4.0
> > Parsing file: /usr/local/lib/qt5/libQt5Core.so.3.0
> > Parsing file: /usr/local/lib/libexecinfo.so.2.0
> > Parsing file: /usr/lib/libm.so.10.1
> > Parsing file: /usr/lib/libz.so.5.0
> > Parsing file: /usr/local/lib/libdouble-conversion.so.0.0
> > Parsing file: /usr/lib/libc++.so.8.0
> > Parsing file: /usr/lib/libc++abi.so.5.0
> > Parsing file: /usr/lib/libpthread.so.26.1
> > Parsing file: /usr/local/lib/libicui18n.so.20.0
> > Parsing file: /usr/local/lib/libicuuc.so.20.0
> > Parsing file: /usr/local/lib/libicudata.so.20.0
> > Parsing file: /usr/local/lib/libpcre2-16.so.0.5
> > Parsing file: /usr/local/lib/libzstd.so.5.0
> > Parsing file: /usr/local/lib/libgthread-2.0.so.4200.12
> > Parsing file: /usr/local/lib/libglib-2.0.so.4201.5
> > Parsing file: /usr/local/lib/libpcre.so.3.0
> > Parsing file: /usr/local/lib/libintl.so.7.0
> > Parsing file: /usr/local/lib/libiconv.so.7.0
> > Parsing file: /usr/lib/libssl.so.48.2
> > Parsing file: /usr/lib/libcrypto.so.46.2
> >
> > ... some other tools need bash as run dependency.
> >
> > OK?
>
> Mostly, see below.
Thanks, new diff below
>
> > Index: Makefile
> > ===================================================================
> > RCS file: /cvs/ports/x11/kde-applications/kde-dev-scripts/Makefile,v
> > retrieving revision 1.7
> > diff -u -p -u -p -r1.7 Makefile
> > --- Makefile 27 Apr 2021 05:26:59 -0000 1.7
> > +++ Makefile 10 May 2021 17:32:30 -0000
> > @@ -3,6 +3,7 @@
> > COMMENT = KDE development helper scripts
> > DISTNAME = kde-dev-scripts-${VERSION}
> > CATEGORIES = devel
> > +REVISION = 0
> >
> > HOMEPAGE = https://kde.org/applications/development/
> >
> > @@ -12,7 +13,8 @@ MODKDE5_DOCS = yes
> > MODULES += lang/python \
> > perl
> >
> > -RUN_DEPENDS = math/graphviz
> > +RUN_DEPENDS = math/graphviz \
> > + shells/bash
> >
> > MODPERL_ADJ_FILES = \
> > colorsvn \
> > Index: patches/patch-draw_lib_dependencies
> > ===================================================================
> > RCS file: patches/patch-draw_lib_dependencies
> > diff -N patches/patch-draw_lib_dependencies
> > --- /dev/null 1 Jan 1970 00:00:00 -0000
> > +++ patches/patch-draw_lib_dependencies 10 May 2021 17:32:30 -0000
> > @@ -0,0 +1,30 @@
> > +$OpenBSD$
> > +
> > +
> > +Index: draw_lib_dependencies
> > +--- draw_lib_dependencies.orig
> > ++++ draw_lib_dependencies
> > +@@ -1,4 +1,4 @@
> > +-#!/bin/bash
> > ++#!/bin/ksh
>
> Since you added a dep on bash, you could use /usr/local/bin/bash here,
>
> > + # Copyright 2013 Dominik Seichter <[email protected]>
> > + #
> > +@@ -24,7 +24,7 @@ LDDTMPFILE=
> > +
> > + cleanup() {
> > + for _v in TMPFILE READELFTMPFILE LDDTMPFILE; do
> > +- [ -n "${!_v}" ] && rm -f -- "${!_v}"
> > ++ [ -n "${_v}" ] && rm -f -- "${_v}"
>
> ... which would remove the need for this (now incorrect) hunk.
>
> If you want to keep keep using ksh in this script, you could just
> replace the loop with:
>
> rm -f "${TMPFILE}" "${READELFTMPFILE}" "${LDDTMPFILE}"
>
> but I don't see the point.
Doh! I missed some parts in my final diff. Anyway let's go with bash.
>
> > + done
> > + }
> > +
> > +@@ -95,7 +95,7 @@ analyze()
> > + exit 1
> > + fi
> > +
> > +- DEPPATH=$(grep -- "$DEP" "$LDDTMPFILE" | awk '{print $3}')
> > ++ DEPPATH=$(grep -- "$DEP" "$LDDTMPFILE" | awk '{print $7}')
>
> Makes sense.
>
> > + if [ -n "$DEPPATH" ];
> > + then
> > + echo " \"$NAME\" -> \"$DEP\";" >> $OUT
> >
>
> --
> jca | PGP : 0x1524E7EE / 5135 92C1 AD36 5293 2BDF DDCC 0DFA 74AE 1524 E7EE
>
Index: Makefile
===================================================================
RCS file: /cvs/ports/x11/kde-applications/kde-dev-scripts/Makefile,v
retrieving revision 1.7
diff -u -p -u -p -r1.7 Makefile
--- Makefile 27 Apr 2021 05:26:59 -0000 1.7
+++ Makefile 11 May 2021 04:06:02 -0000
@@ -3,6 +3,7 @@
COMMENT = KDE development helper scripts
DISTNAME = kde-dev-scripts-${VERSION}
CATEGORIES = devel
+REVISION = 0
HOMEPAGE = https://kde.org/applications/development/
@@ -12,7 +13,8 @@ MODKDE5_DOCS = yes
MODULES += lang/python \
perl
-RUN_DEPENDS = math/graphviz
+RUN_DEPENDS = math/graphviz \
+ shells/bash
MODPERL_ADJ_FILES = \
colorsvn \
@@ -42,5 +44,8 @@ MODPY_ADJ_FILES = \
kdelnk2desktop.py \
reviewboard-am \
zonetab2pot.py \
+
+pre-configure:
+ ${SUBST_CMD} ${WRKSRC}/draw_lib_dependencies
.include <bsd.port.mk>
Index: patches/patch-draw_lib_dependencies
===================================================================
RCS file: patches/patch-draw_lib_dependencies
diff -N patches/patch-draw_lib_dependencies
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ patches/patch-draw_lib_dependencies 11 May 2021 04:06:02 -0000
@@ -0,0 +1,21 @@
+$OpenBSD$
+
+
+Index: draw_lib_dependencies
+--- draw_lib_dependencies.orig
++++ draw_lib_dependencies
+@@ -1,4 +1,4 @@
+-#!/bin/bash
++#!${LOCALBASE}/bin/bash
+
+ # Copyright 2013 Dominik Seichter <[email protected]>
+ #
+@@ -95,7 +95,7 @@ analyze()
+ exit 1
+ fi
+
+- DEPPATH=$(grep -- "$DEP" "$LDDTMPFILE" | awk '{print $3}')
++ DEPPATH=$(grep -- "$DEP" "$LDDTMPFILE" | awk '{print $7}')
+ if [ -n "$DEPPATH" ];
+ then
+ echo " \"$NAME\" -> \"$DEP\";" >> $OUT