gkrellm-2.2.10/src/gkrellm.h: hardcoded plugins directory

Martijn Ras <[email protected]>
Newsgroups gmane.comp.gnome.apps.gkrellm
Message-ID <[email protected]>
Heya Folks,

I just compiled and installed a couple of plugins, some of them showed
up in the list some of them didn't. As it turned out some installed
themselves under /usr/local/lib/gkrellm2/plugins and some under
/usr/local/lib64/gkrellm2/plugins". The first were listed the latter not.

Currently the LOCAL_PLUGINS_DIR and SYSTEM_PLGINS_DIR are hardcoded as
follows, in both src/gkrellm.h and server/gkrellmd.h:

> #define LOCAL_PLUGINS_DIR               "/usr/local/lib/gkrellm2/plugins"
> #if !defined(SYSTEM_PLUGINS_DIR)
> #define SYSTEM_PLUGINS_DIR              "/usr/lib/gkrellm2/plugins"
> #endif

I've update the Makefile to work out the hosttype of the buildmachine
and updated src/gkrellm.h and server/gkrellmd.h to set the PLUGINS_DIR
variables based on that hosttype.

Mazzel,

Martijn.

_______________________________________________
Gkrellm mailing list
[email protected]
http://lists.jutley.org/cgi-bin/mailman/listinfo/gkrellm
libdir.patch (text/plain, 2.3 KB)
--- Makefile.original	2007-02-02 06:53:49.000000000 -0500
+++ Makefile	2007-02-02 06:53:55.000000000 -0500
@@ -105,14 +105,20 @@
 INCLUDEMODE = 644
 INCLUDEDIRMODE = 755
 INSTALL ?= install
-PKGCONFIGDIR ?= $(INSTALLROOT)/lib/pkgconfig
+HOSTTYPE := $(shell arch)
+ifeq ($(HOSTTYPE), 'x86_64')
+LIBDIR ?= $(INSTALLROOT)/lib64
+else
+LIBDIR ?= $(INSTALLROOT)/lib64
+endif
+PKGCONFIGDIR ?= $(LIBDIR)/pkgconfig
 LOCALEDIR ?= $(INSTALLROOT)/share/locale
 
 OS_NAME=$(shell uname -s)
 OS_RELEASE=$(shell uname -r)
 
 export SYS_LIBS EXTRAOBJS BINMODE
-export INSTALLDIR SINSTALLDIR INCLUDEDIR INCLUDEMODE INCLUDEDIRMODE LOCALEDIR
+export INSTALLDIR SINSTALLDIR INCLUDEDIR INCLUDEMODE INCLUDEDIRMODE HOSTTYPE LOCALEDIR
 export MANDIR SMANDIR MANDIRMODE MANMODE
 export OS_NAME OS_RELEASE
 
--- src/gkrellm.h.original	2007-02-02 06:54:05.000000000 -0500
+++ src/gkrellm.h	2007-02-02 06:54:09.000000000 -0500
@@ -118,10 +118,17 @@
 #if !defined(SYSTEM_THEMES_DIR)
 #define	SYSTEM_THEMES_DIR		"/usr/share/gkrellm2/themes"
 #endif
-#define	LOCAL_PLUGINS_DIR		"/usr/local/lib/gkrellm2/plugins"
+#if HOSTTYPE == x86_64
+#define	LOCAL_PLUGINS_DIR		"/usr/lib64/gkrellm2/plugins"
+#if !defined(SYSTEM_PLUGINS_DIR)
+#define	SYSTEM_PLUGINS_DIR		"/usr/lib64/gkrellm2/plugins"
+#endif
+#else
+#define	LOCAL_PLUGINS_DIR		"/usr/lib/gkrellm2/plugins"
 #if !defined(SYSTEM_PLUGINS_DIR)
 #define	SYSTEM_PLUGINS_DIR		"/usr/lib/gkrellm2/plugins"
 #endif
+#endif
 
 #else
 
--- server/gkrellmd.h.original	2007-02-02 06:56:02.000000000 -0500
+++ server/gkrellmd.h	2007-02-02 06:56:10.000000000 -0500
@@ -105,9 +105,16 @@
 #define GKRELLMD_CONFIG     "gkrellmd.conf"
 
 #define GKRELLMD_PLUGINS_DIR		".gkrellm2/plugins-gkrellmd"
-#define GKRELLMD_LOCAL_PLUGINS_DIR	"/usr/local/lib/gkrellm2/plugins-gkrellmd"
+#if HOSTTYPE == x86_64
+#define GKRELLMD_LOCAL_PLUGINS_DIR      "/usr/local/lib64/gkrellm2/plugins-gkrellmd"
 #if !defined(GKRELLMD_SYSTEM_PLUGINS_DIR)
-#define GKRELLMD_SYSTEM_PLUGINS_DIR	"/usr/lib/gkrellm2/plugins-gkrellmd"
+#define GKRELLMD_SYSTEM_PLUGINS_DIR     "/usr/lib64/gkrellm2/plugins-gkrellmd"
+#endif
+#else
+#define GKRELLMD_LOCAL_PLUGINS_DIR      "/usr/local/lib/gkrellm2/plugins-gkrellmd"
+#if !defined(GKRELLMD_SYSTEM_PLUGINS_DIR)
+#define GKRELLMD_SYSTEM_PLUGINS_DIR     "/usr/lib/gkrellm2/plugins-gkrellmd"
+#endif
 #endif
 
 #if !defined(WIN32)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.