-
Notifications
You must be signed in to change notification settings - Fork 1
/
nix-install-intel-hybrid-driver
executable file
·77 lines (61 loc) · 1.39 KB
/
nix-install-intel-hybrid-driver
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#!/bin/sh
### Package: nix-install-intel-hybrid-driver
### Version: v20201212.1200
### Author: Michael Gan "xmixahlx" [email protected]
### License: GPLv3
### Script Dependencies: (none)
## OVERRIDES
# NIXTOOLSDIR
if [ -z $NIXTOOLSDIR ]; then
NIXTOOLSDIR="`pwd`"
PATH=$NIXTOOLSDIR:$PATH
fi
# INSTALLDEPS
if [ -z $INSTALLDEPS ]; then
INSTALLDEPS=debian
fi
# GITBRANCH
if [ -z $GITBRANCH ]; then
GITBRANCH=master
fi
## VARS
RESDIR=$NIXTOOLSDIR/resources
DEVDIR=$NIXTOOLSDIR/upstream
GITREPO=https://github.com/intel
GITTREE=intel-hybrid-driver
PKGDIR=$GITTREE\_$GITBRANCH
## DEPS
# Provide INSTALLDEPS=debian to install dependencies.
if [ $INSTALLDEPS ]; then
if [ $INSTALLDEPS = debian ]; then
sudo apt-get -y install build-essential coreutils libc-bin wget git make \
libcmrt-dev libtool
fi
fi
## PREP
set -e
mkdir -p $DEVDIR
cd $DEVDIR
## GET
[ -f $GITTREE\_26.patch ] || wget https://patch-diff.githubusercontent.com/raw/intel/intel-hybrid-driver/pull/26.patch -O $GITTREE\_26.patch
## GIT
[ -d $PKGDIR ] || git clone --depth=1 $GITREPO/$GITTREE.git --branch=$GITBRANCH $PKGDIR
cd $PKGDIR
git clean -f
git reset --hard
git pull
## CLEAN
rm -Rf tmpbuild
## PATCH
patch -p1 < $DEVDIR/$GITTREE\_26.patch
## CONFIGURE
./autogen.sh
./configure --prefix=/usr/local --libdir=/usr/local/lib/x86_64-linux-gnu/
## BUILD
make -j `nproc`
## INSTALL
sudo make install
sudo ldconfig
## EXIT
exit
## ENJOY