From 77d8649d57a8ef9c7b90f22dae5730caecc07930a85128ebe23a28a2b14a122f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ismail=20D=C3=B6nmez?= Date: Fri, 29 Apr 2011 15:52:00 +0000 Subject: [PATCH] Accepting request 67666 from openSUSE:Factory:Contrib please add nvdock to hardware OBS-URL: https://build.opensuse.org/request/show/67666 OBS-URL: https://build.opensuse.org/package/show/hardware/nvdock?expand=0&rev=1 --- .gitattributes | 23 +++++++++++++ .gitignore | 1 + Makefile | 7 ++++ nvdock-1.02-argptr.patch | 70 ++++++++++++++++++++++++++++++++++++++++ nvdock-1.02.tar.bz2 | 3 ++ nvdock.changes | 5 +++ nvdock.desktop | 10 ++++++ nvdock.spec | 69 +++++++++++++++++++++++++++++++++++++++ 8 files changed, 188 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 Makefile create mode 100644 nvdock-1.02-argptr.patch create mode 100644 nvdock-1.02.tar.bz2 create mode 100644 nvdock.changes create mode 100644 nvdock.desktop create mode 100644 nvdock.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..4f0c9fb --- /dev/null +++ b/Makefile @@ -0,0 +1,7 @@ +CC = gcc +CFLAGS = $(shell pkg-config --cflags gtk+-2.0) ${RPM_OPT_FLAGS} +LDLIBS = $(shell pkg-config --libs gtk+-2.0) + +all: nvdock + +nvdock: nvdock.o icon.o util.o diff --git a/nvdock-1.02-argptr.patch b/nvdock-1.02-argptr.patch new file mode 100644 index 0000000..7521e41 --- /dev/null +++ b/nvdock-1.02-argptr.patch @@ -0,0 +1,70 @@ +diff -rupN nvdock-1.02/src/nvdock.c nvdock-1.02_mod/src/nvdock.c +--- nvdock-1.02/src/nvdock.c 2007-10-19 12:05:06.000000000 +0200 ++++ nvdock-1.02_mod/src/nvdock.c 2011-03-22 18:17:01.478213919 +0100 +@@ -40,7 +40,7 @@ bob_main_quit(void) { + return; + } + +-int main(int argc, char *argv) { ++int main(int argc, char **argv) { + + if(!exists_application("cut") || !exists_application("grep")) { + puts("error: make sure `cut` and `grep` are installed."); +@@ -59,7 +59,7 @@ int main(int argc, char *argv) { + + unsigned int pid = 0; + +- arg = (argstruct *)argc_argv_parse(argc,argv); ++ argc_argv_parse(argc,argv); + + //. more preliminary checks. + arg->has_nvclock = exists_application("nvclock"); +diff -rupN nvdock-1.02/src/nvdock.h nvdock-1.02_mod/src/nvdock.h +--- nvdock-1.02/src/nvdock.h 2007-10-19 12:07:19.000000000 +0200 ++++ nvdock-1.02_mod/src/nvdock.h 2011-03-23 00:38:31.472213662 +0100 +@@ -79,13 +79,15 @@ typedef struct _argc_argv { + gboolean has_nvclock:1; + gboolean has_nvclock_gtk:1; + +- unsigned char nvversion[32]; ++ char nvversion[32]; + + } argstruct; + + argstruct *arg; + BobStatusIcon *bsi; + ++void argc_argv_parse(int argc, char **argv); ++ + gboolean exists_application(const char *); + gboolean exists_icon_file(const char *); + +diff -rupN nvdock-1.02/src/util.c nvdock-1.02_mod/src/util.c +--- nvdock-1.02/src/util.c 2007-11-24 12:17:51.000000000 +0100 ++++ nvdock-1.02_mod/src/util.c 2011-03-22 18:17:22.350213797 +0100 +@@ -33,14 +33,14 @@ The NVIDIA name and Logo are property of + + #include "nvdock.h" + +-argstruct * ++void + argc_argv_parse(int argc, char **argv) { + + //. this function requires the typedef struct _argc_argv, which has been + //. placed in nvdock.h for this application. + + int a = 1; +- argstruct *arg = (argstruct *)malloc(sizeof(argstruct)); ++ arg = (argstruct *)malloc(sizeof(argstruct)); + + arg->version = 0; + arg->help = 0; +@@ -78,8 +78,6 @@ argc_argv_parse(int argc, char **argv) { + + ++a; + } +- +- return arg; + } + + int diff --git a/nvdock-1.02.tar.bz2 b/nvdock-1.02.tar.bz2 new file mode 100644 index 0000000..175b1dc --- /dev/null +++ b/nvdock-1.02.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:fe37d3c2386475b68c4de28c8672f0e8e0c03cdb4e1e054211c7029b086ca72d +size 11881 diff --git a/nvdock.changes b/nvdock.changes new file mode 100644 index 0000000..afe2d65 --- /dev/null +++ b/nvdock.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Tue Mar 22 17:44:05 UTC 2011 - adam@mizerski.pl + +- new package + diff --git a/nvdock.desktop b/nvdock.desktop new file mode 100644 index 0000000..6d3b557 --- /dev/null +++ b/nvdock.desktop @@ -0,0 +1,10 @@ +[Desktop Entry] +Type=Application +Encoding=UTF-8 +Name=NVIDIA Dock +GenericName=Tray dock +Comment=Tray icon launcher for NVIDIA settings +Exec=nvdock +Icon=nvdock +Categories=TrayIcon; +OnlyShowIn=GNOME;KDE;XFCE;LXDE; diff --git a/nvdock.spec b/nvdock.spec new file mode 100644 index 0000000..3dd27d6 --- /dev/null +++ b/nvdock.spec @@ -0,0 +1,69 @@ +# +# spec file for package nvdock +# +# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany. +# +# All modifications and additions to the file contributed by third parties +# remain the property of their copyright owners, unless otherwise agreed +# upon. The license for this file, and modifications and additions to the +# file, is the same license as for the pristine package itself (unless the +# license for the pristine package is not an Open Source License, in which +# case the license is the MIT License). An "Open Source License" is a +# license that conforms to the Open Source Definition (Version 1.9) +# published by the Open Source Initiative. + +# Please submit bugfixes or comments via http://bugs.opensuse.org/ +# +# norootforbuild + +Name: nvdock +Version: 1.02 +Release: 1 +Summary: Tray icon for launching NVIDIA Settings +Group: System/X11/Utilities + +License: BSD-3 +URL: http://www.opsat.net/development/nvdock/ +Source0: http://bobmajdakjr.googlecode.com/files/%{name}-%{version}.tar.bz2 +# The provided Makefile sucks, so I did this one. -- adam@mizerski.pl +Source1: Makefile +Source2: %{name}.desktop +# PATCH-FIX-UPSTREAM nvdock-1.02-argptr.patch adam@mizerski.pl - Get rid of "warning: cast to pointer from integer of different size" +Patch0: %{name}-1.02-argptr.patch + +BuildRequires: pkgconfig(gtk+-2.0) +BuildRequires: update-desktop-files + +%description +Little NVIDIA tray icon. +Hover over it and it will tell you your GPU temperature if your card is into that kind of thing. +A double click will launch the NVIDIA settings control panel, and right click will bring up a nifty menu with a few options. +Also on the menu it will show the NVIDIA driver version, which is surely to come in handy at least one time in your life. + +%prep +%setup -q +%patch0 -p1 + +%build +%__make -C src -f %{SOURCE1} %{?_smp_mflags} + +%install +%__install -m 755 -D src/nvdock %buildroot%{_bindir}/nvdock +# path to icon is hardcoced in src/nvdock.h +%__install -m 644 -D data/nvdock.png %buildroot/usr/share/pixmaps/nvdock.png +%__install -m 644 -D %{SOURCE2} %buildroot%{_datadir}/applications/nvdock.desktop +%suse_update_desktop_file nvdock + +%clean +%__rm -rf %{buildroot} + + +%files +%defattr(-,root,root) +%{_bindir}/nvdock +# path to icon is hardcoced in src/nvdock.h +/usr/share/pixmaps/nvdock.png +%{_datadir}/applications/nvdock.desktop +%doc COPYING ChangeLog README TODO + +%changelog