From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-eopbgr770137.outbound.protection.outlook.com [40.107.77.137]) by sourceware.org (Postfix) with ESMTPS id 4712D385C426 for ; Sat, 23 May 2020 18:08:43 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4712D385C426 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=elBZZNb/GWqXuQSb33p6uuCldGIl/rgi6Nni794tPPO4oLamK8/SGDOxtxRtQvfcVhZvczp4FOMJwScSaXNOGzpiZ6QmT2b/oXEUcfh4ZCYlQOwQVroU8NPy9Ewgi+TP+WjFNMetFbKY1EqJpVgiu7nmXYz4JpuxrzrCsn2sjHCaJdP5ubt4LAc2myxlL0/o4+P/K9QQcrtCyAh6JxebaQwDzJPKM4OAFw7P+s8Pgkv/bEBVdaSpzk12kaPU4VNYzQLX1g26oBkkm90tV1q4j1cwcep7nCcZ+wpR3VVwEAKq60NQjidT/6SE4rygG+L/yYixlENDOzoLgvQymWlzfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=w4V/8l/76yX1VR9zQ8tOyJtPcIkP/LsAtppBu05eCqY=; b=AuRosReoet7fmvhr0NB2wcCSX2tPQxdhyXhwKHxSiWD6eYok3KaEfTCik1D9cItk8N2/Yc4OsfirjZGA64zu7xLiL3RA96UR2wom0FUiCxqUUctLyCEywEpLq7cu4LcNtcFJDfBWyCv0zfYfS0GaHNhIozj6nr30eSiU6CRhG9ZhCXKy25brHMPE/eNCCcTeX85FgWdzC+4PJqKepaAN+aUMpY/7wh2WZh+u7xfERjIb38Jnwuprd5A6wg9PP5ovvCSdeKtpKBbj2Zicritkl8a6S7/jdy2wvbDG0B3IJcJu7EwtnIsEXRaUtkRwmALLXXoFyiBnwNhRufV4PbMQFg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu; dkim=pass header.d=cornell.edu; arc=none Received: from DM6PR04MB6075.namprd04.prod.outlook.com (2603:10b6:5:127::31) by DM6PR04MB6169.namprd04.prod.outlook.com (2603:10b6:5:124::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24; Sat, 23 May 2020 18:08:42 +0000 Received: from DM6PR04MB6075.namprd04.prod.outlook.com ([fe80::f48b:4e13:94d7:f7c4]) by DM6PR04MB6075.namprd04.prod.outlook.com ([fe80::f48b:4e13:94d7:f7c4%4]) with mapi id 15.20.3021.027; Sat, 23 May 2020 18:08:41 +0000 Subject: Re: Updating glib2.0 To: cygwin-apps@cygwin.com References: <074318ee-6ee1-c1c1-c3ee-cff757c6f51a@cornell.edu> From: Ken Brown Message-ID: <38ca6fa6-4f4c-90f8-eccd-e24d1e90d4fd@cornell.edu> Date: Sat, 23 May 2020 14:08:35 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 In-Reply-To: <074318ee-6ee1-c1c1-c3ee-cff757c6f51a@cornell.edu> Content-Type: multipart/mixed; boundary="------------875EB5757B15CB2947245276" Content-Language: en-US X-ClientProxiedBy: CH2PR14CA0009.namprd14.prod.outlook.com (2603:10b6:610:60::19) To DM6PR04MB6075.namprd04.prod.outlook.com (2603:10b6:5:127::31) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from [192.168.0.17] (68.175.129.7) by CH2PR14CA0009.namprd14.prod.outlook.com (2603:10b6:610:60::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3021.24 via Frontend Transport; Sat, 23 May 2020 18:08:41 +0000 X-Originating-IP: [68.175.129.7] X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 57588167-5b53-45b1-5ba0-08d7ff44531f X-MS-TrafficTypeDiagnostic: DM6PR04MB6169: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2089; X-Forefront-PRVS: 0412A98A59 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: fhEVVvL2R//GQbaTojI2uOQKfizNfkLalQtMcblx+BlcgU1rFpHkZQg3hlvnRLJeaYqV+CraxdkaaozLYxJHwkysTid2ChN6qd0fvi05Sv9shYw1tqQlCJEdbgYM8suN6kzQf4xK5wdVkINOcw+u6VViCffdAxSlnRuaXxh5GqgOuQt0C4SjsQaCVldlWD16wJBg2yVGx1Y1k/5wR0ho0Lw1JultjS22JCptGKGlNJ2q4jXJGBu7bJOdTpGt8dJI+wU6PEkhDbKOkD1ehbDayEUcXNtuXEage7jv9bUnfZ7zZGRRYUmZXoom2cju6062j5i46KyL4lzD9PXmpflL95wpxcMKabNVbqzFIhQ4MytFG7lH0io8CYus+FZT71+7 X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR04MB6075.namprd04.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(136003)(346002)(39860400002)(376002)(396003)(366004)(33964004)(2906002)(53546011)(52116002)(31686004)(86362001)(786003)(6916009)(16576012)(478600001)(316002)(16526019)(31696002)(186003)(235185007)(956004)(6486002)(8676002)(66556008)(66946007)(6666004)(2616005)(66576008)(8936002)(75432002)(26005)(5660300002)(66476007)(36756003)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData: 2p64gMflJmXjEzZmtqR5bLgzitnfTZyOHQW7q6Dv45fKUoXknfcU7MZgFwjFkiqmfLAJSxo1FK7ZUUQp/sVSTk3jk8FqpdZBuv0XTH746GomZHLmxJqr2rS+zddSGVZmsSrDGhNm8AdCMHQcWsfAUtSaHw6tmxE58hDip8lWzMxyqPYeWmyMzFyCUk6WqA3xOPE6mYtlEXfqsnugDF1TGmMdEukG35lQhFCYi3W+OT8q1ONREgzrdHBTT8sz//+IwT7yIQ7TCon6h65JN+OpNXYyxwl+5A8uTmbhV25vHs+ab1Yd3Re7C+04xMDGUrKqRROoQI9d/S2G8WOnxAYi5DLC1Yo/Qakz17j8ngZ5zdLXHbyzpl8jcqurk1lfLKlYdR2YunsDT5z6jYRkhr/I5cYH56B/boDtAHhdcN5mtABPqkfAQYdMuyqZJ+RuhVknD5bPnEfpttlshHktQGOwVPYfmGyYXolpVpsjrrpOxbY= X-OriginatorOrg: cornell.edu X-MS-Exchange-CrossTenant-Network-Message-Id: 57588167-5b53-45b1-5ba0-08d7ff44531f X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 May 2020 18:08:41.7725 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 63k+nPqY+mBkYjgDoyOerwEs+xY3DfgbtBKAoRC0mqe8WF+c7j8iq9MMgR0w0606VHmUExhCVhxeYRnIu6tDzw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR04MB6169 X-Spam-Status: No, score=-3.2 required=5.0 tests=BAYES_00, DKIM_INVALID, DKIM_SIGNED, KAM_DMARC_STATUS, KAM_NUMSUBJECT, KAM_SHORT, MSGID_FROM_MTA_HEADER, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=no autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: cygwin-apps@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin package maintainer discussion list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 May 2020 18:08:47 -0000 --------------875EB5757B15CB2947245276 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit On 5/22/2020 7:18 PM, Ken Brown via Cygwin-apps wrote: > I've been planning to adopt gimp and some related build dependencies.  My reason > is that I use gimp and would like to see it kept up to date. > > I thought I had all the prerequisites I needed.  But when I built gimp, I > discovered that it used two functions, g_set_weak_pointer and > g_date_time_new_from_iso8601, that were introduced in glib-2.56. > > [gimp's configure.ac says that it only requires glib 2.54.2, but this seems to > be wrong.  Cygwin's glib is at 2.54.3.  Fedora's is at 2.64.3, which is the > latest upstream release.] > > I'd appreciate some advice about how to proceed.  I'm not interested in adopting > all of GNOME, and it probably doesn't make sense for different components of > GNOME to be adopted by different people. > > A short-term solution (from my personal POV) would be for me to do a > non-maintainer update of glib to 2.56, assuming that's doable without messing up > other GNOME components. > > A better solution (again from my personal POV) would be for someone to adopt > GNOME and update it to its latest release. To focus the discussion a little better, I've built and installed glib2.0-2.56.4. My cygport file and patches are attached. I can now build gimp-2.10.18, and it seems to run fine in limited testing. Ken --------------875EB5757B15CB2947245276 Content-Type: text/plain; charset=UTF-8; name="2.34.3-m4macros.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="2.34.3-m4macros.patch" Fix for -Werror=nested-externs --- origsrc/glib-2.34.3/m4macros/glib-gettext.m4 2012-11-20 08:27:12.000000000 -0600 +++ src/glib-2.34.3/m4macros/glib-gettext.m4 2013-04-15 02:04:25.707401500 -0500 @@ -222,8 +222,8 @@ msgstr "" AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) GLIB_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, [test -z "`$ac_dir/$ac_word -h 2>&1 | grep '(HELP)'`"], :) - AC_TRY_LINK(, [extern int _nl_msg_cat_cntr; - return _nl_msg_cat_cntr], + AC_TRY_LINK([extern int _nl_msg_cat_cntr;], + [return _nl_msg_cat_cntr], [CATOBJEXT=.gmo DATADIRNAME=share], [case $host in --------------875EB5757B15CB2947245276 Content-Type: text/plain; charset=UTF-8; name="2.36.3-not-win32.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="2.36.3-not-win32.patch" --- origsrc/glib-2.36.3/configure.ac 2013-08-04 20:21:20.808722600 -0500 +++ src/glib-2.36.3/configure.ac 2013-08-04 18:30:21.852852200 -0500 @@ -1880,7 +1880,7 @@ dnl ************************************ AC_MSG_CHECKING(for platform-dependent source) case "$host" in - *-*-cygwin*|*-*-mingw*) + *-*-mingw*) PLATFORMDEP=gwin32.lo ;; *) @@ -2594,9 +2594,6 @@ dnl *** Win32 API libs *** dnl ********************** case $host in - *-*-cygwin*) - G_LIBS_EXTRA="-luser32 -lkernel32" - ;; *-*-mingw*) G_LIBS_EXTRA="-lws2_32 -lole32 -lwinmm -lshlwapi" ;; --- origsrc/glib-2.36.3/docs/reference/gio/Makefile.am 2013-08-04 20:21:20.849725000 -0500 +++ src/glib-2.36.3/docs/reference/gio/Makefile.am 2013-08-04 18:11:14.000000000 -0500 @@ -77,6 +77,8 @@ IGNORE_HFILES = \ gunixvolume.h \ gunixvolumemonitor.h \ gwin32appinfo.h \ + gwin32inputstream.h \ + gwin32outputstream.h \ gwin32mount.h \ gwin32resolver.h \ gwin32volumemonitor.h --- origsrc/glib-2.36.3/gio/giomodule-priv.h 2013-08-04 20:21:20.877726600 -0500 +++ src/glib-2.36.3/gio/giomodule-priv.h 2013-08-04 18:11:14.000000000 -0500 @@ -39,7 +39,7 @@ GType _g_io_module_get_default_type ( const gchar *envvar, guint is_supported_offset); -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 void *_g_io_win32_get_module (void); #endif --- origsrc/glib-2.36.3/gio/giomodule.c 2013-08-04 20:21:20.886727100 -0500 +++ src/glib-2.36.3/gio/giomodule.c 2013-08-04 18:11:14.000000000 -0500 @@ -894,7 +894,7 @@ extern GType g_network_monitor_base_get_ extern GType _g_network_monitor_netlink_get_type (void); #endif -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 #include --- origsrc/glib-2.36.3/gio/tests/live-g-file.c 2013-08-04 20:21:20.898727800 -0500 +++ src/glib-2.36.3/gio/tests/live-g-file.c 2013-08-04 18:11:14.000000000 -0500 @@ -1282,7 +1282,7 @@ main (int argc, char *argv[]) write_test = TRUE; only_create_struct = FALSE; target_path = DEFAULT_TEST_DIR; -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 posix_compat = FALSE; #else posix_compat = TRUE; --- origsrc/glib-2.36.3/glib/gatomic.c 2013-08-04 20:21:20.907728300 -0500 +++ src/glib-2.36.3/glib/gatomic.c 2013-08-04 18:11:14.000000000 -0500 @@ -464,7 +464,7 @@ gsize return g_atomic_pointer_xor ((volatile gpointer *) atomic, val); } -#elif defined (G_PLATFORM_WIN32) +#elif defined (G_OS_WIN32) #include #if !defined(_M_AMD64) && !defined (_M_IA64) && !defined(_M_X64) && !(defined _MSC_VER && _MSC_VER <= 1200) --- origsrc/glib-2.36.3/glib/gcharset.c 2013-08-04 20:21:20.925729300 -0500 +++ src/glib-2.36.3/glib/gcharset.c 2013-08-04 18:11:14.000000000 -0500 @@ -496,7 +496,7 @@ guess_category_value (const gchar *categ if ((retval != NULL) && (retval[0] != '\0')) return retval; -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 /* g_win32_getlocale() first checks for LC_ALL, LC_MESSAGES and * LANG, which we already did above. Oh well. The main point of * calling g_win32_getlocale() is to get the thread's locale as used --- origsrc/glib-2.36.3/glib/gconvert.c 2013-08-04 20:21:20.933729800 -0500 +++ src/glib-2.36.3/glib/gconvert.c 2013-08-04 18:11:14.000000000 -0500 @@ -33,9 +33,6 @@ #ifdef G_OS_WIN32 #include "win_iconv.c" -#endif - -#ifdef G_PLATFORM_WIN32 #define STRICT #include #undef STRICT @@ -1258,7 +1255,7 @@ g_locale_from_utf8 (const gchar *utf8str charset, "UTF-8", bytes_read, bytes_written, error); } -#ifndef G_PLATFORM_WIN32 +#ifndef G_OS_WIN32 typedef struct _GFilenameCharsetCache GFilenameCharsetCache; @@ -1374,7 +1371,7 @@ g_get_filename_charsets (const gchar *** return cache->is_utf8; } -#else /* G_PLATFORM_WIN32 */ +#else /* G_OS_WIN32 */ gboolean g_get_filename_charsets (const gchar ***filename_charsets) @@ -1403,7 +1400,7 @@ g_get_filename_charsets (const gchar *** #endif } -#endif /* G_PLATFORM_WIN32 */ +#endif /* G_OS_WIN32 */ static gboolean get_filename_charset (const gchar **filename_charset) --- origsrc/glib-2.36.3/glib/gfileutils.c 2013-08-04 20:21:20.942730300 -0500 +++ src/glib-2.36.3/glib/gfileutils.c 2013-08-04 18:11:14.000000000 -0500 @@ -2153,7 +2153,7 @@ g_path_skip_root (const gchar *file_name { g_return_val_if_fail (file_name != NULL, NULL); -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 /* Skip \\server\share or //server/share */ if (G_IS_DIR_SEPARATOR (file_name[0]) && G_IS_DIR_SEPARATOR (file_name[1]) && @@ -2163,7 +2163,6 @@ g_path_skip_root (const gchar *file_name gchar *p; p = strchr (file_name + 2, G_DIR_SEPARATOR); -#ifdef G_OS_WIN32 { gchar *q; @@ -2171,7 +2170,6 @@ g_path_skip_root (const gchar *file_name if (p == NULL || (q != NULL && q < p)) p = q; } -#endif if (p && p > file_name + 2 && p[1]) { --- origsrc/glib-2.36.3/glib/glib.h 2013-08-04 20:21:20.949730700 -0500 +++ src/glib-2.36.3/glib/glib.h 2013-08-04 18:11:14.000000000 -0500 @@ -96,7 +96,7 @@ #include #include #include -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 #include #endif --- origsrc/glib-2.36.3/glib/gutf8.c 2013-08-04 20:21:20.984732700 -0500 +++ src/glib-2.36.3/glib/gutf8.c 2013-08-04 18:11:14.000000000 -0500 @@ -27,7 +27,7 @@ #endif #include -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 #include #define STRICT #include --- origsrc/glib-2.36.3/glib/gutils.c 2013-08-04 20:21:21.015734500 -0500 +++ src/glib-2.36.3/glib/gutils.c 2013-08-04 18:11:14.000000000 -0500 @@ -72,7 +72,7 @@ #include "garray.h" #include "glibintl.h" -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 #include "gconvert.h" #include "gwin32.h" #endif @@ -86,16 +86,13 @@ * These are portable utility functions. */ -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 # include # ifndef GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS # define GET_MODULE_HANDLE_EX_FLAG_UNCHANGED_REFCOUNT 2 # define GET_MODULE_HANDLE_EX_FLAG_FROM_ADDRESS 4 # endif # include /* For UNLEN */ -#endif /* G_PLATFORM_WIN32 */ - -#ifdef G_OS_WIN32 # include # include /* older SDK (e.g. msvc 5.0) does not have these*/ @@ -131,7 +128,7 @@ #include #endif -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 gchar * _glib_get_dll_directory (void) --- origsrc/glib-2.36.3/glib/gutils.h 2013-08-04 20:21:21.067737500 -0500 +++ src/glib-2.36.3/glib/gutils.h 2013-08-04 18:11:14.000000000 -0500 @@ -350,7 +350,7 @@ g_bit_storage (gulong number) * On non-Windows platforms, expands to nothing. */ -#ifndef G_PLATFORM_WIN32 +#ifndef G_OS_WIN32 # define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) #else # define G_WIN32_DLLMAIN_FOR_DLL_NAME(static, dll_name) \ @@ -378,7 +378,7 @@ DllMain (HINSTANCE hinstDLL, \ #endif /* !G_DISABLE_DEPRECATED */ -#endif /* G_PLATFORM_WIN32 */ +#endif /* G_OS_WIN32 */ G_END_DECLS --- origsrc/glib-2.36.3/glib/gwin32.h 2013-08-04 20:21:21.081738300 -0500 +++ src/glib-2.36.3/glib/gwin32.h 2013-08-04 18:11:14.000000000 -0500 @@ -33,7 +33,7 @@ #include -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 G_BEGIN_DECLS @@ -41,8 +41,6 @@ G_BEGIN_DECLS #define MAXPATHLEN 1024 #endif -#ifdef G_OS_WIN32 - /* * To get prototypes for the following POSIXish functions, you have to * include the indicated non-POSIX headers. The functions are defined @@ -68,7 +66,6 @@ G_BEGIN_DECLS GLIB_AVAILABLE_IN_ALL gint g_win32_ftruncate (gint f, guint size); -#endif /* G_OS_WIN32 */ /* The MS setlocale uses locale names of the form "English_United * States.1252" etc. We want the Unixish standard form "en", "zh_TW" @@ -112,7 +109,7 @@ gchar* g_win32_locale_filename_ G_END_DECLS -#endif /* G_PLATFORM_WIN32 */ +#endif /* G_OS_WIN32 */ #ifdef G_OS_WIN32 #ifdef _WIN64 --- origsrc/glib-2.36.3/glib/libcharset/localcharset.c 2013-08-04 20:21:21.095739100 -0500 +++ src/glib-2.36.3/glib/libcharset/localcharset.c 2013-08-04 18:11:14.000000000 -0500 @@ -46,10 +46,6 @@ # include # endif # endif -# ifdef __CYGWIN__ -# define WIN32_LEAN_AND_MEAN -# include -# endif #elif defined WIN32_NATIVE # define WIN32_LEAN_AND_MEAN # include @@ -111,7 +107,7 @@ _g_locale_get_charset_aliases (void) cp = charset_aliases; if (cp == NULL) { -#if !(defined VMS || defined WIN32_NATIVE || defined __CYGWIN__) +#if !(defined VMS || defined WIN32_NATIVE) FILE *fp; const char *dir; const char *base = "charset.alias"; @@ -237,7 +233,7 @@ _g_locale_get_charset_aliases (void) "DECKOREAN" "\0" "EUC-KR" "\0"; # endif -# if defined WIN32_NATIVE || defined __CYGWIN__ +# if defined WIN32_NATIVE /* To avoid the troubles of installing a separate file in the same directory as the DLL and of retrieving the DLL's directory at runtime, simply inline the aliases here. */ @@ -292,53 +288,6 @@ _g_locale_charset_raw (void) /* Most systems support nl_langinfo (CODESET) nowadays. */ codeset = nl_langinfo (CODESET); -# ifdef __CYGWIN__ - /* Cygwin 2006 does not have locales. nl_langinfo (CODESET) always - returns "US-ASCII". As long as this is not fixed, return the suffix - of the locale name from the environment variables (if present) or - the codepage as a number. */ - if (codeset != NULL && strcmp (codeset, "US-ASCII") == 0) - { - const char *locale; - static char buf[2 + 10 + 1]; - - locale = getenv ("LC_ALL"); - if (locale == NULL || locale[0] == '\0') - { - locale = getenv ("LC_CTYPE"); - if (locale == NULL || locale[0] == '\0') - locale = getenv ("LANG"); - } - if (locale != NULL && locale[0] != '\0') - { - /* If the locale name contains an encoding after the dot, return - it. */ - const char *dot = strchr (locale, '.'); - - if (dot != NULL) - { - const char *modifier; - - dot++; - /* Look for the possible @... trailer and remove it, if any. */ - modifier = strchr (dot, '@'); - if (modifier == NULL) - return dot; - if (modifier - dot < sizeof (buf)) - { - memcpy (buf, dot, modifier - dot); - buf [modifier - dot] = '\0'; - return buf; - } - } - } - - /* Woe32 has a function returning the locale's codepage as a number. */ - sprintf (buf, "CP%u", GetACP ()); - codeset = buf; - } -# endif - # else /* On old systems which lack it, use setlocale or getenv. */ --- origsrc/glib-2.36.3/glib/tests/uri.c 2013-08-04 20:21:21.104739600 -0500 +++ src/glib-2.36.3/glib/tests/uri.c 2013-08-04 18:11:14.000000000 -0500 @@ -56,7 +56,7 @@ to_uri_tests[] = { { "c:\\windows", "otherhost", NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_PATH}, #endif { "etc", "localhost", NULL, G_CONVERT_ERROR_NOT_ABSOLUTE_PATH}, -#ifndef G_PLATFORM_WIN32 +#ifndef G_OS_WIN32 { "/etc/\xE5\xE4\xF6", NULL, "file:///etc/%E5%E4%F6" }, { "/etc/\xC3\xB6\xC3\xA4\xC3\xA5", NULL, "file:///etc/%C3%B6%C3%A4%C3%A5"}, #endif --- origsrc/glib-2.36.3/tests/Makefile.am 2013-08-04 20:21:21.109739900 -0500 +++ src/glib-2.36.3/tests/Makefile.am 2013-08-04 18:11:14.000000000 -0500 @@ -20,7 +20,9 @@ libadd_libgmodule = $(libgmodule) libadd_libglib = $(libglib) if PLATFORM_WIN32 no_undefined = -no-undefined +endif +if OS_WIN32 module_test_exp = module-test.exp module-test.exp: module-test.o --- origsrc/glib-2.36.3/tests/testglib.c 2013-08-04 20:21:21.118740400 -0500 +++ src/glib-2.36.3/tests/testglib.c 2013-08-04 18:11:14.000000000 -0500 @@ -776,7 +776,7 @@ test_info (void) if (g_test_verbose()) { -#ifdef G_PLATFORM_WIN32 +#ifdef G_OS_WIN32 g_printerr ("current locale: %s\n", g_win32_getlocale ()); g_printerr ("found more.com as %s\n", g_find_program_in_path ("more.com")); --------------875EB5757B15CB2947245276 Content-Type: text/plain; charset=UTF-8; name="2.36.3-visibility.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="2.36.3-visibility.patch" --- origsrc/glib-2.36.3/configure.ac 2013-08-04 18:11:14.140206800 -0500 +++ src/glib-2.36.3/configure.ac 2013-08-04 18:30:21.852852200 -0500 @@ -3584,7 +3584,7 @@ dnl visibility attributes for symbol exp dnl GLIB_HIDDEN_VISIBILITY_CFLAGS="" case "$host" in - *-*-mingw*) + *-*-cygwin*|*-*-mingw*) dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport) AC_DEFINE([_GLIB_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern], [defines how to decorate public symbols while building]) --------------875EB5757B15CB2947245276 Content-Type: text/plain; charset=UTF-8; name="2.36.4-gspawn-cygwin.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="2.36.4-gspawn-cygwin.patch" --- origsrc/glib-2.36.4/glib/gspawn.c 2013-08-07 09:36:32.000000000 -0500 +++ src/glib-2.36.4/glib/gspawn.c 2013-10-21 13:25:34.502441400 -0500 @@ -1040,7 +1040,7 @@ fdwalk (int (*cb)(void *data, int fd), v struct rlimit rl; #endif -#ifdef __linux__ +#if defined(__linux__) || defined(__CYGWIN__) DIR *d; if ((d = opendir("/proc/self/fd"))) { --------------875EB5757B15CB2947245276 Content-Type: text/plain; charset=UTF-8; name="2.36.4-gutf8-cygwin.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="2.36.4-gutf8-cygwin.patch" Cygwin defines this since 1.7.8, but our wchar_t is only 16-bit while this code seems to assume 32-bit wchar_t. So, either some incorrect assumptions need to be fixed in the __STDC_ISO_10646__ code paths, or the conditionals need to also be guarded && (__SIZEOF_WCHAR_T__ == 4). Reported by SLao: http://article.gmane.org/gmane.os.cygwin.ports.general/1330 --- origsrc/glib-2.36.4/glib/gunicollate.c 2013-05-07 13:26:07.000000000 -0500 +++ src/glib-2.36.4/glib/gunicollate.c 2013-11-30 21:36:27.710188300 -0600 @@ -37,9 +37,12 @@ #include "gstrfuncs.h" #include "gtestutils.h" #include "gcharset.h" -#ifndef __STDC_ISO_10646__ +#if !defined(__STDC_ISO_10646__) || defined(G_WITH_CYGWIN) #include "gconvert.h" #endif +#ifdef G_WITH_CYGWIN +#undef __STDC_ISO_10646__ +#endif #ifdef _MSC_VER --------------875EB5757B15CB2947245276 Content-Type: text/plain; charset=UTF-8; name="2.38.2-gconvert-cygwin.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="2.38.2-gconvert-cygwin.patch" --- origsrc/glib-2.38.2/glib/gconvert.c 2014-04-02 01:48:25.505447200 -0500 +++ src/glib-2.38.2/glib/gconvert.c 2014-04-02 02:22:47.959345500 -0500 @@ -1583,7 +1583,9 @@ g_filename_from_uri (const gchar *uri, return NULL; } - if (has_case_prefix (path_part, "///")) + if (has_case_prefix (path_part, "////")) + path_part += 1; + else if (has_case_prefix (path_part, "///")) path_part += 2; else if (has_case_prefix (path_part, "//")) { --------------875EB5757B15CB2947245276 Content-Type: text/plain; charset=UTF-8; name="2.42.1-goption-cygwin.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="2.42.1-goption-cygwin.patch" --- origsrc/glib-2.42.1/glib/goption.c 2014-11-09 15:54:26.000000000 -0600 +++ src/glib-2.42.1/glib/goption.c 2015-01-01 19:39:40.385456500 -0600 @@ -1740,7 +1740,7 @@ free_pending_nulls (GOptionContext *cont static char * platform_get_argv0 (void) { -#if defined __linux +#if defined __linux || defined __CYGWIN__ char *cmdline; char *base_arg0; gsize len; --- origsrc/glib-2.42.1/glib/tests/option-argv0.c 2014-06-28 12:02:43.000000000 -0500 +++ src/glib-2.42.1/glib/tests/option-argv0.c 2015-01-01 19:39:34.848253300 -0600 @@ -27,7 +27,7 @@ #include #include -#if defined __linux || defined __OpenBSD__ +#if defined __linux || defined __OpenBSD__ || defined __CYGWIN__ static void test_platform_argv0 (void) { @@ -56,7 +56,7 @@ main (int argc, { g_test_init (&argc, &argv, "no_g_set_prgname", NULL); -#if defined __linux || defined __OpenBSD__ +#if defined __linux || defined __OpenBSD__ || defined __CYGWIN__ g_test_add_func ("/option/argv0", test_platform_argv0); #endif --------------875EB5757B15CB2947245276 Content-Type: text/plain; charset=UTF-8; name="2.56.4-dont-print-null-strings.patch" Content-Transfer-Encoding: 8bit Content-Disposition: attachment; filename="2.56.4-dont-print-null-strings.patch" --- origsrc/glib-2.56.4/gio/gdbusauth.c 2018-12-18 10:03:26.000000000 -0500 +++ src/glib-2.56.4/gio/gdbusauth.c 2020-05-23 08:58:55.003593200 -0400 @@ -1299,9 +1299,9 @@ _g_dbus_auth_run_server (GDBusAuth &line_length, cancellable, error); - debug_print ("SERVER: WaitingForBegin, read '%s'", line); if (line == NULL) goto out; + debug_print ("SERVER: WaitingForBegin, read '%s'", line); if (g_strcmp0 (line, "BEGIN") == 0) { /* YAY, done! */ --- origsrc/glib-2.56.4/gio/gdbusmessage.c 2018-12-18 10:03:26.000000000 -0500 +++ src/glib-2.56.4/gio/gdbusmessage.c 2020-05-23 09:18:23.976547300 -0400 @@ -2727,7 +2727,6 @@ g_dbus_message_to_blob (GDBusMessage if (message->body != NULL) { gchar *tupled_signature_str; - tupled_signature_str = g_strdup_printf ("(%s)", signature_str); if (signature == NULL) { g_set_error (error, @@ -2735,10 +2734,10 @@ g_dbus_message_to_blob (GDBusMessage G_IO_ERROR_INVALID_ARGUMENT, _("Message body has signature ā€œ%sā€ but there is no signature header"), signature_str); - g_free (tupled_signature_str); goto out; } - else if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0) + tupled_signature_str = g_strdup_printf ("(%s)", signature_str); + if (g_strcmp0 (tupled_signature_str, g_variant_get_type_string (message->body)) != 0) { g_set_error (error, G_IO_ERROR, --------------875EB5757B15CB2947245276 Content-Type: text/plain; charset=UTF-8; name="2.56-gmodule-cygwin.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="2.56-gmodule-cygwin.patch" --- origsrc/glib-2.56.4/gmodule/gmodule-win32.c 2018-08-15 12:22:08.000000000 -0400 +++ src/glib-2.56.4/gmodule/gmodule-win32.c 2020-05-23 08:29:18.332616700 -0400 @@ -37,7 +37,20 @@ #ifdef G_WITH_CYGWIN #include -#endif +#include + +static gchar* +fetch_dlerror (gboolean replace_null) +{ + gchar *msg = dlerror (); + + if (!msg && replace_null) + return "unknown dl-error"; + + return msg; +} + +#else static void set_error (const gchar *format, @@ -62,22 +75,26 @@ set_error (const gchar *format, g_free (error); } +#endif /* G_WITH_CYGWIN */ + /* --- functions --- */ static gpointer _g_module_open (const gchar *file_name, gboolean bind_lazy, gboolean bind_local) { - HINSTANCE handle; - wchar_t *wfilename; DWORD old_mode; BOOL success; #ifdef G_WITH_CYGWIN - gchar tmp[MAX_PATH]; + gpointer handle; - cygwin_conv_to_win32_path(file_name, tmp); - file_name = tmp; -#endif + handle = dlopen (file_name, + (bind_local ? RTLD_LOCAL : RTLD_GLOBAL) | (bind_lazy ? RTLD_LAZY : RTLD_NOW)); + if (!handle) + g_module_set_error (fetch_dlerror (TRUE)); +#else + HINSTANCE handle; + wchar_t *wfilename; wfilename = g_utf8_to_utf16 (file_name, -1, NULL, NULL, NULL); /* suppress error dialog */ @@ -91,26 +108,44 @@ _g_module_open (const gchar *file_name, if (!handle) set_error ("'%s': ", file_name); +#endif return handle; } +#ifndef G_WITH_CYGWIN static gint dummy; static gpointer null_module_handle = &dummy; +#endif static gpointer _g_module_self (void) { +#ifdef G_WITH_CYGWIN + gpointer handle; + + handle = dlopen (NULL, RTLD_GLOBAL | RTLD_LAZY); + if (!handle) + g_module_set_error (fetch_dlerror (TRUE)); + + return handle; +#else return null_module_handle; +#endif } static void _g_module_close (gpointer handle, gboolean is_unref) { +#ifdef G_WITH_CYGWIN + if (dlclose (handle) != 0) + g_module_set_error (fetch_dlerror (TRUE)); +#else if (handle != null_module_handle) if (!FreeLibrary (handle)) set_error (""); +#endif } static gpointer @@ -129,8 +164,19 @@ find_in_any_module_using_toolhelp (const if (Module32First (snapshot, &me32)) { do { - if ((p = GetProcAddress (me32.hModule, symbol_name)) != NULL) - break; + if ((p = GetProcAddress (me32.hModule, symbol_name)) != NULL) { +#ifdef G_WITH_CYGWIN + /* if symbol is found in another module, we probably do not want it */ + ssize_t size = cygwin_conv_path (CCP_WIN_A_TO_POSIX, me32.szExePath, NULL, 0); + char *posix = (char *) alloca (size); + cygwin_conv_path (CCP_WIN_A_TO_POSIX, me32.szExePath, posix, size); + if (g_strstr_len (posix, size, "/usr/lib") + || g_strstr_len (posix, size, "/usr/local/lib")) + p = NULL; + else +#endif + break; + } } while (Module32Next (snapshot, &me32)); } @@ -156,6 +202,13 @@ _g_module_symbol (gpointer handle, { gpointer p; +#ifdef G_WITH_CYGWIN + p = dlsym (handle, symbol_name); + if (!p) + p = find_in_any_module (symbol_name); + if (!p) + g_module_set_error (fetch_dlerror (FALSE)); +#else if (handle == null_module_handle) { if ((p = GetProcAddress (GetModuleHandle (NULL), symbol_name)) == NULL) @@ -166,6 +219,7 @@ _g_module_symbol (gpointer handle, if (!p) set_error (""); +#endif return p; } --------------875EB5757B15CB2947245276 Content-Type: text/plain; charset=UTF-8; name="glib2.0.cygport" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="glib2.0.cygport" ORIG_PN="glib" inherit gnome2 python NAME="glib2.0" VERSION=2.56.4 RELEASE=1 CATEGORY="Libs" SUMMARY="GNOME core C function library" DESCRIPTION="GLib is the low-level core library that forms the basis for projects such as GTK+ and GNOME. It provides data structure handling for C, portability wrappers, and interfaces for such runtime functionality as an event loop, threads, dynamic loading, and an object system." HOMEPAGE="http://www.gtk.org/" PATCH_URI=" 2.56-gmodule-cygwin.patch 2.36.3-not-win32.patch 2.36.4-gspawn-cygwin.patch 2.42.1-goption-cygwin.patch 2.34.3-m4macros.patch 2.36.3-visibility.patch 2.36.4-gutf8-cygwin.patch 2.38.2-gconvert-cygwin.patch 2.56.4-dont-print-null-strings.patch " # 2.36.4-gsocket-cygwin.patch # requires abstract sockets BUILD_REQUIRES="gnome-common \ gettext \ gettext-devel \ libfam-devel \ libiconv \ libpcre-devel \ zlib-devel" DISTCLEANFILES="gmodule/gmodule-cygwin.c gio/gdbus-2.0/codegen/config.py" # libelf: for gresource(1), only useful on ELF platforms CYGCONF_ARGS=" --disable-visibility --disable-libelf --with-libiconv=gnu --with-pcre=system --with-threads=posix ac_cv_header_winsock2_h=no ac_cv_header_mswsock_h=no " PKG_NAMES="lib${NAME}_0 lib${NAME}-devel lib${NAME}-doc" libglib2_0_0_SUMMARY="${SUMMARY} (runtime)" libglib2_0_0_REQUIRES="desktop-file-utils gsettings-desktop-schemas shared-mime-info tzdata" libglib2_0_0_CONTENTS=" etc/ usr/bin/cyg*-2.0-0.dll usr/bin/gapplication.exe usr/bin/gdbus.exe usr/bin/gio.exe usr/bin/gio-querymodules.exe usr/bin/glib-compile-schemas.exe usr/bin/gobject-query.exe usr/bin/gsettings.exe usr/lib/gio/ usr/share/doc/ usr/share/glib-2.0/schemas/ usr/share/locale/ usr/share/man/man1/gapplication.* usr/share/man/man1/gdbus.* usr/share/man/man1/gio* usr/share/man/man1/glib-compile-schemas* usr/share/man/man1/gobject* usr/share/man/man1/gsettings.* " libglib2_0_devel_SUMMARY="${SUMMARY} (development)" libglib2_0_devel_CONTENTS=" --exclude=glib-compile-schemas.[^html]* usr/bin/gdbus-codegen usr/bin/glib-* usr/bin/gresource* usr/bin/gtester* usr/include/gio-unix-2.0/ usr/include/glib-2.0/ usr/lib/glib-2.0/include/ usr/lib/lib*-2.0.dll.a usr/lib/pkgconfig/* usr/share/aclocal/ usr/share/gettext/ usr/share/glib-2.0/codegen/ usr/share/glib-2.0/gettext/ usr/share/man/man1/gdbus-codegen* usr/share/man/man1/glib-* usr/share/man/man1/gresource* usr/share/man/man1/gtester* " libglib2_0_doc_CATEGORY="Doc" libglib2_0_doc_CONTENTS="usr/share/gtk-doc/" glib2_0_debuginfo_CONTENTS+=" usr/share/glib-2.0/gdb/" PKG_IGNORE=" usr/share/glib-2.0/valgrind/ " src_install() { local giomodule_cache=/usr/lib/gio/modules/giomodule.cache local gschemas_compiled=/usr/share/glib-2.0/schemas/gschemas.compiled cd ${B} cyginstall completiondir=/etc/bash_completion.d rm -f ${D}/usr/lib/charset.alias pushd ${D}/usr/share/gdb/auto-load mkdir -p usr/bin mv libglib* usr/bin/cygglib-2.0-0.dll-gdb.py mv libgobject* usr/bin/cyggobject-2.0-0.dll-gdb.py popd python_optimize /usr/share/glib-2.0/gdb dodir /etc/postinstall /etc/preremove cat > ${D}/etc/postinstall/zp_${NAME}.sh < ${D}/etc/preremove/${NAME}.sh <