summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app-misc/gtk-sunlight/ChangeLog11
-rw-r--r--app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1-makefile.patch21
-rw-r--r--app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1.patch93
-rw-r--r--app-misc/gtk-sunlight/gtk-sunlight-0.2.1.ebuild35
-rw-r--r--app-misc/gtk-sunlight/metadata.xml9
5 files changed, 169 insertions, 0 deletions
diff --git a/app-misc/gtk-sunlight/ChangeLog b/app-misc/gtk-sunlight/ChangeLog
new file mode 100644
index 000000000000..a82c166210ec
--- /dev/null
+++ b/app-misc/gtk-sunlight/ChangeLog
@@ -0,0 +1,11 @@
+# ChangeLog for app-misc/gtk-sunlight
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/gtk-sunlight/ChangeLog,v 1.1 2010/10/27 23:25:17 xmw Exp $
+
+*gtk-sunlight-0.2.1 (27 Oct 2010)
+
+ 27 Oct 2010; Michael Weber <xmw@gentoo.org> +gtk-sunlight-0.2.1.ebuild,
+ +files/gtk-sunlight-0.2.1-makefile.patch, +files/gtk-sunlight-0.2.1.patch,
+ +metadata.xml:
+ Initial import, fixes bug 342975 by David <write2David@gmail.com>.
+
diff --git a/app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1-makefile.patch b/app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1-makefile.patch
new file mode 100644
index 000000000000..77c4c52aaca6
--- /dev/null
+++ b/app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1-makefile.patch
@@ -0,0 +1,21 @@
+--- makefile 2010-10-05 18:01:14.000000000 +0200
++++ /tmp/makefile 2010-10-28 00:29:30.704714980 +0200
+@@ -1,7 +1,7 @@
+-CC = gcc
++CC ?= gcc
+
+-CFLAGS = `pkg-config --cflags gtk+-2.0 gmodule-2.0`
+-LDFLAGS = `pkg-config --libs gtk+-2.0 gmodule-2.0`
++CFLAGS += `pkg-config --cflags gtk+-2.0 gmodule-2.0`
++LDFLAGS += `pkg-config --libs gtk+-2.0 gmodule-2.0`
+
+ OBJECTS = sunlight.o callbacks.o
+ PROG = gtk-sunlight
+@@ -10,7 +10,8 @@
+ $(CC) -o $@ $(OBJECTS) $(LDFLAGS)
+
+ install:
++ install -d -m 0755 $(DESTDIR)/usr/bin $(DESTDIR)/usr/share/icons
+ cp $(PROG) $(DESTDIR)/usr/bin/
+ cp -r sunlight $(DESTDIR)/usr/share/
+ cp -r applications $(DESTDIR)/usr/share/
diff --git a/app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1.patch b/app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1.patch
new file mode 100644
index 000000000000..2b04b97b8514
--- /dev/null
+++ b/app-misc/gtk-sunlight/files/gtk-sunlight-0.2.1.patch
@@ -0,0 +1,93 @@
+Hop this is felling better now ... Michael Weber
+
+--- gtk-sunlight-0.2.1/callbacks.c
++++ gtk-sunlight-0.2.1callbacks.c
+@@ -19,6 +19,9 @@
+
+
+ #include "support.h"
++#include <glib.h>
++#include <glib/gstdio.h>
++#include <stdlib.h>
+
+ void button_sensitive (ChData *data, gboolean sensitive);
+ void change_wallpaper (ChData *data);
+@@ -94,21 +97,21 @@
+
+ void cmd_ok_clicked ( GtkButton *button, ChData *data)
+ {
+- FILE *file;
+ int time_out;
+- gchar *contents;
++ gchar *contents = g_malloc(1002);
+ gchar *fname = g_strconcat(g_get_home_dir(), DIR_PROJECT, "/sunlight_options", NULL);
+
+ gtk_widget_hide(data->main_window);
+
+ /*Saving gi_rd1 and gi_rd2 to a file under DIR_PROJECT*/
+- sprintf(contents, "%d %d", data->gi_rd1, data->gi_rd2);
++ snprintf(contents, 1000, "%d %d", data->gi_rd1, data->gi_rd2);
+
+ g_file_set_contents(fname, contents, -1, NULL);
+
+ change_wallpaper (data);
+ time_out = gtk_timeout_add(1800000, (GtkFunction) change_wallpaper, data);
+
++ g_free(contents);
+ g_free(fname);
+ }
+
+@@ -118,7 +121,6 @@
+ void
+ change_wallpaper (ChData *data)
+ {
+- FILE *file;
+ gchar *text1, *text2, *image_address, *set_wallpaper;
+ gchar *dir_wallpapers = g_strconcat(g_get_home_dir(), DIR_WALLPAPERS, NULL);
+ gchar *dir_project = g_strconcat(g_get_home_dir(), DIR_PROJECT, NULL);
+@@ -183,7 +185,6 @@
+ void
+ chk_startup_toggled_cb (GtkToggleButton *togglebutton, ChData *data)
+ {
+- FILE *file;
+ gchar *contents = "[Desktop Entry]\nEncoding=UTF-8\nIcon=/usr/share/icons/hicolor/48x48/apps/gtk-sunlight.png\nName=Real-time Sunlight Wallpaper\nComment=World sunlight map every 30 minutes\nExec=gtk-sunlight --nodisplay\nTerminal=false\nType=Application\nCategories=Utility;\nStartupNotify=false\nHidden=false\nNoDisplay=false";
+ gchar *path_startup = g_strconcat(g_get_home_dir(), "/.config/autostart/", NULL);
+
+--- gtk-sunlight-0.2.1/sunlight.c
++++ gtk-sunlight-0.2.1/sunlight.c
+@@ -20,9 +20,15 @@
+ #include "support.h"
+ #include "errno.h"
+ //#include "time.h"
++#include <glib.h>
++#include <glib/gstdio.h>
++#include <stdlib.h>
++#include <ctype.h>
+
+ #define UI_FILE "/usr/share/sunlight/sunlight.glade"
+
++void change_wallpaper (ChData *data);
++
+ gboolean
+ make_dir(gchar *trail)
+ {
+@@ -78,7 +84,7 @@
+ GError *error = NULL;
+ gchar *option_file = g_strconcat(g_get_home_dir(), DIR_PROJECT, "/sunlight_options", NULL);
+ gchar *contents;
+- gint length;
++ gsize length;
+ int time_out;
+
+ GOptionContext *context;
+@@ -111,8 +117,8 @@
+ data = g_slice_new( ChData );
+
+ /* create project directories if necessary */
+- if (!make_dir(DIR_PROJECT)) return;
+- if (!make_dir(DIR_WALLPAPERS)) return;
++ if (!make_dir(DIR_PROJECT)) return 1;
++ if (!make_dir(DIR_WALLPAPERS)) return 1;
+
+ /* Check for sunlight_options file and getting gi_rd1 and gi_rd2*/
+ if (g_file_test(option_file, G_FILE_TEST_EXISTS)){
diff --git a/app-misc/gtk-sunlight/gtk-sunlight-0.2.1.ebuild b/app-misc/gtk-sunlight/gtk-sunlight-0.2.1.ebuild
new file mode 100644
index 000000000000..e9af6d48cc88
--- /dev/null
+++ b/app-misc/gtk-sunlight/gtk-sunlight-0.2.1.ebuild
@@ -0,0 +1,35 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-misc/gtk-sunlight/gtk-sunlight-0.2.1.ebuild,v 1.1 2010/10/27 23:25:17 xmw Exp $
+
+EAPI=3
+
+inherit eutils toolchain-funcs
+
+DESCRIPTION="Real-time Sunlight Wallpaper"
+HOMEPAGE="http://realtimesunlightwallpaper.weebly.com/"
+SRC_URI="http://ppa.launchpad.net/realtime.sunlight.wallpaper/rsw/ubuntu/pool/main/g/${PN}/${PN}_${PV}.orig.tar.gz"
+
+LICENSE="GPL-1"
+SLOT="0"
+KEYWORDS="~amd64"
+IUSE=""
+
+RDEPEND="dev-libs/glib:2
+ x11-libs/gtk+:2"
+DEPEND="${REPEND}
+ dev-util/pkgconfig"
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-makefile.patch
+ epatch "${FILESDIR}"/${P}.patch
+}
+
+src_compile() {
+ emake CC="$(tc-getCC)" || die
+}
+
+src_install() {
+ emake DESTDIR="${ED}" install || die
+ dodoc README || die
+}
diff --git a/app-misc/gtk-sunlight/metadata.xml b/app-misc/gtk-sunlight/metadata.xml
new file mode 100644
index 000000000000..32c2cb560368
--- /dev/null
+++ b/app-misc/gtk-sunlight/metadata.xml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<herd>no-herd</herd>
+<maintainer>
+<email>xmw@gentoo.org</email>
+<name>Michael Weber</name>
+</maintainer>
+</pkgmetadata>