summaryrefslogtreecommitdiff
path: root/sys-power/nvclock
diff options
context:
space:
mode:
authorV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
committerV3n3RiX <venerix@redcorelinux.org>2017-10-09 18:53:29 +0100
commit4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch)
treeba5f07bf3f9d22d82e54a462313f5d244036c768 /sys-power/nvclock
reinit the tree, so we can have metadata
Diffstat (limited to 'sys-power/nvclock')
-rw-r--r--sys-power/nvclock/Manifest11
-rw-r--r--sys-power/nvclock/files/nvclock-0.8_p20110102-buffers.patch202
-rw-r--r--sys-power/nvclock/files/nvclock-0.8_p20110102-desktop.patch18
-rw-r--r--sys-power/nvclock/files/nvclock-0.8_p20110102-r1-make.patch94
-rw-r--r--sys-power/nvclock/files/nvclock-0.8_p20110102-usleep.patch14
-rw-r--r--sys-power/nvclock/files/nvclock_confd9
-rw-r--r--sys-power/nvclock/files/nvclock_initd12
-rw-r--r--sys-power/nvclock/metadata.xml12
-rw-r--r--sys-power/nvclock/nvclock-0.8_p20110102-r2.ebuild65
9 files changed, 437 insertions, 0 deletions
diff --git a/sys-power/nvclock/Manifest b/sys-power/nvclock/Manifest
new file mode 100644
index 000000000000..6a2c7fec3f5d
--- /dev/null
+++ b/sys-power/nvclock/Manifest
@@ -0,0 +1,11 @@
+AUX nvclock-0.8_p20110102-buffers.patch 5181 SHA256 aecb2ecc04601dcd941fb60e83190b3b4e4b8ab656c35788d57baf1cbad95d34 SHA512 bca744826c3b3d12e4e694d692d58cc6b1004c6198ea65af765dacce717e523e0ae4f48fc7b95cadd377160e4c41a311ca901c0a269d0781705fb25ce2919924 WHIRLPOOL ef200a59c2fba56e78f2dd1b02d61bf1aa4bb8e1dd47130bc1eb86c0fb3e68762e5391e60b51062b848efc71aea0a9a35c024c87fbf28418834a7bd3c705b5a1
+AUX nvclock-0.8_p20110102-desktop.patch 544 SHA256 b1e91daa971459d9719a44f0a392044919fd1034ea85a81c8088571f9896ccb0 SHA512 4816780a6fc1770853d547de3f4e7b1533086b69ac380e99df47ba23dff696f1bd9644de9fac25ed82cb86284f2af28323245249d9372a6064499cdfc84618c2 WHIRLPOOL c890094e0ecdb87c1a824e159ea2b0dfe60f119d1091c8ada4b63e72dfba4b26762c69e55921622edcb4364138dc103e7384788db414113118bae7aa1c61bbfd
+AUX nvclock-0.8_p20110102-r1-make.patch 2788 SHA256 b9e3345d5163e5e207477028f7cf07da3aa91d018124c9ccbac2cfae5171c7d0 SHA512 fa1b6591efd950d90501a72ecd1232fdac878cd6126eb15528526a90f4b99c7fe4348a6382a0c111b5af849f678b0a59b143a8ea74653e6d78114887c632a0a6 WHIRLPOOL 792de5a1837ceb9b913375bf4da47a918e5525f4cbf7928ad82a4eb60196f7106d85f15ee72e59f08d9a2a662fb3109f5be5c8524adda6f2174d63988ea4958b
+AUX nvclock-0.8_p20110102-usleep.patch 295 SHA256 4c7b942abc0679a3b45b1c355a00ebd1d8ef1f469c7dcdb2e454daedef029eef SHA512 6681f08788d79b0534734cc09fef5df3686c5fe6664f5e7bd634ee8e45a3e49821201895f221cd42e7cab2be88330febd57f069a24e09da4c60ef2b1fd6ee206 WHIRLPOOL 82545c5bca32ea19e3f5f8100d9401a2e6d5f08e24880cf12f497b09768371a6f1238891587a38f66d2cee6982a1b23bd12db0ec846ebf8350c7e788bbf551e4
+AUX nvclock_confd 360 SHA256 2bbf36faa3b78425471275f70c4d8abdff4720dc854152e4ad7b2da68810bdca SHA512 9a5ebc91fe1346677b982d178099d577ad285b104c38720a975fc6b25190ec86e00ffbc165e7409b8aba5d8d9c1d336508579deb573c5ba7495b84fa28900519 WHIRLPOOL d1f80835454b52e9afa8fcdc96dd9e4b04401124669257c562d3eb3ecb5da446e55ecaa78076fc828c08a36c7f7407ddeeb8633aae86fd2669263cdd9c45189e
+AUX nvclock_initd 145 SHA256 26040fce86a0c409e4f714691f560bc69442919ca19dc29f97d374833712b08f SHA512 348601da9728e2d726504bf23da944859813e52999ef1c716561523d6de61c1726be89b3f57e1a27d4ab641eda19b4dddc6eb8588a0ae1f64b4b418cc14876b1 WHIRLPOOL d3da9e48b36ff89ba275ada91a58e3a40391da6880b1fe5048702faf690577da15e8333c809bab84c694a7c220bb06bc249f4ad6d41f9ba9a95feb248009e6cb
+DIST nvclock-0.8_p20110102.tar.bz2 285043 SHA256 d2a753908ef665caa996b71efd3081501e4b0fb45fa827add685cbc85d5d3745 SHA512 01bf7faed83acdf2390e1f410b2f8b697ff647b15562a6960a99666ec5121b532cbf4380137c9ee24221ccafff641bcdef4748dcad7ac92fb25fa15e735dd140 WHIRLPOOL e0d42a293add54b2d74e94fb54e0b20d29041b741476c63dc29a28ce10efc717a68d7bc82f4fb38f57a998526db4510d0b419e2617261765c8b38bb45ba24c43
+EBUILD nvclock-0.8_p20110102-r2.ebuild 1297 SHA256 99347b0e022a0c334c520d862907758bfcfc5bfa17d391481cb76a260f2d15f5 SHA512 58622a82b4c6a4f062fe092d7afca7af3da3da406c95bd01e9808175248e35a7347268794546727926f5621e1b0c9ec2a62f8b3f5c50da85a311793aa9bda203 WHIRLPOOL fbc18e5895c6203d2eea42410e92f00da698133161225c70fdbfea6793e0e0ef017b9bcf8a27e0292f9dad328f4b5207ba127e39c1b4d805c4bc73ef212d1280
+MISC ChangeLog 2556 SHA256 f0219b47d179962215d69ce1994c27a9eeb3c218bb5cc42dc83d168a4bf62903 SHA512 0fbfdbacb991d094b4d77e33a53f64701e4ed519459ccb824694102df900ce86b373e3c76d9994d374b6bbb49ffdc4addb89ceb84f2781f30810cc54a072c13b WHIRLPOOL eb94db80b628a4c0f8a51ba4aa132f2e410be4ce4cda5f07576b5a8e378d0aaeacf320255dc972b6e10605b4a2f3249d793acbebe4edf2d06a3c35242c506cc6
+MISC ChangeLog-2015 10698 SHA256 95c5ac720a4561ac1485fb1e5b05c9d2ca8bfc4e74a326e00429e81e52533096 SHA512 afcae2b47de0df5ce11f1547e331add2c1d708dbc4f279b5b7701be1aba16209a9db2c3c5f6b9e1fcfaed799d0f8c51dfeaa722eaed7d0b8dddefb021d9cd432 WHIRLPOOL 119755f6890c617dbc371695ecb071d6d791a9a13396c4fa72f66e51ccda81a1c83b493d9fbf48b030c3e0cf667ece055aa81c106a087c09c1ab029a81438b3a
+MISC metadata.xml 399 SHA256 b5d6112ba1fb0b245c5e6f1100c4b2ff8e957c23a59acda66b60e212591518a9 SHA512 df14f8340f688857210010d6843e0a86d706ba3bb9edbe015ad42e36fb7eb6c8606e2ea9d5dbfea7c4f7ad3f0e94c78d7b8c2b7b2a29af88d5c161162f8befcb WHIRLPOOL d5449a065a00ec59f2bcc2f920394729fb87ad5fb46b25ccaf6eda0aeb8921c7c05a127c90d101ff1564718085808ca076257a9291dae78b202790b90ddb0c6b
diff --git a/sys-power/nvclock/files/nvclock-0.8_p20110102-buffers.patch b/sys-power/nvclock/files/nvclock-0.8_p20110102-buffers.patch
new file mode 100644
index 000000000000..f64cb9b8456d
--- /dev/null
+++ b/sys-power/nvclock/files/nvclock-0.8_p20110102-buffers.patch
@@ -0,0 +1,202 @@
+https://bugs.gentoo.org/364667
+
+clean up random buffer overflows in the code
+
+--- a/src/backend/back_linux.c
++++ b/src/backend/back_linux.c
+@@ -42,7 +42,9 @@ static int probe_devices();
+ static int check_driver()
+ {
+ FILE *proc;
+- char buffer[80];
++ char *buffer = NULL;
++ size_t len;
++ int ret = 0;
+
+ proc = fopen("/proc/modules", "r");
+
+@@ -50,9 +52,9 @@ static int check_driver()
+ if(proc == NULL)
+ return 0;
+
+- while(fgets(buffer, 80, proc) != NULL)
++ while(getline(&buffer, &len, proc) != -1)
+ {
+- char name[80];
++ char name[100];
+ int size;
+ int used;
+
+@@ -64,26 +66,23 @@ static int check_driver()
+ {
+ if(strcmp(name, "NVdriver") == 0)
+ {
+- fclose(proc);
+ if(used)
+- return 1;
+-
+- return 0;
++ ret = 1;
++ break;
+ }
+
+ if(strcmp(name, "nvidia") == 0)
+ {
+- fclose(proc);
+ if(used)
+- return 2;
+-
+- return 0;
++ ret = 2;
++ break;
+ }
+ }
+ }
++ free(buffer);
+ fclose(proc);
+
+- return 0;
++ return ret;
+ }
+
+ int init_nvclock()
+@@ -114,7 +113,8 @@ static int probe_devices()
+ {
+ int dev, irq, reg_addr, i=0;
+ unsigned short devbusfn;
+- char buf[256];
++ char *buf = NULL;
++ size_t len;
+ FILE *proc;
+
+ proc = fopen("/proc/bus/pci/devices", "r");
+@@ -124,7 +124,7 @@ static int probe_devices()
+ return 0;
+ }
+
+- while(fgets(buf, sizeof(buf)-1, proc))
++ while(getline(&buf, &len, proc) != -1)
+ {
+ if(sscanf(buf,"%hx %x %x %x",&devbusfn, &dev, &irq, &reg_addr) != 4) continue;
+
+@@ -181,6 +181,7 @@ static int probe_devices()
+ i++;
+ }
+ }
++ free(buf);
+ fclose(proc);
+
+ if(i==0)
+--- a/src/backend/config.c
++++ b/src/backend/config.c
+@@ -286,8 +286,9 @@ int open_config()
+ {
+ if(mkdir(nvclock.path, 0755))
+ {
+- char buf[80];
+- sprintf(buf, "Can't create '%s'. Do you have sufficient permissions?\n", nvclock.path);
++ char buf[1024];
++ snprintf(buf, sizeof(buf), "Can't create path (do you have sufficient permissions?): %s", nvclock.path);
++ buf[sizeof(buf) - 1] = '\0';
+ set_error_str(buf);
+ return 0;
+ }
+@@ -297,8 +298,9 @@ int open_config()
+ /* Check if .nvclock really is a directory. For some users it was a file and this led to a segfault. */
+ if(!S_ISDIR(stat_buf.st_mode))
+ {
+- char buf[80];
+- sprintf(buf, "Can't open '%s'. Is it really a directory?\n", nvclock.path);
++ char buf[1024];
++ snprintf(buf, sizeof(buf), "Can't open path (Is it really a directory?): %s", nvclock.path);
++ buf[sizeof(buf) - 1] = '\0';
+ set_error_str(buf);
+ return 0;
+ }
+--- a/src/backend/error.c
++++ b/src/backend/error.c
+@@ -41,23 +41,19 @@ void set_error_str(const char *str)
+ }
+
+
+-char *get_error(char *buf, int size)
++const char *get_error(void)
+ {
+ switch(nvclock.nv_errno)
+ {
+ case NV_ERR_NO_DEVICES_FOUND:
+- strcpy(buf, "No nvidia cards found in your system!");
+- break;
++ return "No nvidia cards found in your system!";
+ case NV_ERR_NO_DRIVERS_FOUND:
+- strcpy(buf, "You don't have enough permissions to run NVClock! Retry as root or install the Nvidia drivers.");
+- break;
++ return "You don't have enough permissions to run NVClock! Retry as root or install the Nvidia drivers.";
+ case NV_ERR_NOT_ENOUGH_PERMISSIONS:
+- strcpy(buf, "You don't have enough permissions to run NVClock! Retry as root.");
+- break;
++ return "You don't have enough permissions to run NVClock! Retry as root.";
+ case NV_ERR_OTHER:
+- strcpy(buf, nvclock.nv_err_str);
+- break;
++ return nvclock.nv_err_str;
+ }
+
+- return buf;
++ return "unknown";
+ }
+--- a/src/backend/nvclock.h
++++ b/src/backend/nvclock.h
+@@ -335,7 +335,7 @@ cfg_entry* lookup_entry(cfg_entry **cfg, char *section, char *name);
+ void destroy(cfg_entry **cfg);
+
+ /* error handling */
+-char *get_error(char *buf, int size);
++const char *get_error(void);
+ void set_error(int code);
+ void set_error_str(const char *err);
+
+--- a/src/gtk/main.c
++++ b/src/gtk/main.c
+@@ -264,8 +264,7 @@ int main (int argc, char *argv[])
+ */
+ if(!init_nvclock())
+ {
+- char buf[80];
+- GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", get_error(buf, 80));
++ GtkWidget *dialog = gtk_message_dialog_new(NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, "%s", get_error());
+ gtk_dialog_run(GTK_DIALOG(dialog));
+ g_signal_connect_swapped(GTK_OBJECT(dialog), "response", G_CALLBACK(gtk_widget_destroy), GTK_OBJECT(dialog));
+ gtk_widget_destroy(dialog);
+--- a/src/nvclock.c
++++ b/src/nvclock.c
+@@ -604,8 +604,7 @@ int main(int argc, char *argv[])
+
+ if(!init_nvclock())
+ {
+- char buf[80];
+- fprintf(stderr, "Error: %s\n", get_error(buf, 80));
++ fprintf(stderr, "Error: %s\n", get_error());
+ return 0;
+ }
+
+@@ -851,8 +850,7 @@ int main(int argc, char *argv[])
+ {
+ if(!set_card(i))
+ {
+- char buf[80];
+- fprintf(stderr, "Error: %s\n", get_error(buf, 80));
++ fprintf(stderr, "Error: %s\n", get_error());
+ return 0;
+ }
+
+@@ -887,8 +885,7 @@ int main(int argc, char *argv[])
+ /* set the card object to the requested card */
+ if(!set_card(card_number))
+ {
+- char buf[80];
+- fprintf(stderr, "Error: %s\n", get_error(buf, 80));
++ fprintf(stderr, "Error: %s\n", get_error());
+ return 0;
+ }
+
diff --git a/sys-power/nvclock/files/nvclock-0.8_p20110102-desktop.patch b/sys-power/nvclock/files/nvclock-0.8_p20110102-desktop.patch
new file mode 100644
index 000000000000..034208ff817a
--- /dev/null
+++ b/sys-power/nvclock/files/nvclock-0.8_p20110102-desktop.patch
@@ -0,0 +1,18 @@
+fix qa warning:
+
+/usr/share/applications/nvclock.desktop: error: (will be fatal in the future):
+value "nvclock.png" for key "Icon" in group "Desktop Entry" is an icon name
+with an extension, but there should be no extension as described in the Icon
+Theme Specification if the value is not an absolute path
+
+--- a/nvclock.desktop
++++ b/nvclock.desktop
+@@ -3,7 +3,7 @@ Encoding=UTF-8
+ Name=NVCLOCK
+ Comment=Overclock and Monitor NVIDIA cards
+ Exec=nvclock_gtk
+-Icon=nvclock.png
++Icon=nvclock
+ Terminal=false
+ Type=Application
+ Categories=System;
diff --git a/sys-power/nvclock/files/nvclock-0.8_p20110102-r1-make.patch b/sys-power/nvclock/files/nvclock-0.8_p20110102-r1-make.patch
new file mode 100644
index 000000000000..e45e2a6aa341
--- /dev/null
+++ b/sys-power/nvclock/files/nvclock-0.8_p20110102-r1-make.patch
@@ -0,0 +1,94 @@
+- Fix building with --as-needed
+- Fix parallel make by defining two new targets
+- Fix one spelling error
+- Respect CFLAGS, LDFLAGS
+- Link GTK frontend against -lX11 since it uses XOpenDisplay all the time
+
+--- a/configure.in
++++ b/configure.in
+@@ -141,7 +141,7 @@
+ if [test "$HAVE_NVCONTROL" = "yes"]; then
+ echo "- NV-CONTROL support enabled"
+ else
+- echo "- NV-CONROL support disabled"
++ echo "- NV-CONTROL support disabled"
+ fi
+ if [test "$HAVE_GTK2" = "yes"]; then
+ echo "- GTK2 GUI enabled"
+--- a/src/Makefile.in
++++ b/src/Makefile.in
+@@ -16,7 +16,7 @@
+ ifeq ($(HAVE_NVCONTROL), yes)
+ DEPS=$(libbackend) $(libnvcontrol)
+ INCLUDES=@X11_CFLAGS@ -I./backend -I./nvcontrol -I..
+- LIBS=@X11_LIBS@ -L./backend -lbackend -L./nvcontrol -lnvcontrol
++ LIBS=-L./backend -lbackend -L./nvcontrol -lnvcontrol @X11_LIBS@
+ else
+ DEPS=$(libbackend)
+ INCLUDES=-I./backend -I./nvcontrol -I..
+@@ -30,12 +30,17 @@
+
+ all: all-recursive nvclock smartdimmer
+
++$(libbackend):
++ $(MAKE) -C backend
++
++$(libnvcontrol):
++ $(MAKE) -C nvcontrol
+
+ nvclock: $(DEPS) $(LIB) nvclock.c
+- $(CC) $(CFLAGS) -o nvclock $(nvclock_SOURCES) $(INCLUDES) $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o nvclock $(nvclock_SOURCES) $(INCLUDES) $(LIBS)
+
+ smartdimmer: $(DEPS) $(LIB) smartdimmer.c
+- $(CC) $(CFLAGS) -o smartdimmer $(smartdimmer_SOURCES) $(INCLUDES) $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o smartdimmer $(smartdimmer_SOURCES) $(INCLUDES) $(LIBS)
+
+
+ clean: clean-recursive clean-app
+--- a/src/gtk/Makefile.in
++++ b/src/gtk/Makefile.in
+@@ -27,6 +27,7 @@
+ LIBS=@GTK_LIBS@ -L../backend -lbackend
+ OBJECTS=banner.o hw.o main.o settings.o
+ endif
++LIBS += -lX11
+
+
+ .PHONY: clean distclean install
+@@ -33,7 +33,7 @@
+ all: $(PROGRAM)
+
+ nvclock_gtk: $(DEPS) $(OBJECTS)
+- $(CC) $(CFLAGS) -o nvclock_gtk $(OBJECTS) $(libbackend) $(LIBS)
++ $(CC) $(CFLAGS) $(LDFLAGS) -o nvclock_gtk $(OBJECTS) $(libbackend) $(LIBS)
+
+ clean:
+ rm -f nvclock_gtk *.core *.o *.exe
+--- a/src/qt/Makefile.in
++++ b/src/qt/Makefile.in
+@@ -31,7 +31,7 @@
+ all: $(PROGRAM)
+
+ nvclock_qt: $(DEPS) qt_nvclock.moc qt_xfree.moc $(OBJECTS)
+- $(CXX) $(CXXFLAGS) -o nvclock_qt $(CXXFLAGS) $(OBJECTS) $(LIBS)
++ $(CXX) $(CXXFLAGS) $(LDFLAGS) -o nvclock_qt $(OBJECTS) $(LIBS)
+
+ clean:
+ rm -f nvclock_qt *.core *.moc *.o
+--- a/src/backend/Makefile.in
++++ b/src/backend/Makefile.in
+@@ -1,11 +1,11 @@
+-CC=@CC@ -O0
++CC=@CC@
+ AR=ar
+ RANLIB=@RANLIB@
+
+ system=@system@
+ HAVE_NVCONTROL=@HAVE_NVCONTROL@
+ OBJECTS=backend.o bios.o config.o error.o nv30.o nv40.o nv50.o info.o overclock.o utils.o i2c.o xf86i2c.o adt7473.o f75375.o lm99.o w83781d.o w83l785r.o libc_wrapper.o
+-CFLAGS=@X11_CFLAGS@ -I../.. -I../nvcontrol
++CFLAGS=@CFLAGS@ @X11_CFLAGS@ -I../.. -I../nvcontrol
+
+ ifeq ($(system), FreeBSD)
+ OBJECTS+=back_bsd.o
diff --git a/sys-power/nvclock/files/nvclock-0.8_p20110102-usleep.patch b/sys-power/nvclock/files/nvclock-0.8_p20110102-usleep.patch
new file mode 100644
index 000000000000..93c3f288864b
--- /dev/null
+++ b/sys-power/nvclock/files/nvclock-0.8_p20110102-usleep.patch
@@ -0,0 +1,14 @@
+fix warning:
+libc_wrapper.c:54: warning: implicit declaration of function usleep
+
+--- a/src/backend/libc_wrapper.c
++++ b/src/backend/libc_wrapper.c
+@@ -27,6 +27,8 @@
+
++#define _BSD_SOURCE
+ #include <stdio.h>
+ #include "xfree.h"
++#include "config.h"
+
+ #ifdef HAVE_UNISTD_H
+ #include <unistd.h>
diff --git a/sys-power/nvclock/files/nvclock_confd b/sys-power/nvclock/files/nvclock_confd
new file mode 100644
index 000000000000..ff7f15bdd746
--- /dev/null
+++ b/sys-power/nvclock/files/nvclock_confd
@@ -0,0 +1,9 @@
+# Config file for /etc/init.d/nvclock
+
+# Set the core clock speed after -n and the memory clock speed after -m
+# Check your current speeds by running 'nvclock -s' at the command line
+# so you don't overclock too much and burn out the card
+# Test out your overclocking before adding this to the bootup!
+
+CLOCKOPTS="-s"
+#CLOCKOPTS="-n <corespeed> -m <memspeed>"
diff --git a/sys-power/nvclock/files/nvclock_initd b/sys-power/nvclock/files/nvclock_initd
new file mode 100644
index 000000000000..8abf9f01ae9b
--- /dev/null
+++ b/sys-power/nvclock/files/nvclock_initd
@@ -0,0 +1,12 @@
+#!/sbin/openrc-run
+
+depend() {
+ need xdm
+}
+
+start() {
+ ebegin "Setting nvidia card overclock speed"
+ nvclock ${CLOCKOPTS} >/dev/null
+ eend $?
+}
+
diff --git a/sys-power/nvclock/metadata.xml b/sys-power/nvclock/metadata.xml
new file mode 100644
index 000000000000..e699d8b4b7b4
--- /dev/null
+++ b/sys-power/nvclock/metadata.xml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE pkgmetadata SYSTEM "http://www.gentoo.org/dtd/metadata.dtd">
+<pkgmetadata>
+<maintainer type="person">
+ <email>bircoph@gentoo.org</email>
+ <name>Andrew Savchenko</name>
+</maintainer>
+<use>
+ <flag name="gtk">Install the GTK+ based graphical interface</flag>
+ <flag name="nvcontrol">Add NVCONTROL support for OpenGL options</flag>
+</use>
+</pkgmetadata>
diff --git a/sys-power/nvclock/nvclock-0.8_p20110102-r2.ebuild b/sys-power/nvclock/nvclock-0.8_p20110102-r2.ebuild
new file mode 100644
index 000000000000..e915905982f9
--- /dev/null
+++ b/sys-power/nvclock/nvclock-0.8_p20110102-r2.ebuild
@@ -0,0 +1,65 @@
+# Copyright 1999-2013 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI="4"
+
+inherit autotools eutils
+
+DESCRIPTION="NVIDIA Overclocking Utility"
+HOMEPAGE="http://www.linuxhardware.org/nvclock/"
+SRC_URI="mirror://gentoo/${P}.tar.bz2"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="amd64 ppc x86"
+IUSE="gtk nvcontrol"
+
+RDEPEND="
+ gtk? (
+ x11-libs/gtk+:2
+ x11-libs/libX11
+ )
+ nvcontrol? ( x11-libs/libX11 x11-libs/libXext )
+"
+DEPEND="${RDEPEND}"
+
+src_prepare() {
+ epatch \
+ "${FILESDIR}"/${P}-r1-make.patch \
+ "${FILESDIR}"/${P}-usleep.patch \
+ "${FILESDIR}"/${P}-desktop.patch \
+ "${FILESDIR}"/${P}-buffers.patch
+ eautoreconf
+}
+
+src_configure() {
+ sed -i \
+ -e "/^AR=ar/s:=.*:=$(tc-getAR):" \
+ src/*/Makefile.in || die
+
+ # Qt support would mean Qt 3.
+ econf \
+ --docdir=/usr/share/doc/${PF} \
+ --disable-qt \
+ $(use_enable gtk) \
+ $(use_enable nvcontrol)
+}
+
+src_compile() {
+ emake -C src/ nvclock smartdimmer
+ use gtk && emake -C src/gtk/
+}
+
+src_install() {
+ mkdir -p "${D}"/usr/bin || die
+
+ default
+
+ newinitd "${FILESDIR}"/nvclock_initd nvclock
+ newconfd "${FILESDIR}"/nvclock_confd nvclock
+}
+
+pkg_postinst() {
+ elog "To enable card overclocking at startup, edit your /etc/conf.d/nvclock"
+ elog "accordingly and then run: rc-update add nvclock default"
+}