From 18f4a30800a2a8f90e74f0488fd7e9bccc736a8e Mon Sep 17 00:00:00 2001 From: David Guglielmi Date: Mon, 6 Jan 2020 23:07:17 +0100 Subject: [PATCH] x11-misc/gpaste: Port to meson build, apply upstream patches to 3.32.0 --- x11-misc/gpaste/Manifest | 5 +- ....32.0-detect-when-images-are-growing.patch | 83 ++++++++ ...ome-shel-only-var-should-be-exported.patch | 179 ++++++++++++++++++ x11-misc/gpaste/gpaste-3.32.0-r1.ebuild | 87 +++++++++ x11-misc/gpaste/gpaste-3.34.1.ebuild | 42 ++-- 5 files changed, 378 insertions(+), 18 deletions(-) create mode 100644 x11-misc/gpaste/files/gpaste-3.32.0-detect-when-images-are-growing.patch create mode 100644 x11-misc/gpaste/files/gpaste-3.32.0-gnome-shel-only-var-should-be-exported.patch create mode 100644 x11-misc/gpaste/gpaste-3.32.0-r1.ebuild diff --git a/x11-misc/gpaste/Manifest b/x11-misc/gpaste/Manifest index bc643e7..bdb88d4 100644 --- a/x11-misc/gpaste/Manifest +++ b/x11-misc/gpaste/Manifest @@ -1,5 +1,8 @@ +AUX gpaste-3.32.0-detect-when-images-are-growing.patch 3827 BLAKE2B fb2eabd32799e33e6d4f7f79d03cc1c2922794854278704eadd11572497102bf01d6b19a25bb5e7ad1c587ae3ba1a589656c7ac38136b8ce0ffabbdad595c5b7 SHA512 bb36d05f062dc36e04405b57a5fa50558c43d1f60c54d3e9f0ec44d93afe7f165ae1caba36e9cd4ccb2c239b34fc2027bb32c75eb8e7b053136f2049fc1082bc +AUX gpaste-3.32.0-gnome-shel-only-var-should-be-exported.patch 6299 BLAKE2B d23fcc7257c04f3ac927ac47807bd9026bdedf90d21ce40c6d69403b5fe59792338c4a7c74d56d2d5a540d2c75843742c537ddb3705a80fc68d572cf0a2adb98 SHA512 a64a858d8b5aac40e7428eda98e7d38b937f91f75d4ebb5406e5f1a0fe5f3f24ec1b25bbc112f7df709dbaf51b9f1425325c5425e7a891b393a3a2c43eda8bc0 DIST gpaste-3.32.0.tar.gz 181159 BLAKE2B 664151a5cb9653158ad8c137951fbfc402c400421bbd0324598804135aa654407ff0e67ccd8c4f9c025423aa609df3278e64ac50af09033933ef3f0e26d88032 SHA512 f60983c50742c05bf42347ffdaeb00ad1bb691f7d752d8773545dd59f7bf7485e095e26e799983261ee41180b66631e99fa4b6c196057c1ec47e2e138dfa8160 DIST gpaste-3.34.1.tar.gz 184922 BLAKE2B 3498d949706d79ae59dc1dae6cf547a9c6a32d539b3ede737b243abe4eea057869d9c06ed7fa7f81741f901f80f44554502a00b1b047d957086eb86898fb0b88 SHA512 0560b7a0616eaf271d13e2db98f924894236e2714f97d80e6dce1bbb3589073b812b4c641d5fe0557a17e4e05b7506ab90418c7b45ddf953059b970fd4eac52e +EBUILD gpaste-3.32.0-r1.ebuild 1771 BLAKE2B d923c99bbcd3ace5c4fd26d9f0668d34b19bd4a9fcd933309c6367808519077a315218b8ee0e43ddc5a04f8e833bfeb7584289dc9ce6fda9d40118da6b10d0c9 SHA512 6c42afd55e5810379b99024130783ea5065e60756a75694e70f924f3d659fec880e4a2292a181f78b894919a395e606ddc62027bd694f31acd44769f74fd3219 EBUILD gpaste-3.32.0.ebuild 1534 BLAKE2B 8a7afb1cdad5725e1b3f432998984a47784affe793156ce880044f9ec647656b78c7e3ccd94ff4a35f9a5d73a59756a8856edd72a4df194ab66548199ad49351 SHA512 23bde3de55c201bace9d7e6c60926e1d5fc87b4a39b6004a74e3d34b3e1040cb204bf432d9249360c94e050292c47d5d08b65a1a06ca6982c626647481c0415f -EBUILD gpaste-3.34.1.ebuild 1523 BLAKE2B 82ebc1125a4e84fc1435d5207eed986abc89f13dabc48bdcc3f38ee2a7f651c7f2dbf60b9413ab4be4d406c607a9605b717223f467097d3b01f299029dc98953 SHA512 69fb53a1fb3e667e3d48adade3bb84343beea85fbc138dd23eabb10567d4b2879df9048fb99a3afff79fd455523c28d10df24305b2711db3ddaa6117ac781d58 +EBUILD gpaste-3.34.1.ebuild 1760 BLAKE2B 38a35c1d79c511d1c61ade9e83ecfe5d034021365459acf6d474918651b1c303ff580c7db9cf643d5a56014092eb8061964f0e81f1c0902c20f5721e558599bc SHA512 c0877701396bc902b9122a3f181e8fcf04274423df459ee942a1a7ec9fa5af115fac56afedb31e87f5ca1246bf2a6e7a9e1129c08f8096d7ded2e067be4e77d0 MISC metadata.xml 595 BLAKE2B 7a8327f78e0e4cb106350051ff89a5677401e9ffa2d833e424da1f14a89c3147e59be124e6e0a26a3609f57c8a6078a00b6fce6a8f36889bafa5021539c0d89a SHA512 8fca7baa9d40775abe8ce7db98c5fc8e882d96e6200db5d84b6b1964369d6c499e344b30826c405368a18ca0f2caeab94d8dc44f648fe10f317075d82f60ca3d diff --git a/x11-misc/gpaste/files/gpaste-3.32.0-detect-when-images-are-growing.patch b/x11-misc/gpaste/files/gpaste-3.32.0-detect-when-images-are-growing.patch new file mode 100644 index 0000000..ad20b5f --- /dev/null +++ b/x11-misc/gpaste/files/gpaste-3.32.0-detect-when-images-are-growing.patch @@ -0,0 +1,83 @@ +From d195bf0ebc2ed82b49cb83ce9cbad8a7fa492c34 Mon Sep 17 00:00:00 2001 +From: Marc-Antoine Perennou +Date: Tue, 7 May 2019 15:58:46 +0200 +Subject: [PATCH] detect when images are growing + +Signed-off-by: Marc-Antoine Perennou +--- + src/libgpaste/core/gpaste-history.c | 3 +++ + src/libgpaste/core/gpaste-image-item.c | 18 ++++++++++++++++++ + src/libgpaste/core/gpaste-image-item.h | 3 +++ + src/libgpaste/libgpaste.sym | 5 +++++ + 4 files changed, 29 insertions(+), 0 deletions(-) + +diff --git a/src/libgpaste/core/gpaste-history.c b/src/libgpaste/core/gpaste-history.c +index 7936fab1..02f2b4fa 100644 +--- a/src/libgpaste/core/gpaste-history.c ++++ b/src/libgpaste/core/gpaste-history.c +@@ -214,6 +214,9 @@ g_paste_history_private_is_growing_line (GPasteHistoryPrivate *priv, + GPasteItem *old, + GPasteItem *new) + { ++ if (_G_PASTE_IS_IMAGE_ITEM (old) && _G_PASTE_IS_IMAGE_ITEM (new)) ++ return g_paste_image_item_is_growing (_G_PASTE_IMAGE_ITEM (new), _G_PASTE_IMAGE_ITEM (old)); ++ + if (!(g_paste_settings_get_growing_lines (priv->settings) && + _G_PASTE_IS_TEXT_ITEM (old) && _G_PASTE_IS_TEXT_ITEM (new) && + !_G_PASTE_IS_PASSWORD_ITEM (old) && !_G_PASTE_IS_PASSWORD_ITEM (new))) +diff --git a/src/libgpaste/core/gpaste-image-item.c b/src/libgpaste/core/gpaste-image-item.c +index 7b3a3244..2b30a6c6 100644 +--- a/src/libgpaste/core/gpaste-image-item.c ++++ b/src/libgpaste/core/gpaste-image-item.c +@@ -80,6 +80,24 @@ g_paste_image_item_get_image (const GPasteImageItem *self) + return priv->image; + } + ++G_PASTE_VISIBLE gboolean ++g_paste_image_item_is_growing (const GPasteImageItem *self, ++ const GPasteImageItem *other) ++{ ++ g_return_val_if_fail (_G_PASTE_IS_IMAGE_ITEM (self), FALSE); ++ g_return_val_if_fail (_G_PASTE_IS_IMAGE_ITEM (other), FALSE); ++ ++ const GPasteImageItemPrivate *priv = _g_paste_image_item_get_instance_private (self); ++ const GPasteImageItemPrivate *_priv = _g_paste_image_item_get_instance_private (other); ++ ++ if (!priv->image || !_priv->image) ++ return FALSE; ++ ++ gsize len = MIN (gdk_pixbuf_get_byte_length (priv->image), gdk_pixbuf_get_byte_length (_priv->image)); ++ ++ return !memcmp (gdk_pixbuf_read_pixels (priv->image), gdk_pixbuf_read_pixels (_priv->image), len); ++} ++ + static gboolean + g_paste_image_item_equals (const GPasteItem *self, + const GPasteItem *other) +diff --git a/src/libgpaste/core/gpaste-image-item.h b/src/libgpaste/core/gpaste-image-item.h +index bfc74896..b658109b 100644 +--- a/src/libgpaste/core/gpaste-image-item.h ++++ b/src/libgpaste/core/gpaste-image-item.h +@@ -23,6 +23,9 @@ const gchar *g_paste_image_item_get_checksum (const GPasteImageItem *self); + const GDateTime *g_paste_image_item_get_date (const GPasteImageItem *self); + GdkPixbuf *g_paste_image_item_get_image (const GPasteImageItem *self); + ++gboolean g_paste_image_item_is_growing (const GPasteImageItem *self, ++ const GPasteImageItem *other); ++ + GPasteItem *g_paste_image_item_new (GdkPixbuf *img); + GPasteItem *g_paste_image_item_new_from_file (const gchar *path, + GDateTime *date); +diff --git a/src/libgpaste/libgpaste.sym b/src/libgpaste/libgpaste.sym +index daf6329e..650d2a26 100644 +--- a/src/libgpaste/libgpaste.sym ++++ b/src/libgpaste/libgpaste.sym +@@ -505,3 +505,8 @@ global: + g_paste_util_empty_with_confirmation; + g_paste_util_empty_with_confirmation_sync; + } LIBGPASTE_3_28_1; ++ ++LIBGPASTE_3_32_1 { ++global: ++ g_paste_iimage_item_is_growing; ++} LIBGPASTE_3_28_3; diff --git a/x11-misc/gpaste/files/gpaste-3.32.0-gnome-shel-only-var-should-be-exported.patch b/x11-misc/gpaste/files/gpaste-3.32.0-gnome-shel-only-var-should-be-exported.patch new file mode 100644 index 0000000..9a50b56 --- /dev/null +++ b/x11-misc/gpaste/files/gpaste-3.32.0-gnome-shel-only-var-should-be-exported.patch @@ -0,0 +1,179 @@ +From 1eaed802448e5262cc4d3d7b9b95a408ff89494c Mon Sep 17 00:00:00 2001 +From: Marc-Antoine Perennou +Date: Sun, 17 Mar 2019 14:20:10 +0100 +Subject: [PATCH] gnome-shel: only var should be exported + +Fixes part of #268 + +Signed-off-by: Marc-Antoine Perennou +--- + src/gnome-shell/aboutItem.js | 2 +- + src/gnome-shell/deleteButton.js | 2 +- + src/gnome-shell/deleteItemPart.js | 2 +- + src/gnome-shell/dummyHistoryItem.js | 2 +- + src/gnome-shell/emptyHistoryItem.js | 2 +- + src/gnome-shell/item.js | 2 +- + src/gnome-shell/pageItem.js | 2 +- + src/gnome-shell/pageSwitcher.js | 2 +- + src/gnome-shell/searchItem.js | 2 +- + src/gnome-shell/stateSwitch.js | 2 +- + src/gnome-shell/statusIcon.js | 2 +- + src/gnome-shell/uiItem.js | 2 +- + 12 files changed, 12 insertions(+), 12 deletions(-) + +diff --git a/src/gnome-shell/aboutItem.js b/src/gnome-shell/aboutItem.js +index b4a7ff86..6c7bd972 100644 +--- a/src/gnome-shell/aboutItem.js ++++ b/src/gnome-shell/aboutItem.js +@@ -6,7 +6,7 @@ + + const { St } = imports.gi; + +-class GPasteAboutItem { ++var GPasteAboutItem = class { + constructor(client, menu) { + this.actor = new St.Button({ + reactive: true, +diff --git a/src/gnome-shell/deleteButton.js b/src/gnome-shell/deleteButton.js +index 93816a1a..3de6160e 100644 +--- a/src/gnome-shell/deleteButton.js ++++ b/src/gnome-shell/deleteButton.js +@@ -6,7 +6,7 @@ + + const { Clutter, St } = imports.gi; + +-class GPasteDeleteButton { ++var GPasteDeleteButton = class { + constructor(client, index) { + this.actor = new St.Button(); + +diff --git a/src/gnome-shell/deleteItemPart.js b/src/gnome-shell/deleteItemPart.js +index 0b87abaf..b5a5add3 100644 +--- a/src/gnome-shell/deleteItemPart.js ++++ b/src/gnome-shell/deleteItemPart.js +@@ -11,7 +11,7 @@ const Me = ExtensionUtils.getCurrentExtension(); + + const DeleteButton = Me.imports.deleteButton; + +-class GPasteDeleteItemPart { ++var GPasteDeleteItemPart = class { + constructor(client, index) { + this.actor = new St.Bin({ x_align: St.Align.END }); + this._deleteButton = new DeleteButton.GPasteDeleteButton(client, index); +diff --git a/src/gnome-shell/dummyHistoryItem.js b/src/gnome-shell/dummyHistoryItem.js +index 8d227fc9..38f3ea4f 100644 +--- a/src/gnome-shell/dummyHistoryItem.js ++++ b/src/gnome-shell/dummyHistoryItem.js +@@ -10,7 +10,7 @@ const PopupMenu = imports.ui.popupMenu; + + const _ = Gettext.domain('GPaste').gettext; + +-class GPasteDummyHistoryItem extends PopupMenu.PopupMenuItem { ++var GPasteDummyHistoryItem = class extends PopupMenu.PopupMenuItem { + constructor() { + super(_("(Couldn't connect to GPaste daemon)")); + this.setSensitive(false); +diff --git a/src/gnome-shell/emptyHistoryItem.js b/src/gnome-shell/emptyHistoryItem.js +index 94c3df61..35bdb0c4 100644 +--- a/src/gnome-shell/emptyHistoryItem.js ++++ b/src/gnome-shell/emptyHistoryItem.js +@@ -6,7 +6,7 @@ + + const { GLib, GPaste, St } = imports.gi; + +-class GPasteEmptyHistoryItem { ++var GPasteEmptyHistoryItem = class { + constructor(client, settings, menu) { + this.actor = new St.Button({ + reactive: true, +diff --git a/src/gnome-shell/item.js b/src/gnome-shell/item.js +index 99db6662..e04b8a90 100644 +--- a/src/gnome-shell/item.js ++++ b/src/gnome-shell/item.js +@@ -13,7 +13,7 @@ const Me = ExtensionUtils.getCurrentExtension(); + + const DeleteItemPart = Me.imports.deleteItemPart; + +-class GPasteItem extends PopupMenu.PopupMenuItem { ++var GPasteItem = class extends PopupMenu.PopupMenuItem { + constructor(client, size, index) { + super(""); + +diff --git a/src/gnome-shell/pageItem.js b/src/gnome-shell/pageItem.js +index ca0dde3e..1606016e 100644 +--- a/src/gnome-shell/pageItem.js ++++ b/src/gnome-shell/pageItem.js +@@ -8,7 +8,7 @@ const { St } = imports.gi; + + const Signals = imports.signals; + +-class GPastePageItem { ++var GPastePageItem = class { + constructor(page) { + this.actor = new St.Button({ + reactive: true, +diff --git a/src/gnome-shell/pageSwitcher.js b/src/gnome-shell/pageSwitcher.js +index 59e5c3a8..f6d09aeb 100644 +--- a/src/gnome-shell/pageSwitcher.js ++++ b/src/gnome-shell/pageSwitcher.js +@@ -15,7 +15,7 @@ const PageItem = Me.imports.pageItem; + + const MAX_PAGES = 20; + +-class GPastePageSwitcher extends PopupMenu.PopupBaseMenuItem { ++var GPastePageSwitcher = class extends PopupMenu.PopupBaseMenuItem { + constructor() { + super({ + reactive: false, +diff --git a/src/gnome-shell/searchItem.js b/src/gnome-shell/searchItem.js +index 2ec35f5d..9c3daa21 100644 +--- a/src/gnome-shell/searchItem.js ++++ b/src/gnome-shell/searchItem.js +@@ -8,7 +8,7 @@ const PopupMenu = imports.ui.popupMenu; + + const { St } = imports.gi; + +-class GPasteSearchItem extends PopupMenu.PopupBaseMenuItem { ++var GPasteSearchItem = class extends PopupMenu.PopupBaseMenuItem { + constructor() { + super({ + activate: false, +diff --git a/src/gnome-shell/stateSwitch.js b/src/gnome-shell/stateSwitch.js +index cd3fdba6..00a3d0f9 100644 +--- a/src/gnome-shell/stateSwitch.js ++++ b/src/gnome-shell/stateSwitch.js +@@ -10,7 +10,7 @@ const PopupMenu = imports.ui.popupMenu; + + const _ = Gettext.domain('GPaste').gettext; + +-class GPasteStateSwitch extends PopupMenu.PopupSwitchMenuItem { ++var GPasteStateSwitch = class extends PopupMenu.PopupSwitchMenuItem { + constructor(client) { + super(_("Track changes"), client.is_active()); + +diff --git a/src/gnome-shell/statusIcon.js b/src/gnome-shell/statusIcon.js +index e2259fd6..c90a0978 100644 +--- a/src/gnome-shell/statusIcon.js ++++ b/src/gnome-shell/statusIcon.js +@@ -8,7 +8,7 @@ const PopupMenu = imports.ui.popupMenu; + + const { St } = imports.gi; + +-class GPasteStatusIcon { ++var GPasteStatusIcon = class { + constructor() { + this.actor = new St.BoxLayout({ style_class: 'panel-status-menu-box' }); + +diff --git a/src/gnome-shell/uiItem.js b/src/gnome-shell/uiItem.js +index fff0e621..6726cf82 100644 +--- a/src/gnome-shell/uiItem.js ++++ b/src/gnome-shell/uiItem.js +@@ -6,7 +6,7 @@ + + const { GPaste, St } = imports.gi; + +-class GPasteUiItem { ++var GPasteUiItem = class { + constructor(menu) { + this.actor = new St.Button({ + reactive: true, diff --git a/x11-misc/gpaste/gpaste-3.32.0-r1.ebuild b/x11-misc/gpaste/gpaste-3.32.0-r1.ebuild new file mode 100644 index 0000000..e6084c9 --- /dev/null +++ b/x11-misc/gpaste/gpaste-3.32.0-r1.ebuild @@ -0,0 +1,87 @@ +# Copyright 2020 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +VALA_MIN_API_VERSION="0.42" +VALA_USE_DEPEND="vapigen" + +inherit gnome2-utils meson vala vcs-snapshot xdg-utils + +DESCRIPTION="Clipboard management system" +HOMEPAGE="https://github.com/Keruspe/GPaste" +SRC_URI="https://github.com/Keruspe/GPaste/archive/v${PV}.tar.gz -> ${P}.tar.gz" + +LICENSE="GPL-3" +SLOT="0" +KEYWORDS="~amd64 ~x86" +IUSE="X bash-completion gnome introspection systemd vala zsh-completion" + +CDEPEND="dev-libs/appstream-glib + >=dev-libs/gjs-1.54.0 + >=dev-libs/glib-2.58:2 + >=dev-libs/gobject-introspection-1.58.0 + sys-apps/dbus + >=x11-libs/gdk-pixbuf-2.38:2 + >=x11-libs/gtk+-3.24:3 + X? ( + x11-libs/libX11 + x11-libs/libXi + ) + gnome? ( + gnome-base/gnome-control-center:2 + media-libs/clutter + x11-libs/pango + >=x11-wm/mutter-3.32.0:0/4 + ) + systemd? ( sys-apps/systemd )" +RDEPEND="${CDEPEND} + gnome? ( gnome-base/gnome-shell )" +DEPEND="${CDEPEND} + virtual/pkgconfig + vala? ( $(vala_depend) )" + +PATCHES=( + "${FILESDIR}/${P}-detect-when-images-are-growing.patch" + "${FILESDIR}/${P}-gnome-shel-only-var-should-be-exported.patch" +) + +src_prepare() { + default + vala_src_prepare +} + +src_configure() { + local emesonargs=( + $(meson_use X x-keybinder) + $(meson_use bash-completion) + $(meson_use gnome gnome-shell) + $(meson_use introspection) + $(meson_use systemd) + $(meson_use vala vapi) + $(meson_use zsh-completion) + ) + meson_src_configure +} + +src_install() { + meson_src_install + find "${D}" -name '*.la' -delete || die +} + +pkg_preinst() { + gnome2_schemas_savelist +} + +pkg_postinst() { + gnome2_schemas_update + xdg_desktop_database_update + xdg_icon_cache_update + +} + +pkg_postrm() { + gnome2_schemas_update + xdg_desktop_database_update + xdg_icon_cache_update +} diff --git a/x11-misc/gpaste/gpaste-3.34.1.ebuild b/x11-misc/gpaste/gpaste-3.34.1.ebuild index 220ab16..cec5c0f 100644 --- a/x11-misc/gpaste/gpaste-3.34.1.ebuild +++ b/x11-misc/gpaste/gpaste-3.34.1.ebuild @@ -6,7 +6,7 @@ EAPI=7 VALA_MIN_API_VERSION="0.42" VALA_USE_DEPEND="vapigen" -inherit autotools eutils gnome2-utils vala vcs-snapshot +inherit gnome2-utils meson vala vcs-snapshot xdg-utils DESCRIPTION="Clipboard management system" HOMEPAGE="https://github.com/Keruspe/GPaste" @@ -15,7 +15,7 @@ SRC_URI="https://github.com/Keruspe/GPaste/archive/v${PV}.tar.gz -> ${P}.tar.gz" LICENSE="GPL-3" SLOT="0" KEYWORDS="" -IUSE="X bash-completion gnome vala zsh-completion" +IUSE="X bash-completion gnome introspection systemd vala zsh-completion" CDEPEND="dev-libs/appstream-glib >=dev-libs/gjs-1.54.0 @@ -33,36 +33,39 @@ CDEPEND="dev-libs/appstream-glib media-libs/clutter x11-libs/pango >=x11-wm/mutter-3.34.0:0/5 - )" + ) + systemd? ( sys-apps/systemd )" RDEPEND="${CDEPEND} gnome? ( gnome-base/gnome-shell )" DEPEND="${CDEPEND} virtual/pkgconfig vala? ( $(vala_depend) )" +PATCHES=( + "${FILESDIR}/${P}-detect-when-images-are-growing.patch" + "${FILESDIR}/${P}-gnome-shel-only-var-should-be-exported.patch" +) + src_prepare() { default - eautoreconf vala_src_prepare - - if ! use gnome ; then - echo "" > data/control-center.mk || die - fi } src_configure() { - econf \ - $(use_enable X x-keybinder) \ - $(use_enable bash-completion) \ - $(use_enable vala) \ - $(use_enable gnome gnome-shell-extension) \ - $(use_enable zsh-completion) \ - --disable-static \ - --disable-schemas-compile + local emesonargs=( + $(meson_use X x-keybinder) + $(meson_use bash-completion) + $(meson_use gnome gnome-shell) + $(meson_use introspection) + $(meson_use systemd) + $(meson_use vala vapi) + $(meson_use zsh-completion) + ) + meson_src_configure } src_install() { - default + meson_src_install find "${D}" -name '*.la' -delete || die } @@ -72,8 +75,13 @@ pkg_preinst() { pkg_postinst() { gnome2_schemas_update + xdg_desktop_database_update + xdg_icon_cache_update + } pkg_postrm() { gnome2_schemas_update + xdg_desktop_database_update + xdg_icon_cache_update }