6979433 several X packages missing dependencies on ogl-select package
authorAlan Coopersmith <Alan.Coopersmith@Oracle.COM>
Thu, 23 Jun 2011 20:28:56 -0700
changeset 1152 6cf0f98f6d5f
parent 1151 a16a42de154d
child 1153 912dd58dfc72
6979433 several X packages missing dependencies on ogl-select package
open-src/data/ogl-select/mesa_vendor_select
open-src/data/ogl-select/nvidia_vendor_select
open-src/data/ogl-select/sun_vendor_select
open-src/lib/mesa/Makefile
open-src/xserver/xorg/Makefile
pkg/Makefile
pkg/exceptions-validate_pkg.p5m
pkg/manifests/service-opengl-ogl-select.p5m
pkg/manifests/x11-library-freeglut.p5m
pkg/manifests/x11-library-mesa.p5m
pkg/transforms/post-pkgdepend
--- a/open-src/data/ogl-select/mesa_vendor_select	Thu Jun 23 11:07:22 2011 -0700
+++ b/open-src/data/ogl-select/mesa_vendor_select	Thu Jun 23 20:28:56 2011 -0700
@@ -1,6 +1,6 @@
 #!/bin/ksh93
 #
-# Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2011, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -23,7 +23,7 @@
 #
 #
 
-LINKDIR=/var/run/opengl
+LINKDIR=/system/volatile/opengl
 
 PATH=/usr/bin:/usr/sbin
 
--- a/open-src/data/ogl-select/nvidia_vendor_select	Thu Jun 23 11:07:22 2011 -0700
+++ b/open-src/data/ogl-select/nvidia_vendor_select	Thu Jun 23 20:28:56 2011 -0700
@@ -23,7 +23,7 @@
 #
 #
 
-LINKDIR=/var/run/opengl
+LINKDIR=/system/volatile/opengl
 
 PATH=/usr/bin:/usr/sbin
 
--- a/open-src/data/ogl-select/sun_vendor_select	Thu Jun 23 11:07:22 2011 -0700
+++ b/open-src/data/ogl-select/sun_vendor_select	Thu Jun 23 20:28:56 2011 -0700
@@ -1,6 +1,6 @@
 #!/bin/ksh93
 #
-# Copyright (c) 2009, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2009, 2011, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -23,7 +23,7 @@
 #
 #
 
-LINKDIR=/var/run/opengl
+LINKDIR=/system/volatile/opengl
 
 PATH=/usr/bin:/usr/sbin
 
--- a/open-src/lib/mesa/Makefile	Thu Jun 23 11:07:22 2011 -0700
+++ b/open-src/lib/mesa/Makefile	Thu Jun 23 20:28:56 2011 -0700
@@ -153,7 +153,7 @@
 	-rm -f $(HEADERS_TO_DIRECT_LINK:%=$(PROTODIR)/usr/include/GL/%) \
 	       $(HEADERS_TO_RUNTIME_LINK:%=$(PROTODIR)/usr/include/GL/%)
 	ln -s $(HEADERS_TO_DIRECT_LINK:%=../mesa/%) \
-	      $(HEADERS_TO_RUNTIME_LINK:%=../../../var/run/opengl/include/%) \
+	      $(HEADERS_TO_RUNTIME_LINK:%=../../../system/volatile/opengl/include/%) \
 	      $(PROTODIR)/usr/include/GL
 	mkdir -p $(PROTODIR)/usr/lib/GL/$(SUBDIR64) \
 		 $(PROTODIR)/usr/lib/mesa/$(SUBDIR64)
@@ -188,9 +188,9 @@
 	    ln -s $(LIBRARIES_TO_DIRECT_LINK:%=../../mesa/$(SUBDIR64)/%) .)
 	-rm -f $(PROTODIR)/usr/lib/GL/libGL.so.1 \
 	       $(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libGL.so.1
-	ln -s ../../../var/run/opengl/lib/libGL.so.1 \
+	ln -s ../../../system/volatile/opengl/lib/libGL.so.1 \
 		$(PROTODIR)/usr/lib/GL/libGL.so.1
-	ln -s ../../../../var/run/opengl/lib/$(SUBDIR64)/libGL.so.1 \
+	ln -s ../../../../system/volatile/opengl/lib/$(SUBDIR64)/libGL.so.1 \
 		$(PROTODIR)/usr/lib/GL/$(SUBDIR64)/libGL.so.1
 	mkdir -p $(PROTODIR)/usr/X11/lib/$(SUBDIR64) \
 		 $(PROTODIR)/usr/X11/include
--- a/open-src/xserver/xorg/Makefile	Thu Jun 23 11:07:22 2011 -0700
+++ b/open-src/xserver/xorg/Makefile	Thu Jun 23 20:28:56 2011 -0700
@@ -217,7 +217,7 @@
 	mkdir -p $(PROTODIR)$(MESA_MODULE_DIR)/
 	mv -f $(PROTODIR)$(EXT_MODULE_DIR)/libglx.so \
 	      $(PROTODIR)$(MESA_MODULE_DIR)/libglx.so
-	ln -s ../../../../../var/run/opengl/server/libglx.so \
+	ln -s ../../../../../system/volatile/opengl/server/libglx.so \
 	      $(PROTODIR)$(EXT_MODULE_DIR)/libglx.so
 
 install_fix_paths: install_fix_paths_glxmodule
--- a/pkg/Makefile	Thu Jun 23 11:07:22 2011 -0700
+++ b/pkg/Makefile	Thu Jun 23 20:28:56 2011 -0700
@@ -107,6 +107,7 @@
 # different sets of transforms and macros for pkgmogrify.
 #
 SYNTH_PKGS= X-incorporation X-redistributable
+SYNTH_MANIFESTS = $(SYNTH_PKGS:%=%.p5m)
 
 # Any given package list may be empty, but we can only determine that 
 # dynamically, so we always generate all lists.
@@ -304,7 +305,9 @@
 
 ### Dependency detection
 DEP_PKGS= $(PKGS:%=$(PDIR)/%.dep)
-DEP_SYNTH_PKGS= $(SYNTH_PKGS:%=$(PDIR)/%.dep)
+DEP_CURRENT_PKGS = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.dep)
+DEP_LEGACY_PKGS = $(LEGACY_MANIFESTS:%.p5m=$(PDIR)/%.dep)
+DEP_SYNTH_PKGS = $(SYNTH_MANIFESTS:%.p5m=$(PDIR)/%.dep)
 
 PKGDEP_TOKENS_i386= \
 	'PLATFORM=i86hvm' \
@@ -329,21 +332,16 @@
 		$(CP) $(<) $(@); \
 	fi
 
-$(DEP_SYNTH_PKGS): $$(@:%.dep=%.mog)
+$(DEP_SYNTH_PKGS) $(DEP_LEGACY_PKGS): $$(@:%.dep=%.mog)
 	@print "## Skipping dependency generation for $(@F:%.dep=%)"
 	$(PKGDEBUG)$(CP) $(@:%.dep=%.mog) $(@)
 
 ### Dependency resolution
 
-#
-# This rule resolves dependencies across all published manifests.
-# We should be able to do this with
-#
-#    pkgdepend resolve -m $(PUB_PKGS:%.pub=%.dep)
-#
-# but until 14113 is fixed, the incorporations confuse pkgdepend, so we
-# just create the .res file for DEP_SYNTH_PKGS directly.
-#
+DEP_RES_PKGS = $(PKGS:%=$(PDIR)/%.dep.res)
+DEP_RES_CURRENT_PKGS = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.dep.res)
+DEP_RES_LEGACY_PKGS = $(LEGACY_MANIFESTS:%.p5m=$(PDIR)/%.dep.res)
+DEP_RES_SYNTH_PKGS = $(SYNTH_MANIFESTS:%.p5m=$(PDIR)/%.dep.res)
 
 PKGDEP_VERBOSE_FLAG_0 =
 PKGDEP_VERBOSE_FLAG_1 = -v
@@ -353,27 +351,36 @@
 # Normally / on the machine used to build the binaries
 PKGDEP_RESOLVE_IMAGE = /
 
-$(PDIR)/gendeps: $(DEP_SYNTH_PKGS) $(DEP_PKGS)
-	-$(PKGDEBUG)if [[ "$(SUPPRESSPKGDEP)" = "true" ]]; then \
+# This rule resolves dependencies across all manifests for packages
+# currently delivering files.
+$(PDIR)/gendeps: $(DEP_CURRENT_PKGS)
+	$(PKGDEBUG)if [[ "$(SUPPRESSPKGDEP)" = "true" ]]; then \
 		print "## Suppressing dependency resolution"; \
-		for p in $(DEP_PKGS:%.dep=%); do \
-			$(CP) $$p.dep $$p.res; \
+		for p in $(DEP_CURRENT_PKGS:%.dep=%); do \
+			$(CP) $$p.dep $$p.dep.res; \
 		done; \
 	else \
 		print "## Resolving dependencies"; \
 		pkgdepend -R $(PKGDEP_RESOLVE_IMAGE) resolve \
-		    $(PKGDEP_VERBOSE_FLAG) -m $(DEP_PKGS); \
-		for p in $(DEP_PKGS:%.dep=%); do \
-			$(MV) $$p.dep.res $$p.res; \
-		done; \
+		    $(PKGDEP_VERBOSE_FLAG) -m $(DEP_CURRENT_PKGS) ; \
 	fi
-	$(PKGDEBUG)for p in $(DEP_SYNTH_PKGS:%.dep=%); \
-	do \
-		$(CP) $$p.dep $$p.res; \
-	done
 	$(PKGDEBUG)$(TOUCH) $(@)
 
 gendeps: $(PDIR)/gendeps
+$(DEP_RES_CURRENT_PKGS): $(PDIR)/gendeps
+
+$(DEP_RES_SYNTH_PKGS) $(DEP_RES_LEGACY_PKGS): $$(@:%.dep.res=%.dep)
+	@print "## Skipping dependency generation for $(@F:%.dep.res=%)"
+	$(PKGDEBUG)$(CP) $(@:%.dep.res=%.dep) $(@)
+
+# Post-processing of manifests after dependency resolution
+$(PDIR)/%.res: $(PDIR)/%.dep.res
+	$(PKGDEBUG)if [[ -s $< ]] ; then \
+		$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
+			-O $@ $< post-pkgdepend ; \
+	else \
+		$(CP) $< $@ ; \
+	fi
 
 ### pkglint checking (pre-publication)
 
--- a/pkg/exceptions-validate_pkg.p5m	Thu Jun 23 11:07:22 2011 -0700
+++ b/pkg/exceptions-validate_pkg.p5m	Thu Jun 23 20:28:56 2011 -0700
@@ -29,6 +29,8 @@
 # all files under these directories to be flagged as errors for being
 # included in packages.
 
+dir path=system
+dir path=system/volatile
 dir path=usr/lib/mdb
 dir path=usr/lib/mdb/proc
 $(i386_ONLY)dir path=usr/lib/mdb/proc/$(ARCH64) group=bin
--- a/pkg/manifests/service-opengl-ogl-select.p5m	Thu Jun 23 11:07:22 2011 -0700
+++ b/pkg/manifests/service-opengl-ogl-select.p5m	Thu Jun 23 20:28:56 2011 -0700
@@ -19,6 +19,9 @@
 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 # DEALINGS IN THE SOFTWARE.
 #
+
+# Mark /system/volatile/* paths to be removed after pkgdepend, before publishing
+<transform dir link path=system/volatile.* -> set org.opensolaris.nopublish true>
 set name=pkg.fmri value=pkg:/service/opengl/ogl-select@$(OSPKGVERS)
 set name=pkg.description \
     value="ogl-select is a SMF service that determines at boot time which vendor supplied OpenGL headers and libraries will be used, based on the hardware and drivers installed in the system."
@@ -49,6 +52,13 @@
 dir path=usr/share
 dir path=usr/share/man
 dir path=usr/share/man/man1
+# These dirs are used to resolve dependencies during the build but are not
+# published in the packages as they're created at runtime by the SMF service
+dir path=system/volatile/opengl
+dir path=system/volatile/opengl/include
+dir path=system/volatile/opengl/lib
+dir path=system/volatile/opengl/lib/$(ARCH64)
+dir path=system/volatile/opengl/server
 file path=lib/opengl/ogl_select/mesa_vendor_select mode=0555
 $(i386_ONLY)file path=lib/opengl/ogl_select/nvidia_vendor_select mode=0555
 $(sparc_ONLY)file path=lib/opengl/ogl_select/sun_vendor_select mode=0555
@@ -62,23 +72,39 @@
 link path=usr/X11/lib/GL target=../../lib/GL
 link path=usr/X11/lib/libGL.so target=libGL.so.1
 link path=usr/X11/lib/libGL.so.1 target=GL/libGL.so.1
-link path=usr/include/GL/gl.h target=../../../var/run/opengl/include/gl.h
+link path=usr/include/GL/gl.h target=../../../system/volatile/opengl/include/gl.h
 link path=usr/include/GL/glext.h \
-    target=../../../var/run/opengl/include/glext.h
-link path=usr/include/GL/glx.h target=../../../var/run/opengl/include/glx.h
+    target=../../../system/volatile/opengl/include/glext.h
+link path=usr/include/GL/glx.h target=../../../system/volatile/opengl/include/glx.h
 link path=usr/include/GL/glxext.h \
-    target=../../../var/run/opengl/include/glxext.h
+    target=../../../system/volatile/opengl/include/glxext.h
 link path=usr/lib/$(ARCH64)/libGL.so target=libGL.so.1
 link path=usr/lib/$(ARCH64)/libGL.so.1 target=../GL/$(ARCH64)/libGL.so.1
 link path=usr/lib/GL/$(ARCH64)/libGL.so target=libGL.so.1
 link path=usr/lib/GL/$(ARCH64)/libGL.so.1 \
-    target=../../../../var/run/opengl/lib/$(ARCH64)/libGL.so.1
+    target=../../../../system/volatile/opengl/lib/$(ARCH64)/libGL.so.1
 link path=usr/lib/GL/64 target=$(ARCH64)
 link path=usr/lib/GL/libGL.so target=libGL.so.1
-link path=usr/lib/GL/libGL.so.1 target=../../../var/run/opengl/lib/libGL.so.1
+link path=usr/lib/GL/libGL.so.1 target=../../../system/volatile/opengl/lib/libGL.so.1
 link path=usr/lib/libGL.so target=libGL.so.1
 link path=usr/lib/libGL.so.1 target=GL/libGL.so.1
 link path=usr/lib/xorg/modules/extensions/libglx.so \
-    target=../../../../../var/run/opengl/server/libglx.so
+    target=../../../../../system/volatile/opengl/server/libglx.so
+# These links are used to resolve dependencies during the build but are not
+# published in the packages as they're created at runtime by the SMF service
+link path=system/volatile/opengl/include/gl.h target=../../../../usr/include/mesa/gl.h
+link path=system/volatile/opengl/include/glext.h \
+    target=../../../../usr/include/mesa/glext.h
+link path=system/volatile/opengl/include/glx.h \
+    target=../../../../usr/include/mesa/glx.h
+link path=system/volatile/opengl/include/glxext.h \
+    target=../../../../usr/include/mesa/glxext.h
+link path=system/volatile/opengl/lib/$(ARCH64)/libGL.so.1 \
+    target=../../../../../usr/lib/mesa/$(ARCH64)/libGL.so.1
+link path=system/volatile/opengl/lib/64 target=$(ARCH64)
+link path=system/volatile/opengl/lib/libGL.so.1 \
+    target=../../../../usr/lib/mesa/libGL.so.1
+link path=system/volatile/opengl/server/libglx.so \
+    target=../../../../usr/lib/mesa/modules/extensions/libglx.so
 # constype is required to detect which vendor_select script to run
 depend fmri=pkg:/diagnostic/constype type=require
--- a/pkg/manifests/x11-library-freeglut.p5m	Thu Jun 23 11:07:22 2011 -0700
+++ b/pkg/manifests/x11-library-freeglut.p5m	Thu Jun 23 20:28:56 2011 -0700
@@ -1,4 +1,4 @@
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2011, Oracle and/or its affiliates. All rights reserved.
 #
 # Permission is hereby granted, free of charge, to any person obtaining a
 # copy of this software and associated documentation files (the "Software"),
@@ -66,6 +66,7 @@
 file path=usr/share/doc/glut/progress.html
 file path=usr/share/doc/glut/structure.html
 #
-depend fmri=pkg:/service/opengl/ogl-select type=require
+# Autodetected for now:
+# depend fmri=pkg:/service/opengl/ogl-select type=require
 depend fmri=pkg:/x11/header/x11-protocols type=require facet.devel=true
 
--- a/pkg/manifests/x11-library-mesa.p5m	Thu Jun 23 11:07:22 2011 -0700
+++ b/pkg/manifests/x11-library-mesa.p5m	Thu Jun 23 20:28:56 2011 -0700
@@ -128,5 +128,6 @@
 link path=usr/lib/mesa/libGL.so target=libGL.so.1
 link path=usr/lib/mesa/libGLU.so target=libGLU.so.1
 link path=usr/lib/mesa/libGLw.so target=libGLw.so.1
-depend fmri=pkg:/service/opengl/ogl-select type=require
+# Autodetected for now
+# depend fmri=pkg:/service/opengl/ogl-select type=require
 depend fmri=pkg:/x11/header/x11-protocols type=require facet.devel=true
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkg/transforms/post-pkgdepend	Thu Jun 23 20:28:56 2011 -0700
@@ -0,0 +1,26 @@
+#
+# Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a
+# copy of this software and associated documentation files (the "Software"),
+# to deal in the Software without restriction, including without limitation
+# the rights to use, copy, modify, merge, publish, distribute, sublicense,
+# and/or sell copies of the Software, and to permit persons to whom the
+# Software is furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice (including the next
+# paragraph) shall be included in all copies or substantial portions of the
+# Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+# DEALINGS IN THE SOFTWARE.
+#
+
+# Drop files needed for dependency resolution but which should not be
+# published in the packages.
+<transform file dir link org.opensolaris.nopublish=true -> drop>