From 60a4c0a4efe279f989140d65451cf35a2dfef443 Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Sat, 19 Nov 2022 12:49:16 +1000 Subject: [PATCH] AbiWord: add recipe for 3.0.5 version * enable gtk backend --- app-office/abiword/abiword-3.0.5.recipe | 137 ++++++++++++++++ .../abiword/additional-files/abiword.rdef.in | 44 +++++ .../abiword/patches/abiword-3.0.5.patchset | 152 ++++++++++++++++++ 3 files changed, 333 insertions(+) create mode 100644 app-office/abiword/abiword-3.0.5.recipe create mode 100644 app-office/abiword/additional-files/abiword.rdef.in create mode 100644 app-office/abiword/patches/abiword-3.0.5.patchset diff --git a/app-office/abiword/abiword-3.0.5.recipe b/app-office/abiword/abiword-3.0.5.recipe new file mode 100644 index 000000000..78ea96a08 --- /dev/null +++ b/app-office/abiword/abiword-3.0.5.recipe @@ -0,0 +1,137 @@ +SUMMARY="A free word processing program similar to Microsoft® Word" +DESCRIPTION="AbiWord is a free word processing program similar to Microsoft® \ +Word. It is suitable for a wide variety of word processing tasks. + +AbiWord allows you to collaborate with multiple people on one document at the \ +same time. It is tightly integrated with the AbiCollab.net web service, which \ +lets you store documents online, allows easy document sharing with your \ +friends, and performs format conversions on the fly." +HOMEPAGE="https://www.abisource.com/" +COPYRIGHT="1998-2021 the AbiSource community" +LICENSE="GNU GPL v2" +REVISION="1" +SOURCE_URI="https://www.abisource.com/downloads/abiword/$portVersion/source/abiword-$portVersion.tar.gz" +CHECKSUM_SHA256="1257247e9970508d6d1456d3e330cd1909c4b42b25e0f0a1bc32526d6f3a21b4" +SOURCE_DIR="abiword-$portVersion" +PATCHES="abiword-$portVersion.patchset" +ADDITIONAL_FILES="abiword.rdef.in" + +ARCHITECTURES="all !x86_gcc2" +SECONDARY_ARCHITECTURES="x86" + +PROVIDES=" + abiword$secondaryArchSuffix = $portVersion + app:AbiWord = $portVersion + lib:libabiword_3.0$secondaryArchSuffix = $portVersion + " +REQUIRES=" + haiku$secondaryArchSuffix + shared_mime_info$secondaryArchSuffix + lib:libatk_1.0$secondaryArchSuffix + lib:libcairo$secondaryArchSuffix + lib:libenchant_2$secondaryArchSuffix + lib:libexpat$secondaryArchSuffix + lib:libfribidi$secondaryArchSuffix + lib:libfreetype$secondaryArchSuffix + lib:libfontconfig$secondaryArchSuffix + lib:libgdk_3$secondaryArchSuffix + lib:libgdk_pixbuf_2.0$secondaryArchSuffix + lib:libgio_2.0$secondaryArchSuffix + lib:libglib_2.0$secondaryArchSuffix + lib:libgmodule_2.0$secondaryArchSuffix + lib:libgobject_2.0$secondaryArchSuffix + lib:libgsf_1$secondaryArchSuffix + lib:libgthread_2.0$secondaryArchSuffix + lib:libgtk_3$secondaryArchSuffix + lib:libharfbuzz$secondaryArchSuffix + lib:libical$secondaryArchSuffix + lib:libiconv$secondaryArchSuffix + lib:libintl$secondaryArchSuffix + lib:libjpeg$secondaryArchSuffix + lib:libpango_1.0$secondaryArchSuffix + lib:libpangocairo_1.0$secondaryArchSuffix + lib:libpng16$secondaryArchSuffix + lib:librsvg_2$secondaryArchSuffix + lib:libx11$secondaryArchSuffix + lib:libxml2$secondaryArchSuffix + lib:libxslt$secondaryArchSuffix + lib:libz$secondaryArchSuffix + " + +BUILD_REQUIRES=" + haiku${secondaryArchSuffix}_devel + gsettings_desktop_schemas$secondaryArchSuffix + devel:libboost_system$secondaryArchSuffix >= 1.70.0 + devel:libenchant_2$secondaryArchSuffix + devel:libexpat$secondaryArchSuffix + devel:libfribidi$secondaryArchSuffix + devel:libfreetype$secondaryArchSuffix + devel:libfontconfig$secondaryArchSuffix + devel:libgcrypt$secondaryArchSuffix + devel:libgdk_pixbuf_2.0$secondaryArchSuffix + devel:libgtk_3$secondaryArchSuffix + devel:libglib_2.0$secondaryArchSuffix + devel:libgmodule_2.0$secondaryArchSuffix + devel:libgsf_1$secondaryArchSuffix + devel:libharfbuzz$secondaryArchSuffix + devel:libical$secondaryArchSuffix + devel:libiconv$secondaryArchSuffix + devel:libjpeg$secondaryArchSuffix + devel:libpango_1.0$secondaryArchSuffix + devel:libpangocairo_1.0$secondaryArchSuffix + devel:libpng16$secondaryArchSuffix + devel:librsvg_2$secondaryArchSuffix + devel:libwpd_0.10$secondaryArchSuffix + devel:libwpg_0.3$secondaryArchSuffix + devel:libwmf$secondaryArchSuffix + devel:libwv$secondaryArchSuffix + devel:libxml2$secondaryArchSuffix + devel:libxslt$secondaryArchSuffix + devel:libz$secondaryArchSuffix + " +BUILD_PREREQUIRES=" + cmd:autoconf + cmd:automake + cmd:awk + cmd:cmp + cmd:find + cmd:gcc$secondaryArchSuffix + cmd:make + cmd:perl + cmd:pkg_config$secondaryArchSuffix + " + +BUILD() +{ + export LIBS="-lglib-2.0 -lgmodule-2.0" + runConfigure ./configure --with-icondir=$dataDir/icons + make $jobArgs +} + +INSTALL() +{ + make install + mkdir -p $appsDir + mv $binDir/abiword $appsDir/AbiWord + rm -rf $binDir $developDir $libDir/pkgconfig + rm $libDir/abiword-3.0/plugins/*.la + rm $libDir/*.la + rm $dataDir/icons/hicolor/icon-theme.cache + + local APP_SIGNATURE="application/x-vnd.abisource-abiword" + local MAJOR="`echo "$portVersion" | cut -d. -f1`" + local MIDDLE="`echo "$portVersion" | cut -d. -f2`" + local MINOR="`echo "$portVersion" | cut -d. -f3`" + local LONG_INFO="$SUMMARY" + sed \ + -e "s|@APP_SIGNATURE@|$APP_SIGNATURE|" \ + -e "s|@MAJOR@|$MAJOR|" \ + -e "s|@MIDDLE@|$MIDDLE|" \ + -e "s|@MINOR@|$MINOR|" \ + -e "s|@LONG_INFO@|$LONG_INFO|" \ + $portDir/additional-files/abiword.rdef.in > $sourceDir/abiword.rdef + + addResourcesToBinaries $sourceDir/abiword.rdef $appsDir/AbiWord + + addAppDeskbarSymlink $appsDir/AbiWord +} diff --git a/app-office/abiword/additional-files/abiword.rdef.in b/app-office/abiword/additional-files/abiword.rdef.in new file mode 100644 index 000000000..01cc689fe --- /dev/null +++ b/app-office/abiword/additional-files/abiword.rdef.in @@ -0,0 +1,44 @@ + +resource app_flags B_MULTIPLE_LAUNCH; + +resource app_version { + major = @MAJOR@, + middle = @MIDDLE@, + minor = @MINOR@, + + variety = B_APPV_FINAL, + internal = 0, + + short_info = "AbiWord", + long_info = "@LONG_INFO@" +}; + +resource app_signature "@APP_SIGNATURE@"; + +resource vector_icon { + $"6E6369660504006F020106023F80000000000000003F900046000047000000F0" + $"F6FDFF0670E805FF04FF330500060606FF075C415C415CC64F405DC5E95DB996" + $"5D244124C64F24B9FC4025B99625C5E9255C415CB9FC5C41410606FF075C405C" + $"405CC5E9405CC5E95CB9965C244024C5E924B9964024B99624C5E9245C405CB9" + $"965C40400607FF1FC4A5C407C4A5C407C0F6C5E6B923C898BD2AC7A8B910C897" + $"B8EFC893B8FFC896B998C915BB12C9DCBA50C983BCE7C92BC05DC747BEABC844" + $"C1E5C65AC4A5C407C35FC54DC4A5C407C407020FBFC926BFC926BF17B56FBDE9" + $"B677BE64B5F8BBB9B8B8B915BE83BA63BBABB7FDC0ECB685C604B72BC372B70F" + $"C6CCB868C822B7B1C782B836C78FB8B1C610B88CC698B9B2C2B8BCBEBC73BB42" + $"BF96BD55BB75BEEFB9B5BDC0BA17C016B994C170BB8EC0D7BAB9C3D3BF50C811" + $"C729C614C32BC843C6F2C8A1C67DC873C6B8C747C1BAC30DB8D2C588BD14C255" + $"B7BCC0B6B5B0C1AEB68FC06BB574BFC926C01AB55FBFC926BFC926BFC926BFC9" + $"260211C4A5C3A1C4A5C3A1C0F6C580B923C832BD2AC742B7D7C830B8B1C5AAB8" + $"7BC673B9B2C252BCBEBC0DBB42BF30BD55BB0FBEEFB94FBDC0B9B1C016B92EC1" + $"70BB28C0D8BA53C3E1BEFFC833C706C62E48C8B6C817C9B5CA3CC937C929C83C" + $"C40CC30DB86CC640BDE9C255B756C0B6B54AC1AEB629BFC5B48BBDE9B611BE9C" + $"B558BBB9B852B915BE1DBA63BB44B78EC17AB5D2C8B0B68EC511B590C9E9B7DF" + $"CA6BB6C9CACCBAE1C9C6C05DC6E1BDB4C86DC1E5C5F4C4A5C3A0C35FC4E7C4A5" + $"C3A1C4A5C3A1C4A5C3A1C4A5C3A1020A40244024BCCAB497B7DCB7DCB9F4B5C4" + $"B5C4B9F424BFBF24BCCA24BFD3B49ABFFBB499BFE7B4B1B9E3BFBF25B9A7B4FF" + $"C5D125CAE5BFEACAC5B9D9CAE6BFDCCAE7BFBFCAE7BFCECAE7BCCAC7A3B7DCC9" + $"BBB9F4C58BB5C4BFBFB497C2B5B497BFBFB4974024BFBFB4974024060A040101" + $"301F1E01178400040A000100023FEDB60000000000003C92494489244AC6490A" + $"010101201F1E0A00020302024016880000000000003F38B1BD1CF246CAC60A04" + $"0104301F1E01178422040A020104201F1E" +}; diff --git a/app-office/abiword/patches/abiword-3.0.5.patchset b/app-office/abiword/patches/abiword-3.0.5.patchset new file mode 100644 index 000000000..d7bd77b56 --- /dev/null +++ b/app-office/abiword/patches/abiword-3.0.5.patchset @@ -0,0 +1,152 @@ +From aaf43fa8ca17fb2a44dab2a8f5f5224e7e2c902f Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sun, 30 Oct 2022 19:25:47 +1000 +Subject: enchant2 support + + +diff --git a/configure b/configure +index 00b716c..e0bca69 100755 +--- a/configure ++++ b/configure +@@ -4213,7 +4213,7 @@ xp_pkgs=" + " + + # optional deps +-enchant_req='enchant >= 1.2.0' ++enchant_req='enchant-2 >= 1.2.0' + gio_req='gio-2.0' + goffice_req='libgoffice-0.10 >= 0.10.0' + +diff --git a/src/af/xap/xp/enchant_checker.cpp b/src/af/xap/xp/enchant_checker.cpp +index ed97c1f..165de98 100644 +--- a/src/af/xap/xp/enchant_checker.cpp ++++ b/src/af/xap/xp/enchant_checker.cpp +@@ -127,7 +127,7 @@ EnchantChecker::_suggestWord (const UT_UCSChar *ucszWord, size_t len) + pvSugg->addItem (ucszSugg); + } + +- enchant_dict_free_suggestions (m_dict, suggestions); ++ enchant_dict_free_string_list (m_dict, suggestions); + } + + return pvSugg; +@@ -139,7 +139,7 @@ bool EnchantChecker::addToCustomDict (const UT_UCSChar *word, size_t len) + + if (word && len) { + UT_UTF8String utf8 (word, len); +- enchant_dict_add_to_personal (m_dict, utf8.utf8_str(), utf8.byteLength()); ++ enchant_dict_add (m_dict, utf8.utf8_str(), utf8.byteLength()); + return true; + } + return false; +@@ -150,7 +150,7 @@ bool EnchantChecker::isIgnored (const UT_UCSChar *toCorrect, size_t toCorrectLen + UT_return_val_if_fail (m_dict, false); + + UT_UTF8String ignore (toCorrect, toCorrectLen); +- return enchant_dict_is_in_session (m_dict, ignore.utf8_str(), ignore.byteLength()) != 0; ++ return enchant_dict_is_added (m_dict, ignore.utf8_str(), ignore.byteLength()) != 0; + } + + void EnchantChecker::ignoreWord (const UT_UCSChar *toCorrect, size_t toCorrectLen) +-- +2.37.3 + + +From 7e03d4c1dad941f1e872aa6d8e7948c4260e4c94 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sun, 30 Oct 2022 19:07:33 +1000 +Subject: Dirty hack for XDG variables + + +diff --git a/src/wp/main/gtk/UnixMain.cpp b/src/wp/main/gtk/UnixMain.cpp +index f19c841..07d03b9 100644 +--- a/src/wp/main/gtk/UnixMain.cpp ++++ b/src/wp/main/gtk/UnixMain.cpp +@@ -27,6 +27,14 @@ + + int main(int argc, char ** argv) + { ++#ifdef __HAIKU__ ++ g_setenv ("XDG_CONFIG_DIRS", "/boot/system/settings", FALSE); ++ g_setenv ("XDG_DATA_HOME", "/boot/home/config/non-packaged/data", FALSE); ++ g_setenv ("XDG_CONFIG_HOME", "/boot/home/config/settings", FALSE); ++ g_setenv ("XDG_CACHE_HOME", "/boot/home/config/cache", FALSE); ++ g_setenv ("XDG_DATA_DIRS", "/boot/system/non-packaged/data:/boot/system/data", FALSE); ++#endif ++ + return AP_UnixApp::main(PACKAGE_NAME, argc, argv); + } + +-- +2.37.3 + + +From 486245f74b7684650dca7faaf7a1a8652a002a02 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sun, 30 Oct 2022 19:26:24 +1000 +Subject: glib2 segfault fix + + +diff --git a/src/af/util/xp/ut_go_file.cpp b/src/af/util/xp/ut_go_file.cpp +index 63c21b1..4c2e615 100644 +--- a/src/af/util/xp/ut_go_file.cpp ++++ b/src/af/util/xp/ut_go_file.cpp +@@ -1002,6 +1002,12 @@ UT_go_basename_from_uri (const char *uri) + GFile *f = g_file_new_for_uri (uri); + char *basename = g_file_get_basename (f); + g_object_unref (G_OBJECT (f)); ++ if (!basename) // Try again since the "uri" might just be a plain path. ++ { ++ f = g_file_new_for_path (uri); ++ basename = g_file_get_basename (f); ++ g_object_unref (G_OBJECT (f)); ++ } + #elif defined(GOFFICE_WITH_GNOME) + char *raw_uri = gnome_vfs_unescape_string (uri, G_DIR_SEPARATOR_S); + char *basename = raw_uri ? g_path_get_basename (raw_uri) : NULL; +-- +2.37.3 + + +From 32227f11065c56f334bbf8a5b013ac3a484cfd96 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Sat, 19 Nov 2022 12:37:25 +1000 +Subject: Lose precision fix from gentoo + + +diff --git a/src/af/xap/xp/xap_Dialog.cpp b/src/af/xap/xp/xap_Dialog.cpp +index dd210a8..3e92bf0 100644 +--- a/src/af/xap/xp/xap_Dialog.cpp ++++ b/src/af/xap/xp/xap_Dialog.cpp +@@ -36,8 +36,8 @@ + + XAP_Dialog::XAP_Dialog(XAP_DialogFactory * pDlgFactory, XAP_Dialog_Id id, + const char * helpUrl ) +- : m_pApp ( NULL ), m_pDlgFactory ( pDlgFactory ), m_id ( id ), +- m_helpUrl(NULL) ++ : m_pApp ( nullptr ), m_pDlgFactory ( pDlgFactory ), m_id ( id ), ++ m_helpUrl(nullptr) + { + m_pApp = pDlgFactory->getApp(); + +@@ -235,7 +235,7 @@ XAP_Frame * XAP_Dialog_Modeless::getActiveFrame(void) const + // This function returns the frame currently connected to a modeless dialog + + XAP_Frame * pFrame = m_pApp->getLastFocussedFrame(); +- if(pFrame == (XAP_Frame *) NULL) ++ if(pFrame == (XAP_Frame *) nullptr) + { + pFrame = m_pApp->getFrame(0); + } +@@ -267,7 +267,7 @@ XAP_Dialog_Modeless::BuildWindowName(char * pWindowName, const char * pDialogNam + // This function constructs and returns the window name of a modeless dialog by + // concatenating the active frame with the dialog name + +- *pWindowName = (char) NULL; ++ *pWindowName = (char) 0; + UT_UTF8String wn = UT_UTF8String(pDialogName); + + XAP_Frame* pFrame = getActiveFrame(); +-- +2.37.3 +