From 6448fcfd7c03692d14add3247f9bcafafafbc81b Mon Sep 17 00:00:00 2001 From: Ward from fusion-voyager-3 Date: Sun, 15 Sep 2024 21:20:51 +0300 Subject: [PATCH] update rules --- .github/release-nest-v3 | 2 +- debian/control | 13 +++++ debian/rules | 119 +++++++++++++++++++++++++--------------- 3 files changed, 88 insertions(+), 46 deletions(-) diff --git a/.github/release-nest-v3 b/.github/release-nest-v3 index f11c82a..9a03714 100644 --- a/.github/release-nest-v3 +++ b/.github/release-nest-v3 @@ -1 +1 @@ -9 \ No newline at end of file +10 \ No newline at end of file diff --git a/debian/control b/debian/control index e9c664b..8f06cb3 100644 --- a/debian/control +++ b/debian/control @@ -279,6 +279,19 @@ Multi-Arch: same Description: transitional dummy package This is a transitional dummy package, it can be safely removed. +Package: mesa-teflon-delegate-git +Section: libs +Architecture: arm64 +Depends: + ${shlibs:Depends}, + ${misc:Depends}, +Pre-Depends: ${misc:Pre-Depends} +Multi-Arch: same +Description: Mesa TensorFlow Lite external delegate + TensorFlow Lite delegate which can make use of NPUs to accelerate ML + inference. It is implemented in the form of a external delegate, a shared + library which the TensorFlow Lite runtime can load at startup. + Package: libegl1-mesa-git-dev Section: libdevel Architecture: any diff --git a/debian/rules b/debian/rules index 1fbea0f..7f0e3e5 100755 --- a/debian/rules +++ b/debian/rules @@ -14,46 +14,56 @@ DEB_HOST_ARCH_CPU ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU) # for finding the correct llvm-config when meson doesn't know about it yet LLVM_VERSION = 18 +RUST_VERSION = 1.80 export PATH:=/usr/lib/llvm-$(LLVM_VERSION)/bin/:$(PATH) +export PATH:=/usr/lib/rust-$(RUST_VERSION)/bin/:$(PATH) ifneq (,$(filter $(DEB_HOST_ARCH), amd64)) export DEB_BUILD_MAINT_OPTIONS=optimize=+lto else export DEB_BUILD_MAINT_OPTIONS=optimize=-lto endif +export MESON_PACKAGE_CACHE_DIR=/usr/share/cargo/registry/ -ifeq (,$(filter $(DEB_HOST_ARCH), armhf ppc64el sh3 sh4)) -buildflags = \ - $(shell DEB_CFLAGS_MAINT_APPEND=-Wall DEB_CXXFLAGS_MAINT_APPEND=-Wall dpkg-buildflags --export=configure) -else - ifneq (,$(filter $(DEB_HOST_ARCH), armhf)) +DEB_CFLAGS_MAINT_APPEND := -Wall +DEB_CXXFLAGS_MAINT_APPEND := -Wall +ifneq (,$(filter $(DEB_HOST_ARCH), armhf)) # Workaround for a variant of LP: #725126 - buildflags = \ - $(shell DEB_CFLAGS_MAINT_APPEND="-Wall -fno-optimize-sibling-calls" DEB_CXXFLAGS_MAINT_APPEND="-Wall -fno-optimize-sibling-calls" dpkg-buildflags --export=configure) - else - # Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143 - buildflags = \ - $(shell DEB_CFLAGS_MAINT_APPEND="-Wall -O1" DEB_CXXFLAGS_MAINT_APPEND="-Wall -O1" dpkg-buildflags --export=configure) - endif + DEB_CFLAGS_MAINT_APPEND += -fno-optimize-sibling-calls + DEB_CXXFLAGS_MAINT_APPEND += -fno-optimize-sibling-calls +else ifneq (,$(filter $(DEB_HOST_ARCH), m68k)) + # This library has huge jump tables: Debian #1067207 + DEB_CFLAGS_MAINT_APPEND += -mlong-jump-table-offsets + DEB_CXXFLAGS_MAINT_APPEND += -mlong-jump-table-offsets +else ifneq (,$(filter $(DEB_HOST_ARCH), sh4)) + # Workaround for https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83143 + DEB_CFLAGS_MAINT_APPEND += -freorder-blocks-algorithm=simple + DEB_CXXFLAGS_MAINT_APPEND += -freorder-blocks-algorithm=simple endif +buildflags = $(shell \ + DEB_CFLAGS_MAINT_APPEND='$(DEB_CFLAGS_MAINT_APPEND)' \ + DEB_CXXFLAGS_MAINT_APPEND='$(DEB_CXXFLAGS_MAINT_APPEND)' \ + dpkg-buildflags --export=configure) EGL_PLATFORMS = x11 -GALLIUM_DRIVERS = swrast +GALLIUM_DRIVERS = VULKAN_DRIVERS = VULKAN_LAYERS = -confflags_DRI3 = -Ddri3=disabled confflags_OSMESA = -Dosmesa=true confflags_SSE2 = -Dsse2=true +confflags_TEFLON = -Dteflon=false -LLVM_ARCHS = amd64 arm64 armel armhf i386 loong64 powerpc ppc64 ppc64el riscv64 s390x sparc64 x32 -RUSTICL_ARCHS = amd64 arm64 armel armhf loong64 powerpc ppc64 ppc64el riscv64 s390x x32 +LLVM_ARCHS = amd64 arm64 armel armhf i386 loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x sparc64 x32 +RUSTICL_ARCHS = amd64 arm64 armel armhf loong64 mips64el powerpc ppc64 ppc64el riscv64 s390x x32 +NVK_ARCHS = amd64 arm64 armhf ppc64 riscv64 x32 VALGRIND_ARCHS = amd64 arm64 armhf i386 mips64el powerpc ppc64 ppc64el s390x WINE_ARCHS = amd64 arm64 armel armhf i386 WSL_ARCHS = amd64 arm64 # hurd doesn't do direct rendering ifeq ($(DEB_HOST_ARCH_OS), hurd) + GALLIUM_DRIVERS += softpipe confflags_DIRECT_RENDERING = -Dglx-direct=false confflags_GBM = -Dgbm=disabled else @@ -64,7 +74,6 @@ else GALLIUM_DRIVERS += nouveau r300 r600 virgl confflags_DIRECT_RENDERING = -Dglx-direct=true - confflags_DRI3 = -Ddri3=enabled confflags_GBM = -Dgbm=enabled confflags_GALLIUM += -Dgallium-extra-hud=true confflags_GALLIUM += -Dgallium-vdpau=enabled @@ -73,8 +82,8 @@ else # Freedreno requires arm in addition ifneq (,$(filter arm arm64,$(DEB_HOST_ARCH_CPU))) GALLIUM_DRIVERS += freedreno - # broken -# GALLIUM_DRIVERS += asahi + # XXX - broken + #GALLIUM_DRIVERS += asahi endif # etnaviv, tegra, vc4 and v3d kernel support are only available on armhf and arm64 @@ -109,29 +118,16 @@ else VULKAN_DRIVERS += microsoft-experimental endif - # nvk: -# ifneq ($(DEB_DISTRIBUTION), jammy) -# ifeq (,$(filter $(DEB_HOST_ARCH), i386)) -# VULKAN_DRIVERS += nouveau -# endif -# endif - # LLVM is required for building r300g, radeonsi and llvmpipe drivers. # It's also required for building OpenCL support. ifneq (,$(filter $(DEB_HOST_ARCH), $(LLVM_ARCHS))) - GALLIUM_DRIVERS += radeonsi zink + GALLIUM_DRIVERS += radeonsi zink llvmpipe - # Only enable amd on riscv64, swrast needs CPU JIT support which doesn't work properly yet - ifneq (,$(filter $(DEB_HOST_ARCH), riscv64)) - VULKAN_DRIVERS += amd - confflags_GALLIUM += -Ddraw-use-llvm=false - else - # drop virtio from armel, it doesn't build - ifneq (,$(filter $(DEB_HOST_ARCH), armel)) + # drop virtio from armel, it doesn't build + ifneq (,$(filter $(DEB_HOST_ARCH), armel)) VULKAN_DRIVERS += amd swrast - else + else VULKAN_DRIVERS += amd swrast virtio - endif endif VULKAN_LAYERS += device-select intel-nullhw overlay @@ -140,7 +136,15 @@ else # Build rusticl for archs where rustc is available ifneq (,$(filter $(DEB_HOST_ARCH), $(RUSTICL_ARCHS))) - confflags_GALLIUM += -Dgallium-rusticl=true + ifneq ($(DEB_DISTRIBUTION), xxx) + confflags_GALLIUM += -Dgallium-rusticl=true + else + confflags_GALLIUM += -Dgallium-rusticl=false + endif + endif + + ifneq (,$(filter $(DEB_HOST_ARCH), $(NVK_ARCHS))) + VULKAN_DRIVERS += nouveau endif # nine makes sense only on archs that build wine @@ -148,6 +152,7 @@ else confflags_GALLIUM += -Dgallium-nine=true endif else + GALLIUM_DRIVERS += softpipe confflags_GALLIUM += -Dllvm=disabled endif @@ -155,6 +160,11 @@ else confflags_GALLIUM += -Dgallium-va=enabled confflags_GALLIUM += -Dvideo-codecs="all" endif + + # Teflon only supports arm64 + ifneq (,$(filter $(DEB_HOST_ARCH), arm64)) + confflags_TEFLON = -Dteflon=true + endif endif #ifeq ($(DEB_HOST_ARCH), i386) @@ -182,34 +192,49 @@ confflags += \ -Dplatforms="[$(EGL_PLATFORMS_LIST)]" \ -Dvulkan-drivers="[$(VULKAN_DRIVERS_LIST)]" \ -Dvulkan-layers="[$(VULKAN_LAYERS_LIST)]" \ - -Dglvnd=true \ + -Dglvnd=enabled \ -Dshared-glapi=enabled \ - -Dgallium-omx=disabled \ -Db_ndebug=true \ -Dbuild-tests=true \ -Dtools=drm-shim \ $(confflags_DIRECT_RENDERING) \ $(confflags_GBM) \ - $(confflags_DRI3) \ $(confflags_GALLIUM) \ $(confflags_GLES) \ $(confflags_OSMESA) \ $(confflags_SSE2) \ - $(confflags_VALGRIND) + $(confflags_VALGRIND) \ + $(confflags_TEFLON) + + +rewrite_wrap_files: + cp -r subprojects subprojects-save + for crate in paste proc-macro2 quote syn unicode-ident; \ + do \ + export crate_namever=`basename $$MESON_PACKAGE_CACHE_DIR/$$crate-*`; \ + sed -e"/source.*/d" -e"s,$${crate}-.*,$${crate_namever}," -i subprojects/$${crate}.wrap; \ + done + touch subprojects/rewrite override_dh_clean: regen_control - sed -i 's/-.*//' VERSION + dpkg-parsechangelog | awk '/^Version:/ {print $$2}' | sed 's/-.*//;s/~/-/' > VERSION rm -rf .pc rm -rf build rm -rf configure bin/config.guess bin/config.sub config.h.in rm -rf $$(find -name Makefile.in) rm -rf bin/install-sh bin/ltmain.sh + rm -rf src/intel/vulkan/grl/parser.out + rm -rf src/intel/vulkan/grl/parsetab.py for file in debian/*.links.in; do rm -f $${file%%.in}; done find -name '*.pyc' -delete find -name '__pycache__' -delete + if [ -f subprojects/rewrite ]; then \ + rm -rf subprojects; \ + mv subprojects-save subprojects; \ + fi dh_clean -override_dh_auto_configure: +override_dh_auto_configure: rewrite_wrap_files dpkg-parsechangelog | awk '/^Version:/ {print $$2}' > VERSION $(buildflags) dh_auto_configure -- \ $(confflags) @@ -236,14 +261,16 @@ override_dh_installchangelogs: override_dh_install: # purge .la files find debian/tmp/ -name '*.la' -exec rm '{}' ';' - # nvk: - find debian/tmp/usr/bin -name 'mme_*_sim_hw_test' -exec rm '{}' ';' # Get rid of some files which aren't installed. Do not # use -f to ensure we notice disappearing files: rm debian/tmp/usr/lib/*/libglapi.so rm debian/tmp/usr/lib/*/libEGL_mesa.so rm debian/tmp/usr/lib/*/libGLX_mesa.so + ifneq (,$(filter $(DEB_HOST_ARCH), $(NVK_ARCHS))) + rm debian/tmp/usr/bin/mme_fermi_sim_hw_test + rm debian/tmp/usr/bin/mme_tu104_sim_hw_test + endif # use -f here though rm -f debian/tmp/usr/lib/*/libgrl.a @@ -309,8 +336,10 @@ gentarball: regen_control: sed -e"s,@LLVM_VERSION@,$(LLVM_VERSION),g" \ + -e"s,@RUST_VERSION@,$(RUST_VERSION),g" \ -e"s,@LLVM_ARCHS@,$(LLVM_ARCHS),g" \ -e"s,@RUSTICL_ARCHS@,$(RUSTICL_ARCHS),g" \ + -e"s,@NVK_ARCHS@,$(NVK_ARCHS),g" \ -e"s,@VALGRIND_ARCHS@,$(VALGRIND_ARCHS),g" \ -e"s,@WINE_ARCHS@,$(WINE_ARCHS),g" \ debian/control.in > debian/control \ No newline at end of file