Add (WIP?) legacy glib recipe

Untested on gcc2
This commit is contained in:
Chris Roberts
2013-12-09 17:02:50 -07:00
parent a5fdec8a37
commit 8090bf86f9
3 changed files with 282 additions and 71 deletions

View File

@@ -0,0 +1,107 @@
SUMMARY="GLib is a cross-platform software utility library"
DESCRIPTION="GLib is a cross-platform software utility library that began as \
part of the GTK+ project. However, before releasing version 2 of GTK+, the \
project's developers decided to separate non-GUI-specific code from the GTK+ \
platform, thus creating GLib as a separate product. GLib was released as a \
separate library so other developers, those who did not make use of the \
GUI-related portions of GTK+, could make use of the non-GUI portions of the \
library without the overhead of depending on the entire GUI library.
Since GLib is a cross-platform library, applications using it to interface with \
the operating system are usually portable across different operating systems \
without major changes"
HOMEPAGE="http://www.gtk.org/"
SRC_URI="http://ftp.gnome.org/pub/gnome/sources/glib/1.2/glib-1.2.10.tar.gz"
CHECKSUM_MD5="6fe30dad87c77b91b632def29dd69ef9"
LICENSE="GNU LGPL v2"
COPYRIGHT="1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald
1991-2002 Free Software Foundation, Inc.
1997-2002 University of Cambridge.
1998-2001, 2003-2010 Red Hat, Inc.
1995-2002 Several others"
REVISION="1"
ARCHITECTURES="?x86_gcc2 x86"
SECONDARY_ARCHITECTURES="?x86_gcc2 x86"
PROVIDES="
glib$secondaryArchSuffix = $portVersion compat >= 1
lib:libglib$secondaryArchSuffix = $portVersion compat >= 1
lib:libglib_1.2$secondaryArchSuffix = $portVersion compat >= 1
lib:libgmodule$secondaryArchSuffix = $portVersion compat >= 1
lib:libgmodule_1.2$secondaryArchSuffix = $portVersion compat >= 1
lib:libgthread$secondaryArchSuffix = $portVersion compat >= 1
lib:libgthread_1.2$secondaryArchSuffix = $portVersion compat >= 1
"
REQUIRES="
haiku$secondaryArchSuffix >= $haikuVersion
"
BUILD_REQUIRES="
haiku${secondaryArchSuffix}_devel >= $haikuVersion
"
BUILD_PREREQUIRES="
cmd:gcc$secondaryArchSuffix
cmd:ld$secondaryArchSuffix
cmd:libtoolize
cmd:libtool
cmd:aclocal
cmd:autoconf
cmd:automake
cmd:m4
cmd:make
"
PATCHES="glib-1.2.10.patchset"
BUILD()
{
libtoolize --force --copy --install
aclocal
automake --add-missing
autoconf
runConfigure ./configure \
--enable-shared=yes
cp -f $portPackageLinksDir/cmd~libtool/bin/libtool .
make $jobArgs
}
INSTALL()
{
make install
prepareInstalledDevelLibs libglib libglib-1.2 \
libgmodule libgmodule-1.2 \
libgthread libgthread-1.2
fixPkgconfig
# devel package
packageEntries devel \
$developDir $binDir \
$manDir $dataDir \
$libDir/glib
}
# ----- devel package -------------------------------------------------------
PROVIDES_devel="
glib${secondaryArchSuffix}_devel = $portVersion compat >= 0
cmd:glib_config$secondaryArchSuffix = $portVersion
devel:libglib$secondaryArchSuffix = $portVersion compat >= 1
devel:libglib_1.2$secondaryArchSuffix = $portVersion compat >= 1
devel:libgmodule$secondaryArchSuffix = $portVersion compat >= 1
devel:libgmodule_1.2$secondaryArchSuffix = $portVersion compat >= 1
devel:libgthread$secondaryArchSuffix = $portVersion compat >= 1
devel:libgthread_1.2$secondaryArchSuffix = $portVersion compat >= 1
"
REQUIRES_devel="
glib$secondaryArchSuffix == $portVersion base
"

View File

@@ -0,0 +1,175 @@
From afb8aab8236d2c30c34642c755ce7c07dfc95ab2 Mon Sep 17 00:00:00 2001
From: Chris Roberts <cpr420@gmail.com>
Date: Mon, 9 Dec 2013 16:58:10 -0700
Subject: Attempt to bring glib-1 into the modern age
diff --git a/Makefile.am b/Makefile.am
index 3a6e201..f059565 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -70,7 +70,7 @@ configinclude_DATA = \
CONFIGURE_DEPENDENCIES = acglib.m4
-BUILT_SOURCES = stamp-gc-h #note: not glibconfig.h
+BUILT_SOURCES += stamp-gc-h #note: not glibconfig.h
glibconfig.h: stamp-gc-h
@:
stamp-gc-h: config.status
diff --git a/acinclude.m4 b/acinclude.m4
index 47abe43..43ed3f1 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -21,6 +21,18 @@
## configuration script generated by Autoconf, you may include it under
## the same distribution terms that you use for the rest of that program.
+# GLIB_AC_DIVERT_BEFORE_HELP(STUFF)
+# ---------------------------------
+# Put STUFF early enough so that they are available for $ac_help expansion.
+# Handle both classic (<= v2.13) and modern autoconf
+AC_DEFUN([GLIB_AC_DIVERT_BEFORE_HELP],
+[ifdef([m4_divert_text], [m4_divert_text([NOTICE],[$1])],
+ [ifdef([AC_DIVERT], [AC_DIVERT([NOTICE],[$1])],
+ [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
+$1
+AC_DIVERT_POP()])])])
+
+
# serial 40 AC_PROG_LIBTOOL
AC_DEFUN(AC_PROG_LIBTOOL,
[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
diff --git a/configure.in b/configure.in
index 8ee9339..cad722f 100644
--- a/configure.in
+++ b/configure.in
@@ -17,7 +17,7 @@ rm -f glibconfig-sysdefs.h
dnl we need to AC_DIVERT_PUSH/AC_DIVERT_POP these variable definitions so they
dnl are available for $ac_help expansion (don't we all *love* autoconf?)
-AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
+GLIB_AC_DIVERT_BEFORE_HELP([
#
# The following version number definitions apply to GLib, GModule and GThread
# as a whole, so if changes occoured in any of them, they are all
@@ -38,7 +38,7 @@ GLIB_INTERFACE_AGE=10
GLIB_BINARY_AGE=10
GLIB_VERSION=$GLIB_MAJOR_VERSION.$GLIB_MINOR_VERSION.$GLIB_MICRO_VERSION
dnl
-AC_DIVERT_POP()dnl
+])
AC_SUBST(GLIB_MAJOR_VERSION)
AC_SUBST(GLIB_MINOR_VERSION)
@@ -63,7 +63,7 @@ PACKAGE=glib
AM_INIT_AUTOMAKE($PACKAGE, $VERSION, no-define)
# Specify a configuration file
-AM_CONFIG_HEADER(config.h)
+AC_CONFIG_HEADERS(config.h)
AC_DEFINE_UNQUOTED(GLIB_MAJOR_VERSION, $GLIB_MAJOR_VERSION)
AC_DEFINE_UNQUOTED(GLIB_MINOR_VERSION, $GLIB_MINOR_VERSION)
@@ -71,6 +71,7 @@ AC_DEFINE_UNQUOTED(GLIB_MICRO_VERSION, $GLIB_MICRO_VERSION)
AC_DEFINE_UNQUOTED(GLIB_INTERFACE_AGE, $GLIB_INTERFACE_AGE)
AC_DEFINE_UNQUOTED(GLIB_BINARY_AGE, $GLIB_BINARY_AGE)
+AC_CANONICAL_SYSTEM
dnl Initialize libtool
AM_PROG_LIBTOOL
@@ -81,13 +82,13 @@ AC_CANONICAL_HOST
dnl figure debugging default, prior to $ac_help setup
dnl
-AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)dnl
+GLIB_AC_DIVERT_BEFORE_HELP([
if test `expr $GLIB_MINOR_VERSION \% 2` = 1 ; then
debug_default=yes
else
debug_default=minimum
fi
-AC_DIVERT_POP()dnl
+])
dnl declare --enable-* args and collect ac_help strings
AC_ARG_ENABLE(debug, [ --enable-debug=[no/minimum/yes] turn on debugging [default=$debug_default]],,enable_debug=$debug_default)
@@ -154,7 +155,6 @@ AC_DEFINE_UNQUOTED(G_COMPILED_WITH_DEBUGGING, "${enable_debug}")
# Checks for programs.
AC_PROG_CC
-AM_PROG_CC_STDC
AC_PROG_INSTALL
changequote(,)dnl
diff --git a/gmodule/Makefile.am b/gmodule/Makefile.am
index ff4410a..5f0ce56 100644
--- a/gmodule/Makefile.am
+++ b/gmodule/Makefile.am
@@ -42,7 +42,7 @@ libgplugin_b_la_LDFLAGS = @G_MODULE_LDFLAGS@ -avoid-version -module
libgplugin_b_la_LIBADD = @G_MODULE_LIBS@ # $(libglib)
noinst_PROGRAMS = testgmodule
-testgmodule_LDFLAGS += @G_MODULE_LDFLAGS@
+testgmodule_LDFLAGS = @G_MODULE_LDFLAGS@
testgmodule_LDADD = libgmodule.la $(libglib) @G_MODULE_LIBS@
.PHONY: files release
diff --git a/gstrfuncs.c b/gstrfuncs.c
index feb4572..f3859b4 100644
--- a/gstrfuncs.c
+++ b/gstrfuncs.c
@@ -702,7 +702,7 @@ g_strsignal (gint signum)
char *msg;
#ifdef HAVE_STRSIGNAL
- extern char *strsignal (int sig);
+ extern const char *strsignal (int sig);
return strsignal (signum);
#elif NO_SYS_SIGLIST
switch (signum)
@@ -867,8 +867,7 @@ g_printf_string_upper_bound (const gchar* format,
/* beware of positional parameters
*/
case '$':
- g_warning (G_GNUC_PRETTY_FUNCTION
- "(): unable to handle positional parameters (%%n$)");
+ g_warning ("%s(): unable to handle positional parameters (%%n$)", G_GNUC_PRETTY_FUNCTION);
len += 1024; /* try adding some safety padding */
break;
@@ -1034,8 +1033,7 @@ g_printf_string_upper_bound (const gchar* format,
/* n . dddddddddddddddddddddddd E +- eeee */
conv_len += 1 + 1 + MAX (24, spec.precision) + 1 + 1 + 4;
if (spec.mod_extra_long)
- g_warning (G_GNUC_PRETTY_FUNCTION
- "(): unable to handle long double, collecting double only");
+ g_warning ("%s(): unable to handle long double, collecting double only", G_GNUC_PRETTY_FUNCTION);
#ifdef HAVE_LONG_DOUBLE
#error need to implement special handling for long double
#endif
@@ -1077,8 +1075,7 @@ g_printf_string_upper_bound (const gchar* format,
conv_done = TRUE;
if (spec.mod_long)
{
- g_warning (G_GNUC_PRETTY_FUNCTION
- "(): unable to handle wide char strings");
+ g_warning ("%s(): unable to handle wide char strings", G_GNUC_PRETTY_FUNCTION);
len += 1024; /* try adding some safety padding */
}
break;
@@ -1108,9 +1105,7 @@ g_printf_string_upper_bound (const gchar* format,
conv_len += format - spec_start;
break;
default:
- g_warning (G_GNUC_PRETTY_FUNCTION
- "(): unable to handle `%c' while parsing format",
- c);
+ g_warning ("%s(): unable to handle `%c' while parsing format", G_GNUC_PRETTY_FUNCTION, c);
break;
}
conv_done |= conv_len > 0;
--
1.8.3.4

View File

@@ -1,71 +0,0 @@
diff -Naur glib-1.2.10-original/Makefile.am glib-1.2.10/Makefile.am
--- glib-1.2.10-original/Makefile.am 2009-01-22 23:29:09.000000000 +0000
+++ glib-1.2.10/Makefile.am 2009-01-22 23:32:21.000000000 +0000
@@ -1,5 +1,7 @@
## Process this file with automake to produce Makefile.in
+ACLOCAL_AMFLAGS = -I m4
+
# require automake 1.4
AUTOMAKE_OPTIONS = 1.4
@@ -7,8 +9,8 @@
configincludedir = $(pkglibdir)/include
-noinst_SCRIPTS=glib-config
-#BUILT_SOURCES=glib-config
+bin_SCRIPTS=glib-config
+BUILT_SOURCES=glib-config
glib-config: glib-config.in
INCLUDES = -DG_LOG_DOMAIN=g_log_domain_glib @GLIB_DEBUG_FLAGS@
@@ -30,7 +32,7 @@
gthread.pc.in
-noinst_LTLIBRARIES = libglib.la
+lib_LTLIBRARIES = libglib.la
libglib_la_SOURCES = \
garray.c \
@@ -60,11 +62,11 @@
gutils.c
glibincludedir=$(includedir)/glib-1.2
-noinst_HEADERS = \
+glibinclude_HEADERS = \
glib.h
-#noinst_DATA = \
-# glibconfig.h
+configinclude_DATA = \
+ glibconfig.h
CONFIGURE_DEPENDENCIES = acglib.m4
@@ -86,10 +88,10 @@
testgdateparser_LDADD = libglib.la
m4datadir = $(datadir)/aclocal
-noinst_DATA = glib.m4
+m4data_DATA = glib.m4
pkgconfigdir = $(libdir)/pkgconfig
-noinst_DATA = glib.pc gmodule.pc gthread.pc
+pkgconfig_DATA = glib.pc gmodule.pc gthread.pc
glibconfig.h.win32: $(top_builddir)/config.status $(top_srcdir)/glibconfig.h.win32.in
cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status
diff -Naur glib-1.2.10-original/configure.in glib-1.2.10/configure.in
--- glib-1.2.10-original/configure.in 2009-01-22 23:29:09.000000000 +0000
+++ glib-1.2.10/configure.in 2009-01-22 23:30:28.000000000 +0000
@@ -9,6 +9,8 @@
# init autoconf (and check for presence of glist.c)
AC_INIT(glist.c)
+AC_CONFIG_MACRO_DIR([m4])
+
# Save this value here, since automake will set cflags later
cflags_set=${CFLAGS+set}