aboutsummaryrefslogtreecommitdiff
path: root/misc
diff options
context:
space:
mode:
authorslakmagik <jsun@freeshell.org>2010-05-13 00:34:14 +0200
committerMichiel van Wessem <michiel@slackbuilds.org>2010-05-13 00:34:14 +0200
commitcc668d47353026580c3344ea5e93a47ae97cf7fc (patch)
treec29652b9590c9d1567cb4e0025672d2a32772da8 /misc
parent1fffc279db497caf1ba3e351cc157948c0041f5d (diff)
misc/gcolor2: Updated for version 0.4
Diffstat (limited to 'misc')
-rw-r--r--misc/gcolor2/callbacks.c.2.patch17
-rw-r--r--misc/gcolor2/callbacks.c.patch14
-rw-r--r--misc/gcolor2/gcolor2.SlackBuild21
-rw-r--r--misc/gcolor2/gcolor2.info2
-rw-r--r--misc/gcolor2/main.c.patch51
5 files changed, 102 insertions, 3 deletions
diff --git a/misc/gcolor2/callbacks.c.2.patch b/misc/gcolor2/callbacks.c.2.patch
new file mode 100644
index 000000000000..1c86587163f4
--- /dev/null
+++ b/misc/gcolor2/callbacks.c.2.patch
@@ -0,0 +1,17 @@
+
+$FreeBSD: ports/graphics/gcolor2/files/patch-src_callbacks.c,v 1.4 2007/10/24 23:35:51 marcus Exp $
+
+--- src/callbacks.c.orig
++++ src/callbacks.c
+@@ -166,9 +166,10 @@
+ void on_copy_color_to_clipboard_activate (GtkMenuItem *menuitem, gpointer user_data)
+ {
+ gchar* hex;
++ GtkClipboard *cb;
+
+ hex = hex_value (colorvalue);
+- GtkClipboard *cb = gtk_clipboard_get (gdk_atom_intern ("PRIMARY", FALSE));
++ cb = gtk_clipboard_get (gdk_atom_intern ("PRIMARY", FALSE));
+ gtk_clipboard_set_text (cb, hex, strlen (hex));
+ }
+
diff --git a/misc/gcolor2/callbacks.c.patch b/misc/gcolor2/callbacks.c.patch
new file mode 100644
index 000000000000..7fda4938d6b8
--- /dev/null
+++ b/misc/gcolor2/callbacks.c.patch
@@ -0,0 +1,14 @@
+
+--- gcolor2-0.4.orig/src/callbacks.c
++++ gcolor2-0.4/src/callbacks.c
+@@ -9,6 +9,9 @@
+ #include "interface.h"
+ #include "support.h"
+
++/* missing headers on original file */
++#include <string.h>
++#include <glib/gprintf.h>
+
+ GtkWidget *savedialog;
+ gchar *colorname;
+
diff --git a/misc/gcolor2/gcolor2.SlackBuild b/misc/gcolor2/gcolor2.SlackBuild
index bc7e364b8f12..8552758e1fe9 100644
--- a/misc/gcolor2/gcolor2.SlackBuild
+++ b/misc/gcolor2/gcolor2.SlackBuild
@@ -19,6 +19,10 @@ if [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
+ LIBDIRSUFFIX=""
+elif [ "$ARCH" = "x86_64" ]; then
+ SLKCFLAGS="-O2 -fPIC"
+ LIBDIRSUFFIX="64"
fi
set -e
@@ -37,13 +41,24 @@ find . \
-o -perm 400 \) -exec chmod 644 {} \;
# gcolor2 prefills the saved colors with the contents of rgb.txt - which it
-# can't find without this patch.
+# can't find without this patch. Merged with the patch on:
+# http://tinyurl.com/gcolor-64bitpatch . This makes it possible to compile on
+#64bit systems, and not segfault at runtime.
patch -p1 < $CWD/rgb.patch
+# and add a couple of Debian patches and a FreeBSD for x64 segfaults and so on
+patch -p1 < $CWD/callbacks.c.patch
+patch -p0 < $CWD/callbacks.c.2.patch
+patch -p1 < $CWD/main.c.patch
CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
- --prefix=/usr
+ --prefix=/usr \
+ --libdir=/usr/lib${LIBDIRSUFFIX} \
+ --sysconfdir=/etc \
+ --localstatedir=/var \
+ --mandir=/usr/man \
+ --build=$ARCH-slackware-linux
make
make DESTDIR=$PKG install-strip
@@ -61,4 +76,4 @@ cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh
cd $PKG
-/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.tgz
+/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
diff --git a/misc/gcolor2/gcolor2.info b/misc/gcolor2/gcolor2.info
index f7c6216a8413..a3100969176e 100644
--- a/misc/gcolor2/gcolor2.info
+++ b/misc/gcolor2/gcolor2.info
@@ -2,7 +2,9 @@ PRGNAM="gcolor2"
VERSION="0.4"
HOMEPAGE="http://gcolor2.sourceforge.net/"
DOWNLOAD="http://downloads.sourceforge.net/gcolor2/gcolor2-0.4.tar.bz2"
+DOWNLOAD_x86_64=""
MD5SUM="223a126b8a87234d1552be4be4140789"
+MD5SUM_x86_64=""
MAINTAINER="slakmagik"
EMAIL="jsun@freeshell.org"
APPROVED="Michiel"
diff --git a/misc/gcolor2/main.c.patch b/misc/gcolor2/main.c.patch
new file mode 100644
index 000000000000..f8ce79feea9e
--- /dev/null
+++ b/misc/gcolor2/main.c.patch
@@ -0,0 +1,51 @@
+
+--- gcolor2-0.4.orig/src/main.c
++++ gcolor2-0.4/src/main.c
+@@ -4,11 +4,15 @@
+
+ #include <gtk/gtk.h>
+ #include <stdio.h>
+-
+ #include "interface.h"
+ #include "support.h"
+ #include "callbacks.h"
+
++/* missing headers on original file */
++#include <stdlib.h>
++#include <string.h>
++#include <glib/gprintf.h>
++
+ GtkListStore *liststore;
+ GdkWindow *gdkwin;
+ gchar *user_filename;
+@@ -48,8 +52,9 @@
+
+ void add_list_color (gchar *spec, gchar *name, gchar *type, gboolean is_new_color)
+ {
++/* pixmap and mask don't used
+ GdkPixmap *pixmap;
+- GdkBitmap *mask;
++ GdkBitmap *mask; */
+ GdkPixbuf *buf;
+ GtkTreeIter iter;
+
+@@ -103,7 +108,7 @@
+ gchar *name;
+ gchar buffer[512];
+ gchar spec[8];
+- gint r, g, b, lr, lg, lb;
++ gint r, g, b, lr=0, lg=0, lb=0;
+
+ fp = fopen (filename, "r");
+ if (!fp)
+@@ -140,7 +145,8 @@
+ GtkTreeViewColumn *column;
+ GtkWidget *treeview;
+ GtkTreeSelection *select;
+- gchar *buf;
++/* dont used
++ gchar *buf; */
+
+ #ifdef ENABLE_NLS
+ bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);
+