changeset 5496:6292cbc0f0fd

coreutils: do not use patch. Fixes bootstrapping.
author Jan Nieuwenhuizen <janneke@gnu.org>
date Thu, 20 Aug 2009 19:59:32 +0200
parents 8b10d6e5d7b8
children 622e6da7f7fc
files gub/specs/coreutils.py
diffstat 1 files changed, 29 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/gub/specs/coreutils.py	Thu Aug 20 17:33:03 2009 +0200
+++ b/gub/specs/coreutils.py	Thu Aug 20 19:59:32 2009 +0200
@@ -7,33 +7,51 @@
 for GUB's librestrict(2) to kick-in.
 '''
 
+# Let's not use patch now we're a bootstrap package
+no_patch = True
+
 class Coreutils__tools (tools.AutoBuild):
-    source = 'ftp://ftp.gnu.org/pub/gnu/coreutils/coreutils-6.12.tar.gz'
-    if 'BOOTSTRAP' in os.environ.keys ():
-        patches = ['coreutils-6.12-shared-autoconf.patch']
+#    source = 'ftp://ftp.gnu.org/pub/gnu/coreutils/coreutils-6.12.tar.gz'
+    source = 'http://ftp.gnu.org/pub/gnu/coreutils/coreutils-7.4.tar.gz'
+    if 'BOOTSTRAP' in os.environ.keys () or no_patch:
+        # patches = ['coreutils-6.12-shared-autoconf.patch']
+        pass
     else:
         patches = ['coreutils-6.12-shared-automake.patch']
+    def patch (self):
+        tools.AutoBuild.patch (self)
+        if not self.patches:
+            self.file_sub ([('noinst_LIBRARIES', 'lib_LIBRARIES')],
+                           '%(srcdir)s/lib/gnulib.mk')
+            self.file_sub ([
+                    ('libcoreutils[.]a', 'libcoreutils.so'),
+                    ('([(]LIBINTL[)]) ../lib/libcoreutils.so', r'\1'),
+                    ], '%(srcdir)s/src/Makefile.in')
     def _get_build_dependencies (self):
+        if 'BOOTSTRAP' in os.environ.keys () or no_patch:
+            return []
         return ['tools::autoconf', 'tools::automake']
     def force_autoupdate (self):
-        return 'BOOTSTRAP' not in os.environ.keys ()
+        return 'BOOTSTRAP' not in os.environ.keys () or no_patch
     def autoupdate (self):
-        if not 'BOOTSTRAP' in os.environ.keys ():
-            self.system ('''
+        if 'BOOTSTRAP' in os.environ.keys () or no_patch:
+            return
+        self.system ('''
 cd %(srcdir)s && autoreconf
 ''')
     def configure_command (self):
         return (tools.AutoBuild.configure_command (self)
                 + ' CFLAGS=-fPIC')
     def makeflags (self):
-        return ''' LDFLAGS='%(rpath)s' LIBS='$(cp_LDADD) $(ls_LDADD) -lm' RANLIB='mvaso () { mv $$1 $$(dirname $$1)/$$(basename $$1 .a).so; }; mvaso ' libcoreutils_a_AR='gcc -shared -o' '''
+        return ''' LDFLAGS='%(rpath)s' LIBS='$(cp_LDADD) $(ls_LDADD) -lm' RANLIB='mvaso () { test $$(basename $$1) == libcoreutils.a && mv $$1 $$(dirname $$1)/$$(basename $$1 .a).so || : ; }; mvaso ' libcoreutils_a_AR='gcc -shared -o' '''
     def wrap_executables (self):
         # using rpath
         pass
     def install (self):
         # The RANLIB/mvaso trick needs libcoreutils.a to exist at install time.
-        self.system ('cd %(builddir)s/lib && ln libcoreutils.so libcoreutils.a')
+        self.system ('cd %(builddir)s/lib && ln -f libcoreutils.so libcoreutils.a')
         tools.AutoBuild.install (self)
-        if 'BOOTSTRAP' in os.environ.keys ():
-            self.system ('mkdir -p %(install_prefix)/lib')
-            self.system ('cp -pv lib/libcoreutils* %(install_prefix)/lib')
+        self.system ('cd %(builddir)s/lib && rm -f libcoreutils.a')
+        if 'BOOTSTRAP' in os.environ.keys () or no_patch:
+            self.system ('mkdir -p %(install_prefix)s/lib')
+            self.system ('cp -pv %(builddir)s/lib/libcoreutils* %(install_prefix)s/lib')