glib: build on darwin instead of using macports binaries (#2059)

see #2053
This commit is contained in:
Tony Theodore 2018-02-26 22:24:19 +11:00 committed by GitHub
parent 9f92f59a29
commit 0c7a0c4bda
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 96 additions and 34 deletions

View File

@ -1 +0,0 @@
../glib2-macports.mk

View File

@ -1,7 +1,6 @@
# This file is part of MXE. See LICENSE.md for licensing information.
# additional modifications to control native builds
glib_DEPS_$(BUILD) := glib2-macports
gettext_DEPS_$(BUILD) :=
glib_DEPS_$(BUILD) :=
gettext_BUILD_$(BUILD) :=
libiconv_BUILD_$(BUILD) :=

View File

@ -1,19 +0,0 @@
# This file is part of MXE. See LICENSE.md for licensing information.
PKG := glib2-macports
$(PKG)_WEBSITE := packages.macports.org
$(PKG)_DESCR := glib2 pre-built macports package
$(PKG)_IGNORE :=
$(PKG)_VERSION := 2.50.3
$(PKG)_CHECKSUM := b7327d69c8a32d2f4ec4e885c0de189618ca6cd54999c62d1de5d37d78c515cd
$(PKG)_SUBDIR := .
$(PKG)_FILE := glib2-$($(PKG)_VERSION)_0.darwin_16.x86_64.tbz2
$(PKG)_URL := https://packages.macports.org/glib2/glib2-$($(PKG)_VERSION)_0.darwin_16.x86_64.tbz2
$(PKG)_DEPS :=
$(PKG)_TARGETS := $(BUILD)
$(PKG)_TYPE := source-only
define $(PKG)_UPDATE
echo 'manually update glib2-macports as necessary' >&2;
echo $(glib2-macports_VERSION)
endef

View File

@ -5,7 +5,7 @@ Contains ad hoc patches for cross building.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Mark Brand <mabrand@mabrand.nl>
Date: Thu, 23 Sep 2010 21:42:46 +0200
Subject: [PATCH 1/8] fix tool paths
Subject: [PATCH 1/9] fix tool paths
diff --git a/glib-2.0.pc.in b/glib-2.0.pc.in
@ -29,7 +29,7 @@ index 1111111..2222222 100644
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hans Petter Jansson <hpj@cl.no>
Date: Fri, 15 Jun 2012 15:25:01 +0200
Subject: [PATCH 2/8] Avoid DllMain symbol conflict when linking statically
Subject: [PATCH 2/9] Avoid DllMain symbol conflict when linking statically
Adjusted by Boris Nagaev on 29-Jan-2017 to fix
https://gist.github.com/starius/f4fc85939352cb50122ba29e0f5b140d
@ -103,7 +103,7 @@ index 1111111..2222222 100644
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hans Petter Jansson <hpj@cl.no>
Date: Fri, 15 Jun 2012 15:27:22 +0200
Subject: [PATCH 3/8] Allow building without inotify support
Subject: [PATCH 3/9] Allow building without inotify support
diff --git a/configure.ac b/configure.ac
@ -131,7 +131,7 @@ index 1111111..2222222 100644
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hans Petter Jansson <hpj@cl.no>
Date: Fri, 15 Jun 2012 15:28:14 +0200
Subject: [PATCH 4/8] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF.
Subject: [PATCH 4/9] Make sure STDC_HEADERS is set for AC_CHECK_ALIGNOF.
Backported from upstream
@ -152,7 +152,7 @@ index 1111111..2222222 100644
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hans Petter Jansson <hpj@cl.no>
Date: Fri, 15 Jun 2012 15:29:06 +0200
Subject: [PATCH 5/8] Link with dnsapi
Subject: [PATCH 5/9] Link with dnsapi
diff --git a/gio-2.0.pc.in b/gio-2.0.pc.in
@ -171,7 +171,7 @@ index 1111111..2222222 100644
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Hans Petter Jansson <hpj@cl.no>
Date: Fri, 15 Jun 2012 15:29:38 +0200
Subject: [PATCH 6/8] Ensure globals are initialized even when DllMain is not
Subject: [PATCH 6/9] Ensure globals are initialized even when DllMain is not
being run
@ -548,7 +548,7 @@ index 1111111..2222222 100644
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Gerardo Ballabio <gerardo.ballabio@gmail.com>
Date: Sun, 16 Aug 2015 13:18:24 +0200
Subject: [PATCH 7/8] Remove an annoying runtime warning
Subject: [PATCH 7/9] Remove an annoying runtime warning
that pops up when using GtkApplication in Gtk+ 3 programs.
@ -576,7 +576,7 @@ index 1111111..2222222 100644
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: aquiles2k <aj@elane2k.com>
Date: Wed, 6 Apr 2016 22:39:53 +0300
Subject: [PATCH 8/8] fix error "won't overwrite defined macro" on OSX
Subject: [PATCH 8/9] fix error "won't overwrite defined macro" on OSX
See https://github.com/mxe/mxe/issues/1281
@ -595,3 +595,49 @@ index 1111111..2222222 100644
dnl
dnl At the end, if we're not within glib, we'll define the public
dnl definitions in terms of our private definitions.
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Tony Theodore <tonyt@logyst.com>
Date: Mon, 26 Feb 2018 16:09:53 +1100
Subject: [PATCH 9/9] darwin: disable g_cocoa_notification_backend
diff --git a/gio/Makefile.am b/gio/Makefile.am
index 1111111..2222222 100644
--- a/gio/Makefile.am
+++ b/gio/Makefile.am
@@ -279,10 +279,6 @@ unix_sources = \
appinfo_sources += $(unix_appinfo_sources)
-if OS_COCOA
-unix_sources += gcocoanotificationbackend.c
-endif
-
giounixincludedir=$(includedir)/gio-unix-2.0/gio
giounixinclude_HEADERS = \
gdesktopappinfo.h \
diff --git a/gio/giomodule.c b/gio/giomodule.c
index 1111111..2222222 100644
--- a/gio/giomodule.c
+++ b/gio/giomodule.c
@@ -918,9 +918,6 @@ extern GType g_proxy_resolver_portal_get_type (void);
extern GType g_network_monitor_portal_get_type (void);
#endif
-#ifdef HAVE_COCOA
-extern GType g_cocoa_notification_backend_get_type (void);
-#endif
#ifdef G_PLATFORM_WIN32
@@ -1117,9 +1114,6 @@ _g_io_modules_ensure_loaded (void)
g_type_ensure (g_network_monitor_portal_get_type ());
g_type_ensure (g_proxy_resolver_portal_get_type ());
#endif
-#ifdef HAVE_COCOA
- g_type_ensure (g_cocoa_notification_backend_get_type ());
-#endif
#ifdef G_OS_WIN32
g_type_ensure (_g_winhttp_vfs_get_type ());
#endif

View File

@ -22,10 +22,47 @@ define $(PKG)_UPDATE
endef
define $(PKG)_BUILD_DARWIN
# on darwin, use pre-built tools from macports with pinned
# version set in plugins/native/darwin/glib2-macports
$(call PREPARE_PKG_SOURCE,glib2-macports,$(BUILD_DIR))
cp -Rp '$(BUILD_DIR)/opt/local/bin' '$(PREFIX)/$(TARGET)/'
# native build for glib-tools
# libiconv/gettext cause issues with other packages so build inline
mkdir '$(BUILD_DIR).src'
$(call PREPARE_PKG_SOURCE,libiconv,$(BUILD_DIR).src)
cd '$(BUILD_DIR).src/$(libiconv_SUBDIR)' && ./configure \
$(MXE_CONFIGURE_OPTS) \
--prefix='$(BUILD_DIR).usr'
$(MAKE) -C '$(BUILD_DIR).src/$(libiconv_SUBDIR)' -j '$(JOBS)' $(MXE_DISABLE_DOCS)
$(MAKE) -C '$(BUILD_DIR).src/$(libiconv_SUBDIR)' -j 1 install $(MXE_DISABLE_DOCS)
$(call PREPARE_PKG_SOURCE,gettext,$(BUILD_DIR).src)
cd '$(BUILD_DIR).src/$(gettext_SUBDIR)' && ./configure \
$(MXE_CONFIGURE_OPTS) \
--prefix='$(BUILD_DIR).usr'
$(MAKE) -C '$(BUILD_DIR).src/$(gettext_SUBDIR)' -j '$(JOBS)' $(MXE_DISABLE_DOCS)
$(MAKE) -C '$(BUILD_DIR).src/$(gettext_SUBDIR)' -j 1 install $(MXE_DISABLE_DOCS)
cd '$(SOURCE_DIR)' && NOCONFIGURE=true ./autogen.sh
cd '$(BUILD_DIR)' && '$(SOURCE_DIR)/configure' \
$(MXE_CONFIGURE_OPTS) \
--enable-regex \
--disable-threads \
--disable-selinux \
--disable-inotify \
--disable-fam \
--disable-xattr \
--disable-dtrace \
--disable-libmount \
--with-pcre=internal \
CPPFLAGS='-I$(BUILD_DIR).usr/include' \
LDFLAGS='-L$(BUILD_DIR).usr/lib'
$(MAKE) -C '$(BUILD_DIR)/glib' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gthread' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gmodule' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gobject' -j '$(JOBS)' lib_LTLIBRARIES= install-exec
$(MAKE) -C '$(BUILD_DIR)/gio/xdgmime' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gio/kqueue' -j '$(JOBS)'
$(MAKE) -C '$(BUILD_DIR)/gio' -j '$(JOBS)' glib-compile-schemas
$(MAKE) -C '$(BUILD_DIR)/gio' -j '$(JOBS)' glib-compile-resources
$(INSTALL) -m755 '$(BUILD_DIR)/gio/glib-compile-schemas' '$(PREFIX)/$(TARGET)/bin/'
$(INSTALL) -m755 '$(BUILD_DIR)/gio/glib-compile-resources' '$(PREFIX)/$(TARGET)/bin/'
endef
define $(PKG)_BUILD_NATIVE