Hi,

here's a small tweak to discount, building a shared lib instead of a
static lib and applying our versioning. needed for another port ..

i've looked and it seems nothing depends on discount so that
shouldnt cause issues, but who knows..

nits/improvements on the way configure.inc generates librarian.sh
welcome :)

Landry
Index: Makefile
===================================================================
RCS file: /cvs/ports/textproc/discount/Makefile,v
retrieving revision 1.16
diff -u -r1.16 Makefile
--- Makefile    22 Aug 2018 19:07:48 -0000      1.16
+++ Makefile    6 May 2019 15:29:52 -0000
@@ -3,8 +3,9 @@
 COMMENT =              fast C implementation of Markdown
 
 DISTNAME =             discount-2.2.4
-
+SHARED_LIBS =          markdown 0.0
 CATEGORIES =           textproc
+REVISION =             0
 
 HOMEPAGE =             http://www.pell.portland.or.us/~orc/Code/markdown/
 
@@ -19,6 +20,7 @@
 CONFIGURE_STYLE =      simple
 CONFIGURE_SCRIPT =     configure.sh
 CONFIGURE_ARGS =       --github-checkbox \
+                       --shared \
                        --cxx-binding
 
 INSTALL_TARGET =       install.everything
Index: patches/patch-configure_inc
===================================================================
RCS file: patches/patch-configure_inc
diff -N patches/patch-configure_inc
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ patches/patch-configure_inc 6 May 2019 15:29:52 -0000
@@ -0,0 +1,35 @@
+$OpenBSD$
+
+Index: configure.inc
+--- configure.inc.orig
++++ configure.inc
+@@ -1419,7 +1419,8 @@ eval \`awk -F. '{ printf "MAJOR=%d\n", \$1;
+ shift
+ 
+ LIBNAME=\$LIBRARY.so
+-FULLNAME=\$LIBNAME.\$VERSION
++MAJOR=\${libmarkdown_ltversion}
++FULLNAME=\$LIBNAME.\$MAJOR
+ 
+ case "\$ACTION" in
+ make)   FLAGS="$AC_CFLAGS -shared"
+@@ -1428,18 +1429,13 @@ make)   FLAGS="$AC_CFLAGS -shared"
+ 
+       rm -f \$LIBRARY \$LIBNAME \$LIBNAME.\$MAJOR
+       if $AC_CC \$FLAGS \$VFLAGS -o \$FULLNAME "\$@"; then
+-          $PROG_LN_S \$FULLNAME \$LIBRARY
+-          $PROG_LN_S \$FULLNAME \$LIBNAME
+-          $PROG_LN_S \$FULLNAME \$LIBNAME.\$MAJOR
++              echo "yes"
+       fi
+       ;;
+ files)  echo "\$FULLNAME" "\$LIBNAME" "\$LIBNAME.\$MAJOR"
+       ;;
+ install)$PROG_INSTALL -c \$FULLNAME "\$1"
+-      $PROG_LN_S -f \$FULLNAME \$1/\$LIBNAME.\$MAJOR
+-      $PROG_LN_S -f \$FULLNAME \$1/\$LIBNAME
+ EOF
+-    test "$LDCONFIG" && echo '        '$LDCONFIG '"$1"' >> librarian.sh
+     cat >> librarian.sh << EOF
+       ;;
+ esac
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/textproc/discount/pkg/PLIST,v
retrieving revision 1.4
diff -u -r1.4 PLIST
--- pkg/PLIST   6 Mar 2018 18:59:48 -0000       1.4
+++ pkg/PLIST   6 May 2019 15:29:52 -0000
@@ -4,7 +4,7 @@
 @bin bin/mkd2html
 @bin bin/theme
 include/mkdio.h
-lib/libmarkdown.a
+@lib lib/libmarkdown.so.${LIBmarkdown_VERSION}
 lib/pkgconfig/libmarkdown.pc
 @man man/man1/discount.1
 @man man/man1/makepage.1

Reply via email to