19978574 Need an automated, repeatable way to generate X's FOSS required source releases
authorAlan Coopersmith <Alan.Coopersmith@Oracle.COM>
Sat, 08 Nov 2014 14:38:52 -0800
changeset 1479 4a76cf532c2c
parent 1478 31923422df86
child 1480 42297e513c13
19978574 Need an automated, repeatable way to generate X's FOSS required source releases
.hgignore
BUILD_INSTRUCTIONS
Makefile
buildit
open-src/Makefile
open-src/common/Makefile.init
open-src/common/Makefile.options.opensolaris
open-src/common/Makefile.subdirs
open-src/font/Makefile.inc
open-src/lib/Makefile
open-src/lib/freeglut/Makefile
open-src/lib/libglu/Makefile
pkg/Makefile
pkg/generate_font_metadata.pl
pkg/manifests/developer-opensolaris-X.p5m
pkg/transforms/extract_names
--- a/.hgignore	Wed Nov 05 10:16:38 2014 -0800
+++ b/.hgignore	Sat Nov 08 14:38:52 2014 -0800
@@ -43,6 +43,8 @@
 # Skip other files built during the build
 ^open-src/common/Makefile.options$
 ^open-src/data/smf-rbac/x11-server.xml$
+^pkglist.txt$
+^BUILD_INSTRUCTIONS.txt$
 # Skip emacs/patch backup files
 .*\~$
 # Skip xref files
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/BUILD_INSTRUCTIONS	Sat Nov 08 14:38:52 2014 -0800
@@ -0,0 +1,112 @@
+Solaris X Window System Consolidation Build Instructions
+--------------------------------------------------------
+
+Copyright (c) 2006, 2014, 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.
+____________________________________________________________________________
+
+== Build requirements & preparation ==
+
+To build X, you need to set up a machine with the correct build environment:
+ - A machine running a recent build of the target version of Solaris,
+   with the IPS package developer/opensolaris/X installed. This meta-package
+   ensures all the other packages in Solaris which are needed to build X are
+   installed.
+ - The current Solaris Common Build Environment (CBE) version of the
+   Oracle Solaris Studio C & C++ compilers & associated tools.
+   These must be found first for cc/CC/etc. in $PATH when you build, and
+   must include at least these packages (or their equivalents):
+        developer/solarisstudio-123/backend
+        developer/solarisstudio-123/c++
+        developer/solarisstudio-123/cc
+        developer/solarisstudio-123/dmake
+        developer/solarisstudio-123/library/c++-libs
+
+There are several options that may be configured when building this software,
+such as whether to use tools & servers internal to Oracle's network or not.
+Before you build the software for the first time, you will need to ensure
+these options are correctly set for you - see the section titled
+"Setting builder/distro variables" in open-src/README for a list of these
+settings and instructions to configure open-src/common/Makefile.options.
+
+== Building the software ==
+
+To build the software, simply cd into the top level directory and run
+
+ ./buildit
+
+To build the software and create packages, add the -p flag to buildit:
+
+ ./buildit -p
+
+Output of various stages is stored into log files which you can check for
+errors with the included open-src/util/build-tools/find-build-errors script:
+
+build step      files under log/ directory in build tree
+----------      ----------------------------------------
+Software build  buildit-XW, check-rtime
+IPS packaging   make-pkgs, check-pkgs
+
+The built binaries are found after the build in a proto area:
+
+SPARC           proto/root_sparc/
+x86/x64         proto/root_i386/
+
+The file open-src/README has further details on the build system and
+directory organizaiton of this software repository.
+
+== Installing IPS packages ==
+
+The built packages will be found in a repository in the directory
+proto/pkg_sparc or proto/pkg_i386 as appropriate.
+
+Builds made by individual developers default to using the publisher
+name "xnv-devel" but that can be overridden via flags to the buildit or
+make_release_packages scripts.  They will depend on the versions of
+packages from other consolidations that were installed on the system
+they built them on.
+
+The recommended mechanism for installing any of these builds is the onu
+tool provided by ON. You can install the pkg:/developer/build/onbld package
+to get a local copy installed as /opt/onbld/bin/onu .
+
+onu will create a new boot environment and install the packages there - you
+will then need to reboot into that BE to use them. Since none of the X
+packages have the reboot required flag, it is possible to use pkg to install
+them to the live BE, but then you have more work to do if you need to switch
+back to the previous versions.
+
+Note that onu uses pkg image-update, which means there are two important
+things to remember:
+
+1) It will upgrade all of your packages and not just the X packages.
+2) It will normally only upgrade the X packages you already have installed
+   on the system, though it will leave the BE mounted so that you can add
+   other packages via pkg -R /tmp/onu.* install package-name.
+
+To install all the packages provided by the X consolidation for the build
+in your BE, you can install the group package pkg:/consolidation/X/X-all .
+
+Example: Install to a new BE named "X14" that is cloned from the current BE:
+
+ # onu -O -u file://`pwd`/proto/pkgs_i386 -U xnv-devel -t X14
+
+____________________________________________________________________________
--- a/Makefile	Wed Nov 05 10:16:38 2014 -0800
+++ b/Makefile	Sat Nov 08 14:38:52 2014 -0800
@@ -1,6 +1,6 @@
 # Makefile for X Consolidation
 #
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2014, 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"),
@@ -34,8 +34,6 @@
 
 all: setup install check
 
-setup: open-src/common/Makefile.options
-
 # Choose options for branding, download sites, etc.
 # Makefile.options is created as a link to a file containing the desired
 # options, chosen by the first of these found in open-src/common:
@@ -44,6 +42,8 @@
 #	3) Makefile.options.opensolaris
 MK_OPTS = open-src/common/Makefile.options
 
+setup: $(MK_OPTS)
+
 $(MK_OPTS):
 	@ if [[ -n "${X_BUILD_OPTIONS}" ]] ; then \
 	    X_BUILD_OPTIONS="${X_BUILD_OPTIONS}" ; \
@@ -69,3 +69,30 @@
 ### Include common definitions
 DIRNAME=""
 include $(TOP)/open-src/common/Makefile.subdirs
+
+# Files & directories to include in source release zip files
+ZIP_GENERATED_FILES = BUILD_INSTRUCTIONS.txt pkglist.txt
+ZIP_CONTENTS  = $(ZIP_GENERATED_FILES)
+ZIP_CONTENTS += buildit download-tarballs make_release_packages Makefile
+ZIP_CONTENTS += open-src pkg exception_lists
+ZIP_CONTENTS += .hg .hgignore .hgtags 
+
+ZIP_COMMENT_FILE = proto/x.zipcomment
+
+# Don't include Makefile.options symlink in zipfile, so it gets correctly
+# autogenerated for the builder when they first build it
+ZIP_EXCLUDE_FILES = $(MK_OPTS)
+
+proto/x.zip: $(ZIP_GENERATED_FILES)
+	-rm -f proto/x.zip
+	( print 'Oracle Solaris X Consolidation open source release' ; \
+	  LC_ALL=en_US.UTF-8 date ; \
+	  print -n 'hg id: ' ; hg id -it ) > $(ZIP_COMMENT_FILE)
+	zip -9rqyz proto/x.zip $(ZIP_CONTENTS) -x $(ZIP_EXCLUDE_FILES) \
+	  < $(ZIP_COMMENT_FILE)
+
+BUILD_INSTRUCTIONS.txt:
+	cd open-src && $(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) $(TOP)/$(@)
+
+pkglist.txt:
+	cd pkg && $(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) $(TOP)/$(@)
--- a/buildit	Wed Nov 05 10:16:38 2014 -0800
+++ b/buildit	Sat Nov 08 14:38:52 2014 -0800
@@ -45,15 +45,17 @@
 }
 
 MAKE_PKGS=0
+MAKE_SRC_RELEASE=0	# generate sources for Solaris FOSS release process
 VERBOSE_FLAGS=""	# verbosity flag passed to xmake/make_release_packages
 PUBLISHER_FLAGS=""
 
-while getopts pP:v i; do
+while getopts pP:sv i; do
     case $i in
 	p) MAKE_PKGS=1 ;;
+	s) MAKE_SRC_RELEASE=1 ;;
 	v) VERBOSE_FLAGS="-v" ;;
 	P) PUBLISHER_FLAGS="-p $OPTARG" ;;
-	?) print -u2 "USAGE: $0 [-p [-P publisher]] [-v]"; exit 2 ;;
+	?) print -u2 "USAGE: $0 [-p [-P publisher]] [-s] [-v]"; exit 2 ;;
     esac
 done
 
@@ -109,7 +111,7 @@
     ${tool} --version | head -1
 done
 
-# Exported to stop Sun compilers from reporting home on each usage
+# Exported to stop Studio compilers from reporting home on each usage
 export SUNW_NO_UPDATE_NOTIFY='true'
 export UT_NO_USAGE_TRACKING='1'
 
@@ -123,10 +125,22 @@
 /bin/rm -rf "proto/root_${MACH}" "proto/metadata_${MACH}" \
     "proto/pkg_${MACH}" "proto/tools_${MACH}"
 
+${XMAKE} clobber
+
+# Generate source release while tree is in clean state, but ensure we have all
+# the required tarballs for both platforms, (and no extras/old ones) first.
+if [ "${MAKE_SRC_RELEASE}" = 1 ] ; then
+    rm -rf open-src/tarballs
+    mkdir -p open-src/tarballs
+    for darch in i386 sparc ; do
+	(cd open-src ; \
+	  ${XMAKE} download MACH="${darch}" ADD_PASSDOWN_VARS="MACH=${darch}")
+    done
+    rm -f proto/x.zip BUILD_INSTRUCTIONS.txt pkglist.txt
+    ${XMAKE} proto/x.zip
+fi
+
 cd open-src
-# Run as two steps to avoid race between cleaning & rebuilding when
-# using parallel make
-${XMAKE} clobber
 ${XMAKE} install
 ${XMAKE} check_rtime > ../log/check-rtime 2>&1 &
 cd ..
@@ -137,7 +151,8 @@
     /bin/rm -rf log/parfait
     parfait -e all -c open-src/common/X-parfait.conf -z "$(pwd)" \
         -j "${DMAKE_MAX_JOBS:-100%}" -r "${XBUILD_HG_ID}" \
-        -o log/parfait.txt -g log/parfait open-src > log/parfait.out 2>&1 &
+        -o log/parfait.txt -g log/parfait ${X_ADD_PARFAIT_FLAGS} \
+        open-src > log/parfait.out 2>&1 &
 fi
 
 # Set DISTRO_NAME based on open-src/common/Makefile.options
--- a/open-src/Makefile	Wed Nov 05 10:16:38 2014 -0800
+++ b/open-src/Makefile	Sat Nov 08 14:38:52 2014 -0800
@@ -1,6 +1,6 @@
 # Makefile for X Consolidation Open Source bits
 #
-# Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2005, 2014, 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"),
@@ -102,3 +102,22 @@
 # linker flags
 check_rtime:
 	check_rtime -e ../exception_lists/check_rtime -d $(PROTODIR) $(PROTODIR)
+
+# This is generated here instead of in $(TOP)/Makefile so that it has access
+# to the variables defined in Makefile.init like $(GCC)
+include $(TOP)/open-src/common/Makefile.init
+
+$(TOP)/BUILD_INSTRUCTIONS.txt: $(TOP)/BUILD_INSTRUCTIONS
+	-rm -f $(@)
+	cp $(TOP)/BUILD_INSTRUCTIONS $(@)
+	printf '\nThe software in this package was built using:\n\n' >> $(@)
+	(for tool in cc CC fbe lint ; do \
+	    $${tool} -V 2>&1 | head -1 ; \
+	done) >> $(@)
+	dmake -v >> $(@)
+	(for tool in ${GCC} gmake autoconf automake libtool ${PERL} ${PYTHON} hg ; do \
+	    printf "%s: " "$$(whence $${tool})" ; \
+	    $${tool} --version | head -1 ; \
+	done) >> $(@)
+	printf '\non a machine installed with:\n\n' >> $(@) 
+	pkg list '*-incorporation' >> $(@)
--- a/open-src/common/Makefile.init	Wed Nov 05 10:16:38 2014 -0800
+++ b/open-src/common/Makefile.init	Sat Nov 08 14:38:52 2014 -0800
@@ -366,11 +366,13 @@
 LNDIR=$(PROTOTOOLSDIR)$(X11_BIN_DIR)/lndir
 
 # Commands to run font utilities from proto area
-MKFONTDIR=$(PROTOTOOLSDIR)$(X11_BIN_DIR)/mkfontdir
 MKFONTSCALE=$(PROTOTOOLSDIR)$(X11_BIN_DIR)/mkfontscale
 INSTALLALIAS=$(PROTOTOOLSDIR)$(X11_X11LIB_DIR)/installalias
 FC_QUERY=$(PROTOTOOLSDIR)$(X11_BIN_DIR)/fc-query
 FC_SCAN=$(PROTOTOOLSDIR)$(X11_BIN_DIR)/fc-scan
+# mkfontdir is just a shell wrapper around /usr/bin/mkfontscale, so we call
+# it directly here, instead of futzing with command paths in the script
+MKFONTDIR=$(MKFONTSCALE) -b -s -l
 
 # Script fragment to start echoing commands in shell sequences in make rules
 # Sets PS4 to "" so output isn't prepended with "+ " and looks like normal
--- a/open-src/common/Makefile.options.opensolaris	Wed Nov 05 10:16:38 2014 -0800
+++ b/open-src/common/Makefile.options.opensolaris	Sat Nov 08 14:38:52 2014 -0800
@@ -1,6 +1,6 @@
 # X build options for OpenSolaris sources
 #
-# Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2014, 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"),
@@ -38,4 +38,4 @@
 
 # Xserver configuration options for vendor name & support URL
 VENDOR_NAME = OpenSolaris, based on X.Org Foundation sources
-VENDOR_SUPPORT_URL = http://hub.opensolaris.org/bin/view/Community+Group+x_win/
+VENDOR_SUPPORT_URL = http://solaris-x11.java.net/
--- a/open-src/common/Makefile.subdirs	Wed Nov 05 10:16:38 2014 -0800
+++ b/open-src/common/Makefile.subdirs	Sat Nov 08 14:38:52 2014 -0800
@@ -32,6 +32,7 @@
 
 # Variables to always pass down to subdirs
 PASSDOWN_VARS = V="$(V)" TOP="$(TOP)" CDEBUGFLAGS="$(CDEBUGFLAGS)" 
+PASSDOWN_VARS += $(ADD_PASSDOWN_VARS) ADD_PASSDOWN_VARS='$(ADD_PASSDOWN_VARS)'
 
 .DEFAULT:
 	$(MAKE) $(MAKEFLAGS) $(PASSDOWN_VARS) subdirs OS_TARGET=$@
--- a/open-src/font/Makefile.inc	Wed Nov 05 10:16:38 2014 -0800
+++ b/open-src/font/Makefile.inc	Sat Nov 08 14:38:52 2014 -0800
@@ -1,6 +1,6 @@
 # -*- Makefile -*- rules common to most X.Org font modules
 #
-# Copyright (c) 2006, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2006, 2014, 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"),
@@ -96,7 +96,7 @@
 
 # Paths to find mkfontscale, fc-cache & the libraries they need in build area
 FONT_UTILS_PATH=$(PROTODIR)$(X11_DIR)/bin:$(PROTODIR)/usr/bin
-FONT_LIBS_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR):$(PROTODIR)$(X11_DIR)/lib:$(PROTODIR)/usr/lib
+FONT_LIBS_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(LIBSUBDIR_64):$(PROTODIR)$(X11_DIR)/lib$(LIBSUBDIR_64):$(PROTODIR)/usr/lib$(LIBSUBDIR_64)
 
 # Additional environment variable options to GNU autoconf configure script
 MODTYPE_CONFIG_ENV = PATH="$(FONT_UTILS_PATH):$$PATH" \
--- a/open-src/lib/Makefile	Wed Nov 05 10:16:38 2014 -0800
+++ b/open-src/lib/Makefile	Sat Nov 08 14:38:52 2014 -0800
@@ -90,7 +90,7 @@
 libxkbfile: libX11
 mesa: libdrm libX11 libXext libXdamage libXfixes libXxf86vm
 libglu: mesa
-freeglut: mesa
+freeglut: mesa libglu
 
 # pixman doesn't need these itself, but its test framework uses gtk,
 # which does depend on these
--- a/open-src/lib/freeglut/Makefile	Wed Nov 05 10:16:38 2014 -0800
+++ b/open-src/lib/freeglut/Makefile	Sat Nov 08 14:38:52 2014 -0800
@@ -2,7 +2,7 @@
 #
 # FreeGLUT 2.6.0 Makefile
 #
-# Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2014, 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"),
@@ -73,6 +73,9 @@
 #  FreeGLUT really wants to know that we are POSIX friendly
 MODULE_CPPFLAGS = -D__posix__ -D__unix__
 
+# Need to find libdrm in protodir at build time, since libGL links to it
+MODULE_LDFLAGS= -L$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)
+
 # ignore some unneeded dependencies that upstream includes:
 #   unreferenced object=libXext.so.0; unused dependency of libglut.so.3.9.0
 #   unreferenced object=libXxf86vm.so.1; unused dependency of libglut.so.3.9.0
--- a/open-src/lib/libglu/Makefile	Wed Nov 05 10:16:38 2014 -0800
+++ b/open-src/lib/libglu/Makefile	Sat Nov 08 14:38:52 2014 -0800
@@ -57,9 +57,6 @@
 # Patches to apply to source after unpacking, in order
 SOURCE_PATCHES=
 
-# Regenerate Makefile.in's from Makefile.am's after applying glu-exports.patch
-AUTORECONF=yes
-
 # Use -KPIC instead of -Kpic because we have too many symbols on SPARC
 DELIBTOOLIZE_FLAGS_sparc = -P
 DELIBTOOLIZE_FLAGS_i386 = 
@@ -68,8 +65,8 @@
 # pkg-config files to update
 FIX_PC_FILES=glu.pc.in
 
-# Build mesa with this define (Bug 15706016)
-MODULE_CFLAGS = -D__EXTENSIONS__
+# Need to find libdrm in protodir at build time, since libGL links to it
+MODULE_LDFLAGS= -L$(PROTODIR)$(X11_SERVERLIBS_DIR)$(ARCHLIBSUBDIR)
 
 # Override LDFLAGS passed to configure to not include CFLAGS, since that
 # breaks building libGLU with Sun Studio C++ compiler
@@ -83,10 +80,6 @@
 MODULE_MAKE=$(GNUMAKE)
 MODULE_MAKE_SET=yes
 
-# Need to use GNU indent
-MODULE_INDENT=$(GNUINDENT)
-MODULE_INDENT_SET=yes
-
 # Need to build with gcc
 MODULE_COMPILER=gcc
 MODULE_COMPILER_SET=yes
--- a/pkg/Makefile	Wed Nov 05 10:16:38 2014 -0800
+++ b/pkg/Makefile	Sat Nov 08 14:38:52 2014 -0800
@@ -122,11 +122,8 @@
 $(PDIR)/%.p5m: %.p5m
 	$(PKGDEBUG)$(LN) -s ../$< $@
 
-PMANIFESTS = $(MANIFESTS:%=$(PDIR)/%)
-SMANIFESTS = $(SYNTH_MANIFESTS:%=$(PDIR)/%)
-EMANIFESTS = $(EXCEPTION_MANIFESTS:%=$(PDIR)/%)
-
-ALL_MANIFESTS = $(PMANIFESTS) $(SMANIFESTS) $(EMANIFESTS)
+ALL_MANIFEST_SRCS = $(MANIFESTS) $(SYNTH_MANIFESTS) $(EXCEPTION_MANIFESTS)
+ALL_MANIFESTS = $(ALL_MANIFEST_SRCS:%=$(PDIR)/%)
 manifests: $(ALL_MANIFESTS)
 $(ALL_MANIFESTS): $(PDIR)
 
@@ -150,10 +147,13 @@
 
 $(FONT_ATTRS): $(FONT_METADATA)
 
+FONT_LIBS_PATH=$(PROTODIR)$(X11_SERVERLIBS_DIR)$(LIBSUBDIR_64):$(PROTODIR)$(X11_DIR)/lib$(LIBSUBDIR_64):$(PROTODIR)/usr/lib$(LIBSUBDIR_64)
+
 $(PDIR)/%.font: $(PDIR)/%.p5m
 	@print "## Generating font metadata in $(@F)"
 	$(PKGDEBUG)$(RM) $(@)
-	$(PKGDEBUG)$(PERL) generate_font_metadata.pl \
+	$(PKGDEBUG)LD_LIBRARY_PATH=$(FONT_LIBS_PATH) \
+		$(PERL) generate_font_metadata.pl \
 		-p $(PROTODIR) -m $< > $@ || ( rm $@ ; exit 1 )
 
 ### Manifest mogrification
@@ -218,6 +218,9 @@
 AUTOMAKE_PKG_VERSION_CMD = print $(AUTOMAKE_VERSION) | tr -d '.'
 PKGMOG_DEFINES += AUTOMAKE_PKG_VERSION=$(AUTOMAKE_PKG_VERSION_CMD:sh)
 
+# gcc version needed for build dependencies
+GCC_PKG_VERSION_CMD = print $(GCC_VERSION) | tr -d '.'
+PKGMOG_DEFINES += GCC_PKG_VERSION=$(GCC_PKG_VERSION_CMD:sh)
 
 PROC_PKGS = $(PKGS:%=$(PDIR)/%.mog)
 PROC_CURRENT_PKGS = $(CURRENT_MANIFESTS:%.p5m=$(PDIR)/%.mog)
@@ -258,6 +261,14 @@
 		$(PM_TRANSFORMS) $(EXTRA_TRANSFORMS)
 	$(PKGDEBUG)$(TOUCH) $(@)
 
+# List of all packages we build, used in open source code release zip files
+$(TOP)/pkglist.txt:
+	@print "## Generating pkglist.txt"
+	$(PKGDEBUG)$(PKGMOGRIFY) $(PKGMOG_VERBOSE) $(PM_INC:%= -I %) \
+		$(PKGMOG_DEFINES:%=-D %) -O /dev/null \
+		-I manifests -I legacy $(ALL_MANIFEST_SRCS) extract_names \
+		| LC_ALL=C sort -u > $(@)
+
 ### Dependency detection
 
 # Package manifest containing list of packages to use in dependency
@@ -472,6 +483,8 @@
 clean:
 	-$(RM) -r $(PDIR)
 
+clobber: clean clean-repo
+
 .PARALLEL: $(PKGS) $(PROC_PKGS) $(DEP_PKGS) \
 	$(PROC_SYNTH_PKGS) $(DEP_SYNTH_PKGS) $(PUB_PKGS)
 
@@ -504,9 +517,6 @@
 # Instead of fixing all the upstream packages to follow our permission rules
 # just fix the proto area to match our rules
 
-# Uses xargs instead of -exec chmod a-w \{\} \+ as a temporary workaround
-# for Solaris find bug 17962619 until all build machines are running s12_39
-
 fix_perms: 
 	@print "## Fixing proto area permissions"
-	$(PKGDEBUG)find $(PKGROOT) -type f | xargs chmod a-w
+	$(PKGDEBUG)find $(PKGROOT) -type f -exec chmod a-w \{\} \+
--- a/pkg/generate_font_metadata.pl	Wed Nov 05 10:16:38 2014 -0800
+++ b/pkg/generate_font_metadata.pl	Sat Nov 08 14:38:52 2014 -0800
@@ -1,7 +1,7 @@
 #! /usr/perl5/bin/perl -w
 
 #
-# Copyright (c) 2010, 2012, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2010, 2014, 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"),
@@ -71,7 +71,9 @@
   my %xlfds = ();
 
   if (! -f $protometafile) {
-      run_cmd("$proto_dir/usr/bin/mkfontdir", $protofontpath);
+      # mkfontscale -b -s -l is equivalent to mkfontdir
+      run_cmd("$proto_dir/usr/bin/mkfontscale", "-b", "-s", "-l",
+	      $protofontpath);
   }
 
   open my $XFILE, '<', $protometafile
--- a/pkg/manifests/developer-opensolaris-X.p5m	Wed Nov 05 10:16:38 2014 -0800
+++ b/pkg/manifests/developer-opensolaris-X.p5m	Sat Nov 08 14:38:52 2014 -0800
@@ -40,10 +40,11 @@
 # pkgmogrify filter when making the list for pkgdepend resolve -e to use.
 #############################################################################
 
-# Builds need to be able to uncompress upstream tar.bz2 & tar.gz files
+# Builds need to be able to uncompress upstream .bz2, .gz, & .xz files
 depend type=require fmri=pkg:/compress/bzip2 \
     org.opensolaris.pkgdepend.resolve=true
 depend type=require fmri=pkg:/compress/gzip
+depend type=require fmri=pkg:/compress/xz
 
 # X.Org ships many docs using the DocBook XML DTD's and stylesheets
 depend type=require fmri=pkg:/data/docbook/docbook-style-dsssl
@@ -74,6 +75,9 @@
 # The X gate borrows some ON scripts to build, such as validate_pkg
 depend type=require fmri=pkg:/developer/build/onbld
 
+# Many packages use pkg-config to find information about their dependencies
+depend type=require fmri=pkg:/developer/build/pkg-config
+
 # Xserver build includes mdb modules
 depend type=require fmri=pkg:/developer/debug/mdb
 
@@ -82,20 +86,17 @@
 depend type=require fmri=pkg:/developer/documentation-tool/openjade
 depend type=require fmri=pkg:/developer/documentation-tool/opensp
 
-# Some modules use gcc to build
-depend type=require fmri=pkg:/developer/gcc-47
+# Some modules use gcc to build (look for MODULE_COMPILER=gcc in Makefiles)
+depend type=require fmri=pkg:/developer/gcc-$(GCC_PKG_VERSION)
 
-# For now, this is the package that delivers pkg-config (Defect #15543)
-depend type=require fmri=pkg:/developer/gnome/gettext
-
-# Some packages need GNU indent to build
+# Mesa needs GNU indent to build
 depend type=require fmri=pkg:/developer/gnu-indent
 
 # xcb-util needs gperf to generate hash functions
 depend type=require fmri=pkg:/developer/gperf
 
 # tigervnc builds a java applet with javac
-depend type=require fmri=pkg:/developer/java/jdk
+depend type=require fmri=pkg:/developer/java/jdk-8
 
 # Various modules need flex to generate lexers
 depend type=require fmri=pkg:/developer/lexer/flex
@@ -192,8 +193,6 @@
 depend type=require fmri=pkg:/system/library/c++-runtime \
     org.opensolaris.pkgdepend.resolve=true
 depend type=require fmri=pkg:/system/library/flex-runtime
-depend type=require fmri=pkg:/system/library/gcc-45-runtime \
-    org.opensolaris.pkgdepend.resolve=true
 depend type=require fmri=pkg:/system/library/gcc/gcc-c++-runtime \
     org.opensolaris.pkgdepend.resolve=true
 depend type=require fmri=pkg:/system/library/gcc/gcc-c-runtime \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/pkg/transforms/extract_names	Sat Nov 08 14:38:52 2014 -0800
@@ -0,0 +1,25 @@
+#
+# Copyright (c) 2014, 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.
+#
+
+# Print short name, without version or pkg:/ prefix, for each package
+<transform pkg pkg.fmri=(pkg:/)?([^@]*) -> print %<2>>