source: gs2-extensions/gnome-lib/trunk/src/packages/README.txt

Last change on this file was 34983, checked in by anupama, 3 years ago

Merging the gnome-lib branch macos-dev at https://trac.greenstone.org/browser/gs2-extensions/gnome-lib/branches/macos-dev with the main trunk after testing it first on assigned linux 64 bit machine in lab as well as 64 bit LSB VM, and making changes for it to compile on Linux 64 bit LSB.

File size: 4.7 KB
Line 
1README
2
3This file tracks changes made to gnome-lib/packages for Greenstone.
4
5The contents of glib-2.28.1.tar.gz and libxml2-2.9.0.tar.gz have been modified to allow these to compile on Darwin. They were already compiling on Linux machines without requiring any changes. After the changes were made, they compile on Darwin while still compiling on Linux. Checked by compiling GS3 on both Mac Darwin and CentOS Linux.
6
7
8The bugfixes to get (this version of) gnome-lib to compile on Darwin:
9
101. In gs-glib-2.28.1/glib/gatomic.c
11 Bug error was "gatomic.c:885: error: syntax error before '*' token"
12 Solution described at http://code.google.com/p/osxwinebuilder/issues/detail?id=16 which states
13 'Alternatively I got it to compile by adding an extra #include "gthread.h" just before line 885 in gatomic.c,
14 although I guess from the surrounding comments that that would result in inferior performance'
15
16When compiling on LSB-32bit, ran in to a compilation error because it could
17 not find 'linux/magic.h'. This appears to be linked to the fact that
18 LSB is using quite an old version of the kernal headers (2.4?). Newer
19 version of GLIB have a fix for this. At this stage we're not planning
20 on jumping to such a newer version (in case it break other things, such
21 as cross-compiling for Android). So we have taken the autoconf fix for
22 this, and added it in to this version of the source code. Changed
23 'configure.ac' and 'glib/gfileutils.c'
24
252. In gs-libxml2-2.9.0/threads.c
26
27a. First of 2 bugfixes to version gs-libxml2-2.9.0/threads.c is an INSERT of a new line around line 146
28 For a discussion, see http://stackoverflow.com/questions/12484664/what-am-i-doing-wrong-when-installing-lxml-on-mac-os-x-10-8-1
29 For the bugfixes to the 2.9.0 sourcecode see https://git.gnome.org/browse/libxml2/commit/?id=3f6cfbd1d38d0634a2ddcb9a0a13e1b5a2195a5e
30static pthread_once_t once_control_init = PTHREAD_ONCE_INIT;
31+ static pthread_mutex_t global_init_lock = PTHREAD_MUTEX_INITIALIZER;
32
33b. The 2nd and final bugfix to version gs-libxml2-2.9.0/threads.c is a DELETION of a line followed by an INSERT of a new line around line 146
34
35- once_control = PTHREAD_ONCE_INIT;
36+ once_control = once_control_init;
37
38
393. On 14 Oct 2016, Dr Bainbridge reworked Greenstone for the upcomign 3.08 release to use the system libiconv for MacOS, since we found that using the 2 versions of libiconv included with GS didn't work with Mac El Capitan (Mac 10.11.3/v15 when testing with `uname -r`), because the DYLD_LIBRARY_PATH was being emptied on these newer Macs. The solution was to get MacOS to use the system libiconv (libiconv.2.dylib which is actually libiconv.2.4.0.dylib, see https://discussions.apple.com/thread/1931034?start=0&tstart=0) , since the MacOS had its own tweaked libiconv that would work on Macs, and its presence in a system location seemed to be a given.
40
41Besides the changes that were necessary to common-src/packages/configure, mgpp/jni/Makefile.in and mgpp/text/Makefile.in to use a system Mac, the gnome-lib extension's glib uses libiconv too and had to find the right one to get gconvert.c to compile properly. This required the following change, copied from glib-2.50.1.tar.xz (see also https://discussions.apple.com/thread/2378361?start=0&tstart=0, found searching google for: error: GNU libiconv not in use but included iconv.h is from libiconv macos).
42
43ff gs-glib-2.28.1/glib/gconvert.c
44
454. On 30/03/2021, the following customisations to glib-2.54.3/glib/gmessages.c were necessary as part of getting the gnome-lib (merged into main trunk from Mojave/Catalina branch) to compile on the 64 bit Linux LSB.
46
47These changes were taken from a future version of glib, at https://github.com/GNOME/glib/blob/master/glib/gmessages.c
48but should not affect Catalina or Mojave MacOS, as the #if defined tests for linux and next a test concerning Bionic, an Ubuntu distribution.
49
50
51a. Change:
52
53 #if defined(__linux__) && !defined(__BIONIC__)
54 static int
55 journal_sendv (struct iovec *iov,
56 gsize iovlen)
57
58To:
59 /* Enable support for the journal if we're on a recent enough Linux */
60 #if defined(__linux__) && !defined(__BIONIC__) && defined(HAVE_MKOSTEMP) && defined(O_CLOEXEC)
61 #define ENABLE_JOURNAL_SENDV
62 #endif
63
64 #ifdef ENABLE_JOURNAL_SENDV
65 static int
66 journal_sendv (struct iovec *iov,
67 gsize iovlen)
68
69
70
71b. And Change:
72 GLogWriterOutput
73 g_log_writer_journald (GLogLevelFlags log_level,
74 const GLogField *fields,
75 gsize n_fields,
76 gpointer user_data)
77 {
78 #if defined(__linux__) && !defined(__BIONIC__)
79
80To:
81 GLogWriterOutput
82 g_log_writer_journald (GLogLevelFlags log_level,
83 const GLogField *fields,
84 gsize n_fields,
85 gpointer user_data)
86 {
87 #ifdef ENABLE_JOURNAL_SENDV
88
Note: See TracBrowser for help on using the repository browser.