upg ddcui ddcutil

This commit is contained in:
joborun linux 2024-01-24 20:38:09 +02:00
parent 867a072175
commit 4c2f9407a5
6 changed files with 144 additions and 50 deletions

View File

@ -6,52 +6,45 @@
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=ddcui
#pkgver=v0.3.0.r11.g6d693b5
pkgver=0.4.2
pkgver=0.5.0.r3.g418b380
pkgrel=02
pkgdesc='ddcui is a beta version of a graphical user interface for ddcutil, implemented using Qt.'
url='https://www.ddcutil.com/ddcui_main/'
license=('GPL2')
source=(#git+https://github.com/rockowitz/ddcui
"${pkgname}-${pkgver}.tar.gz::https://github.com/rockowitz/${pkgname}/archive/refs/tags/v${pkgver}.tar.gz"
ddcui.desktop)
#source=(#git+https://github.com/rockowitz/ddcui
# "${pkgname}-${pkgver}.tar.gz::https://github.com/rockowitz/${pkgname}/archive/refs/tags/v${pkgver}.tar.gz"
# ddcui.desktop)
provides=('ddcui')
depends=('ddcutil' 'qt5-base')
#makedepends=('git' 'cmake' 'qt5-tools')
makedepends=('cmake' 'qt5-tools')
makedepends=('git' 'cmake' 'qt5-tools')
provides=("$pkgname")
conflicts=("$pkgname-git")
source=('git+https://github.com/rockowitz/ddcui.git')
#pkgver() {
# cd "${srcdir}/${pkgname}"
# git describe --long | sed 's/\([^-]*-g\)/r\1/;s/-/./g'
#}
pkgver() {
cd "${pkgname%-git}"
git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
build() {
# cd "${srcdir}/${pkgname}"
cd "${srcdir}/${pkgname}-${pkgver}"
cmake \
-D CMAKE_INSTALL_PREFIX=/usr \
-D CMAKE_BUILD_TYPE=release \
.
make
cmake -B build -S "${pkgname%-git}" \
-DCMAKE_INSTALL_PREFIX='/usr' \
-DCMAKE_BUILD_TYPE='None' \
-Wno-dev
cmake --build build
}
package() {
# cd "${srcdir}/${pkgname}"
cd "${srcdir}/${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
install -D -m664 ../ddcui.desktop $pkgdir/usr/share/applications/ddcui.desktop
DESTDIR="$pkgdir" cmake --install build
}
#---- arch license gpg-key & sha256sums ----
arch=(x86_64)
license=('GPL2')
license=('GPL-2.0-or-later')
sha256sums=(455a291fca82f56a7904745dac05dc4dd572f4f2687627837837e66c4f8f00b2 # ddcui-0.4.2.tar.gz
dfc636ed820339094226fe6b4e9f855206125390a2f2c7e356a54c21008a3033) # ddcui.desktop
sha256sums=(SKIP) #
# dfc636ed820339094226fe6b4e9f855206125390a2f2c7e356a54c21008a3033) # ddcui.desktop
## 400f70e58bcf80a9dcf932baff0199efe530463bfef01ba1f3774304606aa4b6 ddcui-0.4.2-02-x86_64.pkg.tar.lz
## 79e8a2c4981220bebc79fe12948b62764bbf7c71275e6b667474fe7ccd312c2d ddcui-0.5.0.r3.g418b380-02-x86_64.pkg.tar.lz

View File

@ -6,3 +6,4 @@ qt5-tools
libglvnd
git

66
ddcutil/7f157f62.patch Normal file
View File

@ -0,0 +1,66 @@
From 7f157f620b7f4c3862e140b5b77ff9215f0b7497 Mon Sep 17 00:00:00 2001
From: Sanford Rockowitz <rockowitz@minsoft.com>
Date: Sat, 20 Jan 2024 10:04:36 -0500
Subject: [PATCH] ddci_init(): submaster_initializer not called if implicit
initialization
ddci_init() can be called "explicitly" or "implicitly". An explicit
call is when it is called either from ddca_init() or ddca_init2().
If an API function dependent on initialization is called before
explicit initialization, ddci_init() is called with arguments such
that it can never fail. This is an implicit call. In particular,
it is called with option DDCA_INIT_OPTIONS_DISABLE_CONFIG_FILE and
a null libopts string. Otherwise failure would be possible.
The bug was that some initialization did not occur with this
combination of ddci_init() args. In particular,
submaster_initializer(), which among other things sets the value of
sys_drm_connectors, was not called. Also any options in the
ddcutilrc configuration file that turned on tracing were not
processed, making debugging more difficult.
PowerDevil calls API functions requiring initialization before calling
ddca_init(). As a result, there's an implicit call to ddci_init(),
and because of the bug sys_drm_connectors is not set, resulting
in the "assert(sys_drm_connectors)" failure in function i2c_check_bus().
---
src/libmain/api_base.c | 25 ++++++++++++-------------
1 file changed, 12 insertions(+), 13 deletions(-)
diff --git a/src/libmain/api_base.c b/src/libmain/api_base.c
index 8f2c6e06..d862a361 100644
--- a/src/libmain/api_base.c
+++ b/src/libmain/api_base.c
@@ -660,20 +660,19 @@ ddci_init(const char * libopts,
*infomsg_loc = g_ptr_array_to_ntsa(infomsgs, /*duplicate=*/true);
}
g_ptr_array_free(infomsgs, true);
-
- if (!master_error) {
- if (parsed_cmd->trace_destination) {
- DBGF(debug, "Setting library trace file: %s", parsed_cmd->trace_destination);
- init_library_trace_file(parsed_cmd->trace_destination, enable_syslog, debug);
- }
- master_error = init_tracing(parsed_cmd);
- requested_stats = parsed_cmd->stats_types;
- ptd_api_profiling_enabled = parsed_cmd->flags & CMD_FLAG_PROFILE_API;
- per_display_stats = parsed_cmd->flags & CMD_FLAG_VERBOSE_STATS;
- dsa_detail_stats = parsed_cmd->flags & CMD_FLAG_INTERNAL_STATS;
- if (!submaster_initializer(parsed_cmd))
- master_error = ERRINFO_NEW(DDCRC_UNINITIALIZED, "Initialization failed");
+ }
+ if (!master_error) {
+ if (parsed_cmd->trace_destination) {
+ DBGF(debug, "Setting library trace file: %s", parsed_cmd->trace_destination);
+ init_library_trace_file(parsed_cmd->trace_destination, enable_syslog, debug);
}
+ master_error = init_tracing(parsed_cmd);
+ requested_stats = parsed_cmd->stats_types;
+ ptd_api_profiling_enabled = parsed_cmd->flags & CMD_FLAG_PROFILE_API;
+ per_display_stats = parsed_cmd->flags & CMD_FLAG_VERBOSE_STATS;
+ dsa_detail_stats = parsed_cmd->flags & CMD_FLAG_INTERNAL_STATS;
+ if (!submaster_initializer(parsed_cmd))
+ master_error = ERRINFO_NEW(DDCRC_UNINITIALIZED, "Initialization failed");
}
}

28
ddcutil/8fd63cfd.patch Normal file
View File

@ -0,0 +1,28 @@
From 8fd63cfd3f4378aff737be9f4402f0435dd1e367 Mon Sep 17 00:00:00 2001
From: Sanford Rockowitz <rockowitz@minsoft.com>
Date: Wed, 24 Jan 2024 01:09:35 -0500
Subject: [PATCH] check_how_unsupported_reported(): eliminate invalid assert()
does not allow for case of ambiguous -EIO response
---
src/ddc/ddc_displays.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/ddc/ddc_displays.c b/src/ddc/ddc_displays.c
index 8cefd063..e081a1b7 100644
--- a/src/ddc/ddc_displays.c
+++ b/src/ddc/ddc_displays.c
@@ -421,11 +421,12 @@ check_how_unsupported_reported(Display_Handle * dh) {
}
errinfo_free(erec);
dh->dref->flags |= DREF_UNSUPPORTED_CHECKED;
+#ifdef OUT // EIO case fails this assertion
assert(dh->dref->flags & (DREF_DDC_USES_DDC_FLAG_FOR_UNSUPPORTED |
DREF_DDC_USES_NULL_RESPONSE_FOR_UNSUPPORTED |
DREF_DDC_USES_MH_ML_SH_SL_ZERO_FOR_UNSUPPORTED |
DREF_DDC_DOES_NOT_INDICATE_UNSUPPORTED ) );
-
+#endif
DBGTRC_DONE(debug, TRACE_GROUP, "dref->flags=%s", interpret_dref_flags_t(dref->flags));
}

View File

@ -5,37 +5,42 @@
# Website : https://pozol.eu
#-----------------------------------------| DESCRIPTION |---------------------------------------
pkgname=ddcutil
#pkgver=2.0.0.r46.gea99378f
pkgver=2.0.0rc2
pkgname=ddcutil-git
_pkgname=ddcutil
pkgver=2.1.0.r51.g2c81bba6
pkgrel=02
pkgdesc="Query and change Linux monitor settings using DDC/CI and USB. w/o systemd"
url="https://www.ddcutil.com"
depends=('glib2' 'i2c-tools' 'libusb' 'libdrm' 'libxrandr')
makedepends=('git')
provides=("${pkgname}=${pkgver//.r*/}" 'libddcutil.so=4')
conflicts=("${pkgname}")
_commit=a896e4ccbf245a3cc14d49ce806d8bb76b8a74cc # tags/v2.0.0-rc2
source=("git+https://github.com/rockowitz/ddcutil.git#commit=$_commit")
depends=('glib2' 'i2c-tools' 'libusb' 'libdrm')
makedepends=('git')
provides=("${_pkgname}=${pkgver//.r*/}" 'libddcutil.so=4')
conflicts=("${_pkgname}")
#_commit=a896e4ccbf245a3cc14d49ce806d8bb76b8a74cc # tags/v2.0.0-rc2
#source=("git+https://github.com/rockowitz/ddcutil.git#commit=$_commit")
source=("git+https://github.com/rockowitz/ddcutil.git")
# https://github.com/rockowitz/ddcutil/commit/7f157f62.patch
# https://github.com/rockowitz/ddcutil/commit/8fd63cfd.patch)
#pkgver() {
# cd "$srcdir/${pkgname}"
# git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
#}
pkgver() {
cd "$srcdir/${_pkgname}"
git describe --long --tags | sed 's/^v//;s/\([^-]*-g\)/r\1/;s/-/./g'
}
prepare() {
cd "$srcdir/${pkgname}"
cd "$srcdir/${_pkgname}"
# patch -p1 -i ../7f157f62.patch # Fix assert
# patch -p1 -i ../8fd63cfd.patch # Fix another assert
NOCONFIGURE=1 ./autogen.sh
}
build() {
cd "$srcdir/${pkgname}"
cd "$srcdir/${_pkgname}"
./configure --prefix=/usr
make
}
package() {
cd "$srcdir/${pkgname}"
cd "$srcdir/${_pkgname}"
make DESTDIR="$pkgdir" install
}
@ -46,5 +51,7 @@ arch=(x86_64)
license=('GPL2')
sha256sums=(SKIP)
# 215914fb1f5afbd99213bd22ea92884173dca3aa420b2a93b9a285fc096039e4 # 7f157f62.patch
# 1b94e33ae3536117f01f9eb805653468edcc610e4f27c661a9868364f4bdd4aa) # 8fd63cfd.patch
## 15765359ad8f7bb2030d441cfeef66f3aa0a2d7d4e1e9dc9eaa98433cd3f6963 ddcutil-2.0.0rc2-02-x86_64.pkg.tar.lz
## 2548385bcdc3ddd6af291e437a424ca72e379878f62dcea96b996efd061d1029 ddcutil-git-2.1.0.r51.g2c81bba6-02-x86_64.pkg.tar.lz

View File

@ -1,8 +1,7 @@
i2c-tools
i2c-tools
libdrm
libxrandr
git
autoconf
automake