1 | #!/bin/bash |
---|
2 | #Gebruik deze file als voorbeeld. Plaats de source tar.gz file in de zelfde directory als deze slackbuild |
---|
3 | #Met de NEED en DEP opties is het mogelijk om build dependencies aan te geven. |
---|
4 | #Voor de meeste packages hoeft er verder niks aan de variabellen veranderd te worden. |
---|
5 | ##################################### Build dependency info: |
---|
6 | |
---|
7 | #DEP:linux_src |
---|
8 | #DEP:xorg_proto |
---|
9 | #DEP:xorg_xserver |
---|
10 | #DEP:linux |
---|
11 | |
---|
12 | #######Essential package info. |
---|
13 | #Change these if autodetection fails. |
---|
14 | |
---|
15 | #Name of the Syn-3 package that we are going to create |
---|
16 | NAME=`basename $0|sed 's/.SlackBuild//'` |
---|
17 | |
---|
18 | #Architecture that the created binaries run on. |
---|
19 | #Use noarch for scripts. |
---|
20 | ARCH=`uname -m` |
---|
21 | |
---|
22 | VER=`echo *run | cut -f4 -d-` || exit 1 |
---|
23 | |
---|
24 | |
---|
25 | ########Build and create the pacakge. |
---|
26 | #Uncomment the stuff that you dont want or need |
---|
27 | |
---|
28 | sh NVIDIA-Linux-*.run -x || exit 1 |
---|
29 | cd NVIDIA* || exit 1 |
---|
30 | |
---|
31 | #compile and install kernel module |
---|
32 | pushd kernel || exit 1 |
---|
33 | make IGNORE_CC_MISMATCH=1 SYSSRC=/usr/src/linux module || exit 1 |
---|
34 | mkdir -p /tmp/pkg/lib/modules/`uname -r`/video || exit 1 |
---|
35 | cp nvidia.ko /tmp/pkg/lib/modules/`uname -r`/video || exit 1 |
---|
36 | popd |
---|
37 | |
---|
38 | |
---|
39 | mkdir -p /tmp/pkg/usr/lib |
---|
40 | cp libvdpau* /tmp/pkg/usr/lib || exit 1 |
---|
41 | cp libcuda* /tmp/pkg/usr/lib || exit 1 |
---|
42 | |
---|
43 | mkdir -p /tmp/pkg/usr/X11/lib/xorg/modules/extensions |
---|
44 | cp libXvMCNVIDIA.so* /tmp/pkg/usr/X11/lib || exit 1 |
---|
45 | cp libgl*so* /tmp/pkg/usr/X11/lib/xorg/modules/extensions || exit 1 |
---|
46 | cp libGL*so* /tmp/pkg/usr/X11/lib/xorg/modules/extensions || exit 1 |
---|
47 | |
---|
48 | mkdir -p /tmp/pkg/usr/X11/lib/xorg/modules/drivers |
---|
49 | cp nvidia_drv.so /tmp/pkg/usr/X11/lib/xorg/modules/drivers || exit 1 |
---|
50 | |
---|
51 | mkdir -p /tmp/pkg/usr/bin |
---|
52 | cp nvidia-settings /tmp/pkg/usr/bin || exit 1 |
---|
53 | chmod +x /tmp/pkg/usr/bin/* |
---|
54 | |
---|
55 | #symlinkje |
---|
56 | pushd /tmp/pkg/usr/X11/lib/xorg/modules |
---|
57 | ln -s libnvidia-wfb.so.* libwfb.so || exit 1 |
---|
58 | popd |
---|
59 | |
---|
60 | cd .. |
---|
61 | |
---|
62 | #strip bins and other stuff |
---|
63 | syn3_strip /tmp/pkg || exit 1 |
---|
64 | |
---|
65 | #move development stuff and create seperate development package |
---|
66 | #syn3_move_dev /tmp/pkg /tmp/pkgdev || exit 1 |
---|
67 | #syn3_makepkg /tmp/pkgdev $NAME""_dev $VER $ARCH || exit 1 |
---|
68 | |
---|
69 | #make main package |
---|
70 | syn3_makepkg /tmp/pkg $NAME $VER $ARCH || exit 1 |
---|
71 | |
---|
72 | |
---|