From a91b86291cddcd726ad8dd99ff92959cf650e5e9 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Thu, 29 Apr 2021 11:55:34 -0400 Subject: [PATCH 1/2] Make this work on BigSur/M1, my patches from last year, from the wrong BockBuild fork --- bockbuild.py | 11 ++- bockbuild/darwinprofile.py | 26 ++--- packages/autoconf.py | 10 +- packages/automake.py | 10 +- packages/glib.py | 4 +- packages/gtk+.py | 3 +- packages/ige-mac-integration.py | 13 ++- packages/libcroco.py | 1 - packages/libffi.py | 3 +- packages/murrine.py | 6 ++ packages/patches/gtk/bigsurfix.patch | 43 ++++++++ packages/patches/ige-arm64.patch | 97 +++++++++++++++++++ packages/patches/murrine-prototypes.patch | 38 ++++++++ .../patches/xamarin-gtk-theme-prototype.patch | 39 ++++++++ 14 files changed, 276 insertions(+), 28 deletions(-) create mode 100644 packages/patches/gtk/bigsurfix.patch create mode 100644 packages/patches/ige-arm64.patch create mode 100644 packages/patches/murrine-prototypes.patch create mode 100644 packages/patches/xamarin-gtk-theme-prototype.patch diff --git a/bockbuild.py b/bockbuild.py index 691060b..486d560 100755 --- a/bockbuild.py +++ b/bockbuild.py @@ -62,6 +62,7 @@ def find_profiles (base_path): if not progress_made: break assert Profile.loaded == None + progress ('Hello') return profiles class Bockbuild: @@ -105,16 +106,19 @@ def run(self): loginit('bockbuild (%s)' % (self.bockbuild_rev)) info('cmd: %s' % ' '.join(sys.argv)) - + progress ('here') 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)) finish (exit_codes.FAILURE) global active_profile + progress (sys.argv[1]) Package.profile = active_profile = self.load_profile (sys.argv[1]) + progress ('here34') self.parser = self.init_parser() + progress ('here2') self.cmd_options, self.cmd_args = self.parser.parse_args(sys.argv[2:]) self.packages_to_build = self.cmd_args or active_profile.packages @@ -139,8 +143,12 @@ def run(self): self.build() def init_parser(self): + + progress ('herep') parser = OptionParser( usage='usage: %prog [options] [package_names...]') + + progress ('here5') parser.add_option('--build', action='store_true', dest='do_build', default=True, help='build the profile') @@ -366,6 +374,7 @@ def load_profile(self, source): sys.path.append (path) self.resources.add (path) + progress (fullpath) execfile(fullpath, globals()) Profile.loaded.attach (self) diff --git a/bockbuild/darwinprofile.py b/bockbuild/darwinprofile.py index 026a0da..b2a23d0 100644 --- a/bockbuild/darwinprofile.py +++ b/bockbuild/darwinprofile.py @@ -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) @@ -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): diff --git a/packages/autoconf.py b/packages/autoconf.py index 7741a6e..3e521b0 100644 --- a/packages/autoconf.py +++ b/packages/autoconf.py @@ -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'] diff --git a/packages/automake.py b/packages/automake.py index c9cd305..7c35664 100644 --- a/packages/automake.py +++ b/packages/automake.py @@ -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'] diff --git a/packages/glib.py b/packages/glib.py index 5fac707..4d6e4a1 100644 --- a/packages/glib.py +++ b/packages/glib.py @@ -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) diff --git a/packages/gtk+.py b/packages/gtk+.py index cec45bd..62a207a 100644 --- a/packages/gtk+.py +++ b/packages/gtk+.py @@ -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): diff --git a/packages/ige-mac-integration.py b/packages/ige-mac-integration.py index e381a9e..b3d0fc4 100644 --- a/packages/ige-mac-integration.py +++ b/packages/ige-mac-integration.py @@ -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() diff --git a/packages/libcroco.py b/packages/libcroco.py index 45ff45c..29e0cb8 100644 --- a/packages/libcroco.py +++ b/packages/libcroco.py @@ -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' ]) diff --git a/packages/libffi.py b/packages/libffi.py index 1aecc54..e47a741 100644 --- a/packages/libffi.py +++ b/packages/libffi.py @@ -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() diff --git a/packages/murrine.py b/packages/murrine.py index 5c84ff4..fa41018 100644 --- a/packages/murrine.py +++ b/packages/murrine.py @@ -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() diff --git a/packages/patches/gtk/bigsurfix.patch b/packages/patches/gtk/bigsurfix.patch new file mode 100644 index 0000000..498d0c3 --- /dev/null +++ b/packages/patches/gtk/bigsurfix.patch @@ -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 + #include ++#include + #include + #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 + + 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 diff --git a/packages/patches/ige-arm64.patch b/packages/patches/ige-arm64.patch new file mode 100644 index 0000000..120e566 --- /dev/null +++ b/packages/patches/ige-arm64.patch @@ -0,0 +1,97 @@ +diff -ruN ige-mac-integration-0.9.4.original/configure ige-mac-integration-0.9.4.problem/configure +--- ige-mac-integration-0.9.4.original/configure 2010-07-03 11:26:44.000000000 -0400 ++++ ige-mac-integration-0.9.4.problem/configure 2020-08-06 11:03:36.000000000 -0400 +@@ -11092,7 +11092,7 @@ + int + main () + { +-#ifndef __x86_64__ ++#if !(defined( __x86_64__)||defined(__arm64__)) + #error + #endif + +diff -ruN ige-mac-integration-0.9.4.original/configure.ac ige-mac-integration-0.9.4.problem/configure.ac +--- ige-mac-integration-0.9.4.original/configure.ac 2010-07-03 10:29:15.000000000 -0400 ++++ ige-mac-integration-0.9.4.problem/configure.ac 2020-08-06 11:02:53.000000000 -0400 +@@ -11,7 +11,7 @@ + AM_PROG_LIBTOOL + AC_MSG_CHECKING([Bitness]) + AC_PREPROC_IFELSE( +- [AC_LANG_PROGRAM([[]],[[#ifndef __x86_64__ ++ [AC_LANG_PROGRAM([[]],[[#if !(defined( __x86_64__)||defined(__arm64__)) + #error + #endif + ]])], +diff -ruN ige-mac-integration-0.9.4.original/src/ige-mac-bundle.c ige-mac-integration-0.9.4.problem/src/ige-mac-bundle.c +--- ige-mac-integration-0.9.4.original/src/ige-mac-bundle.c 2010-07-03 10:29:15.000000000 -0400 ++++ ige-mac-integration-0.9.4.problem/src/ige-mac-bundle.c 2020-08-06 11:06:41.000000000 -0400 +@@ -22,7 +22,7 @@ + * -psn_... arguments? + */ + +-#ifndef __x86_64__ ++#if !(defined(__x86_64__) || defined(__arm64__)) + #include + #include + +diff -ruN ige-mac-integration-0.9.4.original/src/ige-mac-bundle.h ige-mac-integration-0.9.4.problem/src/ige-mac-bundle.h +--- ige-mac-integration-0.9.4.original/src/ige-mac-bundle.h 2010-07-03 10:29:15.000000000 -0400 ++++ ige-mac-integration-0.9.4.problem/src/ige-mac-bundle.h 2020-08-06 11:06:46.000000000 -0400 +@@ -21,7 +21,7 @@ + #ifndef __IGE_MAC_BUNDLE_H__ + #define __IGE_MAC_BUNDLE_H__ + +-#ifndef __x86_64__ ++#if !(defined(__x86_64__) || defined(__arm64__)) + #include + + G_BEGIN_DECLS +diff -ruN ige-mac-integration-0.9.4.original/src/ige-mac-dock.c ige-mac-integration-0.9.4.problem/src/ige-mac-dock.c +--- ige-mac-integration-0.9.4.original/src/ige-mac-dock.c 2020-08-05 14:13:05.000000000 -0400 ++++ ige-mac-integration-0.9.4.problem/src/ige-mac-dock.c 2020-08-06 11:05:56.000000000 -0400 +@@ -17,8 +17,8 @@ + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + */ ++#if !(defined(__x86_64__) || defined(__arm64__)) + +-#ifndef __x86_64__ + /* FIXME: Add example like this to docs for the open documents stuff: + + CFBundleDocumentTypes +diff -ruN ige-mac-integration-0.9.4.original/src/ige-mac-dock.h ige-mac-integration-0.9.4.problem/src/ige-mac-dock.h +--- ige-mac-integration-0.9.4.original/src/ige-mac-dock.h 2010-07-03 10:29:15.000000000 -0400 ++++ ige-mac-integration-0.9.4.problem/src/ige-mac-dock.h 2020-08-06 11:06:28.000000000 -0400 +@@ -23,7 +23,7 @@ + + #ifndef __IGE_MAC_DOCK_H__ + #define __IGE_MAC_DOCK_H__ +-#ifndef __x86_64__ ++#if !(defined(__x86_64__) || defined(__arm64__)) + + #include + #include +diff -ruN ige-mac-integration-0.9.4.original/src/ige-mac-menu.c ige-mac-integration-0.9.4.problem/src/ige-mac-menu.c +--- ige-mac-integration-0.9.4.original/src/ige-mac-menu.c 2020-08-05 14:21:07.000000000 -0400 ++++ ige-mac-integration-0.9.4.problem/src/ige-mac-menu.c 2020-08-06 11:05:42.000000000 -0400 +@@ -23,7 +23,7 @@ + * Boston, MA 02111-1307, USA. + */ + +-#ifndef __x86_64__ ++#if !(defined(__x86_64__) || defined(__arm64__)) + #include "config.h" + + #include +diff -ruN ige-mac-integration-0.9.4.original/src/ige-mac-menu.h ige-mac-integration-0.9.4.problem/src/ige-mac-menu.h +--- ige-mac-integration-0.9.4.original/src/ige-mac-menu.h 2010-07-03 10:29:15.000000000 -0400 ++++ ige-mac-integration-0.9.4.problem/src/ige-mac-menu.h 2020-08-06 11:06:17.000000000 -0400 +@@ -25,7 +25,7 @@ + + #ifndef __IGE_MAC_MENU_H__ + #define __IGE_MAC_MENU_H__ +-#ifndef __x86_64__ ++#if !(defined(__x86_64__) || defined(__arm64__)) + + #include + diff --git a/packages/patches/murrine-prototypes.patch b/packages/patches/murrine-prototypes.patch new file mode 100644 index 0000000..3d35f16 --- /dev/null +++ b/packages/patches/murrine-prototypes.patch @@ -0,0 +1,38 @@ +Binary files murrine-0.98.2.orig/src/.support.h.swp and murrine-0.98.2.problem/src/.support.h.swp differ +diff --exclude='*.*o' --exclude=.libs --exclude='*la' -ruN murrine-0.98.2.orig/src/murrine_rc_style.h murrine-0.98.2.problem/src/murrine_rc_style.h +--- murrine-0.98.2.orig/src/murrine_rc_style.h 2012-01-17 12:46:01.000000000 -0500 ++++ murrine-0.98.2.problem/src/murrine_rc_style.h 2020-08-06 11:54:33.000000000 -0400 +@@ -154,5 +154,7 @@ + }; + + GType murrine_rc_style_get_type (void); ++void ++murrine_rc_style_register_types (GTypeModule *module); + + #endif /* MURRINE_RC_STYLE_H */ +diff --exclude='*.*o' --exclude=.libs --exclude='*la' -ruN murrine-0.98.2.orig/src/murrine_style.h murrine-0.98.2.problem/src/murrine_style.h +--- murrine-0.98.2.orig/src/murrine_style.h 2012-01-17 12:46:01.000000000 -0500 ++++ murrine-0.98.2.problem/src/murrine_style.h 2020-08-06 11:53:52.000000000 -0400 +@@ -102,5 +102,7 @@ + }; + + GType murrine_style_get_type (void); ++void ++murrine_style_register_types (GTypeModule *module); + + #endif /* MURRINE_STYLE_H */ +diff --exclude='*.*o' --exclude=.libs --exclude='*la' -ruN murrine-0.98.2.orig/src/support.h murrine-0.98.2.problem/src/support.h +--- murrine-0.98.2.orig/src/support.h 2012-01-17 12:46:01.000000000 -0500 ++++ murrine-0.98.2.problem/src/support.h 2020-08-06 11:53:17.000000000 -0400 +@@ -44,6 +44,11 @@ + #define MENU_OPACITY 0.90 + #define TOOLTIP_OPACITY 0.90 + ++gboolean murrine_widget_is_ltr (GtkWidget *widget); ++gboolean ++murrine_object_is_a (const GObject * object, const gchar * type_name); ++ ++ + /* From gtk-engines 20071109 */ + #define MRN_IS_WIDGET(object) ((object) && murrine_object_is_a ((GObject*)(object), "GtkWidget")) + #define MRN_IS_CONTAINER(object) ((object) && murrine_object_is_a ((GObject*)(object), "GtkContainer")) diff --git a/packages/patches/xamarin-gtk-theme-prototype.patch b/packages/patches/xamarin-gtk-theme-prototype.patch new file mode 100644 index 0000000..2ea2ba4 --- /dev/null +++ b/packages/patches/xamarin-gtk-theme-prototype.patch @@ -0,0 +1,39 @@ +diff --exclude='*.*o' --exclude=.libs --exclude='*la' -ruN xamarin-gtk-theme-None.orig/src/murrine_rc_style.h xamarin-gtk-theme-None.problem/src/murrine_rc_style.h +--- xamarin-gtk-theme-None.orig/src/murrine_rc_style.h 2020-08-03 14:42:53.000000000 -0400 ++++ xamarin-gtk-theme-None.problem/src/murrine_rc_style.h 2020-08-06 12:04:11.000000000 -0400 +@@ -35,6 +35,8 @@ + #define MURRINE_IS_RC_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MURRINE_TYPE_RC_STYLE)) + #define MURRINE_RC_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MURRINE_TYPE_RC_STYLE, MurrineRcStyleClass)) + ++void ++murrine_rc_style_register_types (GTypeModule *module); + typedef enum + { + // MRN_FLAG_UNUSED = 1 << 0, +diff --exclude='*.*o' --exclude=.libs --exclude='*la' -ruN xamarin-gtk-theme-None.orig/src/murrine_style.h xamarin-gtk-theme-None.problem/src/murrine_style.h +--- xamarin-gtk-theme-None.orig/src/murrine_style.h 2020-08-03 14:42:53.000000000 -0400 ++++ xamarin-gtk-theme-None.problem/src/murrine_style.h 2020-08-06 12:04:32.000000000 -0400 +@@ -38,6 +38,9 @@ + #define MURRINE_IS_STYLE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), MURRINE_TYPE_STYLE)) + #define MURRINE_STYLE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), MURRINE_TYPE_STYLE, MurrineStyleClass)) + ++void ++murrine_style_register_types (GTypeModule *module); ++ + struct _MurrineStyle + { + GtkStyle parent_instance; +diff --exclude='*.*o' --exclude=.libs --exclude='*la' -ruN xamarin-gtk-theme-None.orig/src/support.h xamarin-gtk-theme-None.problem/src/support.h +--- xamarin-gtk-theme-None.orig/src/support.h 2020-08-03 14:42:53.000000000 -0400 ++++ xamarin-gtk-theme-None.problem/src/support.h 2020-08-06 12:03:40.000000000 -0400 +@@ -44,6 +44,10 @@ + #define MENU_OPACITY 0.90 + #define TOOLTIP_OPACITY 0.90 + ++gboolean murrine_widget_is_ltr (GtkWidget *widget); ++gboolean ++murrine_object_is_a (const GObject * object, const gchar * type_name); ++ + /* From gtk-engines 20071109 */ + #define MRN_IS_WIDGET(object) ((object) && murrine_object_is_a ((GObject*)(object), "GtkWidget")) + #define MRN_IS_CONTAINER(object) ((object) && murrine_object_is_a ((GObject*)(object), "GtkContainer")) From e1ec58c1b6a3bdca4d5675174703d055d6580ddb Mon Sep 17 00:00:00 2001 From: Vinicius Jarina Date: Mon, 20 Dec 2021 16:06:55 -0300 Subject: [PATCH 2/2] WIP building Mono on Apple M1 * Added `brew` path to unixprofile in order to use toolchain from brew instead of buildingn from source * Add patch to libgif to fix build error (stdlib.h) * Fixed `source_dir_name` "foo-None" when version was None * Removed `--mirror` on cache since it was causing erros * Check `platofm.processor()` to pass `darwin-arm64` to toolchain build --- bockbuild.py | 8 -------- bockbuild/darwinprofile.py | 18 ++++++++--------- bockbuild/package.py | 30 +++++++++++++++++++--------- bockbuild/unixprofile.py | 3 ++- packages/libgif.py | 19 +++++++++++++++++- packages/patches/libgif/libgif.patch | 11 ++++++++++ 6 files changed, 61 insertions(+), 28 deletions(-) create mode 100644 packages/patches/libgif/libgif.patch diff --git a/bockbuild.py b/bockbuild.py index 486d560..5eed7a4 100755 --- a/bockbuild.py +++ b/bockbuild.py @@ -62,7 +62,6 @@ def find_profiles (base_path): if not progress_made: break assert Profile.loaded == None - progress ('Hello') return profiles class Bockbuild: @@ -106,19 +105,15 @@ def run(self): loginit('bockbuild (%s)' % (self.bockbuild_rev)) info('cmd: %s' % ' '.join(sys.argv)) - progress ('here') 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)) finish (exit_codes.FAILURE) global active_profile - progress (sys.argv[1]) Package.profile = active_profile = self.load_profile (sys.argv[1]) - progress ('here34') self.parser = self.init_parser() - progress ('here2') self.cmd_options, self.cmd_args = self.parser.parse_args(sys.argv[2:]) self.packages_to_build = self.cmd_args or active_profile.packages @@ -144,11 +139,9 @@ def run(self): def init_parser(self): - progress ('herep') parser = OptionParser( usage='usage: %prog [options] [package_names...]') - progress ('here5') parser.add_option('--build', action='store_true', dest='do_build', default=True, help='build the profile') @@ -374,7 +367,6 @@ def load_profile(self, source): sys.path.append (path) self.resources.add (path) - progress (fullpath) execfile(fullpath, globals()) Profile.loaded.attach (self) diff --git a/bockbuild/darwinprofile.py b/bockbuild/darwinprofile.py index b2a23d0..8cffaa8 100644 --- a/bockbuild/darwinprofile.py +++ b/bockbuild/darwinprofile.py @@ -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', @@ -132,9 +132,9 @@ def setup (self): self.bockbuild.cmd_options.arch = 'darwin-32' def arch_build(self, arch, package): - if arch == 'darwin-arm64': - package.local_ld_flags = ['-arch arm64'] - package.local_gcc_flags = ['-arch arm64'] + 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'] diff --git a/bockbuild/package.py b/bockbuild/package.py index 9b9c1ca..90d07f7 100644 --- a/bockbuild/package.py +++ b/bockbuild/package.py @@ -10,7 +10,7 @@ import urllib from util.util import * import functools - +import platform class Package: @@ -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 @@ -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) @@ -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) @@ -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: diff --git a/bockbuild/unixprofile.py b/bockbuild/unixprofile.py index 6f04851..7c4d230 100644 --- a/bockbuild/unixprofile.py +++ b/bockbuild/unixprofile.py @@ -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') diff --git a/packages/libgif.py b/packages/libgif.py index 0ae053c..cbb725f 100644 --- a/packages/libgif.py +++ b/packages/libgif.py @@ -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() \ No newline at end of file diff --git a/packages/patches/libgif/libgif.patch b/packages/patches/libgif/libgif.patch new file mode 100644 index 0000000..c8ecba2 --- /dev/null +++ b/packages/patches/libgif/libgif.patch @@ -0,0 +1,11 @@ +diff --git a/lib/gif_hash.c b/lib/gif_hash.c +--- a/lib/gif_hash.c ++++ b/lib/gif_hash.c +@@ -47,6 +47,7 @@ + #include + #endif /* HAVE_FCNTL_H */ + #include ++#include + #include + #include "gif_lib.h" + #include "gif_hash.h"