From cb4d6f643402614eabe44bbf18ac27022409982e Mon Sep 17 00:00:00 2001 From: "Ward Nakchbandi (Cosmic Fusion)" <83735213+CosmicFusion@users.noreply.github.com> Date: Sat, 30 Sep 2023 11:09:09 +0300 Subject: [PATCH] --- debian/changelog | 95 +++++++++++++++++++++++++++++++++++++-- debian/control | 62 +++++++++++++++++-------- debian/control.in | 41 +++++++++++++++++ debian/copyright | 24 ++++++++++ debian/docs | 2 + debian/gbp.conf | 5 +++ debian/rules | 90 ++++++------------------------------- debian/scripts/get_pwd.sh | 2 - debian/watch | 2 + patches/libva-nvidia.diff | 14 ++++++ 10 files changed, 238 insertions(+), 99 deletions(-) create mode 100644 debian/control.in create mode 100644 debian/docs create mode 100644 debian/gbp.conf delete mode 100755 debian/scripts/get_pwd.sh create mode 100644 debian/watch create mode 100644 patches/libva-nvidia.diff diff --git a/debian/changelog b/debian/changelog index 328bc5c..4b9d454 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,5 +1,94 @@ -upstream-name (pkgver-pkgrel) distro_codename; urgency=medium +switcheroo-control (2.6-100pika1) pikauwu; urgency=medium - * Initial release. (Closes: #nnnn) + * Add nvidia-vaapi-driver integration patch - -- ferreo Wed, 18 Jan 2023 21:48:14 +0000 + -- Jeremy Bicha Wed, 24 Aug 2022 23:34:40 -0400 + +switcheroo-control (2.6-1) unstable; urgency=medium + + * New upstream release + * Bump debhelper-compat to 13 + * Build-Depend on dh-sequence-gnome instead of gnome-pkg-tools + * debian/control.in: Build-Depend on python3-gi + * debian/control.in: Set Rules-Requires-Root: no + * debian/rules: Run tests + * debian/rules: Drop no-longer-needed -Wl,--as-needed + * Bump Standards-Version to 4.6.1 + + -- Jeremy Bicha Wed, 24 Aug 2022 23:34:40 -0400 + +switcheroo-control (2.4-3) unstable; urgency=medium + + * debian/control.in: umockdev is also needed for the tests + + -- Sebastien Bacher Mon, 01 Mar 2021 10:37:10 +0100 + +switcheroo-control (2.4-2) unstable; urgency=medium + + * debian/control.in: + - Build-Depends on gir1.2-umockdev-1.0, python3-dbus, python3-dbusmock, + those are needed for the new tests + + -- Sebastien Bacher Fri, 26 Feb 2021 20:06:27 +0100 + +switcheroo-control (2.4-1) unstable; urgency=medium + + * New upstream version + * Updated for the new upstream build requirements + + -- Sebastien Bacher Fri, 26 Feb 2021 16:17:31 +0100 + +switcheroo-control (2.1-1) unstable; urgency=medium + + * New upstream version + + -- Sebastien Bacher Mon, 13 Jan 2020 15:10:38 +0100 + +switcheroo-control (2.0-1) unstable; urgency=medium + + * debian/watch: update for move from github to freedesktop.org + * New upstream release. + * Revert "* debian/patches/gtk-doc-make.patch:" + * Cherry-pick upstream fix GPUs property variant declaration + * Add libgudev-1.0-dev build-dependency + * Replace configure option udevrulesdir with hwdbdir + + -- Andreas Henriksson Sun, 15 Dec 2019 12:26:51 +0100 + +switcheroo-control (1.3.1-2) unstable; urgency=medium + + * debian/patches/gtk-doc-make.patch: + - include gtk-doc.make file which is missing from the tarball, + it's needed to be able to autoreconf the source + + -- Sebastien Bacher Wed, 28 Aug 2019 11:12:47 +0200 + +switcheroo-control (1.3.1-1) unstable; urgency=medium + + * New upstream version + - Work-around lack of access to vga_switcheroo when booting with + SecureBoot enabled (lp: #1768988) + + -- Sebastien Bacher Wed, 21 Aug 2019 16:10:03 +0200 + +switcheroo-control (1.2-2) unstable; urgency=medium + + * Build-Depend on debhelper-compat 12 and drop debian/compat + * Add -Wl,-O1 to our LDFLAGS + * Bump Standards-Version to 4.3.0 + + -- Jeremy Bicha Thu, 27 Dec 2018 12:38:04 -0500 + +switcheroo-control (1.2-1) unstable; urgency=medium + + * New upstream release + * Update Vcs fields for migration to https://salsa.debian.org/ + * Bump debhelper compat to 11 + + -- Jeremy Bicha Sun, 21 Jan 2018 11:06:48 -0500 + +switcheroo-control (1.1-1) unstable; urgency=medium + + * Initial release (Closes: #857503) (LP: #1671828) + + -- Jeremy Bicha Tue, 04 Apr 2017 09:34:04 -0400 diff --git a/debian/control b/debian/control index 0bcd8e0..f478e3f 100644 --- a/debian/control +++ b/debian/control @@ -1,19 +1,45 @@ -Source: upstream-name -Section: admin -Priority: optional -Maintainer: name -Standards-Version: 4.6.1 -Build-Depends: debhelper-compat (= 13) -Rules-Requires-Root: no - -Package: pkgname1 -Architecture: linux-any -# Delete any of these lines if un-used -Depends: ${misc:Depends}, depends -Recommends: high priority optdepends -Conflicts: conflicts -Suggests: low priority optdepends -Breaks: also conflicts!? -Provides: provides +# This file is autogenerated. DO NOT EDIT! # -Description: pkgdesc +# Modifications should be made to debian/control.in instead. +# This file is regenerated automatically in the clean target. +Source: switcheroo-control +Section: gnome +Priority: optional +Maintainer: Debian GNOME Maintainers +Uploaders: Jeremy Bicha , Sebastien Bacher +Build-Depends: debhelper-compat (= 13), + dh-sequence-gnome, + gir1.2-umockdev-1.0, + gtk-doc-tools, + libglib2.0-dev, + libgudev-1.0-dev, + libudev-dev, + meson (>= 0.50), + pkg-config (>= 0.22), + python3-gi, + python3-dbus, + python3-dbusmock, + udev, + umockdev, +Standards-Version: 4.6.1 +Rules-Requires-Root: no +Vcs-Browser: https://salsa.debian.org/gnome-team/switcheroo-control +Vcs-Git: https://salsa.debian.org/gnome-team/switcheroo-control.git +Homepage: https://github.com/hadess/switcheroo-control + +Package: switcheroo-control +Architecture: linux-any +Depends: ${misc:Depends}, + ${shlibs:Depends} +Description: D-Bus service to check the availability of dual-GPU + For systems that have both an integrated GPU and a dedicated GPU, this + package by default will force the integrated GPU to be used to save power. + . + You can launch individual apps using the dedicated GPU by running them + with the environment variable DRI_PRIME=1. Or you can right-click on the + app (while it's not running) in GNOME Shell's Activities Overview + and choose the "Launch using Dedicated Graphics Card" option. + . + If this default behavior is not appropriate, uninstall this package or + set xdg.force_integrated=0 as a kernel command-line option in your + bootloader. diff --git a/debian/control.in b/debian/control.in new file mode 100644 index 0000000..08404bc --- /dev/null +++ b/debian/control.in @@ -0,0 +1,41 @@ +Source: switcheroo-control +Section: gnome +Priority: optional +Maintainer: Debian GNOME Maintainers +Uploaders: @GNOME_TEAM@ +Build-Depends: debhelper-compat (= 13), + dh-sequence-gnome, + gir1.2-umockdev-1.0, + gtk-doc-tools, + libglib2.0-dev, + libgudev-1.0-dev, + libudev-dev, + meson (>= 0.50), + pkg-config (>= 0.22), + python3-gi, + python3-dbus, + python3-dbusmock, + udev, + umockdev, +Standards-Version: 4.6.1 +Rules-Requires-Root: no +Vcs-Browser: https://salsa.debian.org/gnome-team/switcheroo-control +Vcs-Git: https://salsa.debian.org/gnome-team/switcheroo-control.git +Homepage: https://github.com/hadess/switcheroo-control + +Package: switcheroo-control +Architecture: linux-any +Depends: ${misc:Depends}, + ${shlibs:Depends} +Description: D-Bus service to check the availability of dual-GPU + For systems that have both an integrated GPU and a dedicated GPU, this + package by default will force the integrated GPU to be used to save power. + . + You can launch individual apps using the dedicated GPU by running them + with the environment variable DRI_PRIME=1. Or you can right-click on the + app (while it's not running) in GNOME Shell's Activities Overview + and choose the "Launch using Dedicated Graphics Card" option. + . + If this default behavior is not appropriate, uninstall this package or + set xdg.force_integrated=0 as a kernel command-line option in your + bootloader. diff --git a/debian/copyright b/debian/copyright index e69de29..4a12a50 100644 --- a/debian/copyright +++ b/debian/copyright @@ -0,0 +1,24 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: switcheroo-control +Source: https://github.com/hadess/switcheroo-control + +Files: * +Copyright: 2016 Bastien Nocera +License: GPL-3+ + +License: GPL-3+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see . + . + On Debian systems, the complete text of the GNU General + Public License can be found in `/usr/share/common-licenses/GPL-3'. diff --git a/debian/docs b/debian/docs new file mode 100644 index 0000000..7d00d79 --- /dev/null +++ b/debian/docs @@ -0,0 +1,2 @@ +README.md +NEWS diff --git a/debian/gbp.conf b/debian/gbp.conf new file mode 100644 index 0000000..e0196c4 --- /dev/null +++ b/debian/gbp.conf @@ -0,0 +1,5 @@ +[DEFAULT] +pristine-tar = True +debian-branch = debian/master +upstream-branch = upstream/latest +upstream-vcs-tag = %(version)s diff --git a/debian/rules b/debian/rules index ed40aff..ab41c39 100755 --- a/debian/rules +++ b/debian/rules @@ -1,80 +1,18 @@ -#! /usr/bin/make -f +#!/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 DEB_BUILD_MAINT_OPTIONS = hardening=+all +export DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,-z,defs -## === Set paths env vars === - -## Source directory, called upon by $(srcdir) -srcdir = $(shell debian/scripts/get_pwd.sh) -## The Root of package number one, called upon by $(pkgdir1) -pkgdir1 = $(srcdir)/debian/pkgdir1 -## The Root of package number two, you can add as many of these as you like -pkgdir2 = $(srcdir)/debian/pkgdir2 - -## If building a singular package you can remove the number, and as you guessed you call upon it with $(pkgdir) -# pkgdir = $(srcdir)/debian/pkgdir - -## === End end of region === - -## === the chain of command === -## debuild runs a chain of dh functions in the following order: -## dh_testdir -## dh_clean -## dh_auto_clean -## dh_update_autotools_config -## dh_autoreconf -## dh_auto_configure -## dh_prep -## dh_build -## dh_auto_build -## dh_install -## dh_auto_install -## dh_installdocs -## dh_installchangelogs -## dh_perl -## dh_link -## dh_strip_nondeterminism -## dh_compress -## dh_fixperms -## dh_missing -## dh_dwz -## dh_strip -## dh_makeshlibs -## dh_shlibdeps -## dh_installdeb -## dh_gencontrol -## but you are most likely to only need to override the following: -## dh_clean -## dh_auto_configure -## dh_build -## dh_install - -## === End end of region === - -## === overriding dh functions === -## by default all dh functions will run a specific command based on the build system selected by "dh $@" -## if you have a makefile that does everything you need this is fine, -## but most likely you have no MakeFile and you want to add your own commands -## Note : overrides must be places above %: -## So here's a few examples: - -## overriding dh_clean to make it not delete rust vendor files: -#override_dh_clean: -# echo "disabled" - -## overriding dh_auto_configure to add custom configs: -#override_dh_auto_configure: -# $(srcdir)/configure -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_DATADIR=/usr/share -DCMAKE_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu -DBUILD_PLUGIN=OFF - -## overriding dh_install to install files to a package: -#override_dh_auto_configure: -# mkdir -p $(pkgdir1)/usr/bin -# cp $(srcdir)/pikman $(pkgdir1)/usr/bin/ - -## === End end of region === - -## This here will start the build: %: dh $@ + +override_dh_auto_configure: + dh_auto_configure -- \ + -Dgtk_doc=false \ + -Dsystemdsystemunitdir=/lib/systemd/system \ + -Dhwdbdir=/lib/udev/hwdb.d \ + -Dtests=true + +execute_before_dh_install: + # The developer documentation isn't very useful + rm -rf debian/switcheroo-control/usr/share/gtk-doc diff --git a/debian/scripts/get_pwd.sh b/debian/scripts/get_pwd.sh deleted file mode 100755 index ef98ce9..0000000 --- a/debian/scripts/get_pwd.sh +++ /dev/null @@ -1,2 +0,0 @@ -#! /bin/sh -env | grep -w "PWD" | cut -c5- diff --git a/debian/watch b/debian/watch new file mode 100644 index 0000000..ef448d1 --- /dev/null +++ b/debian/watch @@ -0,0 +1,2 @@ +version=4 +https://gitlab.freedesktop.org/hadess/switcheroo-control/-/tags?sort=updated_desc .*/@PACKAGE@@ANY_VERSION@@ARCHIVE_EXT@ diff --git a/patches/libva-nvidia.diff b/patches/libva-nvidia.diff new file mode 100644 index 0000000..4315af5 --- /dev/null +++ b/patches/libva-nvidia.diff @@ -0,0 +1,14 @@ +diff '--color=auto' -ru a/src/switcheroo-control.c b/src/switcheroo-control.c +--- a/src/switcheroo-control.c 2022-07-01 12:29:43.000000000 +0300 ++++ b/src/switcheroo-control.c 2023-09-30 00:39:37.340679199 +0300 +@@ -254,6 +254,10 @@ + /* Make sure Vulkan apps always select Nvidia GPUs */ + g_ptr_array_add (array, g_strdup ("__VK_LAYER_NV_optimus")); + g_ptr_array_add (array, g_strdup ("NVIDIA_only")); ++ ++ /* Make sure LIBVA apps always select Nvidia GPUs */ ++ g_ptr_array_add (array, g_strdup ("LIBVA_DRIVER_NAME")); ++ g_ptr_array_add (array, g_strdup ("nvidia")); + } else { + char *id; +