2024-10-22 17:05:20 +02:00
|
|
|
#! /usr/bin/make -f
|
|
|
|
|
|
|
|
## See debhelper(7) (uncomment to enable).
|
|
|
|
## Output every command that modifies files on the build system.
|
|
|
|
export DH_VERBOSE = 1
|
|
|
|
export PIKA_BUILD_ARCH = $(shell cat ../pika-build-arch)
|
|
|
|
|
|
|
|
override_dh_prep:
|
|
|
|
# amd64 build prep
|
|
|
|
ifeq (amd64,$(DEB_HOST_ARCH))
|
|
|
|
# Extract nvidia files from run archive
|
|
|
|
./nvidia-installer.run --extract-only
|
|
|
|
mkdir -p debian/tmp
|
|
|
|
# Copy installer contents into debian temp dir
|
|
|
|
cp -rf ./NVIDIA-Linux-*/* debian/tmp
|
|
|
|
# Delete 32 libs on amd64 builds
|
|
|
|
rm -rf debian/tmp/32
|
|
|
|
# Extract all manpages
|
|
|
|
gunzip debian/tmp/*.1.gz -k
|
2024-11-19 09:29:08 +01:00
|
|
|
# Apply the patch from ./debian/patches/0001.patch
|
2024-11-19 09:36:46 +01:00
|
|
|
patch -Np2 -i $(srcdir)/debian/patches/0001.patch -d $(srcdir)/debian/tmp/kernel
|
|
|
|
patch -Np2 -i $(srcdir)/debian/patches/0001.patch -d $(srcdir)/debian/tmp/kernel-open
|
2024-10-22 18:43:38 +02:00
|
|
|
# NVENC/NvFBC
|
|
|
|
sed -i 's/\xe8\x35\x3e\xfe\xff\x85\xc0\x41\x89\xc4/\xe8\x35\x3e\xfe\xff\x29\xc0\x41\x89\xc4/g' "debian/tmp/libnvidia-encode.so.565.57.01"
|
2024-10-22 19:09:18 +02:00
|
|
|
sed -i 's/\x85\xc0\x0f\x84\x9b\x00\x00\x00\x48/\x85\xc0\x90\x90\x90\x90\x90\x90\x48/g' "debian/tmp/libnvidia-fbc.so.565.57.01"
|
2024-10-22 17:05:20 +02:00
|
|
|
endif
|
|
|
|
|
|
|
|
# i386 (x86) build
|
|
|
|
ifeq (i386,$(DEB_HOST_ARCH))
|
|
|
|
# Extract nvidia files from run archive
|
|
|
|
./nvidia-installer.run --extract-only
|
|
|
|
mkdir -p debian/tmp
|
|
|
|
# Copy installer contents into debian temp dir
|
|
|
|
cp -rf ./NVIDIA-Linux-*/* debian/tmp
|
2024-11-19 09:15:05 +01:00
|
|
|
# Apply the patch from debian/patches/0001.patch
|
2024-11-19 09:36:46 +01:00
|
|
|
patch -Np2 -i $(srcdir)/debian/patches/0001.patch -d $(srcdir)/debian/tmp/kernel
|
|
|
|
patch -Np2 -i $(srcdir)/debian/patches/0001.patch -d $(srcdir)/debian/tmp/kernel-open
|
2024-10-22 17:05:20 +02:00
|
|
|
# Replace libs with 32 bit
|
|
|
|
rm -rf debian/tmp/*.so*
|
|
|
|
cp -rf ./NVIDIA-Linux-*/32/* debian/tmp
|
|
|
|
rm -rf debian/tmp/32
|
|
|
|
endif
|
|
|
|
|
|
|
|
override_dh_shlibdeps:
|
|
|
|
dh_shlibdeps -l/usr/lib/$(DEB_HOST_MULTIARCH)/nvidia/current/:/usr/lib/nvidia/current/
|
|
|
|
|
|
|
|
%:
|
|
|
|
dh $@
|