summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuri Konotopov <ykonotopov@gnome.org>2024-05-28 19:44:43 +0400
committerJoonas Niilola <juippis@gentoo.org>2024-07-04 20:11:23 +0300
commit04b192a7dbb81ef2709986c9c0ae4ff871577550 (patch)
tree22eb053b45bf458a2ac1921219aac4410f9107d4
parentsci-libs/sundials: add 7.0.0 (diff)
downloadgentoo-04b192a7dbb81ef2709986c9c0ae4ff871577550.tar.gz
gentoo-04b192a7dbb81ef2709986c9c0ae4ff871577550.tar.bz2
gentoo-04b192a7dbb81ef2709986c9c0ae4ff871577550.zip
gnome-extra/gnome-browser-connector: use discovered python during build stage
Closes: https://bugs.gentoo.org/933072 Signed-off-by: Yuri Konotopov <ykonotopov@gnome.org> Signed-off-by: Joonas Niilola <juippis@gentoo.org>
-rw-r--r--gnome-extra/gnome-browser-connector/files/gnome-browser-connector-42.1-python-path.patch109
-rw-r--r--gnome-extra/gnome-browser-connector/gnome-browser-connector-42.1-r1.ebuild51
2 files changed, 160 insertions, 0 deletions
diff --git a/gnome-extra/gnome-browser-connector/files/gnome-browser-connector-42.1-python-path.patch b/gnome-extra/gnome-browser-connector/files/gnome-browser-connector-42.1-python-path.patch
new file mode 100644
index 000000000000..0234444bfe9f
--- /dev/null
+++ b/gnome-extra/gnome-browser-connector/files/gnome-browser-connector-42.1-python-path.patch
@@ -0,0 +1,109 @@
+From fd738093d293739787ae2fd87c67e634c45c7b7b Mon Sep 17 00:00:00 2001
+From: Yuri Konotopov <ykonotopov@gnome.org>
+Date: Tue, 28 May 2024 19:01:57 +0400
+Subject: [PATCH] meson: use discovered python interpreter to run build scripts
+
+See-Also: https://gitlab.gnome.org/GNOME/gnome-browser-extension/-/merge_requests/13
+See-Also: https://bugs.gentoo.org/933072
+---
+ contrib/merge_json.py | 2 --
+ meson.build | 22 +++++++++++++---------
+ 2 files changed, 13 insertions(+), 11 deletions(-)
+ mode change 100755 => 100644 contrib/merge_json.py
+
+diff --git a/contrib/merge_json.py b/contrib/merge_json.py
+old mode 100755
+new mode 100644
+index 8830a2a..41d22e3
+--- a/contrib/merge_json.py
++++ b/contrib/merge_json.py
+@@ -1,5 +1,3 @@
+-#!/usr/bin/python3
+-
+ import argparse
+ import json
+ import os
+diff --git a/meson.build b/meson.build
+index 3a162b5..9903cd6 100644
+--- a/meson.build
++++ b/meson.build
+@@ -8,19 +8,20 @@ project('gnome-browser-connector',
+ )
+
+ # Constants
++CONTRIB_PATH = meson.global_source_root() / 'contrib'
+ MANIFEST_FILENAME = 'org.gnome.browser_connector.json'
+ MANIFEST_LEGACY_FILENAME = 'org.gnome.chrome_gnome_shell.json'
+
+ # Dependencies
+ python_module = import('python')
+-py = python_module.find_installation('python3', required: true, modules: [
++py_install = python_module.find_installation('python3', required: true, modules: [
+ 'gi'
+ ])
+
+ # Configuration used in template files
+ config = configuration_data()
+ config.set('bindir', get_option('prefix') / get_option('bindir'))
+-config.set('python_path', py.path())
++config.set('python_path', py_install.path())
+
+ # Install scripts
+ foreach script : ['gnome-browser-connector', 'gnome-browser-connector-host']
+@@ -35,23 +36,24 @@ endforeach
+ # Python module
+ install_subdir(
+ 'gnome_browser_connector',
+- install_dir: py.get_install_dir(),
++ install_dir: py_install.get_install_dir(),
+ )
+
+ # Chrome/Chromium connector manifests
+ configure_file(
+- input: 'contrib' / MANIFEST_FILENAME,
++ input: CONTRIB_PATH / MANIFEST_FILENAME,
+ output: MANIFEST_FILENAME,
+ configuration: config,
+ )
+ configure_file(
+ input: [
+ meson.current_build_dir() / MANIFEST_FILENAME,
+- 'contrib' / MANIFEST_LEGACY_FILENAME,
++ CONTRIB_PATH / MANIFEST_LEGACY_FILENAME,
+ ],
+ output: MANIFEST_LEGACY_FILENAME,
+ command: [
+- 'contrib/merge_json.py',
++ py_install.path(),
++ CONTRIB_PATH / 'merge_json.py',
+ '--output', '@OUTPUT@',
+ '@INPUT@'
+ ],
+@@ -70,11 +72,12 @@ endforeach
+ configure_file(
+ input: [
+ meson.current_build_dir() / MANIFEST_FILENAME,
+- 'contrib/org.gnome.browser_connector.firefox.json',
++ CONTRIB_PATH / 'org.gnome.browser_connector.firefox.json',
+ ],
+ output: 'firefox-' + MANIFEST_FILENAME,
+ command: [
+- 'contrib/merge_json.py',
++ py_install.path(),
++ CONTRIB_PATH / 'merge_json.py',
+ '--delete', 'allowed_origins',
+ '--output', '@OUTPUT@',
+ '@INPUT@'
+@@ -87,7 +90,8 @@ configure_file(
+ ],
+ output: 'firefox-' + MANIFEST_LEGACY_FILENAME,
+ command: [
+- 'contrib/merge_json.py',
++ py_install.path(),
++ CONTRIB_PATH / 'merge_json.py',
+ '--output', '@OUTPUT@',
+ '@INPUT@'
+ ],
+--
+GitLab
+
diff --git a/gnome-extra/gnome-browser-connector/gnome-browser-connector-42.1-r1.ebuild b/gnome-extra/gnome-browser-connector/gnome-browser-connector-42.1-r1.ebuild
new file mode 100644
index 000000000000..eee9a523e059
--- /dev/null
+++ b/gnome-extra/gnome-browser-connector/gnome-browser-connector-42.1-r1.ebuild
@@ -0,0 +1,51 @@
+# Copyright 1999-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+PYTHON_COMPAT=( python3_{10..12} )
+
+inherit gnome.org meson python-single-r1 xdg
+
+DESCRIPTION="OS-native connector counterpart for GNOME Shell browser extension"
+HOMEPAGE="https://wiki.gnome.org/Projects/GnomeShellIntegration"
+
+LICENSE="GPL-3+"
+SLOT="0"
+KEYWORDS="~amd64 ~arm ~arm64 ~loong ~ppc64 ~x86"
+
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+DEPEND="${PYTHON_DEPS}
+ $(python_gen_cond_dep 'dev-python/pygobject:3[${PYTHON_USEDEP}]')
+"
+RDEPEND="${DEPEND}
+ gnome-base/gnome-shell
+"
+
+PATCHES=(
+ "${FILESDIR}/${P}-python-path.patch"
+)
+
+src_install() {
+ meson_src_install
+ python_fix_shebang "${D}/usr/bin/${PN}"
+ python_fix_shebang "${D}/usr/bin/${PN}-host"
+ python_optimize
+
+ if [[ $(get_libdir) != "lib" && "${SYMLINK_LIB}" != yes ]]; then
+ # Workaround www-client/firefox-bin manifests location
+ # Bug: https://bugs.gentoo.org/643522
+ insinto /usr/lib/mozilla/native-messaging-hosts
+ for id in chrome_gnome_shell browser_connector; do
+ doins "${ED}/usr/$(get_libdir)/mozilla/native-messaging-hosts/org.gnome.${id}.json"
+ done
+ fi
+}
+
+pkg_postinst() {
+ xdg_pkg_postinst
+
+ elog "Please note that this package provides OS-native connector only."
+ elog "You can install browser extension using link provided at"
+ elog "https://extensions.gnome.org website."
+}