This tries to make imake more "regular".
Specifically, it had a few LOCALBASE, but it can have LOCALBASE and X11BASE
throughout.

This is a better config. I might go slightly further: it generates makefiles
so we could unhardcode LOCALBASE and X11BASE entirely probably (by
switching to $(LOCALBASE) and $(X11BASE) where applicable, which work with
make, but do not influence pkg_subst at all.

Also (Hey, Ingo)  imake.cf + Ports harcodes the use of nroff.

Well, it's "easy" enough to fix that, just need to move USE_GROFF definition
higher, and actually make use of it in the configuration.

To the best of my knowledge, this affects only xwit, which might not actually
require groff to function...

Index: devel/imake-cf/Makefile
===================================================================
RCS file: /cvs/ports/devel/imake-cf/Makefile,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile
--- devel/imake-cf/Makefile     25 Feb 2017 22:08:41 -0000      1.12
+++ devel/imake-cf/Makefile     7 Aug 2018 09:45:28 -0000
@@ -6,7 +6,7 @@ CATEGORIES =    devel x11
 V =            1.0.6
 DISTNAME =     xorg-cf-files-${V}
 PKGNAME =      imake-cf-${V}
-REVISION =     1
+REVISION =     2
 MASTER_SITES =         ${MASTER_SITE_XORG:=util/}
 
 PERMIT_PACKAGE_CDROM =                 Yes
@@ -19,11 +19,11 @@ XCONFDIR =  ${PREFIX}/lib/X11/config
 
 NO_TEST=       Yes
 
-do-build:
-       sed ${SUBST} <${WRKSRC}/site.def.in >${WRKSRC}/site.def
-
 pre-configure:
        ${SUBST_CMD} ${WRKSRC}/OpenBSD.cf
+
+do-build:
+       sed ${SUBST} <${WRKSRC}/site.def.in >${WRKSRC}/site.def
 
 do-install:
        ${INSTALL_DATA_DIR} ${XCONFDIR}
Index: devel/imake-cf/patches/patch-OpenBSD_cf
===================================================================
RCS file: /cvs/ports/devel/imake-cf/patches/patch-OpenBSD_cf,v
retrieving revision 1.7
diff -u -p -r1.7 patch-OpenBSD_cf
--- devel/imake-cf/patches/patch-OpenBSD_cf     25 Feb 2017 22:08:42 -0000      
1.7
+++ devel/imake-cf/patches/patch-OpenBSD_cf     7 Aug 2018 09:45:28 -0000
@@ -1,20 +1,39 @@
 $OpenBSD: patch-OpenBSD_cf,v 1.7 2017/02/25 22:08:42 naddy Exp $
---- OpenBSD.cf.orig    Tue Dec 22 02:28:02 2015
-+++ OpenBSD.cf Sat Feb 25 23:01:15 2017
-@@ -26,10 +26,12 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OS
- #define LibDir                        /usr/local/lib/X11
- #define UsrLibDir             /usr/local/lib
- #define ManDirectoryRoot      /usr/local/man
+Index: OpenBSD.cf
+--- OpenBSD.cf.orig
++++ OpenBSD.cf
+@@ -22,18 +22,20 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OS
+ 
+ #ifdef Ports
+ 
+-#define BinDir                        /usr/local/bin
+-#define LibDir                        /usr/local/lib/X11
+-#define UsrLibDir             /usr/local/lib
+-#define ManDirectoryRoot      /usr/local/man
+-#define LdPreLib              -L/usr/X11R6/lib -L/usr/local/lib
+-#define XpmLibDir             /usr/X11R6/lib
+-#define XpmIncDir             /usr/X11R6/include
+-#define ConfigDir             /usr/X11R6/lib/X11/config
+-#define IncRoot                       /usr/local/include
+-#define TopXInclude           -I/usr/X11R6/include
++#define BinDir                        ${LOCALBASE}/bin
++#define LibDir                        ${LOCALBASE}/lib/X11
++#define UsrLibDir             ${LOCALBASE}/lib
++#define ManDirectoryRoot      ${LOCALBASE}/man
 +#define FontDir                       ${LOCALBASE}/share/fonts
 +#define FontEncDir            ${LOCALBASE}/share/fonts/encodings
- #define LdPreLib              -L/usr/X11R6/lib -L/usr/local/lib
- #define XpmLibDir             /usr/X11R6/lib
- #define XpmIncDir             /usr/X11R6/include
--#define ConfigDir             /usr/X11R6/lib/X11/config
++#define LdPreLib              -L${X11BASE}/lib -L${LOCALBASE}/lib
++#define XpmLibDir             ${X11BASE}/lib
++#define XpmIncDir             ${X11BASE}/include
 +#define ConfigDir             ${LOCALBASE}/lib/X11/config
- #define IncRoot                       /usr/local/include
- #define TopXInclude           -I/usr/X11R6/include
++#define IncRoot                       ${LOCALBASE}/include
++#define TopXInclude           -I${X11BASE}/include
  #define ImakeCmd              imake -DPorts
+-#define DocDir                        /usr/local/share/doc
++#define DocDir                        ${LOCALBASE}/share/doc
+ #define BuildHtmlManPages     NO
+ 
+ #endif
 @@ -172,6 +174,9 @@ XCOMM operating system:  OSName (OSMajorVersion./**/OS
  #ifndef CcCmd
  #define CcCmd                         cc
@@ -32,7 +51,7 @@ $OpenBSD: patch-OpenBSD_cf,v 1.7 2017/02
 -#define NeqnCmd                       neqn -Tlatin1
 -#define NroffCmd              nroff -Tlatin1
 -#define       EqnCmd                  eqn -Tps
-+#ifdef Ports
++#ifdef UseGroff
 +# define NroffCmd             ${LOCALBASE}/bin/nroff -Tascii -c
 +# define TroffCmd             ${LOCALBASE}/bin/nroff -Tps
 +# define HTMLroffCmd          ${LOCALBASE}/bin/nroff -Thtml
Index: infrastructure/mk/bsd.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/bsd.port.mk,v
retrieving revision 1.1436
diff -u -p -r1.1436 bsd.port.mk
--- infrastructure/mk/bsd.port.mk       6 Aug 2018 09:36:32 -0000       1.1436
+++ infrastructure/mk/bsd.port.mk       7 Aug 2018 09:45:29 -0000
@@ -272,6 +272,7 @@ NO_DEPENDS ?= No
 NO_BUILD ?= No
 NO_TEST ?= No
 INSTALL_TARGET ?= install
+USE_GROFF ?= No
 
 .if !defined(_ARCH_DEFINES_INCLUDED)
 _ARCH_DEFINES_INCLUDED = Done
@@ -594,7 +595,6 @@ ERRORS += "   (No flavors for this port)
 .  endif
 .endif
 
-USE_GROFF ?= No
 .if ${USE_GROFF:L} == "yes"
 BUILD_DEPENDS += textproc/groff>=1.21
 _PKG_ARGS += -DUSE_GROFF=1
Index: infrastructure/mk/imake.port.mk
===================================================================
RCS file: /cvs/ports/infrastructure/mk/imake.port.mk,v
retrieving revision 1.9
diff -u -p -r1.9 imake.port.mk
--- infrastructure/mk/imake.port.mk     26 Apr 2016 10:56:59 -0000      1.9
+++ infrastructure/mk/imake.port.mk     7 Aug 2018 09:45:29 -0000
@@ -11,6 +11,10 @@ INSTALL_TARGET +=    install.man
 XMKMF ?=               xmkmf -a
 XMKMF +=               -DPorts
 
+.if ${USE_GROFF:L} == "yes"
+XMKMF +=               -DUseGroff
+.endif
+
 .if !exists(${X11BASE})
 IGNORE =       "uses imake, but ${X11BASE} not found"
 .endif

Reply via email to