aboutsummaryrefslogtreecommitdiffstats
path: root/x11/nvidia-driver
diff options
context:
space:
mode:
authordanfe <danfe@FreeBSD.org>2007-10-30 16:16:58 +0800
committerdanfe <danfe@FreeBSD.org>2007-10-30 16:16:58 +0800
commit1e3242806683302d13c8375d7ccb133c44a0beba (patch)
tree94a9dab857dc93c7b8386133d74da4888b46cc06 /x11/nvidia-driver
parentaa174ce29b7086e2574fbc121f4d328ca35a45e7 (diff)
downloadfreebsd-ports-gnome-1e3242806683302d13c8375d7ccb133c44a0beba.tar.gz
freebsd-ports-gnome-1e3242806683302d13c8375d7ccb133c44a0beba.tar.zst
freebsd-ports-gnome-1e3242806683302d13c8375d7ccb133c44a0beba.zip
- Chase another nVidia update (100.x -> 1419, legacy versions -> 7186/9643)
- Convert NVVERSION to brave new order (makes them ugly, I know) - Fix the emulation of semaphores implemented in `nvidia_os.c'. The problem with nVidia's code was that it tries to use a spin mutex with a condition variable, which is explicitely disallowed [1] - Remove X.org-related path hacks since nVidia handles it correctly now - Fix symlinks when installing from package (plist change) - Stop saying FILESDIR when PATCHDIR was meant - Simplify some Makefile logic: remove always-true check Submitted by: mux, Craig Boston (independently) [1]
Diffstat (limited to 'x11/nvidia-driver')
-rw-r--r--x11/nvidia-driver/Makefile36
-rw-r--r--x11/nvidia-driver/distinfo18
-rw-r--r--x11/nvidia-driver/files/100xx-patch-src::nvidia.os61
-rw-r--r--x11/nvidia-driver/files/71xx-patch-src::nvidia.os61
-rw-r--r--x11/nvidia-driver/files/96xx-patch-src::nvidia.os61
-rw-r--r--x11/nvidia-driver/pkg-plist25
6 files changed, 221 insertions, 41 deletions
diff --git a/x11/nvidia-driver/Makefile b/x11/nvidia-driver/Makefile
index faacfabe15f3..79fa26277d78 100644
--- a/x11/nvidia-driver/Makefile
+++ b/x11/nvidia-driver/Makefile
@@ -6,7 +6,7 @@
#
PORTNAME= nvidia-driver
-DISTVERSION?= 100.14.11
+DISTVERSION?= 100.14.19
PORTREVISION?= 0 # For consistency with slave ports
CATEGORIES= x11 kld
MASTER_SITES= ${MASTER_SITE_NVIDIA}
@@ -35,13 +35,13 @@ OPTIONS= FREEBSD_AGP "Use FreeBSD AGP GART driver" off \
# you need to use legacy driver version and install one of corresponding
# `x11/nvidia-driver-71xx' or `x11/nvidia-driver-96xx' slave ports.
#
-.if ${DISTVERSION:M1.0-*}
-NVVERSION= ${DISTVERSION:S/1.0-//}
-.else
NVVERSION= ${DISTVERSION:S/.//g}
-.endif
-EXTRA_PATCHES+= ${FILESDIR}/7667-patch-lib::Makefile
+# Use a dirty hack to apply patches selectively based on NVVERSION (first
+# two or three digits, really).
+#
+EXTRA_PATCHES= ${PATCHDIR}/7667-patch-lib::Makefile \
+ ${PATCHDIR}/${NVVERSION:C/....$//}xx-patch-*
.include <bsd.port.pre.mk>
@@ -90,9 +90,7 @@ LIB_DEPENDS+= m.3:${PORTSDIR}/misc/compat5x
post-patch: .SILENT
# We should support -CURRENT: kill the check
-.if ${NVVERSION} >= 7174
${REINPLACE_CMD} '24,26d' ${WRKSRC}/src/nv-freebsd.h
-.endif
.if defined(WITH_FREEBSD_AGP)
${REINPLACE_CMD} -E 's/undef (NV_SUPPORT_OS_AGP)/define \1/' \
${WRKSRC}/src/nv-freebsd.h
@@ -110,7 +108,7 @@ post-patch: .SILENT
${WRKSRC}/src/nv-freebsd.h
.endif
# Don't build any binaries (nvidia-settings and nvidia-xconfig)
-.if ${NVVERSION} < 9746
+.if ${NVVERSION} < 974600
${REINPLACE_CMD} -E 's/(extension).*/\1/' ${WRKSRC}/x11/Makefile
.else
${REINPLACE_CMD} -E 's/(lib).*/\1/' ${WRKSRC}/x11/Makefile
@@ -120,29 +118,27 @@ post-patch: .SILENT
.if defined(NOPORTDOCS)
${REINPLACE_CMD} -E 's/(x11).*/\1/ ; /doc/d' ${WRKSRC}/Makefile
.endif
-.if ${X_WINDOW_SYSTEM} == "xorg"
- ${REINPLACE_CMD} -e 's|lib/modules|lib/xorg/modules|' \
- ${WRKSRC}/x11/driver/Makefile \
- ${WRKSRC}/x11/extension/Makefile
-.if ${NVVERSION} >= 9746
- ${REINPLACE_CMD} -e 's|lib/modules|lib/xorg/modules|' \
- ${WRKSRC}/x11/lib/Makefile
-.endif
-.endif
# Do not execute afterinstall target (prevent automatic module registration)
${REINPLACE_CMD} -e 's/afterinstall/dontexecute/' ${WRKSRC}/Makefile
pre-su-install:
+# XXX This port silently assumes PREFIX == X11BASE XXX
@${MKDIR} ${PREFIX}/${MODULESDIR}/drivers
+# xorg-server-1.4 installs its own ${X11BASE}/lib/xorg/modules/libwfb.so,
+# so back it up so it can be later restored similarly to what nVidia does:
+.if ${NVVERSION} >= 974600 && ${X_WINDOW_SYSTEM} == "xorg"
+ @${MV} -f ${PREFIX}/${MODULESDIR}/libwfb.so \
+ ${PREFIX}/${MODULESDIR}/XXX-libwfb.so.%%.${XSERVVERSION}
+.endif
post-install:
# pkg-plist is already overbloated, so use this hack instead of PLIST_SUB's
-.if ${NVVERSION} < 8174
+.if ${NVVERSION} < 817400
@${REINPLACE_CMD} '/libnvidia-cfg/d' ${TMPPLIST}
.else
@${REINPLACE_CMD} '/nvidia_drv\.o/d' ${TMPPLIST}
.endif
-.if ${NVVERSION} < 9746
+.if ${NVVERSION} < 974600
@${REINPLACE_CMD} '/wfb/d' ${TMPPLIST}
.endif
@${LN} -sf libXvMCNVIDIA.so.1 ${PREFIX}/lib/libXvMCNVIDIA_dynamic.so.1
diff --git a/x11/nvidia-driver/distinfo b/x11/nvidia-driver/distinfo
index b5c1d685d9e1..60bb5ded063c 100644
--- a/x11/nvidia-driver/distinfo
+++ b/x11/nvidia-driver/distinfo
@@ -1,9 +1,9 @@
-MD5 (NVIDIA-FreeBSD-x86-1.0-7185.tar.gz) = 053b385a944dd8770e6d5985e493b9b4
-SHA256 (NVIDIA-FreeBSD-x86-1.0-7185.tar.gz) = a78e4ac89fa4eede8c0510066be441084d605fb0b9c82056ebe6f82c3d32665f
-SIZE (NVIDIA-FreeBSD-x86-1.0-7185.tar.gz) = 8433584
-MD5 (NVIDIA-FreeBSD-x86-1.0-9639.tar.gz) = 2947394ea9f6a7f7dc6e5bcdd1f6e3db
-SHA256 (NVIDIA-FreeBSD-x86-1.0-9639.tar.gz) = a661f039bd838605543a460769bd18a4296717878450eec4baecc6215b91a8a6
-SIZE (NVIDIA-FreeBSD-x86-1.0-9639.tar.gz) = 9668348
-MD5 (NVIDIA-FreeBSD-x86-100.14.11.tar.gz) = af6f1764fd89177514a2b55d254a7730
-SHA256 (NVIDIA-FreeBSD-x86-100.14.11.tar.gz) = 8511656f042a4b2fc2ed5571a96a2b2972fe27961540e0e63d305aaa58753e42
-SIZE (NVIDIA-FreeBSD-x86-100.14.11.tar.gz) = 11419761
+MD5 (NVIDIA-FreeBSD-x86-71.86.01.tar.gz) = 787e26df5818987f5189d5d75648f105
+SHA256 (NVIDIA-FreeBSD-x86-71.86.01.tar.gz) = 61f33f5735c91d7f700eaf12a586bd0ddfe12506869819e42a95c2dd2fd2b259
+SIZE (NVIDIA-FreeBSD-x86-71.86.01.tar.gz) = 8437426
+MD5 (NVIDIA-FreeBSD-x86-96.43.01.tar.gz) = 443f6e392d2cb557c6bb8e1e9890a2f6
+SHA256 (NVIDIA-FreeBSD-x86-96.43.01.tar.gz) = 75b43958ba3331dec15cb3ca72d073c428bf58e6fe766852a1b98a0cd0a74908
+SIZE (NVIDIA-FreeBSD-x86-96.43.01.tar.gz) = 9675336
+MD5 (NVIDIA-FreeBSD-x86-100.14.19.tar.gz) = a124599d3ca8c2e2683472fde8fdbf64
+SHA256 (NVIDIA-FreeBSD-x86-100.14.19.tar.gz) = c5a37e34266538b0ecfbbec95c7d5f9767e0d750cbf66a7cb54cc13895d601ad
+SIZE (NVIDIA-FreeBSD-x86-100.14.19.tar.gz) = 11146166
diff --git a/x11/nvidia-driver/files/100xx-patch-src::nvidia.os b/x11/nvidia-driver/files/100xx-patch-src::nvidia.os
new file mode 100644
index 000000000000..3a9ae65095c9
--- /dev/null
+++ b/x11/nvidia-driver/files/100xx-patch-src::nvidia.os
@@ -0,0 +1,61 @@
+--- src/nvidia_os.c.orig 2007-07-24 21:06:12.000000000 +0200
++++ src/nvidia_os.c 2007-07-24 21:17:09.000000000 +0200
+@@ -598,7 +598,7 @@
+ != RM_OK))
+ return status;
+
+- mtx_init(&mtx->mutex_mtx, "rm.mutex_mtx", NULL, MTX_SPIN | MTX_RECURSE);
++ mtx_init(&mtx->mutex_mtx, "rm.mutex_mtx", NULL, MTX_DEF | MTX_RECURSE);
+ cv_init(&mtx->mutex_wait, "rm.mutex_wait");
+
+ mtx->refcnt = 1;
+@@ -624,13 +624,13 @@
+ {
+ struct os_mutex *mtx = semaphore;
+
+- mtx_lock_spin(&mtx->mutex_mtx);
++ mtx_lock(&mtx->mutex_mtx);
+ if (mtx->refcnt > 0)
+ rm_disable_interrupts(NULL);
+ mtx->refcnt--;
+ if (mtx->refcnt < 0)
+ cv_wait(&mtx->mutex_wait, &mtx->mutex_mtx);
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+
+ return RM_OK;
+ }
+@@ -639,14 +639,14 @@
+ {
+ struct os_mutex *mtx = semaphore;
+
+- mtx_lock_spin(&mtx->mutex_mtx);
++ mtx_lock(&mtx->mutex_mtx);
+ if (mtx->refcnt < 1) {
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+ return FALSE;
+ } else {
+ rm_disable_interrupts(NULL);
+ mtx->refcnt--;
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+ }
+
+ return TRUE;
+@@ -656,13 +656,13 @@
+ {
+ struct os_mutex *mtx = semaphore;
+
+- mtx_lock_spin(&mtx->mutex_mtx);
++ mtx_lock(&mtx->mutex_mtx);
+ if (mtx->refcnt < 0)
+ cv_signal(&mtx->mutex_wait);
+ if (!mtx->refcnt)
+ rm_enable_interrupts(NULL);
+ mtx->refcnt++;
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+
+ return RM_OK;
+ }
diff --git a/x11/nvidia-driver/files/71xx-patch-src::nvidia.os b/x11/nvidia-driver/files/71xx-patch-src::nvidia.os
new file mode 100644
index 000000000000..ba4c497b24b3
--- /dev/null
+++ b/x11/nvidia-driver/files/71xx-patch-src::nvidia.os
@@ -0,0 +1,61 @@
+--- src/nvidia_os.c.orig 2007-10-30 14:06:34.000000000 +0600
++++ src/nvidia_os.c 2007-10-30 14:09:02.000000000 +0600
+@@ -550,7 +550,7 @@
+ return status;
+
+ #if __FreeBSD_version >= 500000
+- mtx_init(&mtx->mutex_mtx, "rm.mutex_mtx", NULL, MTX_SPIN | MTX_RECURSE);
++ mtx_init(&mtx->mutex_mtx, "rm.mutex_mtx", NULL, MTX_DEF | MTX_RECURSE);
+ cv_init(&mtx->mutex_wait, "rm.mutex_wait");
+ #else
+ /*
+@@ -587,13 +587,13 @@
+ struct os_mutex *mtx = semaphore;
+
+ #if __FreeBSD_version >= 500000
+- mtx_lock_spin(&mtx->mutex_mtx);
++ mtx_lock(&mtx->mutex_mtx);
+ if (mtx->refcnt > 0)
+ rm_disable_interrupts();
+ mtx->refcnt--;
+ if (mtx->refcnt < 0)
+ cv_wait(&mtx->mutex_wait, &mtx->mutex_mtx);
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+ #else
+ int spl = splhigh();
+ if (mtx->refcnt > 0)
+@@ -611,14 +611,14 @@
+ struct os_mutex *mtx = semaphore;
+
+ #if __FreeBSD_version >= 500000
+- mtx_lock_spin(&mtx->mutex_mtx);
++ mtx_lock(&mtx->mutex_mtx);
+ if (mtx->refcnt < 1) {
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+ return FALSE;
+ } else {
+ rm_disable_interrupts();
+ mtx->refcnt--;
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+ }
+ #else
+ int spl = splhigh();
+@@ -641,13 +641,13 @@
+ struct os_mutex *mtx = semaphore;
+
+ #if __FreeBSD_version >= 500000
+- mtx_lock_spin(&mtx->mutex_mtx);
++ mtx_lock(&mtx->mutex_mtx);
+ if (mtx->refcnt < 0)
+ cv_signal(&mtx->mutex_wait);
+ if (!mtx->refcnt)
+ rm_enable_interrupts();
+ mtx->refcnt++;
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+ #else
+ int spl = splhigh();
+ if (!mtx->refcnt)
diff --git a/x11/nvidia-driver/files/96xx-patch-src::nvidia.os b/x11/nvidia-driver/files/96xx-patch-src::nvidia.os
new file mode 100644
index 000000000000..eb717322c068
--- /dev/null
+++ b/x11/nvidia-driver/files/96xx-patch-src::nvidia.os
@@ -0,0 +1,61 @@
+--- src/nvidia_os.c.orig 2007-07-24 21:06:12.000000000 +0200
++++ src/nvidia_os.c 2007-07-24 21:17:09.000000000 +0200
+@@ -598,7 +598,7 @@
+ != RM_OK))
+ return status;
+
+- mtx_init(&mtx->mutex_mtx, "rm.mutex_mtx", NULL, MTX_SPIN | MTX_RECURSE);
++ mtx_init(&mtx->mutex_mtx, "rm.mutex_mtx", NULL, MTX_DEF | MTX_RECURSE);
+ cv_init(&mtx->mutex_wait, "rm.mutex_wait");
+
+ mtx->refcnt = 1;
+@@ -624,13 +624,13 @@
+ {
+ struct os_mutex *mtx = semaphore;
+
+- mtx_lock_spin(&mtx->mutex_mtx);
++ mtx_lock(&mtx->mutex_mtx);
+ if (mtx->refcnt > 0)
+ rm_disable_interrupts();
+ mtx->refcnt--;
+ if (mtx->refcnt < 0)
+ cv_wait(&mtx->mutex_wait, &mtx->mutex_mtx);
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+
+ return RM_OK;
+ }
+@@ -639,14 +639,14 @@
+ {
+ struct os_mutex *mtx = semaphore;
+
+- mtx_lock_spin(&mtx->mutex_mtx);
++ mtx_lock(&mtx->mutex_mtx);
+ if (mtx->refcnt < 1) {
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+ return FALSE;
+ } else {
+ rm_disable_interrupts();
+ mtx->refcnt--;
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+ }
+
+ return TRUE;
+@@ -656,13 +656,13 @@
+ {
+ struct os_mutex *mtx = semaphore;
+
+- mtx_lock_spin(&mtx->mutex_mtx);
++ mtx_lock(&mtx->mutex_mtx);
+ if (mtx->refcnt < 0)
+ cv_signal(&mtx->mutex_wait);
+ if (!mtx->refcnt)
+ rm_enable_interrupts();
+ mtx->refcnt++;
+- mtx_unlock_spin(&mtx->mutex_mtx);
++ mtx_unlock(&mtx->mutex_mtx);
+
+ return RM_OK;
+ }
diff --git a/x11/nvidia-driver/pkg-plist b/x11/nvidia-driver/pkg-plist
index 2e27116734ee..28afdf37c382 100644
--- a/x11/nvidia-driver/pkg-plist
+++ b/x11/nvidia-driver/pkg-plist
@@ -2,6 +2,7 @@
@comment will complain when removing this package:
@comment %%MODULESDIR%%/extensions/XXX-libglx.so.%%%%.%%XSERVVERSION%%
@comment %%MODULESDIR%%/extensions/XXX-libGLcore.so.%%%%.%%XSERVVERSION%%
+@comment %%MODULESDIR%%/XXX-libwfb.so.%%%%.%%XSERVVERSION%%
@comment lib/XXX-libGL.a.%%%%.%%XLIBVERSION%%
@comment lib/XXX-libGL.so.1.%%%%.%%XLIBVERSION%%
@comment They are however restored when this package is removed:
@@ -17,30 +18,30 @@
@exec mv -f %D/lib/libGL.so.1 %D/lib/XXX-libGL.so.1.%%%%.%%XLIBVERSION%%
lib/libGL.so.1
@unexec mv -f %D/lib/XXX-libGL.so.1.%%%%.%%XLIBVERSION%% %D/lib/libGL.so.1
-@exec ln -sf %D/lib/libGL.so.1 %D/lib/libGL.so
+@exec ln -sf libGL.so.1 %D/lib/libGL.so
@comment No rm -f %D/lib/libGL.so because default XFree needs this also
lib/libGLcore.so.1
-@exec ln -sf %D/lib/libGLcore.so.1 %D/lib/libGLcore.so
+@exec ln -sf libGLcore.so.1 %D/lib/libGLcore.so
@unexec rm -f %D/lib/libGLcore.so
lib/libXvMCNVIDIA.so.1
-@exec ln -sf %D/lib/libXvMCNVIDIA.so.1 %D/lib/libXvMCNVIDIA.so
+@exec ln -sf libXvMCNVIDIA.so.1 %D/lib/libXvMCNVIDIA.so
@unexec rm -f %D/lib/libXvMCNVIDIA.so
-@exec ln -sf %D/lib/libXvMCNVIDIA.so.1 %D/lib/libXvMCNVIDIA_dynamic.so.1
+@exec ln -sf libXvMCNVIDIA.so.1 %D/lib/libXvMCNVIDIA_dynamic.so.1
@unexec rm -f %D/lib/libXvMCNVIDIA_dynamic.so.1
lib/libnvidia-cfg.so.1
-@exec ln -sf %D/lib/libnvidia-cfg.so.1 %D/lib/libnvidia-cfg.so
+@exec ln -sf libnvidia-cfg.so.1 %D/lib/libnvidia-cfg.so
@unexec rm -f %D/lib/libnvidia-cfg.so
lib/libnvidia-tls.so.1
-@exec ln -sf %D/lib/libnvidia-tls.so.1 %D/lib/libnvidia-tls.so
+@exec ln -sf libnvidia-tls.so.1 %D/lib/libnvidia-tls.so
@unexec rm -f %D/lib/libnvidia-tls.so
lib/libXvMCNVIDIA.a
%%MODULESDIR%%/libnvidia-wfb.so.1
-@exec ln -sf %D/%%MODULESDIR%%/libnvidia-wfb.so.1 %D/%%MODULESDIR%%/libwfb.so
-@unexec rm -f %D/%%MODULESDIR%%/libwfb.so
+%%XORG%%@exec mv -f %D/%%MODULESDIR%%/libwfb.so %D/%%MODULESDIR%%/XXX-libwfb.so.%%%%.%%XSERVVERSION%% && ln -sf libnvidia-wfb.so.1 %D/%%MODULESDIR%%/libwfb.so
+%%XORG%%@unexec mv -f %D/%%MODULESDIR%%/XXX-libwfb.so.%%%%.%%XSERVVERSION%% %D/%%MODULESDIR%%/libwfb.so
%%MODULESDIR%%/drivers/nvidia_drv.o
%%MODULESDIR%%/drivers/nvidia_drv.so
%%MODULESDIR%%/extensions/libglx.so.1
-@exec ln -sf %D/%%MODULESDIR%%/extensions/libglx.so.1 %D/%%MODULESDIR%%/extensions/libglx.so
+@exec ln -sf libglx.so.1 %D/%%MODULESDIR%%/extensions/libglx.so
@cwd /boot/modules
nvidia.ko
@unexec kldxref %D
@@ -48,9 +49,9 @@ nvidia.ko
%%LINUX%%usr/lib/libGL.so.%%SHLIB_VERSION%%
%%LINUX%%usr/lib/libGLcore.so.%%SHLIB_VERSION%%
%%LINUX%%usr/lib/libnvidia-tls.so.%%SHLIB_VERSION%%
-%%LINUX%%@exec ln -sf %D/usr/lib/libGL.so.%%SHLIB_VERSION%% %D/usr/lib/libGL.so.1
-%%LINUX%%@exec ln -sf %D/usr/lib/libGLcore.so.%%SHLIB_VERSION%% %D/usr/lib/libGLcore.so.1
-%%LINUX%%@exec ln -sf %D/usr/lib/libnvidia-tls.so.%%SHLIB_VERSION%% %D/usr/lib/libnvidia-tls.so.1
+%%LINUX%%@exec ln -sf libGL.so.%%SHLIB_VERSION%% %D/usr/lib/libGL.so.1
+%%LINUX%%@exec ln -sf libGLcore.so.%%SHLIB_VERSION%% %D/usr/lib/libGLcore.so.1
+%%LINUX%%@exec ln -sf libnvidia-tls.so.%%SHLIB_VERSION%% %D/usr/lib/libnvidia-tls.so.1
%%LINUX%%@unexec rm -f %D/usr/lib/libGL.so.1
%%LINUX%%@unexec rm -f %D/usr/lib/libGLcore.so.1
%%LINUX%%@unexec rm -f %D/usr/lib/libnvidia-tls.so.1