Browse Source

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
Edinaldo P. Silva 3 years ago
committed by Willy Sudiarto Raharjo
parent
commit
58ff4821bb
No known key found for this signature in database GPG Key ID: 3F617144D7238786
  1. 2
      desktop/openbox-menu/README
  2. 15
      desktop/openbox-menu/debian_build.patch
  3. 20
      desktop/openbox-menu/openbox-menu-0.8.1-build.patch
  4. 77
      desktop/openbox-menu/openbox-menu-0.8.1-gtk3.patch
  5. 106
      desktop/openbox-menu/openbox-menu-0.8.1-makefile.patch
  6. 22
      desktop/openbox-menu/openbox-menu.SlackBuild
  7. 8
      desktop/openbox-menu/openbox-menu.info
  8. 6
      desktop/openbox-menu/slack-desc

2
desktop/openbox-menu/README

@ -6,7 +6,7 @@ by the LXDE library menu-cache.
Optional dependencie: gnome-menus.
To use, get a copy of menu.xml located in /usr/doc/openbox-menu-0.7.0
To use, get a copy of menu.xml located in /usr/doc/openbox-menu-0.8.1
and put into ~/.config/openbox, after run:
$ openbox --reconfigure

15
desktop/openbox-menu/debian_build.patch

@ -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)

20
desktop/openbox-menu/openbox-menu-0.8.1-build.patch

@ -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

77
desktop/openbox-menu/openbox-menu-0.8.1-gtk3.patch

@ -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;
}

106
desktop/openbox-menu/openbox-menu-0.8.1-makefile.patch

@ -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

22
desktop/openbox-menu/openbox-menu.SlackBuild

@ -2,7 +2,7 @@
#
# Slackware build script for openbox-menu.
#
# Copyright 2015 Edinaldo P. Silva, Rio de Janeiro, Brazil.
# Copyright 2015-2023 Edinaldo P. Silva, Rio de Janeiro, Brazil.
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@ -25,7 +25,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=openbox-menu
VERSION=${VERSION:-0.8.0}
VERSION=${VERSION:-0.8.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@ -70,7 +70,7 @@ rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.bz2
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
find -L . \
@ -79,26 +79,24 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
rm -rf {archlinux,.hg*}
patch -p1 < $CWD/openbox-menu-0.8.1-gtk3.patch
patch -p1 < $CWD/openbox-menu-0.8.1-build.patch
patch -p1 < $CWD/openbox-menu-0.8.1-makefile.patch
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
patch -p1 < $CWD/debian_build.patch
make PREFIX=/usr
make install DESTDIR=$PKG
make install-strip DESTDIR=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
rm -rf $PKG/bin
install -d $PKG/usr/bin
install -D -m755 openbox-menu $PKG/usr/bin/openbox-menu
install -Dm755 openbox-menu $PKG/usr/bin/openbox-menu
install -d $PKG/usr/man/man1
install -D -m644 $CWD/openbox-menu.1 $PKG/usr/man/man1/openbox-menu.1
install -Dm644 $CWD/openbox-menu.1 $PKG/usr/man/man1/openbox-menu.1
find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $( find $PKG/usr/man -type l ) ; do ln -s $( readlink $i ).gz $i.gz ; rm $i ; done
@ -106,7 +104,7 @@ DOCS="AUTHORS ChangeLog COPYING README.md THANKS TODO"
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $DOCS $PKG/usr/doc/$PRGNAM-$VERSION
cp $CWD/menu.xml-sample $PKG/usr/doc/$PRGNAM-$VERSION/menu.xml-sample
install -Dm644 $CWD/menu.xml-sample $PKG/usr/doc/$PRGNAM-$VERSION/menu.xml-sample
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install

8
desktop/openbox-menu/openbox-menu.info

@ -1,8 +1,8 @@
PRGNAM="openbox-menu"
VERSION="0.8.0"
HOMEPAGE="https://bitbucket.org/fabriceT/openbox-menu/"
DOWNLOAD="https://bitbucket.org/fabriceT/openbox-menu/downloads/openbox-menu-0.8.0.tar.bz2"
MD5SUM="0d6f907adf2d47dd4d4198c0ff14721d"
VERSION="0.8.1"
HOMEPAGE="https://github.com/fabriceT/openbox-menu"
DOWNLOAD="https://github.com/fabriceT/openbox-menu/archive/v0.8.1/openbox-menu-0.8.1.tar.gz"
MD5SUM="2794a571c6120514e5442d3bea7eb21e"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="menu-cache lxmenu-data"

6
desktop/openbox-menu/slack-desc

@ -9,10 +9,10 @@
openbox-menu: openbox-menu (pipemenu for Openbox window manager)
openbox-menu:
openbox-menu: Openbox-menu is a pipemenu for Openbox window manager. It provides a
openbox-menu: dynamic menu listing installed applications.
openbox-menu:
openbox-menu: Home page: https://bitbucket.org/fabriceT/openbox-menu
openbox-menu: dynamic menu listing installed applications. Most of the work is done
openbox-menu: by the LXDE library menu-cache.
openbox-menu:
openbox-menu: Home page: https://github.com/fabriceT/openbox-menu
openbox-menu:
openbox-menu:
openbox-menu:

Loading…
Cancel
Save