ports/79759: Improving the linuxolator part of bsd.port.mk

Alexander Leidinger netchild at FreeBSD.org
Sun Apr 10 14:40:06 UTC 2005


>Number:         79759
>Category:       ports
>Synopsis:       Improving the linuxolator part of bsd.port.mk
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Apr 10 14:40:05 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Alexander Leidinger
>Release:        FreeBSD 6.0-CURRENT i386
>Organization:
FreeBSD 
>Environment:


System: FreeBSD 6.0-CURRENT #131: Fri Mar 25 16:02:28 CET 2005
    root at Magellan.Leidinger.net:/big/usr/src/sys/i386/compile/WORK



>Description:


This is a patch for bsd.port.mk, it improves the USE_LINUX behavior.

User visible effect: an user can override the default linux base in make.conf with e.g. "OVERRIDE_DEFAULT_LINUX_BASE=rh-9". This should have no effect on the ports build cluster.

Developer improvements:
 - USE_LINUX=* implies NO_FILTER_SHLIBS=yes, STRIP="", STRIP_CMD=<appropriate content> (perhaps visible effects on the cluster).
 - USE_XLIB references the linux X11 libs in the USE_LINUX case (most likely visible effects on the cluster).
 - USE_LINUX_PREFIX implies NO_MTREE (perhaps visible effects on the cluster).
 - Introducing DEFAULT_LINUX_BASE for the use in BUILD_DEPENDS and FETCH_DEPENDS instead of hardcoding a particular linux_base (hopefully no visible effects on the cluster).

Patches for UPDATING and CHANGES are prepared, but out of scope for a testrun on the cluster. Appropriate improvements (removal of obsolete options, ...) for the linux ports are prepared and will be made available on emulation@ and to the maintainers when the patch hits the tree.

Change into the ports collection directory and use "patch -p1".



>How-To-Repeat:





>Fix:


--- USE_LINUX.diff begins here ---
--- ports/Mk/bsd.port.mk	Fri Mar 18 00:22:07 2005
+++ devel_ports/Mk/bsd.port.mk	Sun Apr 10 16:19:08 2005
@@ -280,7 +280,8 @@
 # XMKMF			- Set to path of `xmkmf' if not in $PATH
 #				  Default: xmkmf -a
 # USE_X_PREFIX	- If set, this port installs in ${X11BASE}.  Implies USE_XLIB.
-# USE_XLIB		- If set, this port uses the X libraries.
+# USE_XLIB		- If set, this port uses the X libraries. In the USE_LINUX
+#				  case the linux X libraries are referenced.
 #
 # USE_FREETYPE	- If set, this port uses the freetype print libraries.
 # USE_GL		- If set, this port uses libGL (not needed with XFree86 4.x
@@ -347,8 +348,15 @@
 # USE_LINUX		- Set to yes to say the port needs emulators/linux_base-8.
 #				  Set to value <X>, if the port needs emulators/linux_base-<X>.
 #				  If set to "7", a dependency is registered to emulators/linux_base.
+#				  Implies appropriate settings for NO_FILTER_SHLIBS,
+#				  STRIP and STRIP_CMD.
 # USE_LINUX_PREFIX
-#				- controls the action of PREFIX (see above).
+#				- controls the action of PREFIX (see above). Only use this
+#				  if the port is a linux infrastructure port (e.g. contains libs
+#				  or a sound server which supports the FreeBSD native one),
+#				  use the default or the X11 prefix if it's a leaf port
+#				  (e.g. a game or program).
+#				  Implies NO_MTREE=yes.
 ##
 # USE_MYSQL		- Add MySQL client dependency.
 #				  If no version is given (by the maintainer via the port or
@@ -1500,15 +1508,35 @@
 .endif
 
 .if defined(USE_LINUX)
+
+# install(1) also does a brandelf on strip, so don't strip with FreeBSD tools.
+STRIP=
+.	if exists(${LINUXBASE}/usr/bin/strip)
+STRIP_CMD=	${LINUXBASE}/usr/bin/strip
+.	else
+STRIP_CMD=	${TRUE}
+.	endif
+
+NO_FILTER_SHLIBS=	yes
+
+# Allow the user to specify another linux_base version.
+.	if defined(OVERRIDE_DEFAULT_LINUX_BASE)
+.		if ${USE_LINUX} == yes
+USE_LINUX=	${OVERRIDE_DEFAULT_LINUX_BASE}
+.		endif
+.	endif
+
 .	if exists(${PORTSDIR}/emulators/linux_base-${USE_LINUX})
-RUN_DEPENDS+=	${LINUXBASE}/bin/sh:${PORTSDIR}/emulators/linux_base-${USE_LINUX}
+DEFAULT_LINUX_BASE=	${LINUXBASE}/bin/sh:${PORTSDIR}/emulators/linux_base-${USE_LINUX}
 .	else
 .		if ${USE_LINUX} == "7"
-RUN_DEPENDS+= ${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
+DEFAULT_LINUX_BASE=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base
 .		else
-RUN_DEPENDS+=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base-8
+DEFAULT_LINUX_BASE=	${LINUXBASE}/etc/redhat-release:${PORTSDIR}/emulators/linux_base-8
 .		endif
 .	endif
+
+RUN_DEPENDS+=	${DEFAULT_LINUX_BASE}
 .endif
 
 .if defined(USE_MOTIF)
@@ -1775,7 +1803,11 @@
 .endif
 
 .if defined(USE_XLIB)
+.	if defined(USE_LINUX)
+RUN_DEPENDS+=	${LINUXBASE}/usr/X11R6/lib/libXrender.so.1:${PORTSDIR}/x11/linux-XFree86-libs
+.	else
 LIB_DEPENDS+=	X11.6:${X_LIBRARIES_PORT}
+.	endif
 # Add explicit X options to avoid problems with false positives in configure
 .if defined(GNU_CONFIGURE)
 CONFIGURE_ARGS+=--x-libraries=${X11BASE}/lib --x-includes=${X11BASE}/include
--- USE_LINUX.diff ends here ---



>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list