Browse Source

Go back to old glib on macOS

pull/25/head
falkTX 5 months ago
parent
commit
ecbfb2eddf
10 changed files with 242 additions and 11 deletions
  1. +1
    -1
      bootstrap-carla.sh
  2. +2
    -2
      bootstrap-jack2.sh
  3. +15
    -4
      bootstrap-plugins.sh
  4. +131
    -0
      patches/glib/macos-universal/01_aarch64-atomic-as-mutex.patch
  5. +40
    -0
      patches/glib/macos-universal/01_skip-gettext.patch
  6. +40
    -0
      patches/glib/macos/01_skip-gettext.patch
  7. +0
    -0
      patches/glib/win32/01_skip-gettext.patch
  8. +0
    -0
      patches/glib/win32/02_fix-stat32i64-usage.patch
  9. +1
    -0
      patches/glib/win64
  10. +12
    -4
      setup/versions.sh

+ 1
- 1
bootstrap-carla.sh View File

@@ -351,7 +351,7 @@ fi
# ---------------------------------------------------------------------------------------------------------------------
# cxfreeze

download cx_Freeze "${CXFREEZE_VERSION}" "https://github.com/anthony-tuininga/cx_Freeze.git" "" "git"
git_clone cx_Freeze "${CXFREEZE_VERSION}" "https://github.com/anthony-tuininga/cx_Freeze.git"

if [ "${CXFREEZE_VERSION}" = "e1c33afea842bc61dac82145a8a0be5fbd318a92" ]; then
patch_file cx_Freeze "${CXFREEZE_VERSION}" "setup.py" 's/extra_postargs=extraArgs,/extra_postargs=extraArgs+os.getenv("LDFLAGS").split(),/'


+ 2
- 2
bootstrap-jack2.sh View File

@@ -104,7 +104,7 @@ build_custom_db db "${DB_VERSION}" "--disable-java --disable-replication --disab
# rtaudio (download, win32 only)

if [ "${WIN32}" -eq 1 ]; then
download rtaudio "${RTAUDIO_VERSION}" "${RTAUDIO_URL}" "" "git"
git_clone rtaudio "${RTAUDIO_VERSION}" "${RTAUDIO_URL}"
# fixes for portaudio
ASIO_DIR="${PAWPAW_BUILDDIR}/rtaudio-${RTAUDIO_VERSION}/include"
if [ -d "${ASIO_DIR}" ]; then
@@ -143,7 +143,7 @@ fi
# tre (win32 only)

if [ "${WIN32}" -eq 1 ]; then
download tre "${TRE_VERSION}" "${TRE_URL}" "" "git"
git_clone tre "${TRE_VERSION}" "${TRE_URL}"
build_autoconfgen tre "${TRE_VERSION}" "--disable-nls"
fi



+ 15
- 4
bootstrap-plugins.sh View File

@@ -72,9 +72,11 @@ fi
# ---------------------------------------------------------------------------------------------------------------------
# libffi

if [ "${MACOS}" -eq 1 ] || [ "${WIN32}" -eq 1 ]; then
if [ "${WIN32}" -eq 1 ]; then
LIBFFI_EXTRAFLAGS="--disable-multi-os-directory --disable-raw-api"

download libffi "${LIBFFI_VERSION}" "${LIBFFI_URL}"
build_autoconf libffi "${LIBFFI_VERSION}"
build_autoconf libffi "${LIBFFI_VERSION}" "${LIBFFI_EXTRAFLAGS}"
fi

# ---------------------------------------------------------------------------------------------------------------------
@@ -89,11 +91,20 @@ if [ "${MACOS}" -eq 1 ] || [ "${WIN32}" -eq 1 ]; then
GLIB_EXTRAFLAGS+=" --with-threads=posix"
fi

if [ "${WIN32}" -eq 1 ]; then
if [ "${MACOS}" -eq 1 ]; then
export EXTRA_LDFLAGS="-lresolv"
patch_file glib ${GLIB_VERSION} "glib/gconvert.c" '/#error/g'

if [ "${MACOS_UNIVERSAL}" -eq 1 ]; then
patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_ARM/__aarch64__/'
patch_file glib ${GLIB_VERSION} "glib/gatomic.c" 's/G_ATOMIC_X86_64/__SSE2__/'
fi

elif [ "${WIN32}" -eq 1 ]; then
export EXTRA_CFLAGS="-Wno-format -Wno-format-overflow"
fi

download glib ${GLIB_VERSION} "${GLIB_URL}" "tar.xz"
download glib ${GLIB_VERSION} "${GLIB_URL}" "${GLIB_TAR_EXT}"
build_autoconfgen glib ${GLIB_VERSION} "${GLIB_EXTRAFLAGS}"
fi



+ 131
- 0
patches/glib/macos-universal/01_aarch64-atomic-as-mutex.patch View File

@@ -0,0 +1,131 @@
--- glib-2.22.5/glib/gatomic.c 2021-01-12 00:34:17.000000000 +0000
+++ glib-2.22.5.mod/glib/gatomic.c 2021-01-12 00:31:22.000000000 +0000
@@ -561,55 +561,33 @@
# error "Your system has an unsupported pointer size"
# endif /* GLIB_SIZEOF_VOID_P */
# elif defined (__aarch64__)
-static volatile int atomic_spin = 0;
-
-static int atomic_spin_trylock (void)
-{
- int result;
-
- asm volatile (
- "swp %0, %1, [%2]\n"
- : "=&r,&r" (result)
- : "r,0" (1), "r,r" (&atomic_spin)
- : "memory");
- if (result == 0)
- return 0;
- else
- return -1;
-}
-
-static void atomic_spin_lock (void)
-{
- while (atomic_spin_trylock())
- sched_yield();
-}
-
-static void atomic_spin_unlock (void)
-{
- atomic_spin = 0;
-}
+#include <pthread.h>
+static pthread_mutex_t g_atomic_lock = PTHREAD_MUTEX_INITIALIZER;
gint
g_atomic_int_exchange_and_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
- gint result;
-
- atomic_spin_lock();
- result = *atomic;
- *atomic += val;
- atomic_spin_unlock();
+ guint oldval;
- return result;
+ pthread_mutex_lock (&g_atomic_lock);
+ oldval = *atomic;
+ *atomic = oldval & val;
+ pthread_mutex_unlock (&g_atomic_lock);
+
+ return oldval;
}
void
g_atomic_int_add (volatile gint G_GNUC_MAY_ALIAS *atomic,
gint val)
{
- atomic_spin_lock();
- *atomic += val;
- atomic_spin_unlock();
+ guint oldval;
+
+ pthread_mutex_lock (&g_atomic_lock);
+ oldval = *atomic;
+ *atomic = oldval & val;
+ pthread_mutex_unlock (&g_atomic_lock);
}
gboolean
@@ -617,19 +595,16 @@
gint oldval,
gint newval)
{
- gboolean result;
+ gboolean success;
- atomic_spin_lock();
- if (*atomic == oldval)
- {
- result = TRUE;
- *atomic = newval;
- }
- else
- result = FALSE;
- atomic_spin_unlock();
+ pthread_mutex_lock (&g_atomic_lock);
- return result;
+ if ((success = (*atomic == oldval)))
+ *atomic = newval;
+
+ pthread_mutex_unlock (&g_atomic_lock);
+
+ return success;
}
gboolean
@@ -637,19 +612,17 @@
gpointer oldval,
gpointer newval)
{
- gboolean result;
-
- atomic_spin_lock();
- if (*atomic == oldval)
- {
- result = TRUE;
- *atomic = newval;
- }
- else
- result = FALSE;
- atomic_spin_unlock();
+ gpointer *ptr = atomic;
+ gboolean success;
- return result;
+ pthread_mutex_lock (&g_atomic_lock);
+
+ if ((success = (*ptr == oldval)))
+ *ptr = newval;
+
+ pthread_mutex_unlock (&g_atomic_lock);
+
+ return success;
}
# elif defined (G_ATOMIC_CRIS) || defined (G_ATOMIC_CRISV32)
# ifdef G_ATOMIC_CRIS

+ 40
- 0
patches/glib/macos-universal/01_skip-gettext.patch View File

@@ -0,0 +1,40 @@
diff --git a/Makefile.in b/Makefile.in
index 3402627..27210f1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -401,7 +401,7 @@ EXTRA_DIST = ChangeLog.pre-2-20 ChangeLog.pre-2-18 ChangeLog.pre-2-16 \
gio-2.0-uninstalled.pc.in gio-unix-2.0-uninstalled.pc.in
TEST_PROGS =
AUTOMAKE_OPTIONS = 1.7
-SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po docs
+SUBDIRS = . m4macros glib gmodule gthread gobject gio po
DIST_SUBDIRS = $(SUBDIRS) build
bin_SCRIPTS = glib-gettextize
AM_CPPFLAGS = \
diff --git a/configure.in b/configure.in
index b9c3342..e421aa0 100644
--- a/configure.in
+++ b/configure.in
@@ -465,13 +465,6 @@ ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
GLIB_GNU_GETTEXT
-if test "$gt_cv_have_gettext" != "yes" ; then
- AC_MSG_ERROR([
-*** You must have either have gettext support in your C library, or use the
-*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
-])
-fi
-
LIBS="$INTLLIBS $LIBS"
GETTEXT_PACKAGE=glib20
@@ -2682,8 +2675,6 @@ dnl **************************
dnl *** Checks for gtk-doc ***
dnl **************************
-GTK_DOC_CHECK([1.11])
-
AC_ARG_ENABLE(man,
[AC_HELP_STRING([--enable-man],
[regenerate man pages from Docbook [default=no]])],enable_man=yes,

+ 40
- 0
patches/glib/macos/01_skip-gettext.patch View File

@@ -0,0 +1,40 @@
diff --git a/Makefile.in b/Makefile.in
index 3402627..27210f1 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -401,7 +401,7 @@ EXTRA_DIST = ChangeLog.pre-2-20 ChangeLog.pre-2-18 ChangeLog.pre-2-16 \
gio-2.0-uninstalled.pc.in gio-unix-2.0-uninstalled.pc.in
TEST_PROGS =
AUTOMAKE_OPTIONS = 1.7
-SUBDIRS = . m4macros glib gmodule gthread gobject gio tests po docs
+SUBDIRS = . m4macros glib gmodule gthread gobject gio po
DIST_SUBDIRS = $(SUBDIRS) build
bin_SCRIPTS = glib-gettextize
AM_CPPFLAGS = \
diff --git a/configure.in b/configure.in
index b9c3342..e421aa0 100644
--- a/configure.in
+++ b/configure.in
@@ -465,13 +465,6 @@ ALL_LINGUAS="`grep -v '^#' "$srcdir/po/LINGUAS" | tr '\n' ' '`"
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/po/LINGUAS'])
GLIB_GNU_GETTEXT
-if test "$gt_cv_have_gettext" != "yes" ; then
- AC_MSG_ERROR([
-*** You must have either have gettext support in your C library, or use the
-*** GNU gettext library. (http://www.gnu.org/software/gettext/gettext.html
-])
-fi
-
LIBS="$INTLLIBS $LIBS"
GETTEXT_PACKAGE=glib20
@@ -2682,8 +2675,6 @@ dnl **************************
dnl *** Checks for gtk-doc ***
dnl **************************
-GTK_DOC_CHECK([1.11])
-
AC_ARG_ENABLE(man,
[AC_HELP_STRING([--enable-man],
[regenerate man pages from Docbook [default=no]])],enable_man=yes,

patches/glib/01_skip-gettext.patch → patches/glib/win32/01_skip-gettext.patch View File


patches/glib/02_fix-stat32i64-usage.patch → patches/glib/win32/02_fix-stat32i64-usage.patch View File


+ 1
- 0
patches/glib/win64 View File

@@ -0,0 +1 @@
win32

+ 12
- 4
setup/versions.sh View File

@@ -42,14 +42,22 @@ ZLIB_URL=https://github.com/madler/zlib.git
FFTW_VERSION=3.3.10
FFTW_URL=http://www.fftw.org

LIBFFI_VERSION=3.3
LIBFFI_URL=https://sourceware.org/pub/libffi
LIBFFI_VERSION=3.4.2
LIBFFI_URL=https://github.com/libffi/libffi/releases/download/v${LIBFFI_VERSION}

PCRE_VERSION=8.45
PCRE_URL=http://download.sourceforge.net/pcre

GLIB_MVERSION=2.45
GLIB_VERSION=2.45.8
if [ "${MACOS}" -eq 1 ]; then
GLIB_MVERSION=2.22
GLIB_VERSION=2.22.5
GLIB_TAR_EXT=tar.gz
else
GLIB_MVERSION=2.45
GLIB_VERSION=2.45.8
GLIB_TAR_EXT=tar.xz
fi

GLIB_URL=https://download.gnome.org/sources/glib/${GLIB_MVERSION}

LIBLO_VERSION=0.31


Loading…
Cancel
Save