Skip to content
This repository has been archived by the owner on Jun 24, 2022. It is now read-only.

Partially support for darwin-64 #64

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 18 additions & 3 deletions gub/commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -341,9 +342,23 @@ def execute (self, logger):
globs.append ('no-globs-for-%(dest)s' % locals ())
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIUC it's because of this idiosyncracy that the --ignore-failed Tar flag is useful, maybe not only for linux-x86:binutils (this was the first package on which I got a consistent build failure without this flag).


_v = logger.verbose_flag ()
cmd = 'tar -C %(root)s/%(suffix_dir)s --ignore-failed --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):
Expand Down
2 changes: 2 additions & 0 deletions gub/config_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -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']
Expand Down
1 change: 1 addition & 0 deletions gub/installer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions gub/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
9 changes: 9 additions & 0 deletions gub/specs/bzip2.py
Original file line number Diff line number Diff line change
@@ -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'
Expand All @@ -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')
Expand Down
4 changes: 1 addition & 3 deletions gub/specs/osx-lilypad.py
Original file line number Diff line number Diff line change
@@ -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'
2 changes: 1 addition & 1 deletion gub/specs/tar.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
11 changes: 11 additions & 0 deletions patches/bzip2-1.0.6-darwin-soname.patch
Original file line number Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions test-lily/test-binary.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
}
Expand Down
1 change: 1 addition & 0 deletions test-lily/upload.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def argv0_relocation ():
'linux-ppc',
'darwin-ppc',
'darwin-x86',
'darwin-64',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Jahrme, as Darwin64 can't be built on GNU/Linux yet, what do you think about replacing this list with a dictionary with current list a keys and supported building host OS/architecture as values? I'd provide a patch, but I don't know which targets you can easily build on Darwin 64, is it everything listed here, or only Darwin 64, or something in between?

'documentation',
'test-output',
'freebsd-x86',
Expand Down