summaryrefslogtreecommitdiff
path: root/x11/gcolor2
diff options
context:
space:
mode:
authorkamil <kamil>2015-07-25 02:06:04 +0000
committerkamil <kamil>2015-07-25 02:06:04 +0000
commit4939523b8bc32775239ba952c310a07ffd23ddd7 (patch)
tree487816d7c61fea0461fb542b61295e4ef1374f5f /x11/gcolor2
parent88b4ec2dc8c2373224bc523b6dceae268cfeff43 (diff)
downloadpkgsrc-4939523b8bc32775239ba952c310a07ffd23ddd7.tar.gz
Import gcolor2-0.4 as x11/gcolor2
gcolor2 is a simple color selector that was originally based on gcolor, ported to use GTK+2, and now has a completely new UI. Use Gentoo mirror in the place of SourceForge as more reliable.
Diffstat (limited to 'x11/gcolor2')
-rw-r--r--x11/gcolor2/DESCR2
-rw-r--r--x11/gcolor2/Makefile33
-rw-r--r--x11/gcolor2/PLIST5
-rw-r--r--x11/gcolor2/distinfo8
-rw-r--r--x11/gcolor2/files/gcolor2.desktop9
-rw-r--r--x11/gcolor2/patches/patch-src_callbacks.c20
-rw-r--r--x11/gcolor2/patches/patch-src_interface.c47
-rw-r--r--x11/gcolor2/patches/patch-src_main.c47
8 files changed, 171 insertions, 0 deletions
diff --git a/x11/gcolor2/DESCR b/x11/gcolor2/DESCR
new file mode 100644
index 00000000000..8945ca3f667
--- /dev/null
+++ b/x11/gcolor2/DESCR
@@ -0,0 +1,2 @@
+gcolor2 is a simple color selector that was originally based on gcolor, ported
+to use GTK+2, and now has a completely new UI.
diff --git a/x11/gcolor2/Makefile b/x11/gcolor2/Makefile
new file mode 100644
index 00000000000..57b6b20dcd8
--- /dev/null
+++ b/x11/gcolor2/Makefile
@@ -0,0 +1,33 @@
+# $NetBSD: Makefile,v 1.1 2015/07/25 02:06:04 kamil Exp $
+
+DISTNAME= gcolor2-0.4
+CATEGORIES= x11
+MASTER_SITES= ${MASTER_SITE_GENTOO:=distfiles/}
+
+MAINTAINER= pkgsrc-users@NetBSD.org
+HOMEPAGE= http://gcolor2.sourceforge.net/
+COMMENT= Simple color selector
+LICENSE= gnu-gpl-v2
+
+GNU_CONFIGURE= yes
+USE_TOOLS+= gmake perl pkg-config
+
+BUILD_DEPENDS+= p5-XML-Parser>=2.31nb1:../../textproc/p5-XML-Parser
+
+SUBST_CLASSES+= df
+SUBST_STAGE.df= post-configure
+SUBST_MESSAGE.df= Fixing icon reference in desktop file
+SUBST_FILES.df= ${PKGBASE}.desktop
+SUBST_SED.df= -e 's:/usr/share:${PREFIX}/share:1'
+
+AUTO_MKDIRS= yes
+
+post-extract:
+ ${RUN}${CP} ${FILESDIR}/${PKGBASE}.desktop ${WRKSRC}/
+
+post-install:
+ ${RUN}${INSTALL_DATA} ${WRKSRC}/${PKGBASE}.desktop ${DESTDIR}${PREFIX}/share/applications
+
+.include "../../sysutils/desktop-file-utils/desktopdb.mk"
+.include "../../x11/gtk2/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/x11/gcolor2/PLIST b/x11/gcolor2/PLIST
new file mode 100644
index 00000000000..56c84dc34c8
--- /dev/null
+++ b/x11/gcolor2/PLIST
@@ -0,0 +1,5 @@
+@comment $NetBSD: PLIST,v 1.1 2015/07/25 02:06:04 kamil Exp $
+bin/gcolor2
+share/applications/gcolor2.desktop
+share/pixmaps/gcolor2/about_icon.png
+share/pixmaps/gcolor2/icon.png
diff --git a/x11/gcolor2/distinfo b/x11/gcolor2/distinfo
new file mode 100644
index 00000000000..721dde2b793
--- /dev/null
+++ b/x11/gcolor2/distinfo
@@ -0,0 +1,8 @@
+$NetBSD: distinfo,v 1.1 2015/07/25 02:06:04 kamil Exp $
+
+SHA1 (gcolor2-0.4.tar.gz) = 7cfa173825d486c54a5358b6f41e679d8a2cd5b6
+RMD160 (gcolor2-0.4.tar.gz) = d31dd5d19720a8888be269778d2be6715849c506
+Size (gcolor2-0.4.tar.gz) = 375217 bytes
+SHA1 (patch-src_callbacks.c) = e8eaeed80aba3a10bf86d29f4e7afd4c0a812586
+SHA1 (patch-src_interface.c) = a979f4d926fa1ec95238108dc291340a8722221c
+SHA1 (patch-src_main.c) = 1754723647a862a41bae253a8a68dd25e1458b3d
diff --git a/x11/gcolor2/files/gcolor2.desktop b/x11/gcolor2/files/gcolor2.desktop
new file mode 100644
index 00000000000..aeb38b713f2
--- /dev/null
+++ b/x11/gcolor2/files/gcolor2.desktop
@@ -0,0 +1,9 @@
+[Desktop Entry]
+Name=GColor2
+GenericName=Color Selector
+Comment=Choose Colors
+Exec=gcolor2
+Icon=/usr/share/pixmaps/gcolor2/icon.png
+Terminal=false
+Type=Application
+Categories=Graphics;GTK;
diff --git a/x11/gcolor2/patches/patch-src_callbacks.c b/x11/gcolor2/patches/patch-src_callbacks.c
new file mode 100644
index 00000000000..2cbc7265668
--- /dev/null
+++ b/x11/gcolor2/patches/patch-src_callbacks.c
@@ -0,0 +1,20 @@
+$NetBSD: patch-src_callbacks.c,v 1.1 2015/07/25 02:06:04 kamil Exp $
+
+Add missing header for strlen(3) and strspn(3).
+
+Backport additional changes from Fedora.
+http://pkgs.fedoraproject.org/cgit/gcolor2.git/tree/gcolor2-0.4-missing-includes.patch
+
+--- src/callbacks.c.orig 2005-07-12 18:06:12.000000000 +0000
++++ src/callbacks.c
+@@ -2,8 +2,10 @@
+ # include <config.h>
+ #endif
+
++#include <glib/gprintf.h>
+ #include <gtk/gtk.h>
+ #include <stdio.h>
++#include <string.h>
+
+ #include "callbacks.h"
+ #include "interface.h"
diff --git a/x11/gcolor2/patches/patch-src_interface.c b/x11/gcolor2/patches/patch-src_interface.c
new file mode 100644
index 00000000000..a07372f581a
--- /dev/null
+++ b/x11/gcolor2/patches/patch-src_interface.c
@@ -0,0 +1,47 @@
+$NetBSD: patch-src_interface.c,v 1.1 2015/07/25 02:06:04 kamil Exp $
+
+gdk_pixbuf_unref() is deprecated and replaced with g_object_unref()
+
+--- src/interface.c.orig 2005-07-11 14:30:33.000000000 +0000
++++ src/interface.c
+@@ -63,7 +63,7 @@ create_gcolor2 (void)
+ if (gcolor2_icon_pixbuf)
+ {
+ gtk_window_set_icon (GTK_WINDOW (gcolor2), gcolor2_icon_pixbuf);
+- gdk_pixbuf_unref (gcolor2_icon_pixbuf);
++ g_object_unref (gcolor2_icon_pixbuf);
+ }
+
+ vbox1 = gtk_vbox_new (FALSE, 3);
+@@ -242,7 +242,7 @@ create_save_dialog (void)
+ if (save_dialog_icon_pixbuf)
+ {
+ gtk_window_set_icon (GTK_WINDOW (save_dialog), save_dialog_icon_pixbuf);
+- gdk_pixbuf_unref (save_dialog_icon_pixbuf);
++ g_object_unref (save_dialog_icon_pixbuf);
+ }
+ gtk_window_set_type_hint (GTK_WINDOW (save_dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
+
+@@ -370,7 +370,7 @@ create_about_dialog (void)
+ if (about_dialog_icon_pixbuf)
+ {
+ gtk_window_set_icon (GTK_WINDOW (about_dialog), about_dialog_icon_pixbuf);
+- gdk_pixbuf_unref (about_dialog_icon_pixbuf);
++ g_object_unref (about_dialog_icon_pixbuf);
+ }
+
+ dialog_vbox3 = GTK_DIALOG (about_dialog)->vbox;
+@@ -487,7 +487,7 @@ create_delete_dialog (void)
+ if (delete_dialog_icon_pixbuf)
+ {
+ gtk_window_set_icon (GTK_WINDOW (delete_dialog), delete_dialog_icon_pixbuf);
+- gdk_pixbuf_unref (delete_dialog_icon_pixbuf);
++ g_object_unref (delete_dialog_icon_pixbuf);
+ }
+ gtk_window_set_type_hint (GTK_WINDOW (delete_dialog), GDK_WINDOW_TYPE_HINT_DIALOG);
+
+@@ -526,4 +526,3 @@ create_delete_dialog (void)
+ gtk_widget_grab_default (delete_cancel);
+ return delete_dialog;
+ }
+-
diff --git a/x11/gcolor2/patches/patch-src_main.c b/x11/gcolor2/patches/patch-src_main.c
new file mode 100644
index 00000000000..b2fbf7bebf2
--- /dev/null
+++ b/x11/gcolor2/patches/patch-src_main.c
@@ -0,0 +1,47 @@
+$NetBSD: patch-src_main.c,v 1.1 2015/07/25 02:06:04 kamil Exp $
+
+Add missing header for strspn(3).
+
+Backport additional changes from Fedora.
+http://pkgs.fedoraproject.org/cgit/gcolor2.git/tree/gcolor2-0.4-missing-includes.patch
+
+--- src/main.c.orig 2005-07-11 14:55:49.000000000 +0000
++++ src/main.c
+@@ -2,8 +2,11 @@
+ # include <config.h>
+ #endif
+
++#include <glib/gprintf.h>
+ #include <gtk/gtk.h>
+ #include <stdio.h>
++#include <stdlib.h>
++#include <string.h>
+
+ #include "interface.h"
+ #include "support.h"
+@@ -48,8 +51,6 @@ gchar* get_system_file ()
+
+ void add_list_color (gchar *spec, gchar *name, gchar *type, gboolean is_new_color)
+ {
+- GdkPixmap *pixmap;
+- GdkBitmap *mask;
+ GdkPixbuf *buf;
+ GtkTreeIter iter;
+
+@@ -103,7 +104,7 @@ void add_rgb_file (gchar *filename, gcha
+ 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 +141,6 @@ gint main (gint argc, gchar *argv[])
+ GtkTreeViewColumn *column;
+ GtkWidget *treeview;
+ GtkTreeSelection *select;
+- gchar *buf;
+
+ #ifdef ENABLE_NLS
+ bindtextdomain (GETTEXT_PACKAGE, PACKAGE_LOCALE_DIR);