x11-misc/gcolor2: initial import

Signed-off-by: tastytea <tastytea@tastytea.de>
This commit is contained in:
tastytea 2022-04-17 08:51:10 +02:00
parent 8f9e3f2f63
commit 492c84f7c6
Signed by: tastytea
SSH Key Fingerprint: SHA256:FBkvrOlhq5use1XEttyUGT4bUTDVA1ar9SgIc9P03cM
7 changed files with 164 additions and 0 deletions

View File

@ -0,0 +1,2 @@
DIST gcolor2-0.4.tar.gz 375217 BLAKE2B c8bc8581c9790106a9461cda03e40c201faec95c9c0d7890dbb8903346a85208c506dd8c9cd0735036b4a294205f44c857edbae8282574d195e77f4954bae91c SHA512 9b9677b4be8797c9b03deef9bf1b96e6497d2adf85f74d01f1b478f04d92cb912790c4d5fb74f403295219cac6c0d3fcabaa7de340975bbcdb68b0347f6042a3
DIST gcolor2.svg 12742 BLAKE2B 40f5e6624a0a90d8d8c81dd5814d836741bab04f19d73cfbd96f224baa78165447d1642c18a55ef282771a02de4bddd77d975c4aa75bb74b98d63227f87031ea SHA512 377dbd494e5a3f881df65415ee66310cd96b4e4ac668101aa068bfe6f575b694c930817cec942e885f93465d05ccc604950f2154e26be95618d6f272d81ffe1b

View File

@ -0,0 +1,46 @@
diff --exclude-from=/home/dang/bin/scripts/diffrc -up -ruN gcolor2-0.4.orig/src/callbacks.c gcolor2-0.4/src/callbacks.c
--- gcolor2-0.4.orig/src/callbacks.c 2005-07-12 14:06:12.000000000 -0400
+++ gcolor2-0.4/src/callbacks.c 2007-02-17 19:19:38.000000000 -0500
@@ -4,6 +4,9 @@
#include <gtk/gtk.h>
#include <stdio.h>
+#include <string.h>
+#include <glib.h>
+#include <glib/gprintf.h>
#include "callbacks.h"
#include "interface.h"
@@ -172,6 +175,9 @@ void on_copy_color_to_clipboard_activate
gtk_clipboard_set_text (cb, hex, strlen (hex));
}
+void add_rgb_file (gchar *filename, gchar *type);
+gchar* get_system_file (void);
+
void on_show_system_colors_activate (GtkMenuItem *menuitem, gpointer user_data)
{
if (gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (menuitem)))
@@ -266,6 +272,8 @@ void on_save_button_clicked (GtkButton *
gtk_widget_destroy (savedialog);
}
+void add_list_color (gchar *spec, gchar *name, gchar *type, gboolean is_new_color);
+
void add_color_to_treeview ()
{
GtkTreeView *treeview;
diff --exclude-from=/home/dang/bin/scripts/diffrc -up -ruN gcolor2-0.4.orig/src/main.c gcolor2-0.4/src/main.c
--- gcolor2-0.4.orig/src/main.c 2005-07-11 10:55:49.000000000 -0400
+++ gcolor2-0.4/src/main.c 2007-02-17 19:18:23.000000000 -0500
@@ -4,6 +4,10 @@
#include <gtk/gtk.h>
#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <glib.h>
+#include <glib/gprintf.h>
#include "interface.h"
#include "support.h"

View File

@ -0,0 +1,27 @@
--- a/src/callbacks.c
+++ b/src/callbacks.c
@@ -13,6 +13,9 @@
#include "support.h"
+GtkWidget *gcolor2;
+GtkWidget *menu;
+GdkColor colorvalue;
GtkWidget *savedialog;
gchar *colorname;
static GtkWidget *aboutdialog = NULL;
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -42,9 +42,9 @@
"\302\267 Usability / user interface enhancements\n" \
"\302\267 Code cleanup"
-GtkWidget *gcolor2;
-GtkWidget *menu;
-GdkColor colorvalue;
+extern GtkWidget *gcolor2;
+extern GtkWidget *menu;
+extern GdkColor colorvalue;
enum
{

View File

@ -0,0 +1,10 @@
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,7 @@
AC_DISABLE_STATIC
AC_PROG_LIBTOOL
AC_PROG_INTLTOOL([0.27])
+PKG_PROG_PKG_CONFIG
GETTEXT_PACKAGE=gcolor2

View File

@ -0,0 +1,21 @@
--- a/src/callbacks.h
+++ b/src/callbacks.h
@@ -12,6 +12,7 @@
#define SYSTEM_FILE_2 "/usr/lib/X11/rgb.txt"
#define SYSTEM_FILE_3 "/etc/X11/rgb.txt"
#define SYSTEM_FILE_4 "/usr/openwin/lib/X11/rgb.txt"
+#define SYSTEM_FILE_5 "/usr/share/X11/rgb.txt"
/* about dialog text */
#define ABOUT_CREDITS_TEXT "Developer:\n" \
--- a/src/main.c
+++ b/src/main.c
@@ -36,6 +36,8 @@
sys_filename = SYSTEM_FILE_3;
else if (g_file_test (SYSTEM_FILE_4, G_FILE_TEST_EXISTS))
sys_filename = SYSTEM_FILE_4;
+ else if (g_file_test (SYSTEM_FILE_5, G_FILE_TEST_EXISTS))
+ sys_filename = SYSTEM_FILE_5;
else
return FALSE;
return TRUE;

View File

@ -0,0 +1,47 @@
# Copyright 1999-2020, 2022 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
EAPI=7
inherit autotools desktop xdg
DESCRIPTION="A GTK+ color selector"
HOMEPAGE="http://gcolor2.sourceforge.net"
SRC_URI="
mirror://sourceforge/${PN}/${P}.tar.gz
https://dev.gentoo.org/~pacho/gnome/${PN}.svg"
LICENSE="GPL-2 public-domain"
SLOT="0"
KEYWORDS="~amd64 ~ppc ~ppc64 ~x86"
RDEPEND=">=x11-libs/gtk+-2.4:2"
DEPEND="${RDEPEND}"
BDEPEND="
>=dev-util/intltool-0.27
virtual/pkgconfig"
PATCHES=(
"${FILESDIR}"/modular-rgb.patch
"${FILESDIR}"/${P}-amd64.patch
"${FILESDIR}"/${P}-pkg-config-macro.patch
"${FILESDIR}"/${P}-fno-common.patch
)
src_prepare() {
xdg_src_prepare
# To check at each bump.
sed "s/^#.*/[encoding: UTF-8]/" -i po/POTFILES.in || die "sed failed"
echo "gcolor2.glade" >> po/POTFILES.in || die
eautoreconf
}
src_install() {
default
# Icon from https://sourceforge.net/p/gcolor2/patches/5/
doicon -s scalable "${DISTDIR}/${PN}.svg"
make_desktop_entry ${PN} Gcolor2 ${PN} Graphics
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE pkgmetadata SYSTEM "https://www.gentoo.org/dtd/metadata.dtd">
<pkgmetadata>
<maintainer type="project">
<email>gnome@gentoo.org</email>
<name>Gentoo GNOME Desktop</name>
</maintainer>
<upstream>
<remote-id type="sourceforge">gcolor2</remote-id>
</upstream>
</pkgmetadata>