Browse Source
desktop/openbox-menu: Updated for version 0.8.1.
desktop/openbox-menu: Updated for version 0.8.1.
Signed-off-by: bedlam <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>pull/196/head
committed by
Willy Sudiarto Raharjo
No known key found for this signature in database
GPG Key ID: 3F617144D7238786
8 changed files with 221 additions and 35 deletions
-
2desktop/openbox-menu/README
-
15desktop/openbox-menu/debian_build.patch
-
20desktop/openbox-menu/openbox-menu-0.8.1-build.patch
-
77desktop/openbox-menu/openbox-menu-0.8.1-gtk3.patch
-
106desktop/openbox-menu/openbox-menu-0.8.1-makefile.patch
-
22desktop/openbox-menu/openbox-menu.SlackBuild
-
8desktop/openbox-menu/openbox-menu.info
-
6desktop/openbox-menu/slack-desc
@ -1,15 +0,0 @@ |
|||
Description: Make makefile compatible with Debian's standards. |
|||
Author: Mateusz Łukasik <mati75@linuxmint.pl> |
|||
Last-Update: 2013-11-30 |
|||
|
|||
--- a/Makefile
|
|||
+++ b/Makefile
|
|||
@@ -7,7 +7,7 @@ CC=gcc
|
|||
CFLAGS+=-DWITH_ICONS |
|||
# Uncomment this line if Openbox can display SVG icons |
|||
# Check SVG support with '$ ldd /usr/bin/openbox | grep svg', librsvg must appear.. |
|||
-# CFLAGS+=-DWITH_SVG
|
|||
+CFLAGS+=-DWITH_SVG
|
|||
|
|||
prefix= /usr/local |
|||
DESTDIR ?= $(prefix) |
|||
@ -0,0 +1,20 @@ |
|||
From e3989a504d9713d0de8b236b1f8d21c74d1fcd00 Mon Sep 17 00:00:00 2001 |
|||
From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com> |
|||
Date: Thu, 11 Feb 2021 21:12:52 +0300 |
|||
Subject: [PATCH 1/2] Fix compilation |
|||
|
|||
icon_theme is needed in menu.c |
|||
--- 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 |
|||
|
|||
@ -0,0 +1,77 @@ |
|||
From 8fe1e7fa9239ed8b604a59ef2202f183f1f56eb6 Mon Sep 17 00:00:00 2001 |
|||
From: Fabrice THIROUX <fabrice.thiroux@net-c.com> |
|||
Date: Sat, 13 Feb 2021 14:46:53 +0100 |
|||
Subject: [PATCH] Updated for gtk3. Remove icon_theme annoying variable |
|||
|
|||
---
|
|||
--- 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 |
|||
|
|||
--- 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) |
|||
--- a/src/openbox-menu.h
|
|||
+++ b/src/openbox-menu.h
|
|||
@@ -19,6 +19,7 @@
|
|||
|
|||
#ifndef __OPENBOXMENU_APP__ |
|||
#define __OPENBOXMENU_APP__ |
|||
+
|
|||
#include <menu-cache.h> |
|||
|
|||
#ifdef WITH_ICONS |
|||
--- 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; |
|||
} |
|||
@ -0,0 +1,106 @@ |
|||
From fa18093783ec77102c304134626bf3b4ddc07ec8 Mon Sep 17 00:00:00 2001 |
|||
From: "Azamat H. Hackimov" <azamat.hackimov@gmail.com> |
|||
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 |
|||
|
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue