From lev@ftp.translate.ru  Fri Jun 13 12:20:05 2003
Return-Path: <lev@ftp.translate.ru>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 4F62937B401
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 13 Jun 2003 12:20:05 -0700 (PDT)
Received: from ftp.translate.ru (ftp.translate.ru [195.131.4.140])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 5798A43F93
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 13 Jun 2003 12:20:04 -0700 (PDT)
	(envelope-from lev@ftp.translate.ru)
Received: from ftp.translate.ru (localhost [127.0.0.1])
	by ftp.translate.ru (8.12.9/8.12.9) with ESMTP id h5DJK07R010288
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 13 Jun 2003 23:20:00 +0400 (MSD)
	(envelope-from lev@ftp.translate.ru)
Received: (from lev@localhost)
	by ftp.translate.ru (8.12.9/8.12.9/Submit) id h5DJJtN3010287;
	Fri, 13 Jun 2003 23:19:55 +0400 (MSD)
	(envelope-from lev)
Message-Id: <200306131919.h5DJJtN3010287@ftp.translate.ru>
Date: Fri, 13 Jun 2003 23:19:55 +0400 (MSD)
From: "Lev A. Serbryakov" <lev@serebryakov.spb.ru>
Reply-To: "Lev A. Serbryakov" <lev@serebryakov.spb.ru>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: Add WITHOUT_X11 knob to `lang/ocaml'
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         53289
>Category:       ports
>Synopsis:       Add WITHOUT_X11 knob to `lang/ocaml'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    lev
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          update
>Submitter-Id:   current-users
>Arrival-Date:   Fri Jun 13 12:20:10 PDT 2003
>Closed-Date:    Sat Jun 28 10:42:46 PDT 2003
>Last-Modified:  Sun Jun 29 03:00:36 PDT 2003
>Originator:     Lev A. Serbryakov <lev@serebryakov.spb.ru>
>Release:        FreeBSD 4.8-STABLE i386
>Organization:
>Environment:
System: FreeBSD ftp.translate.ru 4.8-STABLE FreeBSD 4.8-STABLE #0: Fri Apr 11 00:25:30 MSD 2003 lev@ftp.translate.ru:/usr/obj/usr/src/sys/FTPTR i386
Ports collection: 13 Jun 2003

>Description:
  
  OCAML compiler & framework `lang/ocaml' could be compiled without Tk
from ports. But it requires X11 (XLIB) in any case now. It is not good
in some cases, and `ocaml' could be compiled withou X11 easily.
  This PR adds `WITHOUT_X11' knob to `lang/ocaml' Makefile.
  

>How-To-Repeat:

>Fix:

diff -ruN ocaml.orig/Makefile ocaml/Makefile
--- ocaml.orig/Makefile	Fri Feb 21 15:35:05 2003
+++ ocaml/Makefile	Wed Jun 11 19:20:58 2003
@@ -19,9 +19,20 @@
 MAINTAINER=	patrick@watson.org
 COMMENT=	An ML language based on a complete class-based objective system
 
+.if defined(WITHOUT_X11)
+PLIST_SUB+=	X11="@comment "
+WITHOUT_TK=	yes
+TKSFX=		-nox11
+.else
+PLIST_SUB+=	X11=""
+USE_XLIB=       yes
+.endif
+
 .if defined(WITHOUT_TK)
 PLIST_SUB+=	TK="@comment "
+.if !defined(WITHOUT_X11)
 TKSFX=		-notk
+.endif
 .else
 PLIST_SUB+=	TK=""
 BUILD_DEPENDS+=	${LOCALBASE}/include/tcl8.3:${PORTSDIR}/lang/tcl83
@@ -29,7 +40,6 @@
 LIB_DEPENDS=	tk83.1:${PORTSDIR}/x11-toolkits/tk83
 .endif
 
-USE_XLIB=	yes
 HAS_CONFIGURE=	yes
 ALL_TARGET=	world.opt
 
@@ -67,14 +77,18 @@
 		camlp4.1 ocpp.1
 
 CONFIGURE_ARGS=	-prefix ${PREFIX} \
-		-x11include ${X11BASE}/include \
-		-x11lib ${X11BASE}/lib \
 		-with-pthread
 
+.if defined(WITHOUT_X11)
+CONFIGURE_ARGS+= -tk-no-x11 -no-tk
+.else
+CONFIGURE_ARGS+= -x11include ${X11BASE}/include \
+		 -x11lib ${X11BASE}/lib
 .if defined(WITHOUT_TK)
-CONFIGURE_ARGS+=-no-tk
+CONFIGURE_ARGS+= -no-tk
 .else
 CONFIGURE_ARGS+=-tkdefs "-I${PREFIX}/include/tcl8.3 -I${PREFIX}/include/tk8.3"
+.endif
 .endif
 
 .if !defined(NOPORTDOCS)
diff -ruN ocaml.orig/pkg-plist ocaml/pkg-plist
--- ocaml.orig/pkg-plist	Wed Aug 21 06:14:30 2002
+++ ocaml/pkg-plist	Wed Jun 11 19:20:37 2003
@@ -30,7 +30,7 @@
 lib/ocaml/stublibs/dllnums.so
 lib/ocaml/stublibs/dllbigarray.so
 lib/ocaml/stublibs/dllthreads.so
-lib/ocaml/stublibs/dllgraphics.so
+%%X11%%lib/ocaml/stublibs/dllgraphics.so
 lib/ocaml/stublibs/dllmldbm.so
 %%TK%%lib/ocaml/stublibs/dlllabltk.so
 %%TK%%lib/ocaml/stublibs/dlltkanim.so
@@ -239,12 +239,12 @@
 lib/ocaml/condition.mli
 lib/ocaml/mutex.mli
 lib/ocaml/thread.mli
-lib/ocaml/libgraphics.a
-lib/ocaml/graphicsX11.mli
-lib/ocaml/graphics.mli
-lib/ocaml/graphicsX11.cmi
-lib/ocaml/graphics.cmi
-lib/ocaml/graphics.cma
+%%X11%%lib/ocaml/libgraphics.a
+%%X11%%lib/ocaml/graphicsX11.mli
+%%X11%%lib/ocaml/graphics.mli
+%%X11%%lib/ocaml/graphicsX11.cmi
+%%X11%%lib/ocaml/graphics.cmi
+%%X11%%lib/ocaml/graphics.cma
 lib/ocaml/libmldbm.a
 lib/ocaml/dbm.mli
 lib/ocaml/dbm.cmi
@@ -730,8 +730,8 @@
 lib/ocaml/bigarray.cmx
 lib/ocaml/bigarray.a
 lib/ocaml/libthreadsnat.a
-lib/ocaml/graphics.a
-lib/ocaml/graphics.cmxa
+%%X11%%lib/ocaml/graphics.a
+%%X11%%lib/ocaml/graphics.cmxa
 lib/ocaml/dbm.a
 lib/ocaml/dbm.cmxa
 lib/ocaml/dbm.cmx
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->lev 
Responsible-Changed-By: lev 
Responsible-Changed-When: Sat Jun 28 03:08:25 PDT 2003 
Responsible-Changed-Why:  

It's my PR, I'll take care of it. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=53289 
State-Changed-From-To: open->closed 
State-Changed-By: lev 
State-Changed-When: Sat Jun 28 10:42:01 PDT 2003 
State-Changed-Why:  

Commited, thanks. 


http://www.freebsd.org/cgi/query-pr.cgi?pr=53289 

From: Sergei Kolobov <sergei@kolobov.com>
To: "Lev A. Serebryakov" <lev@FreeBSD.org>
Cc: freebsd-gnats-submit@FreeBSD.org
Subject: Re: ports/53289: Add WITHOUT_X11 knob to `lang/ocaml'
Date: Sun, 29 Jun 2003 13:56:54 +0400

 Lev,
 
 Please also take a look at port/52808, which contains a similar 
 (but not identical) update.
 
 Sergei
>Unformatted:
