diff --git a/gnome/Chatty/Portfile b/gnome/Chatty/Portfile new file mode 100644 index 000000000000..a8c530da71fe --- /dev/null +++ b/gnome/Chatty/Portfile @@ -0,0 +1,69 @@ +# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4 + +PortSystem 1.0 +PortGroup compiler_blacklist_versions 1.0 +PortGroup gitlab 1.0 +PortGroup meson 1.0 + +gitlab.instance https://gitlab.gnome.org +gitlab.setup World Chatty 0.8.5 v +revision 0 +categories gnome +license GPL-3 +maintainers nomaintainer + +description SMS/MMS, Matrix and (optionally) XMPP messaging +long_description {*}${description} via ModemManager, mmsd-tng, libcmatrix \ + and libpurple. +use_bzip2 yes + +checksums rmd160 0616bcda715da407e0cb5525d37573c0691762bb \ + sha256 a613e44b1bf1d5e1d1332cc7233f7edfd141ac06f17c3a0833e0e4c65c37d858 \ + size 1516194 + +meson.wrap_mode nodownload + +# https://gitlab.gnome.org/World/Chatty/-/issues/950 +patchfiles-append patch-strchrnul.diff + +depends_build-append \ + port:appstream \ + port:gettext \ + port:itstool \ + path:bin/pkg-config:pkgconfig + +depends_lib-append path:lib/pkgconfig/cairo.pc:cairo \ + port:desktop-file-utils \ + port:evolution-data-server-gtk4 \ + path:lib/pkgconfig/gdk-pixbuf-2.0.pc:gdk-pixbuf2 \ + port:gettext-runtime \ + path:lib/pkgconfig/glib-2.0.pc:glib2 \ + port:gnome-desktop-gtk4 \ + path:lib/pkgconfig/gobject-introspection-1.0.pc:gobject-introspection \ + port:gstreamer1 \ + path:lib/pkgconfig/gtk+-4.0.pc:gtk4 \ + port:gtksourceview5 \ + port:libadwaita \ + port:libcmatrix \ + port:libfeedback \ + port:libmm-glib \ + port:libphonenumber-cpp \ + port:libpurple \ + path:lib/pkgconfig/pango.pc:pango \ + port:sqlite3 + +depends_run-append port:gsettings-desktop-schemas + +# protobuf3-cpp used by libphonenumber-cpp needs at least C++11, +# also: https://gitlab.gnome.org/World/Chatty/-/issues/951 +compiler.cxx_standard 2017 +compiler.blacklist-append \ + {clang} {macports-clang-1[0-7]} +# Compiler blacklists do not work correctly here. +compiler.whitelist macports-clang-19 macports-clang-18 \ + macports-gcc-14 macports-gcc-13 + +post-activate { + system "${prefix}/bin/gtk4-update-icon-cache -f -t ${prefix}/share/icons/hicolor" + system "${prefix}/bin/glib-compile-schemas ${prefix}/share/glib-2.0/schemas" +} diff --git a/gnome/Chatty/files/patch-strchrnul.diff b/gnome/Chatty/files/patch-strchrnul.diff new file mode 100644 index 000000000000..ab92cb0a0af6 --- /dev/null +++ b/gnome/Chatty/files/patch-strchrnul.diff @@ -0,0 +1,42 @@ +--- src/mm/chatty-sms-uri.c.orig 2024-08-22 02:36:26 ++++ src/mm/chatty-sms-uri.c 2024-10-10 18:52:36 +@@ -22,6 +22,15 @@ + #include "chatty-sms-uri.h" + #include "chatty-log.h" + ++#ifdef __APPLE__ ++static const char *chatty_strchrnul(const char *s, int c) { ++ const char *ptr = strchr(s, c); ++ if (!ptr) ++ ptr = s + strlen(s); ++ return ptr; ++} ++#endif ++ + /** + * SECTION: chatty-sms-uri + * @title: ChattySmsUri +@@ -120,7 +129,11 @@ + return; + + self->numbers_valid = TRUE; ++#ifdef __APPLE__ ++ end = chatty_strchrnul (self->uri, '?'); ++#else + end = strchrnul (self->uri, '?'); ++#endif + numbers = g_strndup (self->uri, end - self->uri); + number_start = numbers; + +@@ -172,7 +185,11 @@ + goto end; + + body = body + strlen ("body="); ++ #ifdef __APPLE__ ++ end = chatty_strchrnul (body, '&'); ++ #else + end = strchrnul (body, '&'); ++ #endif + text = g_strndup (body, end - body); + + self->body = g_uri_unescape_string (text, NULL);