Skip to content

Commit

Permalink
gajim: update to 1.9.3
Browse files Browse the repository at this point in the history
  • Loading branch information
barracuda156 committed Aug 28, 2024
1 parent 00be181 commit a5639e2
Show file tree
Hide file tree
Showing 2 changed files with 131 additions and 14 deletions.
43 changes: 29 additions & 14 deletions net/gajim/Portfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ PortGroup gitlab 1.0
PortGroup python 1.0

gitlab.instance https://dev.gajim.org
gitlab.setup gajim gajim 1.8.4
gitlab.setup gajim gajim 1.9.3
revision 0

categories net chat x11
Expand All @@ -24,40 +24,55 @@ supported_archs noarch
master_sites https://dev.gajim.org/gajim/gajim/-/archive/${version}/
use_bzip2 yes

checksums rmd160 050c844f9f2dc4682f2b6597b3ef4ad642e9c416 \
sha256 50d1f5f5376e52c2fb1d481b790877f19ed987d68ea9f39c915dd16286b6837d \
size 3076987
checksums rmd160 44756e3aea4e6a918c8b9ed63a38b69f330e80f1 \
sha256 c6064bece82aeb603e7e93102bebbf28a779f08a68ba7067ad56f821f0faea13 \
size 3112338

variant python310 conflicts python311 description {Use Python 3.10} {}
variant python311 conflicts python310 description {Use Python 3.11} {}
variant python310 conflicts python311 python312 description {Use Python 3.10} {}
variant python311 conflicts python310 python312 description {Use Python 3.11} {}
variant python312 conflicts python310 python311 description {Use Python 3.12} {}

if {![variant_isset python310]} {
default_variants +python311
if {![variant_isset python310] && ![variant_isset python311]} {
default_variants +python312
}

foreach pv {311 310} {
foreach pv {312 311 310} {
if {[variant_isset python${pv}]} {
python.default_version ${pv}
break
}
}

depends_build port:gettext \
depends_build-append \
port:gettext \
port:intltool \
path:bin/pkg-config:pkgconfig \
port:libtool
port:libtool \
path:bin/pkg-config:pkgconfig

depends_lib port:adwaita-icon-theme \
depends_lib-append port:adwaita-icon-theme \
path:lib/pkgconfig/gtk+-3.0.pc:gtk3 \
port:gtksourceview4 \
path:lib/pkgconfig/librsvg-2.0.pc:librsvg \
path:lib/pkgconfig/libsoup-2.4.pc:libsoup \
port:py${python.version}-certifi \
port:py${python.version}-css-parser \
port:py${python.version}-emoji \
port:py${python.version}-idna \
port:py${python.version}-keyring \
port:py${python.version}-nbxmpp \
port:py${python.version}-omemo-dr \
port:py${python.version}-pillow \
port:py${python.version}-pypng \
port:py${python.version}-qrcode
port:py${python.version}-qrcode \
port:py${python.version}-sqlalchemy

# https://dev.gajim.org/gajim/gajim/-/issues/11966
if {${os.platform} eq "darwin" && ${os.major} > 12} {
depends_run-append \
port:py${python.version}-pyobjc
} else {
patchfiles-append \
0001-Avoid-non-existing-unsupported-AppKit-module.patch
}

depends_run-append port:libayatana-appindicator
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
From 0927997834d8e0e715afa685b287e47ee39709ba Mon Sep 17 00:00:00 2001
From: Sergey Fedorov <[email protected]>
Date: Thu, 29 Aug 2024 00:34:41 +0800
Subject: [PATCH] Avoid non-existing / unsupported AppKit module

---
gajim/common/i18n.py | 13 +++++++------
gajim/common/sound.py | 35 ++++++++++++++++++-----------------
2 files changed, 25 insertions(+), 23 deletions(-)

diff --git gajim/common/i18n.py gajim/common/i18n.py
index 0c46f7e10..1d57c6cda 100644
--- gajim/common/i18n.py
+++ gajim/common/i18n.py
@@ -96,20 +96,21 @@ def _get_win32_default_lang() -> str:
windll = ctypes.windll.kernel32
return locale.windows_locale[windll.GetUserDefaultUILanguage()]

- @staticmethod
- def _get_darwin_default_lang() -> str:
- from AppKit import NSLocale
+# This invoked a non-existing module. Disable it.
+# @staticmethod
+# def _get_darwin_default_lang() -> str:
+# from AppKit import NSLocale

# FIXME: This returns a two letter language code (en, de, fr)
# We need a way to get en_US, de_DE etc.
- return NSLocale.currentLocale().languageCode()
+# return NSLocale.currentLocale().languageCode()

def _get_default_lang(self) -> str:
if sys.platform == 'win32':
return self._get_win32_default_lang()

- if sys.platform == 'darwin':
- return self._get_darwin_default_lang()
+# if sys.platform == 'darwin':
+# return self._get_darwin_default_lang()

return locale.getdefaultlocale()[0] or 'en'

diff --git gajim/common/sound.py gajim/common/sound.py
index e1cbce1a4..fe332ee8e 100644
--- gajim/common/sound.py
+++ gajim/common/sound.py
@@ -19,8 +19,9 @@
if sys.platform == 'win32' or typing.TYPE_CHECKING:
import winsound

-if sys.platform == 'darwin' or typing.TYPE_CHECKING:
- from AppKit import NSSound
+# This invoked a non-existing module. Disable it.
+# if sys.platform == 'darwin' or typing.TYPE_CHECKING:
+# from AppKit import NSSound

log = logging.getLogger('gajim.c.sound')

@@ -71,19 +72,19 @@ def loop_in_progress(self) -> bool:
return self._loop_in_progress


-class PlatformMacOS(PlaySound):
-
- def play(self, path: Path, loop: bool = False) -> None:
- assert NSSound is not None
- sound = NSSound.alloc()
- sound.initWithContentsOfFile_byReference_(str(path), True)
- sound.play()
-
- def stop(self) -> None:
- pass
-
- def loop_in_progress(self) -> bool:
- return False
+# class PlatformMacOS(PlaySound):
+#
+# def play(self, path: Path, loop: bool = False) -> None:
+# assert NSSound is not None
+# sound = NSSound.alloc()
+# sound.initWithContentsOfFile_byReference_(str(path), True)
+# sound.play()
+#
+# def stop(self) -> None:
+# pass
+#
+# def loop_in_progress(self) -> bool:
+# return False


class PlatformUnix(PlaySound):
@@ -149,8 +150,8 @@ def _init_platform() -> PlaySound:
if sys.platform == 'win32':
return PlatformWindows()

- if sys.platform == 'darwin':
- return PlatformMacOS()
+# if sys.platform == 'darwin':
+# return PlatformMacOS()

return PlatformUnix()

0 comments on commit a5639e2

Please sign in to comment.