From ba14d4c733eec4d0ccdd4783e0ec3eb9a4c35317 Mon Sep 17 00:00:00 2001 From: Dominik Drobek Date: Sun, 12 Jan 2020 00:49:04 +0100 Subject: graphics/gcolor2: Changed category, updated script Added license and aligned SlackBuild script with the SBo template. Added SVG icon, and made doinst.sh update the icon cache. Changed source URL to gzip-compressed tarball. Category is changed from "misc" to "graphics", as it seems more appropriate. This change is also reflected in the .desktop file. Old Debian patches are dropped, and more up-to-date Gentoo patch is used instead. rgb.txt patch is renamed. Signed-off-by: Willy Sudiarto Raharjo --- graphics/gcolor2/README | 9 + graphics/gcolor2/amd64_segfault.patch | 46 ++++ graphics/gcolor2/color_definition_path.patch | 23 ++ graphics/gcolor2/doinst.sh | 9 + graphics/gcolor2/gcolor2.SlackBuild | 108 +++++++++ graphics/gcolor2/gcolor2.desktop | 10 + graphics/gcolor2/gcolor2.info | 10 + graphics/gcolor2/gcolor2.svg | 317 +++++++++++++++++++++++++++ graphics/gcolor2/slack-desc | 19 ++ 9 files changed, 551 insertions(+) create mode 100644 graphics/gcolor2/README create mode 100644 graphics/gcolor2/amd64_segfault.patch create mode 100644 graphics/gcolor2/color_definition_path.patch create mode 100644 graphics/gcolor2/doinst.sh create mode 100644 graphics/gcolor2/gcolor2.SlackBuild create mode 100644 graphics/gcolor2/gcolor2.desktop create mode 100644 graphics/gcolor2/gcolor2.info create mode 100644 graphics/gcolor2/gcolor2.svg create mode 100644 graphics/gcolor2/slack-desc (limited to 'graphics') diff --git a/graphics/gcolor2/README b/graphics/gcolor2/README new file mode 100644 index 000000000000..5a258055af01 --- /dev/null +++ b/graphics/gcolor2/README @@ -0,0 +1,9 @@ +gcolor2 is a simple color selector that was originally based on gcolor, +ported to GTK+2 and fitted with a new user interface. It only requires +GTK+2, so it's not dependent on any specific desktop environment. + +It provides the usual color wheel method, input box method, color-picker +method, and the ability to save user-defined colors. + +The list of saved colors is initially filled with the definitions read +from /usr/share/X11/rgb.txt. diff --git a/graphics/gcolor2/amd64_segfault.patch b/graphics/gcolor2/amd64_segfault.patch new file mode 100644 index 000000000000..cd06a8315f98 --- /dev/null +++ b/graphics/gcolor2/amd64_segfault.patch @@ -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 + #include ++#include ++#include ++#include + + #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 + #include ++#include ++#include ++#include ++#include + + #include "interface.h" + #include "support.h" diff --git a/graphics/gcolor2/color_definition_path.patch b/graphics/gcolor2/color_definition_path.patch new file mode 100644 index 000000000000..60c2830515af --- /dev/null +++ b/graphics/gcolor2/color_definition_path.patch @@ -0,0 +1,23 @@ +diff -Naur gcolor2-0.4.orig/src/callbacks.h gcolor2-0.4/src/callbacks.h +--- gcolor2-0.4.orig/src/callbacks.h 2005-07-11 19:18:59.000000000 -0400 ++++ gcolor2-0.4/src/callbacks.h 2008-03-11 03:59:49.000000000 -0400 +@@ -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" \ +diff -Naur 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 2008-03-11 04:00:12.000000000 -0400 +@@ -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; diff --git a/graphics/gcolor2/doinst.sh b/graphics/gcolor2/doinst.sh new file mode 100644 index 000000000000..65c7e2eeb9aa --- /dev/null +++ b/graphics/gcolor2/doinst.sh @@ -0,0 +1,9 @@ +if [ -x /usr/bin/update-desktop-database ]; then + /usr/bin/update-desktop-database -q usr/share/applications >/dev/null 2>&1 +fi + +if [ -e usr/share/icons/hicolor/icon-theme.cache ]; then + if [ -x /usr/bin/gtk-update-icon-cache ]; then + /usr/bin/gtk-update-icon-cache -f usr/share/icons/hicolor >/dev/null 2>&1 + fi +fi diff --git a/graphics/gcolor2/gcolor2.SlackBuild b/graphics/gcolor2/gcolor2.SlackBuild new file mode 100644 index 000000000000..abde646cf70d --- /dev/null +++ b/graphics/gcolor2/gcolor2.SlackBuild @@ -0,0 +1,108 @@ +#!/bin/sh + +# Slackware build script for gcolor2 +# +# Copyright 2010, 2011 slakmagik +# Copyright 2020 Dominik Drobek +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=gcolor2 +VERSION=${VERSION:-0.4} +BUILD=${BUILD:-4} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +# add path to rgb.txt color definitions provided by X11: +patch -p1 < $CWD/color_definition_path.patch +# fix segfaults on x86_64 and remove some compilation warnings: +patch -p1 < $CWD/amd64_segfault.patch +# correct character class definition in configure script: +sed -i '/gentoo_ltmain_version/s/\[:space:\]/[&]/g' configure + +CFLAGS="$SLKCFLAGS" \ +CXXFLAGS="$SLKCFLAGS" \ +./configure \ + --prefix=/usr \ + --libdir=/usr/lib${LIBDIRSUFFIX} \ + --sysconfdir=/etc \ + --localstatedir=/var \ + --mandir=/usr/man \ + --build=$ARCH-slackware-linux + +make +make install DESTDIR=$PKG + +install -D -m 644 $CWD/$PRGNAM.svg $PKG/usr/share/icons/hicolor/scalable/apps/$PRGNAM.svg +install -D -m 644 $CWD/$PRGNAM.desktop $PKG/usr/share/applications/$PRGNAM.desktop + +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 + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a AUTHORS ChangeLog COPYING INSTALL $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +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.${PKGTYPE:-tgz} diff --git a/graphics/gcolor2/gcolor2.desktop b/graphics/gcolor2/gcolor2.desktop new file mode 100644 index 000000000000..1d7e199ee2a6 --- /dev/null +++ b/graphics/gcolor2/gcolor2.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Version=1.0 +Type=Application +Name=gcolor2 +GenericName=Color Chooser +Comment=Pick colors via numeric input, color wheel, or named colors +Icon=gcolor2 +Exec=gcolor2 +Terminal=false +Categories=Graphics;GTK; diff --git a/graphics/gcolor2/gcolor2.info b/graphics/gcolor2/gcolor2.info new file mode 100644 index 000000000000..608caa3ce6f3 --- /dev/null +++ b/graphics/gcolor2/gcolor2.info @@ -0,0 +1,10 @@ +PRGNAM="gcolor2" +VERSION="0.4" +HOMEPAGE="http://gcolor2.sourceforge.net/" +DOWNLOAD="http://downloads.sourceforge.net/gcolor2/gcolor2-0.4.tar.gz" +MD5SUM="02de9d925ad5921522685f402caec3ec" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Dominik Drobek" +EMAIL="dominik.drobek (at) o2.pl" diff --git a/graphics/gcolor2/gcolor2.svg b/graphics/gcolor2/gcolor2.svg new file mode 100644 index 000000000000..d9de35dee393 --- /dev/null +++ b/graphics/gcolor2/gcolor2.svg @@ -0,0 +1,317 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + diff --git a/graphics/gcolor2/slack-desc b/graphics/gcolor2/slack-desc new file mode 100644 index 000000000000..4bad1ac240e6 --- /dev/null +++ b/graphics/gcolor2/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +gcolor2: gcolor2 (GTK+2 color selector) +gcolor2: +gcolor2: gcolor2 is a simple color selector application that is not dependent +gcolor2: on any specific desktop environment. +gcolor2: +gcolor2: It provides the color wheel method, input box method, color-picker +gcolor2: method, and the ability to save user-defined colors. +gcolor2: +gcolor2: Homepage: http://gcolor2.sourceforge.net/ +gcolor2: +gcolor2: -- cgit v1.2.3