diff options
author | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 13:49:04 -0700 |
---|---|---|
committer | Robin H. Johnson <robbat2@gentoo.org> | 2015-08-08 17:38:18 -0700 |
commit | 56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch) | |
tree | 3f91093cdb475e565ae857f1c5a7fd339e2d781e /sys-power/nvclock | |
download | gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2 gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip |
proj/gentoo: Initial commit
This commit represents a new era for Gentoo:
Storing the gentoo-x86 tree in Git, as converted from CVS.
This commit is the start of the NEW history.
Any historical data is intended to be grafted onto this point.
Creation process:
1. Take final CVS checkout snapshot
2. Remove ALL ChangeLog* files
3. Transform all Manifests to thin
4. Remove empty Manifests
5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$
5.1. Do not touch files with -kb/-ko keyword flags.
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests
X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project
X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration
X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn
X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts
X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration
X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging
X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'sys-power/nvclock')
-rw-r--r-- | sys-power/nvclock/Manifest | 1 | ||||
-rw-r--r-- | sys-power/nvclock/files/nvclock-0.8_p20110102-buffers.patch | 202 | ||||
-rw-r--r-- | sys-power/nvclock/files/nvclock-0.8_p20110102-desktop.patch | 18 | ||||
-rw-r--r-- | sys-power/nvclock/files/nvclock-0.8_p20110102-r1-make.patch | 94 | ||||
-rw-r--r-- | sys-power/nvclock/files/nvclock-0.8_p20110102-usleep.patch | 14 | ||||
-rw-r--r-- | sys-power/nvclock/files/nvclock_confd | 9 | ||||
-rw-r--r-- | sys-power/nvclock/files/nvclock_initd | 12 | ||||
-rw-r--r-- | sys-power/nvclock/metadata.xml | 12 | ||||
-rw-r--r-- | sys-power/nvclock/nvclock-0.8_p20110102-r2.ebuild | 66 |
9 files changed, 428 insertions, 0 deletions
diff --git a/sys-power/nvclock/Manifest b/sys-power/nvclock/Manifest new file mode 100644 index 000000000000..8497c5b83694 --- /dev/null +++ b/sys-power/nvclock/Manifest @@ -0,0 +1 @@ +DIST nvclock-0.8_p20110102.tar.bz2 285043 SHA256 d2a753908ef665caa996b71efd3081501e4b0fb45fa827add685cbc85d5d3745 SHA512 01bf7faed83acdf2390e1f410b2f8b697ff647b15562a6960a99666ec5121b532cbf4380137c9ee24221ccafff641bcdef4748dcad7ac92fb25fa15e735dd140 WHIRLPOOL e0d42a293add54b2d74e94fb54e0b20d29041b741476c63dc29a28ce10efc717a68d7bc82f4fb38f57a998526db4510d0b419e2617261765c8b38bb45ba24c43 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, ®_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..bcab3b581b23 --- /dev/null +++ b/sys-power/nvclock/files/nvclock_initd @@ -0,0 +1,12 @@ +#!/sbin/runscript + +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..eb475ca95015 --- /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> + <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..b9e7d5978e5c --- /dev/null +++ b/sys-power/nvclock/nvclock-0.8_p20110102-r2.ebuild @@ -0,0 +1,66 @@ +# Copyright 1999-2013 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id$ + +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" +} |