From 0c8e4e536ddf0771f4ea4df1fdadf5de02d8faa2 Mon Sep 17 00:00:00 2001 From: EnumDev Date: Thu, 8 May 2025 17:19:00 +0300 Subject: [PATCH] Initial Commit --- pkg.info | 10 ++++++ source-files/libwebkit2gtk41.patch | 57 ++++++++++++++++++++++++++++++ source.sh | 30 ++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 pkg.info create mode 100644 source-files/libwebkit2gtk41.patch create mode 100644 source.sh diff --git a/pkg.info b/pkg.info new file mode 100644 index 0000000..25a27e0 --- /dev/null +++ b/pkg.info @@ -0,0 +1,10 @@ +name: ulauncher +description: Feature rich application Launcher for Linux +version: 5.15.7 +url: https://ulauncher.io/ +license: GPL3-or-later +architecture: any +depends: ["gdk-pixbuf","gtk3","libkeybinder3","libnotify","python-pycairo","python-dbus","python-pygobject","python-levenshtein","python-pyinotify","python-pyxdg","python-websocket-client","webkitgtk"] +optional_depends: ["libayatana-appindicator"] +make_depends: ["python-distutils-extra","python-setuptools"] +type: source diff --git a/source-files/libwebkit2gtk41.patch b/source-files/libwebkit2gtk41.patch new file mode 100644 index 0000000..e214560 --- /dev/null +++ b/source-files/libwebkit2gtk41.patch @@ -0,0 +1,57 @@ +From 08b52d22df8054fd6b8cd8e61dec72d8ab6dc846 Mon Sep 17 00:00:00 2001 +From: Albin Larsson +Date: Sat, 27 Apr 2024 14:13:36 +0200 +Subject: [PATCH] fix: support gir1.2-webkit2-4.1 for ubuntu 24.04 + +--- + debian/control | 2 +- + .../ui/windows/PreferencesUlauncherDialog.py | 4 ++-- + ulauncher/utils/WebKit2.py | 15 +++++++++++++++ + 3 files changed, 18 insertions(+), 3 deletions(-) + create mode 100644 ulauncher/utils/WebKit2.py + +diff --git a/ulauncher/ui/windows/PreferencesUlauncherDialog.py b/ulauncher/ui/windows/PreferencesUlauncherDialog.py +index 2fe19efaa..e4e304192 100644 +--- a/ulauncher/ui/windows/PreferencesUlauncherDialog.py ++++ b/ulauncher/ui/windows/PreferencesUlauncherDialog.py +@@ -12,10 +12,9 @@ + gi.require_version('Gio', '2.0') + gi.require_version('GLib', '2.0') + gi.require_version('Gtk', '3.0') +-gi.require_version('WebKit2', '4.0') + + # pylint: disable=wrong-import-position,unused-argument +-from gi.repository import Gio, Gtk, WebKit2, GLib # type: ignore ++from gi.repository import Gio, Gtk, GLib # type: ignore + + from ulauncher.api.shared.action.OpenAction import OpenAction + from ulauncher.ui.windows.HotkeyDialog import HotkeyDialog +@@ -39,6 +38,7 @@ + from ulauncher.utils.Settings import Settings + from ulauncher.utils.Router import Router, get_url_params + from ulauncher.utils.AutostartPreference import AutostartPreference ++from ulauncher.utils.WebKit2 import WebKit2 + from ulauncher.ui.AppIndicator import AppIndicator + from ulauncher.search.shortcuts.ShortcutsDb import ShortcutsDb + from ulauncher.config import get_data_file, get_options, get_version, EXTENSIONS_DIR +diff --git a/ulauncher/utils/WebKit2.py b/ulauncher/utils/WebKit2.py +new file mode 100644 +index 000000000..70589eb63 +--- /dev/null ++++ b/ulauncher/utils/WebKit2.py +@@ -0,0 +1,15 @@ ++import gi ++ ++# The package version refers to the "build environment". Not the actual Webkit version ++# 4.0 means it was built with GTK 3 and libsoup 2 ++# 4.1 means it was built with GTK 3 and libsoup 3 (HTTP/2) ++# 5.0 means it was built with GTK 4 and libsoup 3 (incompatible w Ulauncher, and was only supported for a short period) ++# 6.0 means the same as 5.0, but the API has major changes, and the package name was renamed, dropping the "2" ++# https://blog.tingping.se/2021/06/07/http2-in-libsoup.html ++# https://discourse.gnome.org/t/please-build-against-libsoup-3-by-default/10190 ++# https://bugs.webkit.org/show_bug.cgi?id=245296 ++try: ++ gi.require_version('WebKit2', '4.1') ++except ValueError: ++ gi.require_version('WebKit2', '4.0') ++from gi.repository import WebKit2 # type: ignore[attr-defined] # noqa: F401 diff --git a/source.sh b/source.sh new file mode 100644 index 0000000..f7a180e --- /dev/null +++ b/source.sh @@ -0,0 +1,30 @@ +# This is the source.sh script. It is executed by BPM in a temporary directory when compiling a source package +# BPM Expects the source code to be extracted into the automatically created 'source' directory which can be accessed using $BPM_SOURCE +# BPM Expects the output files to be present in the automatically created 'output' directory which can be accessed using $BPM_OUTPUT + +DOWNLOAD="https://github.com/Ulauncher/Ulauncher/releases/download/${BPM_PKG_VERSION}/ulauncher_${BPM_PKG_VERSION}.tar.gz" +FILENAME="${DOWNLOAD##*/}" + +# The prepare function is executed in the root of the temp directory +# This function is used for downloading files and putting them into the correct location +prepare() { + wget "$DOWNLOAD" + tar -xvf "$FILENAME" --strip-components=1 -C "$BPM_SOURCE" +} + +# The build function is executed in the source directory +# This function is used to compile the source code +build() { + # Patch for fixing webkit2gtk 4.1 compatability + patch -Np1 < "$BPM_WORKDIR"/libwebkit2gtk41.patch + + python setup.py build +} + +# The package function is executed in the source directory +# This function is used to move the compiled files into the output directory +package() { + python setup.py install --root="$BPM_OUTPUT" --prefix=/usr + + install -Dm644 LICENSE "$BPM_OUTPUT"/usr/share/licenses/ulauncher/LICENSE +}