Skip to content
This repository was archived by the owner on Aug 8, 2024. It is now read-only.
Draft
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
3 changes: 2 additions & 1 deletion bockbuild.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,6 @@ def run(self):

loginit('bockbuild (%s)' % (self.bockbuild_rev))
info('cmd: %s' % ' '.join(sys.argv))

if len (sys.argv) < 2:
info ('Profiles in %s --' % self.git ('config --get remote.origin.url', self.profile_root)[0])
info(map (lambda x: '\t%s: %s' % (x.name, x.description), self.profiles))
Expand Down Expand Up @@ -139,8 +138,10 @@ def run(self):
self.build()

def init_parser(self):

parser = OptionParser(
usage='usage: %prog [options] [package_names...]')

parser.add_option('--build',
action='store_true', dest='do_build', default=True,
help='build the profile')
Expand Down
38 changes: 21 additions & 17 deletions bockbuild/darwinprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ class DarwinProfile (UnixProfile):
# ccache uses a different CC since it's not installed yet
# every thing after ccache needs a working ccache
default_toolchain = [
'cmake',
'autoconf',
'automake',
#'cmake',
#'autoconf',
#'automake',
'ccache',
'libtool',
'xz',
'tar',
# 'libtool',
# 'xz',
# 'tar',

# needed to autogen gtk+
'gtk-osx-docbook',
Expand Down Expand Up @@ -132,19 +132,23 @@ def setup (self):
self.bockbuild.cmd_options.arch = 'darwin-32'

def arch_build(self, arch, package):
if arch == 'darwin-universal':
package.local_ld_flags = ['-arch i386', '-arch x86_64']
package.local_gcc_flags = ['-arch i386', '-arch x86_64']
if arch == 'darwin-arm64':
package.local_ld_flags = ['-arch arm64']
package.local_gcc_flags = ['-arch arm64']
elif arch == 'darwin-universal':
package.local_ld_flags = ['-arch arm64', '-arch x86_64']
package.local_gcc_flags = ['-arch arm64', '-arch x86_64']
elif arch == 'darwin-32':
package.local_ld_flags = ['-arch i386', '-m32']
package.local_gcc_flags = ['-arch i386', '-m32']
package.local_ld_flags = ['-arch arm64']
package.local_gcc_flags = ['-arch arm64']
package.local_configure_flags = [
'--build=i386-apple-darwin13.0.0', '--host=i386-apple-darwin13.0.0', '--disable-dependency-tracking']
'--build=arm64-apple-darwin13.0.0', '--host=arm64-apple-darwin13.0.0', '--disable-dependency-tracking']
elif arch == 'darwin-64':
package.local_ld_flags = ['-arch x86_64 -m64']
package.local_gcc_flags = ['-arch x86_64 -m64']
package.local_configure_flags = [
'--build=x86_64-apple-darwin13.0.0', '--host=x86_64-apple-darwin13.0.0', '--disable-dependency-tracking']
package.local_ld_flags = ['-arch arm64']
package.local_gcc_flags = ['-arch arm64']

#package.local_ld_flags = ['-arch x86_64 -m64']
#package.local_gcc_flags = ['-arch x86_64 -m64']
else:
error('Unknown arch %s' % arch)

Expand Down Expand Up @@ -306,7 +310,7 @@ def __init__(self):
Profile.FileProcessor.__init__(self, match=match_stageable_binary)

def process(self, path):
run_shell('dsymutil -t 2 "%s" >/dev/null' % path)
run_shell('dsymutil "%s" >/dev/null' % path)
run_shell('strip -S "%s" > /dev/null' % path)

class validate_rpaths (Profile.FileProcessor):
Expand Down
30 changes: 21 additions & 9 deletions bockbuild/package.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import urllib
from util.util import *
import functools

import platform

class Package:

Expand Down Expand Up @@ -67,7 +67,10 @@ def __init__(self, name, version=None, organization=None, configure_flags=None,

self.source_dir_name = source_dir_name
if self.source_dir_name is None:
self.source_dir_name = "%s-%s" % (name, version)
if version is None:
self.source_dir_name = name
else:
self.source_dir_name = "%s-%s" % (name, version)

self.revision = revision

Expand Down Expand Up @@ -171,8 +174,12 @@ def create_cache():
if os.path.exists(workspace_dir):
self.rm(workspace_dir)
progress('Cloning git repo: %s' % source_url)
self.git('clone --mirror %s %s' %
(source_url, cache_dir), self.profile.bockbuild.root)
if self.git_branch is None:
self.git('clone %s %s' %
(source_url, cache_dir), self.profile.bockbuild.root)
else:
self.git('clone -b %s %s %s' %
(self.git_branch, source_url, cache_dir), self.profile.bockbuild.root)

def update_cache():
trace('Updating cache: ' + cache_dir)
Expand Down Expand Up @@ -212,9 +219,9 @@ def resolve():
target_revision = self.revision

if self.git_branch is not None:
self.git('checkout %s' % self.git_branch, workspace_dir)
self.git('merge origin/%s --ff-only' %
self.git_branch, workspace_dir)
# self.git('checkout %s' % self.git_branch, workspace_dir)
# self.git('merge origin/%s --ff-only' %
# self.git_branch, workspace_dir)

if self.revision is None: # target the tip of the branch
target_revision = git_get_revision(self, workspace_dir)
Expand Down Expand Up @@ -508,13 +515,18 @@ def start_build(self, arch, dest, stage):
delete(workspace)
shutil.move(workspace_x86, workspace)

print 'lipo', self.name
print('lipo', self.name)

self.lipo_dirs(stagedir_x32, package_stage, 'lib')
self.copy_side_by_side(
stagedir_x32, package_stage, 'bin', '32', '64')
elif arch == 'toolchain':
package_stage = self.do_build('darwin-64')
toolchain_arch = ''
if platform.processor() == 'arm':
toolchain_arch = 'darwin-arm64'
else:
toolchain_arch = 'darwin-64'
package_stage = self.do_build(toolchain_arch)
elif self.m64_only:
package_stage = self.do_build('darwin-64')
elif self.m32_only:
Expand Down
3 changes: 2 additions & 1 deletion bockbuild/unixprofile.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ def attach (self, bockbuild):
'%{staged_prefix}/bin',
'/usr/bin',
'/bin',
'/usr/local/bin')
'/usr/local/bin',
'/opt/homebrew/bin')

self.env.set('C_INCLUDE_PATH', '%{staged_prefix}/include')

Expand Down
10 changes: 5 additions & 5 deletions packages/autoconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ def install(self):

def arch_build(self, arch):
if arch == 'darwin-universal':
self.local_ld_flags = ['-arch i386', '-arch x86_64']
self.local_gcc_flags = ['-arch i386', '-arch x86_64']
self.local_ld_flags = ['-arch arm64', '-arch x86_64']
self.local_gcc_flags = ['-arch arm64', '-arch x86_64']
elif arch == 'darwin-32':
self.local_ld_flags = ['-arch i386', '-m32']
self.local_gcc_flags = ['-arch i386', '-m32']
self.local_configure_flags = ['--build=i386-apple-darwin13.0.0']
self.local_ld_flags = ['-arch arm64']
self.local_gcc_flags = ['-arch arm64']
self.local_configure_flags = ['--build=arm64-apple-darwin13.0.0']
elif arch == 'darwin-64':
self.local_ld_flags = ['-arch x86_64 -m64']
self.local_gcc_flags = ['-arch x86_64 -m64']
Expand Down
10 changes: 5 additions & 5 deletions packages/automake.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ def __init__(self):

def arch_build(self, arch):
if arch == 'darwin-universal':
self.local_ld_flags = ['-arch i386', '-arch x86_64']
self.local_gcc_flags = ['-arch i386', '-arch x86_64']
self.local_ld_flags = ['-arch arm64', '-arch x86_64']
self.local_gcc_flags = ['-arch arm64', '-arch x86_64']
elif arch == 'darwin-32':
self.local_ld_flags = ['-arch i386', '-m32']
self.local_gcc_flags = ['-arch i386', '-m32']
self.local_configure_flags = ['--build=i386-apple-darwin13.0.0']
self.local_ld_flags = ['-arch arm64']
self.local_gcc_flags = ['-arch arm64']
self.local_configure_flags = ['--build=arm64-apple-darwin13.0.0']
elif arch == 'darwin-64':
self.local_ld_flags = ['-arch x86_64 -m64']
self.local_gcc_flags = ['-arch x86_64 -m64']
Expand Down
4 changes: 2 additions & 2 deletions packages/glib.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ def prep(self):
def arch_build(self, arch):
Package.profile.arch_build(arch, self)
if arch == 'darwin-universal': # multi-arch build pass
self.local_ld_flags = ['-arch i386', '-arch x86_64']
self.local_gcc_flags = ['-arch i386', '-arch x86_64', '-Os']
self.local_ld_flags = ['-arch arm64', '-arch x86_64']
self.local_gcc_flags = ['-arch arm64', '-arch x86_64', '-Os']
self.local_configure_flags.extend(['--disable-dependency-tracking'])
else:
Package.arch_build(self, arch)
Expand Down
3 changes: 2 additions & 1 deletion packages/gtk+.py
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,8 @@ def __init__(self):

# https://dev.azure.com/devdiv/DevDiv/_workitems/edit/1092021/
'patches/gtk/0078-Optimize-querying-symbolic-hotkeys.patch',
'patches/gtk/gdk-quartz-Remove-titlebar-handling-from-find_child.patch'
'patches/gtk/gdk-quartz-Remove-titlebar-handling-from-find_child.patch',
'patches/gtk/bigsurfix.patch'
])

def prep(self):
Expand Down
13 changes: 12 additions & 1 deletion packages/ige-mac-integration.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,14 @@
SourceForgePackage('gtk-osx', 'ige-mac-integration', '0.9.4', ['--without-compile-warnings'],
class IgePackage(SourceForgePackage):
def __init__(self):
SourceForgePackage.__init__(self, 'gtk-osx', 'ige-mac-integration', '0.9.4', ['--without-compile-warnings'],
override_properties={'configure': './configure --prefix="%{staged_prefix}"',
'makeinstall': 'make install'})
self.sources.extend(["patches/ige-arm64.patch"])

def prep(self):
SourceForgePackage.prep(self)
if Package.profile.name == 'darwin':
for p in range(1, len(self.local_sources)):
self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"')

IgePackage()
1 change: 0 additions & 1 deletion packages/libcroco.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
GnomeXzPackage('libcroco', version_major='0.6', version_minor='8',
configure_flags=[
'--host=i386-apple-darwin',
'--disable-Bsymbolic',
'--enable-gtk-doc-html=no'
])
3 changes: 2 additions & 1 deletion packages/libffi.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
class LibFfiPackage (Package):

def __init__(self):
Package.__init__(self, 'libffi', '3.0.13', sources=[
Package.__init__(self, 'libffi', '3.3', configure_flags=["--build=aarch64-apple-darwin20.0.0"],
sources=[
'ftp://sourceware.org/pub/%{name}/%{name}-%{version}.tar.gz'])

LibFfiPackage()
19 changes: 18 additions & 1 deletion packages/libgif.py
Original file line number Diff line number Diff line change
@@ -1 +1,18 @@
SourceForgePackage('giflib', 'giflib', '4.1.6')
class LibgifPackage (SourceForgePackage):

def __init__(self):
SourceForgePackage.__init__(self, 'giflib', 'giflib', '4.1.6')
self.sources.extend([
'patches/libgif/libgif.patch'
])

def build(self):
if Package.profile.name == 'darwin':
Package.configure(self)
for p in range(1, len(self.local_sources)):
self.sh('patch -u lib/gif_hash.c -i %{local_sources[' + str(p) + ']}')
Package.make(self)
else:
Package.build(self)

LibgifPackage()
6 changes: 6 additions & 0 deletions packages/murrine.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ def __init__(self):

# FIXME: this may need porting
# self.sources.append ('patches/murrine-osx.patch')
self.sources.append ('patches/murrine-prototypes.patch')

def prep(self):
GnomeXzPackage.prep(self)
if Package.profile.name == 'darwin':
for p in range(1, len(self.local_sources)):
self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"')

Package.prep(self)

MurrinePackage()
43 changes: 43 additions & 0 deletions packages/patches/gtk/bigsurfix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff --exclude='*.la*' --exclude=configure --exclude=.deps --exclude='config.*' --exclude=autom4te.cache --exclude='*m4' --exclude=.git --exclude=Makefile.in --exclude=Makefile -ru gtk-2.24.problem/gtk/gtkclipboard-quartz.c gtk-works/gtk/gtkclipboard-quartz.c
--- gtk-2.24.problem/gtk/gtkclipboard-quartz.c 2020-08-05 13:47:21.000000000 -0400
+++ gtk-works/gtk/gtkclipboard-quartz.c 2020-08-05 13:42:56.000000000 -0400
@@ -32,6 +32,7 @@
#include "gtkintl.h"
#include "gtktextbuffer.h"
#include "gtkquartz.h"
+#include "gdk/quartz/gdkquartz.h"
#include "gtkalias.h"

enum {
diff --exclude='*.la*' --exclude=configure --exclude=.deps --exclude='config.*' --exclude=autom4te.cache --exclude='*m4' --exclude=.git --exclude=Makefile.in --exclude=Makefile -ru gtk-2.24.problem/gtk/gtkiconfactory.c gtk-works/gtk/gtkiconfactory.c
--- gtk-2.24.problem/gtk/gtkiconfactory.c 2020-08-05 13:47:21.000000000 -0400
+++ gtk-works/gtk/gtkiconfactory.c 2020-08-05 13:36:37.000000000 -0400
@@ -27,6 +27,7 @@
#include "config.h"
#include <stdlib.h>
#include <errno.h>
+#include <math.h>
#include <string.h>
#include "gtkiconfactory.h"
#include "gtkiconcache.h"
@@ -1490,6 +1491,8 @@
{
tmp_pixbuf = gtk_icon_info_load_icon (info, &error);
gtk_icon_info_free (info);
+ } else {
+ tmp_pixbuf = NULL;
}
}
else
diff --exclude='*.la*' --exclude=configure --exclude=.deps --exclude='config.*' --exclude=autom4te.cache --exclude='*m4' --exclude=.git --exclude=Makefile.in --exclude=Makefile -ru gtk-2.24.problem/gtk/gtkprivate.h gtk-works/gtk/gtkprivate.h
--- gtk-2.24.problem/gtk/gtkprivate.h 2020-08-05 13:47:21.000000000 -0400
+++ gtk-works/gtk/gtkprivate.h 2020-08-05 13:34:39.000000000 -0400
@@ -30,7 +30,7 @@
#include <gtk/gtkwidget.h>

G_BEGIN_DECLS
-
+gboolean gdk_quartz_get_fix_modifiers (void);
/* The private flags that are used in the private_flags member of GtkWidget.
*/
typedef enum
Loading