This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
forked from rbernon/debian-nvidia-vulkan-beta
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
70 lines (56 loc) · 2.79 KB
/
Makefile
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
NVIDIA_VERSION = 450.57
NVIDIA_VERSION_DEB = 1
NVIDIA_BETA_VERSION = 450.56.02
NVIDIA_BETA_PKG = nvidia-graphics-drivers-$(NVIDIA_BETA_VERSION)
NVIDIA_BETA_TAR = nvidia-graphics-drivers_$(NVIDIA_BETA_VERSION)
NVIDIA_BETA_URL = https://developer.nvidia.com/vulkan-beta-$(subst .,,$(NVIDIA_BETA_VERSION))-linux
NVIDIA_BETA_SRC = NVIDIA-Linux-x86_64-$(NVIDIA_BETA_VERSION).run
.PHONY: all
all: $(NVIDIA_BETA_PKG)
$(NVIDIA_BETA_PKG).orig-amd64/$(NVIDIA_BETA_SRC): $(shell mkdir -p $(NVIDIA_BETA_PKG).orig-amd64)
wget --content-disposition $(NVIDIA_BETA_URL) -O $@
$(NVIDIA_BETA_PKG).orig-amd64:
mkdir -p $@
$(NVIDIA_BETA_TAR).orig-amd64.tar.gz: $(NVIDIA_BETA_PKG).orig-amd64 $(NVIDIA_BETA_PKG).orig-amd64/$(NVIDIA_BETA_SRC)
tar --owner=root --group=src --mode=+x -czvf $(@F) -C $(@D) $<
$(NVIDIA_BETA_PKG).orig:
mkdir -p $@
$(NVIDIA_BETA_TAR).orig.tar.gz: $(NVIDIA_BETA_PKG).orig
tar --owner=root --group=src --mode=+x -czvf $(@F) -C $(@D) $<
nvidia-graphics-drivers-$(NVIDIA_VERSION):
apt source nvidia-driver=$(NVIDIA_VERSION)-$(NVIDIA_VERSION_DEB)
.PHONY: $(NVIDIA_BETA_PKG)
$(NVIDIA_BETA_PKG): nvidia-graphics-drivers-$(NVIDIA_VERSION) $(NVIDIA_BETA_TAR).orig.tar.gz $(NVIDIA_BETA_TAR).orig-amd64.tar.gz
rm -rf $@
cd nvidia-graphics-drivers-$(NVIDIA_VERSION) && uupdate -b -f -v $(NVIDIA_BETA_VERSION)
-cd "$@" && (make -f debian/rules nv-readme.ids; cp nv-readme.ids debian)
-cd "$@" && (sed -re '/ARCH_LIST.*arm64/d' -i debian/rules.defs)
-cd "$@" && dpkg-buildpackage -j12 --build=binary --post-clean
cd "$@" && dpkg-buildpackage -j12 --build=binary --post-clean
cd "$@" && dpkg-buildpackage -j12 -a i386 --build=any --post-clean
# remove legacy/non-glvnd packages
rm libegl1-nvidia_$(NVIDIA_BETA_VERSION)-1_amd64.deb \
nvidia-nonglvnd-vulkan-common_$(NVIDIA_BETA_VERSION)-1_amd64.deb \
nvidia-nonglvnd-vulkan-common_$(NVIDIA_BETA_VERSION)-1_i386.deb \
nvidia-libopencl1_$(NVIDIA_BETA_VERSION)-1_amd64.deb \
nvidia-libopencl1_$(NVIDIA_BETA_VERSION)-1_i386.deb #\
# These don't seem to get built as of 450.57. the i386 versions of these in experimental are still on 450.51
#nvidia-driver_$(NVIDIA_BETA_VERSION)-1_i386.deb \
#nvidia-smi_$(NVIDIA_BETA_VERSION)-1_i386.deb \
#xserver-xorg-video-nvidia_$(NVIDIA_BETA_VERSION)-1_i386.deb
@echo "Now run 'sudo make install' to install all the packages."
.PHONY: clean
clean:
rm -rf nvidia-graphics-drivers*
rm -f *.deb
.PHONY: install
install: dpkg-install apt-hold
.PHONY: dpkg-install
dpkg-install:
dpkg -i *$(NVIDIA_BETA_VERSION)-1_*.deb
.PHONY: apt-hold
apt-hold:
apt-mark hold $$(ls -1 *$(NVIDIA_BETA_VERSION)-1_*.deb | perl -ne '/^([\w-]*)_[\d-\.]*_(\w*)\.deb$$/ && print "$$1:$$2\n"')
.PHONY: apt-unhold
apt-unhold:
apt-mark unhold $$(ls -1 *$(NVIDIA_BETA_VERSION)-1_*.deb | perl -ne '/^([\w-]*)_[\d-\.]*_(\w*)\.deb$$/ && print "$$1:$$2\n"')