From a0eea18e9fd56a512d2dc3026d49a93b921fc8f9 Mon Sep 17 00:00:00 2001 From: Jahrme Risner Date: Mon, 8 Apr 2019 14:53:40 -0700 Subject: [PATCH 1/6] Initial darwin-64 Attempt --- gub/config_cache.py | 2 ++ gub/installer.py | 1 + gub/settings.py | 1 + test-lily/test-binary.py | 1 + test-lily/upload.py | 1 + 5 files changed, 6 insertions(+) diff --git a/gub/config_cache.py b/gub/config_cache.py index 1a6ab039c..a82f1ecf4 100644 --- a/gub/config_cache.py +++ b/gub/config_cache.py @@ -207,11 +207,13 @@ config_cache['linux-64'] = config_cache['linux-x86'] config_cache['freebsd-64'] = config_cache['freebsd-x86'] +config_cache['darwin-64'] = config_cache['darwin-x86'] config_cache['arm'] += config_cache['32'] config_cache['cygwin'] += config_cache['32'] config_cache['darwin-ppc'] += config_cache['32'] config_cache['darwin-x86'] += config_cache['32'] +config_cache['darwin-64'] += config_cache['64'] config_cache['freebsd-64'] += config_cache['64'] config_cache['freebsd-x86'] += config_cache['32'] config_cache['linux-64'] += config_cache['64'] diff --git a/gub/installer.py b/gub/installer.py index 708bbdfc9..79f73d812 100644 --- a/gub/installer.py +++ b/gub/installer.py @@ -472,6 +472,7 @@ def get_installer (settings, *arguments): 'darwin-ppc' : DarwinBundle, 'darwin-x86' : DarwinBundle, + 'darwin-64' : DarwinBundle, 'freebsd-x86' : Shar, 'freebsd4-x86' : Shar, 'freebsd6-x86' : Shar, diff --git a/gub/settings.py b/gub/settings.py index 4fa7d45d7..afbeea92c 100644 --- a/gub/settings.py +++ b/gub/settings.py @@ -19,6 +19,7 @@ 'cygwin': 'i686-cygwin', 'darwin-ppc': 'powerpc-apple-darwin8', 'darwin-x86': 'i686-apple-darwin8', + 'darwin-64': 'x86_64-apple-darwin', 'freebsd4-x86': 'i686-freebsd4', 'freebsd6-x86': 'i686-freebsd6', diff --git a/test-lily/test-binary.py b/test-lily/test-binary.py index 7bd1b4568..c672e5c5a 100755 --- a/test-lily/test-binary.py +++ b/test-lily/test-binary.py @@ -40,6 +40,7 @@ def system (c, ignore_error=False): 'linux-64': 'shar', 'darwin-ppc' : 'darwin', 'darwin-x86' : 'darwin', + 'darwin-64' : 'darwin', 'freebsd-x86': 'shar', 'freebsd-64': 'shar', } diff --git a/test-lily/upload.py b/test-lily/upload.py index f8b8437ce..041f33b0a 100644 --- a/test-lily/upload.py +++ b/test-lily/upload.py @@ -32,6 +32,7 @@ def argv0_relocation (): 'linux-ppc', 'darwin-ppc', 'darwin-x86', + 'darwin-64', 'documentation', 'test-output', 'freebsd-x86', From 956e455f1cb4abe8c2c38d7d26adf28b6f8e70bc Mon Sep 17 00:00:00 2001 From: Jahrme Risner Date: Thu, 7 Feb 2019 13:02:55 -0800 Subject: [PATCH 2/6] Fix osx-lilypad Specification --- gub/specs/osx-lilypad.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/gub/specs/osx-lilypad.py b/gub/specs/osx-lilypad.py index 3c6532b0b..24d0b6081 100644 --- a/gub/specs/osx-lilypad.py +++ b/gub/specs/osx-lilypad.py @@ -1,12 +1,10 @@ from gub import build class Osx_lilypad (build.NullBuild): - pass + source = 'http://lilypond.org/downloads/gub-sources/osx-lilypad-universal/osx-lilypad-universal-0.6.3.tar.gz' class Osx_lilypad__darwin__ppc (build.NullBuild): # yes, we really need the old version here # later versions were built on OSX 10.7, which doesn't have pcc support source = 'http://lilypond.org/downloads/gub-sources/osx-lilypad-universal/osx-lilypad-universal-0.4.tar.gz' -class Osx_lilypad__darwin__x86 (build.NullBuild): - source = 'http://lilypond.org/downloads/gub-sources/osx-lilypad-universal/osx-lilypad-universal-0.6.3.tar.gz' From 5b37d3b99e703483b3ae68c6a509ae4d400b5186 Mon Sep 17 00:00:00 2001 From: Jahrme Risner Date: Thu, 7 Feb 2019 13:07:37 -0800 Subject: [PATCH 3/6] Add patch to bzip2 to compile on mac. --- gub/specs/bzip2.py | 9 +++++++++ patches/bzip2-1.0.6-darwin-soname.patch | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100644 patches/bzip2-1.0.6-darwin-soname.patch diff --git a/gub/specs/bzip2.py b/gub/specs/bzip2.py index 43f6c0e85..f0044bb3b 100644 --- a/gub/specs/bzip2.py +++ b/gub/specs/bzip2.py @@ -1,5 +1,6 @@ from gub import tools from gub import target +from gub import build_platform class Bzip2 (target.MakeBuild): source = 'http://http.debian.net/debian/pool/main/b/bzip2/bzip2_1.0.6.orig.tar.bz2' @@ -14,9 +15,17 @@ def install (self): class Bzip2__tools (tools.MakeBuild): source = 'http://http.debian.net/debian/pool/main/b/bzip2/bzip2_1.0.6.orig.tar.bz2' + patches = [] compile_flags = ' -f Makefile-libbz2_so' install_flags = (tools.MakeBuild.install_flags + ' PREFIX=%(install_prefix)s') + + # On darwin hosts, we need to substitute 'soname' for 'install_name' + if 'darwin' in build_platform.machine(): + patches = patches + [ + 'bzip2-1.0.6-darwin-soname.patch', + ] + def install (self): tools.MakeBuild.install (self) self.system ('cp -pv %(builddir)s/libbz2.so* %(install_prefix)s/lib') diff --git a/patches/bzip2-1.0.6-darwin-soname.patch b/patches/bzip2-1.0.6-darwin-soname.patch new file mode 100644 index 000000000..fa5a4dc1d --- /dev/null +++ b/patches/bzip2-1.0.6-darwin-soname.patch @@ -0,0 +1,11 @@ +--- bzip2-1.0.6/Makefile-libbz2_so.old 2019-02-02 11:45:09.000000000 -0800 ++++ bzip2-1.0.6/Makefile-libbz2_so 2019-02-02 11:45:17.000000000 -0800 +@@ -35,7 +35,7 @@ + bzlib.o + + all: $(OBJS) +- $(CC) -shared -Wl,-soname -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS) ++ $(CC) -shared -Wl,-install_name -Wl,libbz2.so.1.0 -o libbz2.so.1.0.6 $(OBJS) + $(CC) $(CFLAGS) -o bzip2-shared bzip2.c libbz2.so.1.0.6 + rm -f libbz2.so.1.0 + ln -s libbz2.so.1.0.6 libbz2.so.1.0 From 95232d4726036274e8721a9ca83bb128094b31de Mon Sep 17 00:00:00 2001 From: Jahrme Risner Date: Wed, 27 Feb 2019 10:49:03 -0800 Subject: [PATCH 4/6] Remove flag not available in BSD tar and undocumented in GNU tar. --- gub/commands.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gub/commands.py b/gub/commands.py index f867882a5..b1de6da04 100644 --- a/gub/commands.py +++ b/gub/commands.py @@ -341,7 +341,7 @@ def execute (self, logger): globs.append ('no-globs-for-%(dest)s' % locals ()) _v = logger.verbose_flag () - cmd = 'tar -C %(root)s/%(suffix_dir)s --ignore-failed --exclude="*~"%(_v)s -zcf %(dest)s ' % locals () + cmd = 'tar -C %(root)s/%(suffix_dir)s --exclude="*~"%(_v)s -zcf %(dest)s ' % locals () cmd += ' '.join (globs) loggedos.system (logger, cmd) From 174553ba6a17f60d907ad81551967a3b959604b7 Mon Sep 17 00:00:00 2001 From: Jahrme Risner Date: Thu, 7 Feb 2019 13:04:26 -0800 Subject: [PATCH 5/6] Update tar from 1.28 to 1.31 --- gub/specs/tar.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gub/specs/tar.py b/gub/specs/tar.py index 7cf16b92f..097ff09b9 100644 --- a/gub/specs/tar.py +++ b/gub/specs/tar.py @@ -3,7 +3,7 @@ from gub import tools class Tar__tools (tools.AutoBuild): - source = 'http://ftp.gnu.org/pub/gnu/tar/tar-1.28.tar.gz' + source = 'https://ftp.gnu.org/gnu/tar/tar-1.31.tar.gz' def __init__ (self, settings, source): tools.AutoBuild.__init__ (self, settings, source) if isinstance (self.source, repository.TarBall): From e806802ee69cc2d31b701d2500e65afde5ffb083 Mon Sep 17 00:00:00 2001 From: Jahrme Risner Date: Sun, 5 May 2019 14:45:25 -0700 Subject: [PATCH 6/6] Conditionally use tar flag --ignore-failed. --- gub/commands.py | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/gub/commands.py b/gub/commands.py index b1de6da04..e59ce8a17 100644 --- a/gub/commands.py +++ b/gub/commands.py @@ -6,6 +6,7 @@ import sys import traceback # +from gub import build_platform from gub import loggedos from gub import misc from gub import octal @@ -341,9 +342,23 @@ def execute (self, logger): globs.append ('no-globs-for-%(dest)s' % locals ()) _v = logger.verbose_flag () - cmd = 'tar -C %(root)s/%(suffix_dir)s --exclude="*~"%(_v)s -zcf %(dest)s ' % locals () - cmd += ' '.join (globs) - loggedos.system (logger, cmd) + + tar_flags = [ + '--exclude="*~"%(_v)s', + '-C %(root)s/%(suffix_dir)s', + '-c', + '-f %(dest)s', + '-z', + ] + + # '--ignore-failed' is required to build binutils on GNU/Linux systems. + # Default tar on Darwin is BSD, which does not have '--ignore-failed'. + if 'darwin' not in build_platform.machine(): + tar_flags.append('--ignore-failed') + + tar_cmd = ' '.join(['tar'] + tar_flags + globs) % locals () + + loggedos.system (logger, tar_cmd) # FIXME class ForcedAutogenMagic (SerializedCommand):