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

More work to get 64-bit Mac builds of LilyPond working #69

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 19 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 ())

_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
3 changes: 3 additions & 0 deletions gub/config_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,11 +207,14 @@

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-64'] = config_cache['darwin-x86'] + config_cache['64']
config_cache['darwin-x86'] += config_cache['32']
config_cache['darwin-64'] += config_cache['64']
marnen marked this conversation as resolved.
Show resolved Hide resolved
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: 4 additions & 0 deletions gub/specs/file.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
from gub import build_platform
from gub import tools
import os

Expand All @@ -7,3 +8,6 @@ class File__tools (tools.AutoBuild):
'libtool',
'zlib',
]

if 'darwin' in build_platform.machine():
compile_command = 'DYLD_LIBRARY_PATH="%(system_prefix)s/lib" ' + tools.AutoBuild.compile_command
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/perl-extutils-makemaker.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
from gub import tools

class Perl_extutils_makemaker (tools.CpanBuild):
source = 'http://search.cpan.org/CPAN/authors/id/M/MS/MSCHWERN/ExtUtils-MakeMaker-6.55_02.tar.gz'
source = 'https://cpan.metacpan.org/authors/id/B/BI/BINGOS/ExtUtils-MakeMaker-7.34.tar.gz'

6 changes: 4 additions & 2 deletions gub/specs/perl-xml-parser.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from gub import tools

class Perl_xml_parser (tools.CpanBuild):
source = 'http://search.cpan.org/CPAN/authors/id/M/MS/MSERGEANT/XML-Parser-2.36.tar.gz'
dependencies = ['expat']
source = 'https://cpan.metacpan.org/authors/id/T/TO/TODDR/XML-Parser-2.44.tar.gz'
dependencies = [
'expat',
]
76 changes: 41 additions & 35 deletions gub/specs/perl.py
Original file line number Diff line number Diff line change
@@ -1,39 +1,45 @@
import re
#
from gub import misc
from gub import build_platform
from gub import tools

# And this is supposed to be one of the most compiled packages?
# So why doesn't anyone fix configuring/compiling it? Shees.
class Perl__tools (tools.AutoBuild):
source = 'http://www.cpan.org/src/5.0/perl-5.10.0.tar.gz'
class Perl__tools(tools.AutoBuild):
source = 'https://www.cpan.org/src/5.0/perl-5.28.1.tar.gz'
srcdir_build_broken = True
def patch (self):
tools.AutoBuild.patch (self)
self.file_sub ([('-c (/dev/null)', r'-e \1')], '%(srcdir)s/Configure')
configure_binary = '%(autodir)s/configure.gnu'
# -Dcc=%(CC)s
# -Dprefix=%(prefix_dir)s -- BOOTSTRAP
configure_command = misc.join_lines ('''%(configure_binary)s
-Dprefix=%(system_prefix)s
-Dcc='%(toolchain_prefix)sgcc %(target_gcc_flags)s'
-Dtargetarch=%(target_architecture)s
-Dusrinc=%(system_prefix)s/include
-Dincpth=/
-Dlibpth=%(system_prefix)s/lib
-Dsitelib=%(system_prefix)s/lib/perl5/5.10.0
-Dsitearch=%(system_prefix)s/lib/perl5/5.10.0
-Dusedl
-Duseshrplib
-Dlibperl=libperl.so
-Dcccdlflags=-fPIC
-Dlocallibpth=/
-Aldflags='%(rpath)s'
-Alibs='-lm -lrt -ldl'
''')
def configure (self):
tools.AutoBuild.configure (self)
for i in ['%(builddir)s/makefile', '%(builddir)s/x2p/makefile']:
# Ugh, missing some command?
self.file_sub ([('^0$','')], i)
# def install_command (self):


if 'darwin' in build_platform.machine():
librt_flag = '-lSystem'
target_arch_flag = '' # TODO: fix for cross-compilation
else:
librt_flag = '-lrt'
target_arch_flag = '-Dtargetarch=%(target_architecture)s'

configure_command = ' '.join([
'%(configure_binary)s',
'-Aldflags="%(rpath)s"',
'-Alibs="-lm -ldl %(librt_flag)s"',
'-Dcc="%(toolchain_prefix)sgcc %(target_gcc_flags)s"',
'-Dcccdlflags=-fPIC',
'-Dincpth=/',
'-Dlibperl=libperl.so',
'-Dlibpth=%(system_prefix)s/lib',
'-Dlocallibpth=/',
'-Dprefix=%(system_prefix)s',
'-Dsitearch=%(system_prefix)s/lib/perl5/5.28.1',
'-Dsitelib=%(system_prefix)s/lib/perl5/5.28.1',
target_arch_flag,
'-Dusedl',
'-Duseshrplib',
'-Dusrinc=%(system_prefix)s/include',
])

def patch(self):
tools.AutoBuild.patch(self)
self.file_sub([('-c (/dev/null)', r'-e \1')], '%(srcdir)s/Configure')

def configure(self):
tools.AutoBuild.configure(self)
if 'darwin' not in build_platform.machine():
for i in ['%(builddir)s/makefile', '%(builddir)s/x2p/makefile']:
# Ugh, missing some command?
self.file_sub([('^0$','')], i)
6 changes: 6 additions & 0 deletions gub/specs/pkg-config.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
from gub import build_platform
from gub import tools

class Pkg_config__tools (tools.AutoBuild):
dependencies = [
'libtool',
'system::g++',
]

def __init__ (self, settings, source):
tools.AutoBuild.__init__ (self, settings, source)
if 'darwin' in build_platform.machine():
self.configure_variables += 'CFLAGS="-I%(system_prefix)s/include -std=gnu89"'
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
2 changes: 1 addition & 1 deletion gub/specs/xzutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
from gub import tools

class Xzutils__tools (tools.AutoBuild):
source = 'http://tukaani.org/xz/xz-5.0.7.tar.bz2'
source = 'https://tukaani.org/xz/xz-5.0.7.tar.bz2'
dependencies = ['tools::bzip2']
4 changes: 2 additions & 2 deletions gub/target.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,8 +150,8 @@ def get_substitution_dict (self, env={}):
'NM': '%(toolchain_prefix)snm',
'PKG_CONFIG_PATH': '%(system_prefix)s/lib/pkgconfig',
'PATH': '%(cross_prefix)s/bin:%(tools_archmatch_prefix)s/bin:%(tools_prefix)s/bin:%(tools_cross_prefix)s/bin:' + os.environ['PATH'],
'PERL5LIB': 'foo:%(tools_prefix)s/lib/perl5/5.10.0'
+ ':%(tools_prefix)s/lib/perl5/5.10.0/%(build_architecture)s'
'PERL5LIB': 'foo:%(tools_prefix)s/lib/perl5/5.28.1'
+ ':%(tools_prefix)s/lib/perl5/5.28.1/%(build_architecture)s'
+ ':%(tools_prefix)s/share/autoconf'
+ misc.append_path (os.environ.get ('PERL5LIB', '')),
'PKG_CONFIG': '''pkg-config \
Expand Down
4 changes: 2 additions & 2 deletions gub/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,8 @@ def get_substitution_dict (self, env={}):
# 'LIBRESTRICT_IGNORE': '%(system_prefix)s/bin/make:%(system_prefix)s/gcc:%(system_prefix)s/g++:%(system_prefix)s/ld', #etc.
+ misc.append_path (os.environ.get ('LIBRARY_PATH', '')),
'PATH': '%(system_prefix)s/bin:%(system_cross_prefix)s/bin:' + os.environ['PATH'],
'PERL5LIB': 'foo:%(tools_prefix)s/lib/perl5/5.10.0'
+ ':%(tools_prefix)s/lib/perl5/5.10.0/%(build_architecture)s'
'PERL5LIB': 'foo:%(tools_prefix)s/lib/perl5/5.28.1'
+ ':%(tools_prefix)s/lib/perl5/5.28.1/%(build_architecture)s'
+ ':%(tools_prefix)s/share/autoconf'
+ misc.append_path (os.environ.get ('PERL5LIB', '')),
}
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',
'documentation',
'test-output',
'freebsd-x86',
Expand Down