diff --git a/build_sylpheed_macos.sh b/build_sylpheed_macos.sh index fd0ba33..788f2fd 100755 --- a/build_sylpheed_macos.sh +++ b/build_sylpheed_macos.sh @@ -53,7 +53,7 @@ EOF mkdir -p "${HOME}/gtk/inst/lib/pkgconfig" "${HOME}/gtk/inst/include/enchant-2" cp -a "${SOURCE_DIR}/enchant/enchant.h" "${HOME}/gtk/inst/include/enchant-2/" -clang "${SOURCE_DIR}/enchant/enchant.m" -O3 -DNDEBUG -dynamiclib -fPIC -current_version 9.8.0 -compatibility_version 9.0.0 \ +clang "${SOURCE_DIR}/enchant/enchant.m" -O3 -DNDEBUG -dynamiclib -fPIC -current_version 11.1.0 -compatibility_version 11.0.0 \ -mmacos-version-min=${MACOSX_DEPLOYMENT_TARGET} -arch arm64 -framework AppKit -framework Foundation \ -Weverything -Wno-gnu-zero-variadic-macro-arguments -Wno-documentation-unknown-command -Wno-poison-system-directories \ -Wno-declaration-after-statement \ @@ -66,7 +66,7 @@ includedir=\${prefix}/include Name: libenchant Description: A spell checking library -Version: 2.6.8 +Version: 2.8.1 Libs: -L\${libdir} -lenchant-2 Cflags: -I\${includedir}/enchant-2 EOF @@ -171,7 +171,7 @@ EOF mkdir -p "${HOME}/gtk/inst/lib/pkgconfig" "${HOME}/gtk/inst/include/enchant-2" cp -a "${SOURCE_DIR}/enchant/enchant.h" "${HOME}/gtk/inst/include/enchant-2/" -clang "${SOURCE_DIR}/enchant/enchant.m" -O3 -DNDEBUG -dynamiclib -fPIC -current_version 9.8.0 -compatibility_version 9.0.0 \ +clang "${SOURCE_DIR}/enchant/enchant.m" -O3 -DNDEBUG -dynamiclib -fPIC -current_version 11.1.0 -compatibility_version 11.0.0 \ -mmacos-version-min=${MACOSX_DEPLOYMENT_TARGET} -arch x86_64 -framework AppKit -framework Foundation \ -Weverything -Wno-gnu-zero-variadic-macro-arguments -Wno-documentation-unknown-command -Wno-poison-system-directories \ -Wno-declaration-after-statement \ @@ -184,7 +184,7 @@ includedir=\${prefix}/include Name: libenchant Description: A spell checking library -Version: 2.6.8 +Version: 2.8.1 Libs: -L\${libdir} -lenchant-2 Cflags: -I\${includedir}/enchant-2 EOF diff --git a/enchant/enchant.h b/enchant/enchant.h index 12c7169..69592e2 100644 --- a/enchant/enchant.h +++ b/enchant/enchant.h @@ -1,4 +1,4 @@ -/* enchant +/** \file enchant.h * Copyright (C) 2003 Dom Lachowicz * Copyright (C) 2016-2024 Reuben Thomas * @@ -9,7 +9,7 @@ * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public License @@ -38,11 +38,16 @@ extern "C" { #endif -typedef struct str_enchant_broker EnchantBroker; -typedef struct str_enchant_dict EnchantDict; +typedef struct _EnchantBroker EnchantBroker; +typedef struct _EnchantDict EnchantDict; const char *enchant_get_version (void); +/** + * Note: strings are all UTF-8, except for file names and paths, which are + * in the GLib file name encoding. + */ + /** * enchant_broker_init * @@ -62,9 +67,10 @@ void enchant_broker_free (EnchantBroker * broker); /** * enchant_broker_request_dict * @broker: A non-null #EnchantBroker - * @tag: The non-null language tag you wish to request a dictionary for ("en_US", "de_DE", ...) + * @tag: The non-null language tag or tags you wish to request a dictionary + * for ("en_US", "de_DE", "en_US,fr_FR", ...) * - * Returns: An #EnchantDict, or %null if no suitable dictionary could be found. This dictionary is reference counted. + * Returns: An #EnchantDict, or %null if no suitable dictionary could be found. * The default personal wordlist file is used. */ EnchantDict *enchant_broker_request_dict (EnchantBroker * broker, const char *const tag); @@ -72,23 +78,23 @@ EnchantDict *enchant_broker_request_dict (EnchantBroker * broker, const char *co /** * enchant_broker_request_dict_with_pwl * @broker: A non-null #EnchantBroker - * @tag: The non-null language tag you wish to request a dictionary for ("en_US", "de_DE", ...) - * @pwl: A non-null pathname in the GLib file name encoding (UTF-8 on Windows) to the personal wordlist file - * - * Returns: An #EnchantDict, or %null if no suitable dictionary could be found, or if the pwl could not be opened. - * This dictionary is reference counted. + * @tag: The non-null language tag or tags you wish to request a dictionary + * for ("en_US", "de_DE", "en_US,fr_FR", ...) + * @pwl: The full path of a personal wordlist file, or %null to default to + * "TAG.dic" in the user's configuration directory, where TAG is the + * first tag in @tag. + * + * Returns: An #EnchantDict, or %null if no suitable dictionary could be + * found, or if the PWL could not be opened. */ EnchantDict *enchant_broker_request_dict_with_pwl (EnchantBroker * broker, const char *const tag, const char *pwl); /** * enchant_broker_request_pwl_dict + * @pwl: The full path of a personal wordlist file * - * PWL is a personal wordlist file, 1 entry per line - * - * @pwl: A non-null pathname in the GLib file name encoding (UTF-8 on Windows) - * to the personal wordlist file - * - * Returns: An EnchantDict. This dictionary is reference counted. + * Returns: An #EnchantDict, or %null if no suitable dictionary could be + * found, or if the PWL could not be opened. */ EnchantDict *enchant_broker_request_pwl_dict (EnchantBroker * broker, const char *const pwl); @@ -97,16 +103,18 @@ EnchantDict *enchant_broker_request_pwl_dict (EnchantBroker * broker, const char * @broker: A non-null #EnchantBroker * @dict: A non-null #EnchantDict * - * Releases the dictionary when you are done using it. Must only be called once per dictionary request + * Frees the dictionary when you are finished with it. Must be called at + * most once per #EnchantDict. */ void enchant_broker_free_dict (EnchantBroker * broker, EnchantDict * dict); /** * enchant_broker_dict_exists * @broker: A non-null #EnchantBroker - * @tag: The non-null language tag you wish to request a dictionary for ("en_US", "de_DE", ...) + * @tag: The non-null language tag you wish to request a dictionary for + * ("en_US", "de_DE", ...) * - * Return existance of the requested dictionary (1 == true, 0 == false) + * Returns: 1 if the dictionary exists, and 0 otherwise. */ int enchant_broker_dict_exists (EnchantBroker * broker, const char * const tag); @@ -117,10 +125,7 @@ int enchant_broker_dict_exists (EnchantBroker * broker, const char * const tag); * @ordering: A non-null ordering (nuspell,aspell,hunspell,hspell) * * Declares a preference of dictionaries to use for the language - * described/referred to by @tag. The ordering is a comma delimited - * list of provider names. As a special exception, the "*" tag can - * be used as a language tag to declare a default ordering for any - * language that does not explictly declare an ordering. + * referred to by @tag; see enchant(5) for more details. */ void enchant_broker_set_ordering (EnchantBroker * broker, const char * const tag, @@ -129,8 +134,8 @@ void enchant_broker_set_ordering (EnchantBroker * broker, * enchant_broker_get_error * @broker: A non-null broker * - * Returns a const char string or NULL describing the last exception in UTF-8 encoding. - * WARNING: The error message may not be valid UTF-8. + * Returns a possibly-invalid UTF-8 string describing the last error, or + * %null. * WARNING: error is transient and is likely cleared as soon as the * next broker operation happens. */ @@ -138,12 +143,13 @@ const char *enchant_broker_get_error (EnchantBroker * broker); /** * EnchantBrokerDescribeFn - * @provider_name: The provider's identifier, such as "hunspell" or "aspell", in UTF-8 encoding - * @provider_desc: A description of the provider, such as "Aspell 0.53" in UTF-8 encoding - * @provider_dll_file: The provider's DLL filename in Glib file encoding (UTF-8 on Windows) + * @provider_name: The provider's identifier, such as "hunspell" or + * "aspell". + * @provider_desc: A description of the provider, such as "Aspell 0.53". + * @provider_dll_file: The provider's DLL filename. * @user_data: Supplied user data, or %null if you don't care * - * Callback used to enumerate and describe Enchant's various providers + * Callback used to enumerate and describe Enchant's various providers. */ typedef void (*EnchantBrokerDescribeFn) (const char * const provider_name, const char * const provider_desc, @@ -156,8 +162,8 @@ typedef void (*EnchantBrokerDescribeFn) (const char * const provider_name, * @fn: A non-null #EnchantBrokerDescribeFn * @user_data: Optional user-data * - * Enumerates the Enchant providers and tells - * you some rudimentary information about them. + * Enumerates the Enchant providers and tells you some rudimentary + * information about them. */ void enchant_broker_describe (EnchantBroker * broker, EnchantBrokerDescribeFn fn, @@ -166,27 +172,24 @@ void enchant_broker_describe (EnchantBroker * broker, /** * enchant_dict_check * @dict: A non-null #EnchantDict - * @word: The non-null word you wish to check, in UTF-8 encoding - * @len: The byte length of @word, or -1 for strlen (@word) - * - * Will return an "incorrect" value if any of those pre-conditions - * are not met. + * @word: The non-null word you wish to check + * @len: The length of @word in bytes, or -1 for strlen(@word) * - * Returns: 0 if the word is correctly spelled, positive if not, negative if error + * Returns: 0 if the word is correctly spelled, positive if not, negative on + * invalid arguments or other error. */ int enchant_dict_check (EnchantDict * dict, const char *const word, ssize_t len); /** * enchant_dict_suggest * @dict: A non-null #EnchantDict - * @word: The non-null word you wish to find suggestions for, in UTF-8 encoding - * @len: The byte length of @word, or -1 for strlen (@word) - * @out_n_suggs: The location to store the # of suggestions returned, or %null + * @word: The non-null word you wish to find suggestions for + * @len: The length of @word in bytes, or -1 for strlen(@word) + * @out_n_suggs: The location in which to store the number of suggestions + * returned, or %null * - * Will return a %null value if any of those pre-conditions - * is not met. - * - * Returns: A %null terminated list of UTF-8 encoded suggestions, or %null + * Returns: A %null terminated list of suggestions, or %null if any of the + * pre-conditions is not met. */ char **enchant_dict_suggest (EnchantDict * dict, const char *const word, ssize_t len, size_t * out_n_suggs); @@ -194,20 +197,19 @@ char **enchant_dict_suggest (EnchantDict * dict, const char *const word, /** * enchant_dict_add * @dict: A non-null #EnchantDict - * @word: The non-null word you wish to add to your personal dictionary, in UTF-8 encoding - * @len: The byte length of @word, or -1 for strlen (@word) + * @word: The non-null word you wish to add to your personal dictionary + * @len: The length of @word in bytes, or -1 for strlen(@word) * - * The word is also added to the session. If the word exists in the exclude - * dictionary, it will be removed from the exclude dictionary. + * The word is also added to the session. The word is removed from the exclude + * dictionary if present there. */ void enchant_dict_add (EnchantDict * dict, const char *const word, ssize_t len); /** * enchant_dict_add_to_session * @dict: A non-null #EnchantDict - * @word: The non-null word you wish to add to this spell-checking session, in UTF-8 encoding - * @len: The byte length of @word, or -1 for strlen (@word) - * + * @word: The non-null word you wish to add to this session + * @len: The length of @word in bytes, or -1 for strlen(@word) */ void enchant_dict_add_to_session (EnchantDict * dict, const char *const word, ssize_t len); @@ -215,8 +217,8 @@ void enchant_dict_add_to_session (EnchantDict * dict, const char *const word, ss * enchant_dict_remove * @dict: A non-null #EnchantDict * @word: The non-null word you wish to add to your exclude dictionary and - * remove from the personal dictionary, in UTF-8 encoding - * @len: The byte length of @word, or -1 for strlen (@word) + * remove from the personal dictionary + * @len: The length of @word in bytes, or -1 for strlen(@word) * * The word is also removed from the session. */ @@ -225,37 +227,43 @@ void enchant_dict_remove (EnchantDict * dict, const char *const word, ssize_t le /** * enchant_dict_remove_from_session * @dict: A non-null #EnchantDict - * @word: The non-null word you wish to exclude from this spell-checking session, in UTF-8 encoding - * @len: The byte length of @word, or -1 for strlen (@word) - * + * @word: The non-null word you wish to exclude from this session + * @len: The length of @word in bytes, or -1 for strlen(@word) */ void enchant_dict_remove_from_session (EnchantDict * dict, const char *const word, ssize_t len); /** * enchant_dict_is_added * @dict: A non-null #EnchantDict - * @word: The word you wish to see if it has been added (to your session or dict) in UTF-8 encoding - * @len: the byte length of @word, or -1 for strlen (@word) + * @word: The word you wish to check + * @len: the length of @word in bytes, or -1 for strlen(@word) + * + * Returns: 1 if the word is valid in the session, 0 if not. */ int enchant_dict_is_added (EnchantDict * dict, const char *const word, ssize_t len); /** * enchant_dict_is_removed * @dict: A non-null #EnchantDict - * @word: The word you wish to see if it has been removed (from your session or dict) in UTF-8 encoding - * @len: the byte length of @word, or -1 for strlen (@word) + * @word: The word you wish to check + * @len: the length of @word in bytes, or -1 for strlen(@word) + * + * Returns: 1 if the word is specifically excluded from the session, 0 if + * not; that is, it is in the exclude dictionary or in the session exclude + * list, and has not been added to the session include list. */ int enchant_dict_is_removed (EnchantDict * dict, const char *const word, ssize_t len); /** * enchant_dict_store_replacement * @dict: A non-null #EnchantDict - * @mis: The non-null word you wish to add a correction for, in UTF-8 encoding - * @mis_len: The byte length of @mis, or -1 for strlen (@mis) - * @cor: The non-null correction word, in UTF-8 encoding - * @cor_len: The byte length of @cor, or -1 for strlen (@cor) + * @mis: The non-null word for which you wish to add a correction + * @mis_len: The length of @mis in bytes, or -1 for strlen(@mis) + * @cor: The non-null correction word + * @cor_len: The length of @cor in bytes, or -1 for strlen(@cor) * - * Does nothing; API is deprecated and retained only for backwards compatibility. + * Deprecated: 2.5.0: does nothing; the API is retained only for backwards + * compatibility. */ void enchant_dict_store_replacement (EnchantDict * dict, const char *const mis, ssize_t mis_len, @@ -266,7 +274,7 @@ void enchant_dict_store_replacement (EnchantDict * dict, * @dict: A non-null #EnchantDict * @string_list: A non-null string list returned from enchant_dict_suggest * - * Releases the string list + * Releases the string list. */ void enchant_dict_free_string_list (EnchantDict * dict, char **string_list); @@ -274,8 +282,8 @@ void enchant_dict_free_string_list (EnchantDict * dict, char **string_list); * enchant_dict_get_error * @dict: A non-null #EnchantDict * - * Returns a const char string or NULL describing the last exception in UTF-8 encoding. - * WARNING: The error message may not be valid UTF-8. + * Returns: a possibly-invalid UTF-8 string describing the last exception, + * or %null. * WARNING: error is transient. It will likely be cleared as soon as * the next dictionary operation is called. */ @@ -285,12 +293,13 @@ const char *enchant_dict_get_error (EnchantDict * dict); * enchant_dict_get_extra_word_characters * @dict: A non-null #EnchantDict * - * Returns a const char UTF-8-encoded string containing the non-letter characters - * allowed in a word, e.g. "01234567890’-". If dash occurs, it will be last, so that - * the string can be appended to a character class used to match word characters. + * Returns: a string containing the non-letter characters allowed in a word, + * e.g. "01234567890’-". If hyphen occurs, it will be last, so that the + * string can be appended to a character class used to match word + * characters. * - * Words containing non-letters not in this string will automatically be rejected - * by Enchant. + * Words containing non-letters not in this string will automatically be + * rejected by Enchant. * * Note that for some back-ends the result may be a guess, in which case it * may include characters not actually allowed in the given dictionary. @@ -300,34 +309,42 @@ const char *enchant_dict_get_extra_word_characters (EnchantDict * dict); /** * enchant_dict_is_word_character * @dict: An #EnchantDict, or %null - * @uc: A unicode code-point + * @uc: A Unicode code-point * @n: An integer: 0 if the character is at the start of a word, 1 if it is - * in the middle, or 2 if at the end. + * in the middle, or 2 if at the end. * - * Returns a flag specifying whether the given character is valid at the - * given position. + * Returns: 1 if the given character is valid at the given position, + * otherwise 0. * - * One way to match a complete word is to check that the first character matches - * with n == 0, then proceed matching characters with n == 1 until failure, then - * proceed backwards until a character matches with n == 2. + * One way to match a complete word is to check that the first character + * matches with n == 0, then proceed matching characters with n == 1 until + * failure, then proceed backwards until a character matches with n == 2. * * Note that for some back-ends the result may be a guess, in which case it * may allow characters not actually allowed in the given dictionary. * - * If @dict is %null, a built-in implementation is used (FIXME: We should document - * behavior for this). If @n is not 0, 1 or 2, then a false flag is returned. + * If @dict is %null, a built-in implementation is used which implements the + * following rules: + * + * * Apostrophe is accepted anywhere except at the end of a word. + * * Dashes are accepted in the middle of a word. + * * Letters, numbers, connecting punctuation and marks are accepted + * anywhere in a word. + * + * If @n is not 0, 1 or 2, then 0 is returned. */ int enchant_dict_is_word_character (EnchantDict * dict, uint32_t uc, size_t n); /** * EnchantDictDescribeFn - * @lang_tag: The dictionary's language tag (eg: en_US, de_AT, ...) - * @provider_name: The provider's name (eg: Aspell) in UTF-8 encoding - * @provider_desc: The provider's description (eg: Aspell 0.50.3) in UTF-8 encoding - * @provider_file: The DLL/SO where this dict's provider was loaded from in Glib file encoding (UTF-8 on Windows) - * @user_data: Supplied user data, or %null if you don't care - * - * Callback used to describe an individual dictionary + * @lang_tag: The dictionary's language tag (e.g. en_US, de_AT, ...) + * @provider_name: The provider's name (e.g. "Aspell") + * @provider_desc: The provider's description (e.g. "Aspell 0.50.3") + * @provider_file: The full path of the dynamic library from which this + * dictionary's provider was loaded + * @user_data: User data pointer, or %null + * + * Callback used to describe a dictionary. */ typedef void (*EnchantDictDescribeFn) (const char * const lang_tag, const char * const provider_name, @@ -341,7 +358,7 @@ typedef void (*EnchantDictDescribeFn) (const char * const lang_tag, * @dict: A non-null #EnchantDictDescribeFn * @user_data: Optional user-data * - * Describes an individual dictionary + * Describes a dictionary. */ void enchant_dict_describe (EnchantDict * dict, EnchantDictDescribeFn fn, @@ -353,8 +370,7 @@ void enchant_dict_describe (EnchantDict * dict, * @fn: A non-null #EnchantDictDescribeFn * @user_data: Optional user-data * - * Enumerates the dictionaries available from - * all Enchant providers. + * Enumerates the dictionaries available from all Enchant providers. */ void enchant_broker_list_dicts (EnchantBroker * broker, EnchantDictDescribeFn fn, @@ -363,10 +379,8 @@ void enchant_broker_list_dicts (EnchantBroker * broker, /** * enchant_set_prefix_dir * - * Set the prefix dir. This overrides any auto-detected value, - * and can also be used on systems or installations where - * auto-detection does not work. - * + * Sets the prefix dir. This overrides any auto-detected value, and can also + * be used on systems or installations where auto-detection does not work. */ void enchant_set_prefix_dir(const char *); diff --git a/enchant/enchant.m b/enchant/enchant.m index 34c41ae..960384b 100644 --- a/enchant/enchant.m +++ b/enchant/enchant.m @@ -1,8 +1,8 @@ /* clang enchant.m -O3 \ -dynamiclib -fPIC \ - -current_version 9.8.0 \ - -compatibility_version 9.0.0 \ + -current_version 11.1.0 \ + -compatibility_version 11.0.0 \ -mmacos-version-min=10.9 \ -framework AppKit \ -framework Foundation \ @@ -48,12 +48,12 @@ } \ } while (0) -struct str_enchant_broker +struct _EnchantBroker { NSSpellChecker *checker; }; -struct str_enchant_dict +struct _EnchantDict { NSSpellChecker *checker; NSString *language; diff --git a/modulesets/bootstrap.modules b/modulesets/bootstrap.modules index ad4acb6..6ac1637 100644 --- a/modulesets/bootstrap.modules +++ b/modulesets/bootstrap.modules @@ -8,7 +8,6 @@ - @@ -54,9 +53,7 @@ - - - + @@ -115,7 +112,7 @@ - + @@ -123,7 +120,7 @@ - + @@ -175,7 +172,7 @@ - + @@ -211,12 +208,12 @@ - + - + @@ -237,7 +234,7 @@ - + @@ -245,12 +242,12 @@ - + - + @@ -273,7 +270,7 @@ - + @@ -282,9 +279,9 @@ - - - + + + @@ -378,7 +375,7 @@ - + @@ -412,12 +409,12 @@ - + - + diff --git a/patches/0001-XZ-disable-futimens.patch b/patches/0001-XZ-disable-futimens.patch index cecee18..fe934d9 100644 --- a/patches/0001-XZ-disable-futimens.patch +++ b/patches/0001-XZ-disable-futimens.patch @@ -8,20 +8,20 @@ Subject: [PATCH] XZ: disable futimens 1 file changed, 3 insertions(+) diff --git a/config.h.in b/config.h.in -index c8ba420..f95b12c 100644 +index 95f8cce..ade4346 100644 --- a/config.h.in +++ b/config.h.in -@@ -133,7 +133,10 @@ - #undef HAVE_FCNTL_H +@@ -151,7 +151,10 @@ + #undef HAVE_FUNC_ATTRIBUTE_CONSTRUCTOR - /* Define to 1 if you have the `futimens' function. */ + /* Define to 1 if you have the 'futimens' function. */ +/* +// warning: 'futimens' is only available on macOS 10.13 or newer [-Wunguarded-availability-new] #undef HAVE_FUTIMENS +*/ - /* Define to 1 if you have the `futimes' function. */ + /* Define to 1 if you have the 'futimes' function. */ #undef HAVE_FUTIMES -- -2.37.0 (Apple Git-136) +2.39.3 (Apple Git-146)