[Lunar-commits] <moonbase> NVIDIA-beta: make gtk+-2 optional
Paul Bredbury
brebs at lunar-linux.org
Tue Feb 1 11:48:24 CET 2011
commit 9a679fc2fda109516e505aaaabefccb985b3666f
Author: Paul Bredbury <brebs at lunar-linux.org>
Date: Tue Feb 1 17:48:24 2011 +0700
NVIDIA-beta: make gtk+-2 optional
To break circular dependency, so it is possible to recover from both gtk+-2 and nvidia being broken.
---
x11/NVIDIA-beta/BUILD | 62 +++++++++++++++++++++++++---------------------
x11/NVIDIA-beta/DEPENDS | 4 ++-
2 files changed, 37 insertions(+), 29 deletions(-)
diff --git a/x11/NVIDIA-beta/BUILD b/x11/NVIDIA-beta/BUILD
index 717dd0c..cd0dbde 100644
--- a/x11/NVIDIA-beta/BUILD
+++ b/x11/NVIDIA-beta/BUILD
@@ -1,5 +1,5 @@
(
- # This is installer less build script. If you find bugs let me know by e-mail: zbiggy(0)o2(period)pl
+ # This is an installer-less build script. If you find bugs let me know by e-mail: zbiggy(0)o2(period)pl
GCCKNL=`cat /proc/version | cut -d\( -f3 | cut -d\ -f3`
GCCNOW=`gcc --version | grep gcc | cut -d\ -f3`
@@ -60,26 +60,29 @@
cp tls_test_dso_`uname`-x86.so ../tls_test_dso.so
fi &&
- # Builds nvidia-settings from source
- cd ../nvidia-settings-$VERSION &&
+ cd ..
+ if in_depends $MODULE "gtk+-2" ; then
+ # Builds nvidia-settings from source
+ cd nvidia-settings-$VERSION &&
- # xf86vmode.h has been removed in xf86vidmodeproto 2.3
- if [[ ! -e /usr/include/X11/extensions/xf86vmode.h ]] ; then
- sedit "s:#include <X11/extensions/xf86vmode.h>:#include <X11/extensions/xf86vmproto.h>:" src/libXNVCtrlAttributes/NvCtrlAttributes{,VidMode,Glx}.c
- fi &&
+ # xf86vmode.h has been removed in xf86vidmodeproto 2.3
+ if [[ ! -e /usr/include/X11/extensions/xf86vmode.h ]] ; then
+ sedit "s:#include <X11/extensions/xf86vmode.h>:#include <X11/extensions/xf86vmproto.h>:" src/libXNVCtrlAttributes/NvCtrlAttributes{,VidMode,Glx}.c
+ fi &&
- make clean &&
- make -C src/libXNVCtrl &&
+ make clean &&
+ make -C src/libXNVCtrl &&
# X_CFLAGS=$CFLAGS GL_INCLUDE_PATH=$SOURCE_DIRECTORY
- make &&
- if [[ $(arch) == x86_64 ]] ; then
- install -m 755 _out/Linux_x86_64/nvidia-settings .. &&
- install -m 644 _out/Linux_x86_64/nvidia-settings.1.gz ..
- else
- install -m 755 _out/Linux_x86/nvidia-settings .. &&
- install -m 644 _out/Linux_x86/nvidia-settings.1.gz ..
- fi &&
- install -m 644 doc/nvidia-settings.png .. &&
+ make &&
+ if [[ $(arch) == x86_64 ]] ; then
+ install -m 755 _out/Linux_x86_64/nvidia-settings .. &&
+ install -m 644 _out/Linux_x86_64/nvidia-settings.1.gz ..
+ else
+ install -m 755 _out/Linux_x86/nvidia-settings .. &&
+ install -m 644 _out/Linux_x86/nvidia-settings.1.gz ..
+ fi &&
+ install -m 644 doc/nvidia-settings.png ..
+ fi &&
install -m 644 doc/nvidia-settings.desktop .. &&
# Builds nvidia-xconfig from source
@@ -87,10 +90,10 @@
make clean &&
make &&
if [[ $(arch) == x86_64 ]] ; then
- install -m 755 _out/Linux_x86_64/nvidia-xconfig ..
+ install -m 755 _out/Linux_x86_64/nvidia-xconfig .. &&
install -m 644 _out/Linux_x86_64/nvidia-xconfig.1.gz ..
else
- install -m 755 _out/Linux_x86/nvidia-xconfig ..
+ install -m 755 _out/Linux_x86/nvidia-xconfig .. &&
install -m 644 _out/Linux_x86/nvidia-xconfig.1.gz ..
fi &&
cd .. &&
@@ -116,7 +119,6 @@
install -m0444 nvidia.icd /etc/OpenCL/vendors &&
install -m0755 nvidia-bug-report.sh /usr/bin &&
install -m0755 nvidia-installer /usr/bin &&
- install -m0755 nvidia-settings /usr/bin &&
install -m0755 nvidia-smi /usr/bin &&
ln -sf /usr/bin/nvidia-installer /usr/bin/nvidia-uninstall &&
install -m0755 nvidia-xconfig /usr/bin &&
@@ -153,16 +155,20 @@
mkdir -p /usr/lib/xorg/modules/extensions &&
install -m0755 libglx.so.$VERSION /usr/lib/xorg/modules/extensions &&
- mkdir -p /usr/share/applications &&
- install -m0444 nvidia-settings.desktop /usr/share/applications &&
-
- mkdir -p /usr/share/doc/NVIDIA_GLX-1.0/html &&
+ mkdir -p /usr/share/{applications,doc/NVIDIA_GLX-1.0/html} &&
install -m0444 html/* /usr/share/doc/NVIDIA_GLX-1.0/html &&
- install -m0444 README.txt nvidia-settings.png LICENSE NVIDIA_Changelog /usr/share/doc/NVIDIA_GLX-1.0 &&
- install -m0444 nvidia-xconfig.1.gz nvidia-smi.1.gz nvidia-settings.1.gz nvidia-installer.1.gz /usr/share/man/man1 &&
+ install -m0444 README.txt LICENSE NVIDIA_Changelog /usr/share/doc/NVIDIA_GLX-1.0 &&
+ install -m0444 nvidia-xconfig.1.gz nvidia-smi.1.gz nvidia-installer.1.gz /usr/share/man/man1 &&
# Register Nvidia XvMC library for use in any XvMC enabled media player
- install -m644 XvMCConfig /etc/X11
+ install -m644 XvMCConfig /etc/X11 &&
+
+ if in_depends $MODULE "gtk+-2" ; then
+ install -m0755 nvidia-settings /usr/bin &&
+ install -m0444 nvidia-settings.desktop /usr/share/applications &&
+ install -m0444 nvidia-settings.1.gz /usr/share/man/man1 &&
+ install -m0444 nvidia-settings.png /usr/share/doc/NVIDIA_GLX-1.0
+ fi
) > $C_FIFO 2>&1
diff --git a/x11/NVIDIA-beta/DEPENDS b/x11/NVIDIA-beta/DEPENDS
index 936fc26..807ffc5 100644
--- a/x11/NVIDIA-beta/DEPENDS
+++ b/x11/NVIDIA-beta/DEPENDS
@@ -2,5 +2,7 @@ depends pciutils
depends ncurses
depends libXxf86vm
depends libvdpau
-depends gtk+-2
depends CUDA-OpenCL-headers
+
+# Optional, to break circular dependency between gtk+-2 and nvidia
+optional_depends "gtk+-2" "" "" "to build nvidia-settings"
More information about the Lunar-commits
mailing list