From 5bb9ff1ee56d2b5e75e01a7f066d8b0cec84ec02 Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Sat, 20 Mar 2021 14:27:17 +0000 Subject: gentoo resync : 20.03.2021 --- .../files/openbox-menu-0.8.1-build.patch | 26 +++++ .../files/openbox-menu-0.8.1-gtk3.patch | 91 ++++++++++++++++++ .../files/openbox-menu-0.8.1-makefile.patch | 106 +++++++++++++++++++++ 3 files changed, 223 insertions(+) create mode 100644 x11-misc/openbox-menu/files/openbox-menu-0.8.1-build.patch create mode 100644 x11-misc/openbox-menu/files/openbox-menu-0.8.1-gtk3.patch create mode 100644 x11-misc/openbox-menu/files/openbox-menu-0.8.1-makefile.patch (limited to 'x11-misc/openbox-menu/files') diff --git a/x11-misc/openbox-menu/files/openbox-menu-0.8.1-build.patch b/x11-misc/openbox-menu/files/openbox-menu-0.8.1-build.patch new file mode 100644 index 000000000000..b1130c85d864 --- /dev/null +++ b/x11-misc/openbox-menu/files/openbox-menu-0.8.1-build.patch @@ -0,0 +1,26 @@ +From e3989a504d9713d0de8b236b1f8d21c74d1fcd00 Mon Sep 17 00:00:00 2001 +From: "Azamat H. Hackimov" +Date: Thu, 11 Feb 2021 21:12:52 +0300 +Subject: [PATCH 1/2] Fix compilation + +icon_theme is needed in menu.c +--- + src/openbox-menu.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/src/openbox-menu.h b/src/openbox-menu.h +index 88ab2bf..e3dee22 100644 +--- a/src/openbox-menu.h ++++ b/src/openbox-menu.h +@@ -82,4 +82,8 @@ gboolean context_get_persistent (OB_Menu*); + + void context_free(OB_Menu *); + ++#ifdef WITH_ICONS ++extern GtkIconTheme *icon_theme; ++#endif ++ + #endif // __OPENBOXMENU_APP__ +-- +2.26.2 + diff --git a/x11-misc/openbox-menu/files/openbox-menu-0.8.1-gtk3.patch b/x11-misc/openbox-menu/files/openbox-menu-0.8.1-gtk3.patch new file mode 100644 index 000000000000..6b16b8a0ff8d --- /dev/null +++ b/x11-misc/openbox-menu/files/openbox-menu-0.8.1-gtk3.patch @@ -0,0 +1,91 @@ +From 8fe1e7fa9239ed8b604a59ef2202f183f1f56eb6 Mon Sep 17 00:00:00 2001 +From: Fabrice THIROUX +Date: Sat, 13 Feb 2021 14:46:53 +0100 +Subject: [PATCH] Updated for gtk3. Remove icon_theme annoying variable + +--- + Makefile | 4 ++-- + src/menu.c | 1 - + src/openbox-menu.h | 1 + + src/utils.c | 16 ++++++---------- + 4 files changed, 9 insertions(+), 13 deletions(-) + +diff --git a/Makefile b/Makefile +index 5d8af49..5e09ef2 100644 +--- a/Makefile ++++ b/Makefile +@@ -1,5 +1,5 @@ +-LIBS= `pkg-config --libs glib-2.0 gtk+-2.0 libmenu-cache` +-CFLAGS+= -g -Wall `pkg-config --cflags glib-2.0 gtk+-2.0 libmenu-cache` ++LIBS= `pkg-config --libs glib-2.0 gtk+-3.0 libmenu-cache` ++CFLAGS+= -g -Wall `pkg-config --cflags glib-2.0 gtk+-3.0 libmenu-cache` + CC=gcc + #-DG_DISABLE_DEPRECATED + +diff --git a/src/menu.c b/src/menu.c +index 5b7e8f8..3b752d9 100644 +--- a/src/menu.c ++++ b/src/menu.c +@@ -240,7 +240,6 @@ main (int argc, char **argv) + + #ifdef WITH_ICONS + gtk_init (&argc, &argv); +- icon_theme = gtk_icon_theme_get_default (); + #endif + + if ((ob_context = configure (argc, argv)) == NULL) +diff --git a/src/openbox-menu.h b/src/openbox-menu.h +index 7035e9d..f5a7bce 100644 +--- a/src/openbox-menu.h ++++ b/src/openbox-menu.h +@@ -19,6 +19,7 @@ + + #ifndef __OPENBOXMENU_APP__ + #define __OPENBOXMENU_APP__ ++ + #include + + #ifdef WITH_ICONS +diff --git a/src/utils.c b/src/utils.c +index 7a68316..2f4f95b 100644 +--- a/src/utils.c ++++ b/src/utils.c +@@ -169,8 +169,6 @@ clean_exec (MenuCacheApp *app) + + #if WITH_ICONS + +-extern GtkIconTheme *icon_theme; +- + /****f* utils/item_icon_path + * OUTPUT + * return the path for the themed icon if item. +@@ -199,23 +197,21 @@ item_icon_path (MenuCacheItem *item) + if (g_path_is_absolute (name)) + return g_strdup (name); + +- /* We remove the file extension as gtk_icon_theme_lookup_icon can't +- * lookup a theme icon for, ie, 'geany.png'. It has to be 'geany'. +- */ +- tmp_name = strndup (name, strrchr (name, '.') - name); + #ifdef WITH_SVG +- icon_info = gtk_icon_theme_lookup_icon (icon_theme, tmp_name, 16, GTK_ICON_LOOKUP_GENERIC_FALLBACK); ++ icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default(), name, 16, GTK_ICON_LOOKUP_GENERIC_FALLBACK); + #else +- icon_info = gtk_icon_theme_lookup_icon (icon_theme, tmp_name, 16, GTK_ICON_LOOKUP_NO_SVG | GTK_ICON_LOOKUP_GENERIC_FALLBACK); ++ icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default(), name, 16, GTK_ICON_LOOKUP_NO_SVG | GTK_ICON_LOOKUP_GENERIC_FALLBACK); + #endif + g_free (tmp_name); + } + ++ ++ + if (!icon_info) /* 2nd fallback */ +- icon_info = gtk_icon_theme_lookup_icon (icon_theme, "empty", 16, GTK_ICON_LOOKUP_NO_SVG); ++ icon_info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), "empty", 16, GTK_ICON_LOOKUP_NO_SVG); + + icon = g_strdup (gtk_icon_info_get_filename (icon_info)); +- gtk_icon_info_free (icon_info); ++ g_object_unref (icon_info); + + return icon; + } diff --git a/x11-misc/openbox-menu/files/openbox-menu-0.8.1-makefile.patch b/x11-misc/openbox-menu/files/openbox-menu-0.8.1-makefile.patch new file mode 100644 index 000000000000..a2848bf464bf --- /dev/null +++ b/x11-misc/openbox-menu/files/openbox-menu-0.8.1-makefile.patch @@ -0,0 +1,106 @@ +From fa18093783ec77102c304134626bf3b4ddc07ec8 Mon Sep 17 00:00:00 2001 +From: "Azamat H. Hackimov" +Date: Thu, 11 Feb 2021 21:47:47 +0300 +Subject: [PATCH 2/2] Update Makefile build + +Introduce CC and PKG_CONFIG variables that can be redefined by user. +Added variables WITH_ICONS and WITH_SVG that can be also redefined by user. +Misc enhancements to file globbing. + +* 2021-03-15 asturm: Fix BINDIR path, add DESTDIR, adapt to GTK3 change + +--- a/Makefile ++++ b/Makefile +@@ -1,19 +1,31 @@ +-LIBS= `pkg-config --libs glib-2.0 gtk+-3.0 libmenu-cache` +-CFLAGS+= -g -Wall `pkg-config --cflags glib-2.0 gtk+-3.0 libmenu-cache` +-CC=gcc ++CC ?= gcc ++PKG_CONFIG ?= pkg-config ++ ++CFLAGS ?= -O2 -g ++CFLAGS += -Wall $(shell $(PKG_CONFIG) --cflags glib-2.0 gtk+-3.0 libmenu-cache) ++LIBS += $(shell $(PKG_CONFIG) --libs glib-2.0 gtk+-3.0 libmenu-cache) ++ + #-DG_DISABLE_DEPRECATED + +-# Comment this line if you don't want icons to appear in menu +-CFLAGS+=-DWITH_ICONS +-# Uncomment this line if Openbox can display SVG icons ++# set to 0 to turn off icons in menus ++WITH_ICONS=1 ++ ++ifeq ($(WITH_ICONS),1) ++CFLAGS += -DWITH_ICONS ++endif ++ ++# set to 0 to turn off svg icons in menus + # Check SVG support with '$ ldd /usr/bin/openbox | grep svg', librsvg must appear.. +-# CFLAGS+=-DWITH_SVG ++WITH_SVG=0 ++ ++ifeq ($(WITH_SVG),1) ++CFLAGS += -DWITH_SVG ++endif + +-prefix= /usr/local +-DESTDIR ?= $(prefix) +-BINDIR= ${DESTDIR}/bin ++prefix = /usr ++BINDIR = ${prefix}/bin + +-SRC= $(shell ls src/*.c 2> /dev/null) ++SRC= $(wildcard src/*.c) + OBJ= $(SRC:.c=.o) + + all: $(OBJ) check openbox-menu +@@ -25,15 +37,18 @@ + openbox-menu: $(OBJ) + $(CC) $(OBJ) -o openbox-menu $(LDFLAGS) $(LIBS) + +-.PHONY: clean install doc changelog check xmllint ++.PHONY: clean install install-strip doc changelog check xmllint + + clean: + @rm -f $(OBJ) $(TEST_OBJ) openbox-menu check + @rm -rf doc + + install: ++ @install -Dm 755 openbox-menu "$(DESTDIR)$(BINDIR)/openbox-menu" ++ ++install-strip: + @strip -s openbox-menu +- @install -Dm 755 openbox-menu $(BINDIR)/openbox-menu ++ @install -Dm 755 openbox-menu "$(DESTDIR)$(BINDIR)/openbox-menu" + + doc: + robodoc --src . --doc doc/ --multidoc --index --html --cmode + +diff --git a/README.md b/README.md +--- a/README.md ++++ b/README.md +@@ -6,17 +6,17 @@ Type `make` then, with superuser privileges, `make install` to install it. openb + + ## Compile openbox-menu without icons ## + +-Openbox-menu shows icons before categories name and applications name (in fact, the menu and the icons are displayed by Openbox; Openbox-menu only outputs text content). You can remove icon support by editing the Makefile and commenting the following line (add a # in the begining) ++Openbox-menu shows icons before categories name and applications name (in fact, the menu and the icons are displayed by Openbox; Openbox-menu only outputs text content). You can enable icon support by running `make` with `WITH_ICONS=1` option (pass `WITH_ICONS=0` to disable it): + +-> CFLAGS+=-DWITH_ICONS ++> make WITH_ICONS=1 + + If errors occur while compiling, remove gtk+-2.0 from lines above the one previously commented. + + ## SVG support + +-Openbox can display SVG icons since version 3.5.1. SVG support in openbox-menu has to be activated in Makefile by uncommenting the following line ++Openbox can display SVG icons since version 3.5.1. SVG support in openbox-menu can be enabled by running `make` with `WITH_SVG=1` option (pass `WITH_SVG=0` to disable it): + +-> CFLAGS+=-DWITH_SVG ++> make WITH_SVG=1 + + SVG suport will be activated by default in the future. + +-- +2.26.2 + -- cgit v1.2.3