Skip to content
Permalink
Browse files

glib2: Update to 2.56.0

Closes: https://trac.macports.org/ticket/56081

Also, patch configure.ac, not configure. The reason why we were patching
configure was that patching configure.ac would have required running
autoreconf, and that would have required pkg-config, and at the time,
pkg-config depended on glib2, and MacPorts cannot accommodate circular
dependencies. pkg-config has included its own private copy of glib2
since f0e3b8c, so this reason no
longer applies.

We have been maintaining a large configure patch which needs to be
tediously regenerated from the configure.ac patch whenever glib2 is
updated. That effort is saved by being able to use the configure.ac
patch directly.

The Portfile is also simplified by allowing pkg-config to find the
libraries of the dependencies, rather than having to specify each of
them manually.

Reverts 847ba02.

See: https://trac.macports.org/ticket/55577

Also, add SIZEOF_SSIZE_T handling to config.h.ed. This should have been
done in 2eb6602 when similar patching
was added to the configure script. Add a comment to the patch to remind
the maintainer to update config.h.ed too.

Also, no longer undefine AC_APPLE_UNIVERSAL_BUILD in config.h. It's
unclear why we were ever doing this. config.h is only used at build
time. The only thing AC_APPLE_UNIVERSAL_BUILD currently does is ensure
WORDS_BIGENDIAN is defined correctly. glib doesn't use WORDS_BIGENDIAN;
it uses its own G_BYTE_ORDER, G_BIG_ENDIAN and G_LITTLE_ENDIAN. Maybe
AC_APPLE_UNIVERSAL_BUILD used to do something more objectionable.
  • Loading branch information
ryandesign committed Mar 24, 2018
1 parent 2a266a2 commit db9f7311c52cf7ad198a8aff1fd9c80e8f11d8b5
@@ -8,8 +8,7 @@ PortGroup compiler_blacklist_versions 1.0
name glib2
conflicts glib2-devel
set my_name glib
version 2.54.3
revision 2
version 2.56.0
set branch [join [lrange [split ${version} .] 0 1] .]
categories devel
maintainers {ryandesign @ryandesign} openmaintainer
@@ -29,31 +28,33 @@ long_description Glib is a library which includes support routines \

master_sites gnome:sources/${my_name}/${branch}/

checksums rmd160 7439dbf9d661352e7f2c1beae84b76e401798675 \
sha256 963fdc6685dc3da8e5381dfb9f15ca4b5709b28be84d9d05a9bb8e446abac0a8 \
size 7836536
checksums rmd160 66e132db3589581e64b65849ecdf21179f47e53e \
sha256 ecef6e17e97b8d9150d0e8a4b3edee1ac37331213b8a2a87a083deea408a0fc7 \
size 8026416

# patch-configure-switch-for-gappinfo-impl-mp.diff: understand comments inline!
# => https://trac.macports.org/ticket/53911
# => https://bugzilla.gnome.org/show_bug.cgi?id=781548
patchfiles libintl.patch \
patch-configure.diff \
patchfiles gcocoanotificationbackend.patch \
libintl.patch \
patch-glib-gmain.c.diff \
patch-glib_gunicollate.c.diff \
patch-gio_xdgmime_xdgmime.c.diff \
patch-gio_gdbusprivate.c.diff \
patch-get-launchd-dbus-session-address.diff \
patch-gmodule-gmodule-dl.c.diff \
patch-configure-switch-for-gappinfo-impl-mp.diff
patch-configure-switch-for-gappinfo-impl.diff \
universal.patch

depends_build bin:xmllint:libxml2
depends_build bin:xmllint:libxml2 \
port:pkgconfig

depends_lib port:gettext \
port:libffi \
port:libiconv \
port:pcre \
port:zlib

use_autoreconf yes
autoreconf.args -fvi

if {[vercmp ${macosx_deployment_target} 10.9] < 0} {
# GLib-CRITICAL **: attempting to free a locked GVariant instance. This should never happen.
compiler.blacklist-append {clang < 318}
@@ -83,12 +84,7 @@ configure.args --enable-static --disable-libelf \

configure.perl /usr/bin/perl
configure.python /usr/bin/python
configure.env-append PCRE_CFLAGS="-I${prefix}/include" \
PCRE_LIBS="-L${prefix}/lib -lpcre" \
PERL_PATH=${configure.perl} \
PKG_CONFIG=false \
ZLIB_CFLAGS="-I${prefix}/include" \
ZLIB_LIBS="-L${prefix}/lib -lz"
configure.env-append PERL_PATH=${configure.perl}

post-patch {
reinplace -W ${worksrcpath} "s|@PREFIX@|${prefix}|g" gio/gdbusprivate.c gio/xdgmime/xdgmime.c glib/gi18n-lib.h glib/gi18n.h
@@ -98,16 +94,6 @@ post-patch {
reinplace "s|-Werror=missing-prototypes||" ${worksrcpath}/configure
}

pre-configure {
if {![variant_isset quartz] && ![variant_isset x11]} {
error "Either +x11 or +quartz is required"
}

set libffi_version [exec sed -n {s/Version: //p} ${prefix}/lib/pkgconfig/libffi.pc]
configure.env-append LIBFFI_CFLAGS="-I${prefix}/lib/libffi-${libffi_version}/include" \
LIBFFI_LIBS="-L${prefix}/lib -lffi"
}

post-configure {
system "ed - ${worksrcpath}/config.h < ${filespath}/config.h.ed"
}
@@ -151,6 +137,11 @@ if {![variant_isset quartz]} {
if {![variant_isset x11]} {
default_variants +quartz
}
if {![variant_isset quartz] && ![variant_isset x11]} {
pre-configure {
return -code error "Either +x11 or +quartz is required"
}
}

livecheck.type gnome
livecheck.name ${my_name}
@@ -1,6 +1,3 @@
/ AC_APPLE_UNIVERSAL_BUILD /c
/* #undef AC_APPLE_UNIVERSAL_BUILD */
.
/ G_VA_COPY_AS_ARRAY /c
#ifdef __LP64__
#define G_VA_COPY_AS_ARRAY 1
@@ -22,6 +19,13 @@
#define SIZEOF_SIZE_T 4
#endif
.
/ SIZEOF_SSIZE_T /c
#ifdef __LP64__
#define SIZEOF_SSIZE_T 8
#else
#define SIZEOF_SSIZE_T 4
#endif
.
/ SIZEOF_VOID_P /c
#ifdef __LP64__
#define SIZEOF_VOID_P 8
@@ -0,0 +1,18 @@
Don't try to compile gcocoanotificationbackend.c on OS X < 10.9 which
doesn't support it.
https://bugzilla.gnome.org/show_bug.cgi?id=794380
--- gio/Makefile.am.orig 2018-03-12 11:23:37.000000000 -0500
+++ gio/Makefile.am 2018-03-15 14:27:31.000000000 -0500
@@ -612,8 +612,11 @@
gnextstepsettingsbackend.c \
gosxcontenttype.c \
gosxappinfo.c \
- gosxappinfo.h \
+ gosxappinfo.h
+if MAC_OS_X_9
+libgio_objc_2_0_la_SOURCES += \
gcocoanotificationbackend.c
+endif

noinst_LTLIBRARIES += libgio-objc-2.0.la
libgio_2_0_la_LIBADD += libgio-objc-2.0.la

0 comments on commit db9f731

Please sign in to comment.
You can’t perform that action at this time.