This repository has been archived by the owner on Sep 17, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.yml
247 lines (218 loc) · 11.1 KB
/
package.yml
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
name : nvidia-glx-driver
version : 535.104.05
release : 480
source :
- https://us.download.nvidia.com/XFree86/Linux-x86_64/535.104.05/NVIDIA-Linux-x86_64-535.104.05.run : 2f9d609d1da770beee757636635c46e7ed8253ade887b87c7a5482e33fcbedc9
extract : no
homepage : https://nvidia.com
license :
- EULA
summary :
- NVIDIA Binary Driver (LTS Kernel)
- common : Shared assets for the NVIDIA GLX Driver
- current : NVIDIA Binary Driver (Current Kernel)
- modaliases : These files are used by the Software Center for hardware detection
- 32bit : 32-bit libraries for NVIDIA Binary Driver
component :
- kernel.drivers
- common : xorg.driver
- current : kernel.drivers
- modaliases : kernel.drivers
- 32bit : xorg.driver
description:
- NVIDIA Binary Driver (LTS Kernel)
- common : Shared assets for the NVIDIA GLX Driver
- current : NVIDIA Binary Driver (Current Kernel)
- modaliases : These files are used by the Software Center for hardware detection
- 32bit : 32-bit libraries for NVIDIA Binary Driver
rundeps :
- common :
- linux-driver-management
- egl-wayland
- kbd
- libglvnd
- 32bit :
- nvidia-glx-driver-common
- libglvnd-32bit
- main : nvidia-glx-driver-common
- current : nvidia-glx-driver-common
conflicts :
- nvidia-390-glx-driver
- nvidia-470-glx-driver
- nvidia-beta-driver
- nvidia-developer-driver
- common :
- nvidia-390-glx-driver-common
- nvidia-470-glx-driver-common
- nvidia-beta-driver-common
- nvidia-developer-driver-common
- 32bit :
- nvidia-390-glx-driver-32bit
- nvidia-470-glx-driver-32bit
- nvidia-beta-driver-32bit
- nvidia-developer-driver-32bit
- current :
- nvidia-390-glx-driver-current
- nvidia-470-glx-driver-current
- nvidia-beta-driver-current
- nvidia-developer-driver-current
patterns :
- common : /*
- modaliases :
- /usr/share/doflicky/modaliases
- /usr/share/linux-driver-management/modaliases
- 32bit : /usr/lib32
- main :
- /lib/modules/*.lts
- /usr/share/metainfo/nvidia-lts.appdata.xml
- /usr/share/pixmaps/nvidia-lts.png
- current :
- /lib/modules/*.current
- /usr/share/metainfo/nvidia-current.appdata.xml
- /usr/share/pixmaps/nvidia-current.png
strip : no
debug : no
builddeps :
- pkgconfig(gtk+-2.0)
- pkgconfig(gtk+-3.0)
- pkgconfig(libelf)
- pkgconfig(xorg-server)
- linux-lts
- linux-lts-headers
- linux-current
- linux-current-headers
- libglvnd-32bit
permanent :
- /lib/modules
setup : |
sh $sources/NVIDIA-Linux-x86_64-$version.run --extract-only
pushd NVIDIA*
# Prepare kernel trees
cp -a kernel lts_kernel
cp -a kernel current_kernel
# We need systemd units.
tar xf nvidia-persistenced-init.tar.bz2
build : |
# Build kernel modules
%make -C lts_kernel SYSSRC="/lib/modules/%kernel_version_lts%/build"
%make -C current_kernel SYSSRC="/lib/modules/%kernel_version_current%/build"
install : |
# Install LTS kernel drivers
install -D -d -m 00755 $installdir/lib/modules/%kernel_version_lts%/kernel/drivers/video
install -m 00644 lts_kernel/*.ko $installdir/lib/modules/%kernel_version_lts%/kernel/drivers/video/.
# Install current kernel drivers
install -D -d -m 00755 $installdir/lib/modules/%kernel_version_current%/kernel/drivers/video
install -m 00644 current_kernel/*.ko $installdir/lib/modules/%kernel_version_current%/kernel/drivers/video/.
# Prepare modaliases from the LTS kernel
sh -e $pkgfiles/nvidia_supported nvidia ${package} README.txt lts_kernel/nvidia/nv-kernel.o_binary > modalias
install -D -m 00644 modalias $installdir/usr/share/doflicky/modaliases/${package}.modaliases
# New location, keep the old one around for a short while
install -D -m 00644 modalias $installdir/usr/share/linux-driver-management/modaliases/${package}.modaliases
# Install nvidia driver for xorg
install -D -m 00755 nvidia_drv.so $installdir/%libdir%/xorg/modules/drivers/nvidia_drv.so
# Install all binaries
install -D -d -m 00755 $installdir/usr/bin
install -m 00755 `find . -maxdepth 1 -type f -name "nvidia-*" -executable` $installdir/usr/bin/.
rm -v $installdir/usr/bin/nvidia-installer
# Install all libraries
install -D -d -m 00755 $installdir/usr/lib{32,64}
install -m 00755 lib*.so* $installdir/%libdir%/.
# install -m 00755 tls/lib*.so* $installdir/%libdir%/.
install -m 00755 32/lib*.so* $installdir/usr/lib32/.
# install -m 00755 32/tls/lib*.so* $installdir/usr/lib32/.
# Strip glvnd bits and OpenCL, we have those elsewhere
rm -v $installdir/usr/lib{32,64}/{libGLX.so.0,libGL.so.1.7.0,libOpenGL.so.0,libOpenCL.so.1.0.0,libGLdispatch.so*}
function redo_libs() {
for gl in $* ; do
i=`dirname ${gl}`
clean=`echo $(basename ${gl})|sed -e 's@\.so\.%version%@@g'`
soname=`objdump -p ${gl} | grep SONAME | awk '{print $2}'`
if [[ ! -e $i/${soname} ]] ; then
ln -sv `basename ${gl}` $i/${soname}
fi
if [[ ! -e $i/{clean}.so ]]; then
ln -sv `basename ${gl}` $i/${clean}.so
fi
done
}
redo_libs $installdir/usr/lib64/lib*.so.%version%
redo_libs $installdir/usr/lib32/lib*.so.%version%
# Remove the non glvnd portions
rm -v $installdir/{%libdir%,/usr/lib32}/lib{EGL,GLESv1_CM,GLESv2}.so*
# rm -v $installdir/%libdir%/libglx.so*
# Move vdpau into the final position
install -D -d -m 00755 $installdir/usr/lib{32,64}/vdpau
mv -v $installdir/%libdir%/libvdpau* $installdir/%libdir%/vdpau/.
mv -v $installdir/usr/lib32/libvdpau* $installdir/usr/lib32/vdpau/.
# Data files
install -D -m 00644 nvidia-settings.desktop $installdir/usr/share/applications/nvidia-settings.desktop
sed -e 's@__UTILS_PATH__@/usr/bin@' -e 's@__PIXMAP_PATH__@/usr/share/pixmaps@' -i $installdir/usr/share/applications/nvidia-settings.desktop
install -D -m 00644 nvidia-settings.png $installdir/usr/share/pixmaps/nvidia-settings.png
install -D -m 00644 nvidia.icd $installdir/usr/share/OpenCL/vendors/nvidia.icd
install -D -d -m 00755 $installdir/usr/share/nvidia
install -m 00644 nvoptix.bin $installdir/usr/share/nvidia/
# Appdata
install -Dm00644 $pkgfiles/nvidia-current.appdata.xml $installdir/usr/share/metainfo/nvidia-current.appdata.xml
install -Dm00644 $pkgfiles/nvidia-lts.appdata.xml $installdir/usr/share/metainfo/nvidia-lts.appdata.xml
install -Dm00644 nvidia-settings.png $installdir/usr/share/pixmaps/nvidia-current.png
install -Dm00644 nvidia-settings.png $installdir/usr/share/pixmaps/nvidia-lts.png
# Vulkan
install -D -m 00644 nvidia_icd.json $installdir/usr/share/vulkan/icd.d/10_nvidia.json
sed -e 's@__NV_VK_ICD__@libGLX_nvidia.so.0@' -i $installdir/usr/share/vulkan/icd.d/10_nvidia.json
# libnvidia-vulkan-producer.so has no SONAME set, so create the missing link manually
ln -s "libnvidia-vulkan-producer.so.$version" $installdir/%libdir%/libnvidia-vulkan-producer.so.1
# EGL
install -D -m 00644 10_nvidia_wayland.json $installdir/usr/share/egl/egl_external_platform.d/10_nvidia_wayland.json
install -D -m 00644 15_nvidia_gbm.json $installdir/usr/share/egl/egl_external_platform.d/15_nvidia_gbm.json
# GBM
install -D -d -m 00755 $installdir/%libdir%/gbm
ln -s "../libnvidia-allocator.so.$version" $installdir/%libdir%/gbm/nvidia-drm_gbm.so
# Missing symlinks
ln -s libnvidia-egl-gbm.so.1.1.0 $installdir/%libdir%/libnvidia-egl-gbm.so.1
ln -s libnvidia-egl-gbm.so.1 $installdir/%libdir%/libnvidia-egl-gbm.so
# Make sure glvnd knows where to be
install -D -d -m 00755 $installdir/usr/share/glvnd/egl_vendor.d
install -m 00644 10_nvidia.json $installdir/usr/share/glvnd/egl_vendor.d/10_nvidia.json
# Keep settings UI happy
install -m 00644 nvidia-application-profiles-${version}-key-documentation $installdir/usr/share/nvidia/.
# Install NVIDIA NGX dll for use with Proton and Wine
install -D -d -m 00755 $installdir/%libdir%/nvidia/wine
install -m 00644 *nvngx.dll $installdir/%libdir%/nvidia/wine/.
# Blacklist nouveau
install -D -d -m 00755 $installdir/usr/lib/modprobe.d
echo "blacklist nouveau" > $installdir/usr/lib/modprobe.d/nvidia.conf
# Init
install -D -m 00644 nvidia-persistenced-init/systemd/nvidia-persistenced.service.template \
$installdir/usr/lib/systemd/system/nvidia-persistenced.service
sed -e 's@__USER__@nvidia-persistenced@' -i $installdir/usr/lib/systemd/system/nvidia-persistenced.service
# Additional files
install -D -m 00644 $pkgfiles/71-nvidia.rules $installdir/%libdir%/udev/rules.d/71-nvidia.rules
install -D -m 00644 $pkgfiles/nvidia-glx-driver.tmpfiles $installdir/%libdir%/tmpfiles.d/nvidia-glx-driver.conf
install -D -m 00644 $pkgfiles/nvidia-glx-driver.sysusers $installdir/%libdir%/sysusers.d/nvidia-glx-driver.conf
install -D -m 00755 $pkgfiles/create-uvm-dev-node $installdir/sbin/create-uvm-dev-node
install -D -m 00644 $pkgfiles/cmdline-nvidia.conf $installdir/usr/lib/kernel/cmdline.d/40_nvidia.conf
# new PM stuff
install -Dm00644 systemd/system/*.service -t $installdir/%libdir%/systemd/system
install -Dm00755 systemd/system-sleep/nvidia $installdir/%libdir%/systemd/system-sleep/nvidia
install -Dm00755 systemd/nvidia-sleep.sh $installdir/usr/bin/nvidia-sleep.sh
# enable new PM stuff OOTB
install -dm00755 $installdir/%libdir%/systemd/system/systemd-hibernate.service.wants
ln -sv ../nvidia-hibernate.service $installdir/%libdir%/systemd/system/systemd-hibernate.service.wants/
ln -sv ../nvidia-resume.service $installdir/%libdir%/systemd/system/systemd-hibernate.service.wants/
install -dm00755 $installdir/%libdir%/systemd/system/systemd-suspend.service.wants
ln -sv ../nvidia-suspend.service $installdir/%libdir%/systemd/system/systemd-suspend.service.wants/
ln -sv ../nvidia-resume.service $installdir/%libdir%/systemd/system/systemd-suspend.service.wants/
# Enable Dynamic Boost support OOTB.
install -Dm00755 nvidia-powerd $installdir/usr/bin/nvidia-powerd
install -Dm00644 nvidia-dbus.conf $installdir/usr/share/dbus-1/system.d/nvidia-dbus.conf
install -dm00755 $installdir/%libdir%/systemd/system/multi-user.target.wants
ln -sv ../nvidia-powerd.service $installdir/%libdir%/systemd/system/multi-user.target.wants/
# Make sure our glx is found, LDM will handle the main config file
install -D -m 00644 $pkgfiles/xorg.conf $installdir/usr/share/X11/xorg.conf.d/10-nvidia.conf
# install glxserver extension for xorg
install -d $installdir/%libdir%/nvidia/modules
mv $installdir/usr/lib64/libglxserver_nvidia.so* $installdir/%libdir%/nvidia/modules/
# Nuke egl wayland conflict, we package it separately
rm -fv $installdir/%libdir%/libnvidia-egl-wayland*
# Compress modules with zstd
find "$installdir" -name '*.ko' -exec strip --strip-debug {} \; -exec zstd {} \; -exec rm -v {} \;