[csw-devel] SF.net SVN: gar:[21630] csw/mgar/gar/v2

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Aug 2 23:33:28 CEST 2013


Revision: 21630
          http://gar.svn.sourceforge.net/gar/?rev=21630&view=rev
Author:   wahwah
Date:     2013-08-02 21:33:24 +0000 (Fri, 02 Aug 2013)
Log Message:
-----------
mGARv2: Build Python modules for 2.6 and 2.7

Results are merged into dual-version module packages.

Also, stop depending on CSWpython and/or CSWpython27. These dependencies
aren't that useful anyway.

Also attempt to choose the right compiler.

Writeup: http://wiki.opencsw.org/python-module-locations

Mailing list discussion:
http://lists.opencsw.org/pipermail/maintainers/2013-August/018365.html

Modified Paths:
--------------
    csw/mgar/gar/v2/categories/python/category.mk
    csw/mgar/gar/v2/gar.mk
    csw/mgar/gar/v2/lib/python/dependency_checks.py
    csw/mgar/gar/v2/lib/python/dependency_checks_test.py

Modified: csw/mgar/gar/v2/categories/python/category.mk
===================================================================
--- csw/mgar/gar/v2/categories/python/category.mk	2013-08-02 21:15:36 UTC (rev 21629)
+++ csw/mgar/gar/v2/categories/python/category.mk	2013-08-02 21:33:24 UTC (rev 21630)
@@ -1,6 +1,3 @@
-# Add a dependency to CSWpython
-_EXTRA_GAR_PKGS += $(PYTHON_PACKAGE)
-
 # For the record, do not include the following line:
 # _MERGE_EXCLUDE_CATEGORY += .*\.egg-info.*
 #
@@ -35,4 +32,23 @@
 # versions of python too.
 SITE_PACKAGES = $(PYTHON_SITE_PACKAGES)
 
+# Do not make all Python modules depend on the interpreter. With the
+# dual-version packages we would have to make all modules depend on both
+# Python versions. It's better to not depend on any Python version.
+# _EXTRA_GAR_PKGS += $(PYTHON_PACKAGE_2_6)
+# _EXTRA_GAR_PKGS += $(PYTHON_PACKAGE_2_7)
+
+# During the transition to Python 2.7, all modules are built for two Python
+# versions: 2.6 and 2.7. This implies the dependency on both CSWpython and
+# CSWpython27.
+_CATEGORY_MODULATORS ?= PYTHON_VERSION
+MODULATIONS_PYTHON_VERSION ?= 2_6 2_7
+MERGE_SCRIPTS_isa-default-python_version-2_6 ?= copy-all
+MERGE_SCRIPTS_isa-default-python_version-2_7 ?= copy-all
+MERGE_SCRIPTS_isa-default-python_version-3_3 ?= copy-all
+
 include gar/gar.mk
+
+GARCOMPILER_PYTHON_2_6 = SOS12U3
+GARCOMPILER_PYTHON_2_7 = GNU
+GARCOMPILER = $(GARCOMPILER_$(PYTHON_VERSION))

Modified: csw/mgar/gar/v2/gar.mk
===================================================================
--- csw/mgar/gar/v2/gar.mk	2013-08-02 21:15:36 UTC (rev 21629)
+++ csw/mgar/gar/v2/gar.mk	2013-08-02 21:33:24 UTC (rev 21630)
@@ -82,7 +82,7 @@
 # ========================= MODULATIONS ======================== 
 
 # The default is to modulate over ISAs
-MODULATORS ?= ISA $(EXTRA_MODULATORS) $(EXTRA_MODULATORS_$(GARCH))
+MODULATORS ?= ISA $(_CATEGORY_MODULATORS) $(EXTRA_MODULATORS) $(EXTRA_MODULATORS_$(GARCH))
 MODULATIONS_ISA = $(NEEDED_ISAS)
 
 tolower = $(shell echo $(1) | tr '[A-Z]' '[a-z]')

Modified: csw/mgar/gar/v2/lib/python/dependency_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/dependency_checks.py	2013-08-02 21:15:36 UTC (rev 21629)
+++ csw/mgar/gar/v2/lib/python/dependency_checks.py	2013-08-02 21:33:24 UTC (rev 21630)
@@ -31,12 +31,13 @@
 DEPENDENCY_FILENAME_REGEXES = (
     (r".*\.pl$",   (u"CSWperl",)),
     (r".*\.pm$",   (u"CSWperl",)),
-    (r"/?opt/csw/lib/python(2\.6)?/(site-packages|lib-dynload)/.+\.py$",
-                   (u"CSWpython",)),
-    (r"/?opt/csw/lib/python2\.7/(site-packages|lib-dynload)/.+\.py$",
-                   (u"CSWpython27",)),
-    (r"/?opt/csw/lib/python3\.3/(site-packages|lib-dynload)/.+\.py$",
-                   (u"CSWpython33",)),
+    # Do not make Python modules depend on Python.
+    # (r"/?opt/csw/lib/python(2\.6)?/(site-packages|lib-dynload)/.+\.py$",
+    #                (u"CSWpython",)),
+    # (r"/?opt/csw/lib/python2\.7/(site-packages|lib-dynload)/.+\.py$",
+    #                (u"CSWpython27",)),
+    # (r"/?opt/csw/lib/python3\.3/(site-packages|lib-dynload)/.+\.py$",
+    #                (u"CSWpython33",)),
     (r".*\.rb$",   (u"CSWruby", u"CSWruby18", u"CSWruby191", u"CSWlibruby1-9-1-1")),
     (r".*\.elc?$", (u"CSWemacs-common",)),
     (r"/opt/csw/apache2/", (u"CSWapache2",)),

Modified: csw/mgar/gar/v2/lib/python/dependency_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/dependency_checks_test.py	2013-08-02 21:15:36 UTC (rev 21629)
+++ csw/mgar/gar/v2/lib/python/dependency_checks_test.py	2013-08-02 21:33:24 UTC (rev 21630)
@@ -237,43 +237,43 @@
         None, None)
     self.mox.VerifyAll()
 
-  def testByFilenamePython(self):
-    self.pkg_data = copy.deepcopy(tree_stats[0])
-    self.pkg_data["pkgmap"] = [
-        {'class': 'none', 'line': 'not important', 'mode': '0755',
-         'path': '/opt/csw/lib/python/site-packages/foo.py',
-         'type': 'f', 'group': 'bin', 'user': 'root'}]
-    self.error_mgr_mock.NeedPackage('CSWtree', u'CSWpython',
-        "found file(s) matching "
-        "/?opt/csw/lib/python(2\\.6)?/(site-packages|lib-dynload)/.+"
-        "\\.py$, e.g. '/opt/csw/lib/python/site-packages/foo.py'")
-    self.mox.ReplayAll()
-    result = dependency_checks.ByFilename(
-        self.pkg_data,
-        self.error_mgr_mock,
-        self.logger_stub,
-        self.messenger_stub,
-        None, None)
-    self.mox.VerifyAll()
+  # def testByFilenamePython(self):
+  #   self.pkg_data = copy.deepcopy(tree_stats[0])
+  #   self.pkg_data["pkgmap"] = [
+  #       {'class': 'none', 'line': 'not important', 'mode': '0755',
+  #        'path': '/opt/csw/lib/python/site-packages/foo.py',
+  #        'type': 'f', 'group': 'bin', 'user': 'root'}]
+  #   self.error_mgr_mock.NeedPackage('CSWtree', u'CSWpython',
+  #       "found file(s) matching "
+  #       "/?opt/csw/lib/python(2\\.6)?/(site-packages|lib-dynload)/.+"
+  #       "\\.py$, e.g. '/opt/csw/lib/python/site-packages/foo.py'")
+  #   self.mox.ReplayAll()
+  #   result = dependency_checks.ByFilename(
+  #       self.pkg_data,
+  #       self.error_mgr_mock,
+  #       self.logger_stub,
+  #       self.messenger_stub,
+  #       None, None)
+  #   self.mox.VerifyAll()
 
-  def testByFilenamePython27(self):
-    self.pkg_data = copy.deepcopy(tree_stats[0])
-    self.pkg_data["pkgmap"] = [
-        {'class': 'none', 'line': 'not important', 'mode': '0755',
-         'path': '/opt/csw/lib/python2.7/site-packages/foo.py',
-         'type': 'f', 'group': 'bin', 'user': 'root'}]
-    self.error_mgr_mock.NeedPackage('CSWtree', u'CSWpython27',
-        "found file(s) matching "
-        "/?opt/csw/lib/python2\\.7/(site-packages|lib-dynload)/.+"
-        "\\.py$, e.g. '/opt/csw/lib/python2.7/site-packages/foo.py'")
-    self.mox.ReplayAll()
-    result = dependency_checks.ByFilename(
-        self.pkg_data,
-        self.error_mgr_mock,
-        self.logger_stub,
-        self.messenger_stub,
-        None, None)
-    self.mox.VerifyAll()
+  # def testByFilenamePython27(self):
+  #   self.pkg_data = copy.deepcopy(tree_stats[0])
+  #   self.pkg_data["pkgmap"] = [
+  #       {'class': 'none', 'line': 'not important', 'mode': '0755',
+  #        'path': '/opt/csw/lib/python2.7/site-packages/foo.py',
+  #        'type': 'f', 'group': 'bin', 'user': 'root'}]
+  #   self.error_mgr_mock.NeedPackage('CSWtree', u'CSWpython27',
+  #       "found file(s) matching "
+  #       "/?opt/csw/lib/python2\\.7/(site-packages|lib-dynload)/.+"
+  #       "\\.py$, e.g. '/opt/csw/lib/python2.7/site-packages/foo.py'")
+  #   self.mox.ReplayAll()
+  #   result = dependency_checks.ByFilename(
+  #       self.pkg_data,
+  #       self.error_mgr_mock,
+  #       self.logger_stub,
+  #       self.messenger_stub,
+  #       None, None)
+  #   self.mox.VerifyAll()
 
   def testLibraries_1(self):
     self.pkg_data = copy.deepcopy(tree_stats[0])

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list