pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Fix for graphics/graphviz on FreeBSD



I was building graphics/graphviz on FreeBSD and encountered this error:
sfclrlock.c:47:48: error: use of undeclared identifier 'SF_FLAGS'
    rv = (f->mode & SF_PUSH) ? 0 : (f->flags & SF_FLAGS);
                                               ^

By looking in the FreeBSD port tree, I seen the fix consisting in replacing SF_FLAGS by SFIO_FLAGS. I seen no comment about this fix and I assume that is because FreeBSD defines SF_FLAGS in /usr/include/sys/socket.h.

Do you think it is acceptable to commit the patch below?

The newline and the inclusion of bsd.prefs.mk is only justified by doc/Makefile-example. I don't request a merge upstream because the master branch doesn't contain the sfclrlock.c file. Then I hope this fix could become obsolete in a future release.

----------8<----------8<----------8<----------8<----------8<----------
Index: Makefile
===================================================================
RCS file: /cvsroot/pkgsrc/graphics/graphviz/Makefile,v
retrieving revision 1.222
diff -u -r1.222 Makefile
--- Makefile    2 Sep 2020 03:23:10 -0000       1.222
+++ Makefile    26 Oct 2020 10:48:49 -0000
@@ -37,6 +37,7 @@
 CONFIGURE_ENV+=                ac_cv_prog_PHP=
 CONFIGURE_ENV+=                ac_cv_prog_RUBY=
 CPPFLAGS+=             -DNO_POSTSCRIPT_ALIAS=1
+
 PKGCONFIG_OVERRIDE+=   lib/cdt/libcdt.pc.in
 PKGCONFIG_OVERRIDE+=   lib/cgraph/libcgraph.pc.in
 PKGCONFIG_OVERRIDE+=   lib/edgepaint/liblab_gamut.pc.in
@@ -62,11 +63,22 @@
 REPLACE_PERL+=         tclpkg/gv/demo/modgraph.pl contrib/dotmcl.pl \
                        contrib/dirgraph/dirgraph.pl
 
+.include "../../mk/bsd.prefs.mk"
+
 .include "../../mk/compiler.mk"
 .if !empty(CC_VERSION:Mgcc-2*)
 BUILDLINK_TRANSFORM+=  rm:-Wno-unused-parameter
 .endif
 
+.if ${OPSYS} == "FreeBSD"
+SUBST_CLASSES+=                sfflags
+SUBST_STAGE.sfflags=   pre-configure
+SUBST_MESSAGE.sfflags= Fixing SF_FLAGS identifier for FreeBSD.
+SUBST_FILES.sfflags=   lib/sfio/sfclrlock.c lib/sfio/sfio_t.h lib/sfio/sfio.h
+SUBST_FILES.sfflags+=  lib/sfio/sfnew.c lib/sfio/sfopen.c lib/sfio/sfset.c
+SUBST_SED.sfflags=     -e 's|SF_FLAGS|SFIO_FLAGS|g'
+.endif
+
 # Prevent another config.status run.
 pre-build:
        touch ${WRKSRC}/Makefile ${WRKSRC}/graphviz_version.h


Home | Main Index | Thread Index | Old Index