Changeset View
Changeset View
Standalone View
Standalone View
head/emulators/i386-wine/files/nvidia.sh
#!/bin/sh | #!/bin/sh | ||||
# Copyright 2010 to 2015 David Naylor <dbn@FreeBSD.org> | # Copyright 2010 to 2015 David Naylor <dbn@FreeBSD.org> | ||||
# Copyright 2012 Jan Beich <jbeich@tormail.org> | # Copyright 2012 Jan Beich <jbeich@tormail.org> | ||||
# Copyright 2020 Lorenzo Salvadore <salvadore@FreeBSD.org> | |||||
# All rights reserved. | # All rights reserved. | ||||
# | # | ||||
# Redistribution and use in source and binary forms, with or without | # Redistribution and use in source and binary forms, with or without | ||||
# modification, are permitted provided that the following conditions are met: | # modification, are permitted provided that the following conditions are met: | ||||
# | # | ||||
# 1. Redistributions of source code must retain the above copyright notice, | # 1. Redistributions of source code must retain the above copyright notice, | ||||
# this list of conditions and the following disclaimer. | # this list of conditions and the following disclaimer. | ||||
# | # | ||||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Lines | |||||
# - gracefully handle a corrupt nVidia tarball | # - gracefully handle a corrupt nVidia tarball | ||||
# - provide checksum and size information for nVidia tarball | # - provide checksum and size information for nVidia tarball | ||||
# Version 1.15 - 2015/03/10 | # Version 1.15 - 2015/03/10 | ||||
# - handle nvidia-driver with package name suffix | # - handle nvidia-driver with package name suffix | ||||
# - handle i386-wine with arbitary package name suffix | # - handle i386-wine with arbitary package name suffix | ||||
# - remove support for old pkg_ tools | # - remove support for old pkg_ tools | ||||
# Version 1.16 - 2017/06/04 | # Version 1.16 - 2017/06/04 | ||||
# - use https download site | # - use https download site | ||||
# Version 1.17 - 2020/03/02 | |||||
# - do not do anything if nvidia-driver version >= 440.59 | |||||
set -e | set -e | ||||
PORTSDIR=${PORTSDIR:-/usr/ports} | PORTSDIR=${PORTSDIR:-/usr/ports} | ||||
PREFIX=${PREFIX:-/usr/local} | PREFIX=${PREFIX:-/usr/local} | ||||
DISTDIR=${DISTDIR:-${PORTSDIR}/distfiles} | DISTDIR=${DISTDIR:-${PORTSDIR}/distfiles} | ||||
if [ -d $DISTDIR ] | if [ -d $DISTDIR ] | ||||
▲ Show 20 Lines • Show All 77 Lines • ▼ Show 20 Lines | |||||
NV=`version 'nvidia-driver*'` | NV=`version 'nvidia-driver*'` | ||||
[ -n "$NV" ] \ | [ -n "$NV" ] \ | ||||
|| terminate 1 "Unable to detect nvidia-driver, please install first" | || terminate 1 "Unable to detect nvidia-driver, please install first" | ||||
echo "=> Detected nvidia-driver: ${NV}" | echo "=> Detected nvidia-driver: ${NV}" | ||||
NVIDIA=${NV} | NVIDIA=${NV} | ||||
NV=`echo ${NV} | cut -f 1 -d _ | cut -f 1 -d ,` | NV=`echo ${NV} | cut -f 1 -d _ | cut -f 1 -d ,` | ||||
if [ ! "$(pkg version -t ${NV} 440.59)" == "<" ] | |||||
then | |||||
terminate 0 "nvidia-driver 440.59+ already includes 32-bit drivers: nothing to do" | |||||
fi | |||||
if [ ! -f NVIDIA-FreeBSD-x86-${NV}.tar.gz ] || !(tar -tf NVIDIA-FreeBSD-x86-${NV}.tar.gz > /dev/null 2>&1) | if [ ! -f NVIDIA-FreeBSD-x86-${NV}.tar.gz ] || !(tar -tf NVIDIA-FreeBSD-x86-${NV}.tar.gz > /dev/null 2>&1) | ||||
then | then | ||||
[ -n "$NO_FETCH" ] \ | [ -n "$NO_FETCH" ] \ | ||||
&& terminate 8 "NVIDIA-FreeBSD-x86-${NV}.tar.gz unavailable" | && terminate 8 "NVIDIA-FreeBSD-x86-${NV}.tar.gz unavailable" | ||||
echo "=> Downloading NVIDIA-FreeBSD-x86-${NV}.tar.gz from https://download.nvidia.com..." | echo "=> Downloading NVIDIA-FreeBSD-x86-${NV}.tar.gz from https://download.nvidia.com..." | ||||
rm -f NVIDIA-FreeBSD-x86-${NV}.tar.gz | rm -f NVIDIA-FreeBSD-x86-${NV}.tar.gz | ||||
fetch -aRr https://download.nvidia.com/XFree86/FreeBSD-x86/${NV}/NVIDIA-FreeBSD-x86-${NV}.tar.gz \ | fetch -aRr https://download.nvidia.com/XFree86/FreeBSD-x86/${NV}/NVIDIA-FreeBSD-x86-${NV}.tar.gz \ | ||||
Show All 38 Lines |