* [bug#75159] [PATCH v0 0/4] Add corectrl and corectrl-helper-service-type
@ 2024-12-28 10:18 Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 0/5] Add corectrl and corectrl-helper-service-type Ashvith Shetty
0 siblings, 2 replies; 12+ messages in thread
From: Ashvith Shetty @ 2024-12-28 10:18 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
This patch series adds the package corectrl. It also includes the helper
service and it's documentation.
Ashvith Shetty (3):
gnu: Add trompeloeil.
gnu: Add corectrl.
services: Add corectrl-helper-service-type.
Rutherther (1):
guix: qt: add inputs and outputs build variables in qt-build
doc/guix.texi | 15 ++++
gnu/local.mk | 1 +
gnu/packages/check.scm | 23 +++++
.../patches/corectrl-polkit-install-dir.patch | 21 +++++
gnu/packages/pciutils.scm | 83 ++++++++++++++++++-
gnu/services/pciutils.scm | 43 ++++++++++
guix/build-system/qt.scm | 54 ++++++------
7 files changed, 213 insertions(+), 27 deletions(-)
create mode 100644 gnu/packages/patches/corectrl-polkit-install-dir.patch
create mode 100644 gnu/services/pciutils.scm
--
2.46.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build
2024-12-28 10:18 [bug#75159] [PATCH v0 0/4] Add corectrl and corectrl-helper-service-type Ashvith Shetty
@ 2024-12-28 10:44 ` Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 2/4] gnu: Add trompeloeil Ashvith Shetty
` (3 more replies)
2024-12-28 15:30 ` [bug#75159] [PATCH v1 0/5] Add corectrl and corectrl-helper-service-type Ashvith Shetty
1 sibling, 4 replies; 12+ messages in thread
From: Ashvith Shetty @ 2024-12-28 10:44 UTC (permalink / raw)
To: 75159; +Cc: Rutherther
From: Rutherther <rutherther@ditigal.xyz>
Qt build doesn't provide build-variables of inputs and outputs,
so it's not possible to refer to %outputs in arguments of
a package that uses qt-build-system. This patch unifies
qt-build-system's behavior with other build systems like
cmake-build-system or gnu-build-system.
* guix/build-system/qt.scm (qt-build): Wrap with with-build-variables to
provide variables to arguments
Change-Id: I65853a5831ce7b5dc7ebe10807c6e61bb89cab36
---
guix/build-system/qt.scm | 54 +++++++++++++++++++++-------------------
1 file changed, 28 insertions(+), 26 deletions(-)
diff --git a/guix/build-system/qt.scm b/guix/build-system/qt.scm
index d1f721c54e..5f9a5019ae 100644
--- a/guix/build-system/qt.scm
+++ b/guix/build-system/qt.scm
@@ -152,32 +152,34 @@ (define builder
(with-imported-modules imported-modules
#~(begin
(use-modules #$@(sexp->gexp modules))
- (qt-build #:source #+source
- #:system #$system
- #:outputs #$(outputs->gexp outputs)
- #:inputs #$(input-tuples->gexp inputs)
- #:search-paths '#$(sexp->gexp
- (map search-path-specification->sexp
- search-paths))
- #:phases #$(if (pair? phases)
- (sexp->gexp phases)
- phases)
- #:qtbase #+qtbase
- #:qt-wrap-excluded-outputs #$qt-wrap-excluded-outputs
- #:qt-wrap-excluded-inputs #$qt-wrap-excluded-inputs
- #:configure-flags #$configure-flags
- #:make-flags #$make-flags
- #:out-of-source? #$out-of-source?
- #:build-type #$build-type
- #:tests? #$tests?
- #:test-target #$test-target
- #:parallel-build? #$parallel-build?
- #:parallel-tests? #$parallel-tests?
- #:validate-runpath? #$validate-runpath?
- #:patch-shebangs? #$patch-shebangs?
- #:strip-binaries? #$strip-binaries?
- #:strip-flags #$strip-flags
- #:strip-directories #$strip-directories))))
+
+ #$(with-build-variables inputs outputs
+ #~(qt-build #:source #+source
+ #:system #$system
+ #:outputs %outputs
+ #:inputs %build-inputs
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
+ #:qtbase #+qtbase
+ #:qt-wrap-excluded-outputs #$qt-wrap-excluded-outputs
+ #:qt-wrap-excluded-inputs #$qt-wrap-excluded-inputs
+ #:configure-flags #$configure-flags
+ #:make-flags #$make-flags
+ #:out-of-source? #$out-of-source?
+ #:build-type #$build-type
+ #:tests? #$tests?
+ #:test-target #$test-target
+ #:parallel-build? #$parallel-build?
+ #:parallel-tests? #$parallel-tests?
+ #:validate-runpath? #$validate-runpath?
+ #:patch-shebangs? #$patch-shebangs?
+ #:strip-binaries? #$strip-binaries?
+ #:strip-flags #$strip-flags
+ #:strip-directories #$strip-directories)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
system #:graft? #f)))
--
2.46.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#75159] [PATCH v0 2/4] gnu: Add trompeloeil.
2024-12-28 10:44 ` [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
@ 2024-12-28 10:44 ` Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 3/4] gnu: Add corectrl Ashvith Shetty
` (2 subsequent siblings)
3 siblings, 0 replies; 12+ messages in thread
From: Ashvith Shetty @ 2024-12-28 10:44 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
* gnu/packages/check.scm (trompeloeil): New variable.
Change-Id: I44d83ff4230a1c836bedc124acb1a40742f17021
---
gnu/packages/check.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index dd32800870..6afd7fefb5 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -3805,6 +3805,29 @@ (define-public toml-test
tests. The output format is JSON.")
(license license:expat)))
+(define-public trompeloeil
+ (package
+ (name "trompeloeil")
+ (version "49")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/rollbear/trompeloeil")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0m4bfzcj033qfk3sihbikrhk9krsdbsqk79nsambnsnqqcgc2903"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:tests? #f))
+ (home-page "https://github.com/rollbear/trompeloeil")
+ (synopsis "Header only C++14 mocking framework")
+ (description
+ "A thread-safe header-only mocking framework for C++11/14 using the Boost Software License 1.0")
+ (license license:boost1.0)))
+
(define-public unittest-cpp
(package
(name "unittest-cpp")
--
2.46.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#75159] [PATCH v0 3/4] gnu: Add corectrl.
2024-12-28 10:44 ` [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 2/4] gnu: Add trompeloeil Ashvith Shetty
@ 2024-12-28 10:44 ` Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 4/4] services: Add corectrl-helper-service-type Ashvith Shetty
2024-12-28 12:49 ` [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build Zheng Junjie
3 siblings, 0 replies; 12+ messages in thread
From: Ashvith Shetty @ 2024-12-28 10:44 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
* gnu/packages/pciutils.scm (corectrl): New variable.
* gnu/packages/patches/corectrl-polkit-install-dir.patch:
New file.
Change-Id: I726c6cbfb6530abd8284f36e10a1e1f7a0fc4661
---
.../patches/corectrl-polkit-install-dir.patch | 21 +++++
gnu/packages/pciutils.scm | 83 ++++++++++++++++++-
2 files changed, 103 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/corectrl-polkit-install-dir.patch
diff --git a/gnu/packages/patches/corectrl-polkit-install-dir.patch b/gnu/packages/patches/corectrl-polkit-install-dir.patch
new file mode 100644
index 0000000000..586e096cf4
--- /dev/null
+++ b/gnu/packages/patches/corectrl-polkit-install-dir.patch
@@ -0,0 +1,21 @@
+diff --git a/src/helper/CMakeLists.txt b/src/helper/CMakeLists.txt
+index c262086..523ea97 100644
+--- a/src/helper/CMakeLists.txt
++++ b/src/helper/CMakeLists.txt
+@@ -26,15 +26,7 @@ message("D-Bus files will be installed into ${DBUS_DATADIR_PREFIX_DIR}/dbus-1")
+
+ # Find polkit
+ pkg_check_modules(POLKIT REQUIRED polkit-gobject-1)
+-execute_process(
+- COMMAND pkg-config --variable=policydir polkit-gobject-1
+- RESULT_VARIABLE POLKIT_POLICY_INSTALL_DIR_RESULT
+- OUTPUT_VARIABLE POLKIT_POLICY_INSTALL_DIR
+- OUTPUT_STRIP_TRAILING_WHITESPACE
+-)
+-if(NOT POLKIT_POLICY_INSTALL_DIR_RESULT EQUAL "0")
+- message(FATAL_ERROR "Failed to retrieve Polkit `policydir` variable using pkg-config")
+-endif()
++option(POLKIT_POLICY_INSTALL_DIR "Polkit policy directory")
+
+ list(APPEND HELPER_COMPILE_DEFINITIONS
+ SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE
diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index 08f1634113..1ae568a8eb 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
+;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -30,11 +31,23 @@ (define-module (gnu packages pciutils)
#:use-module (guix utils)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system qt)
#:use-module (gnu packages)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages check)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages crypto)
+ #:use-module (gnu packages gcc)
+ #:use-module (gnu packages gl)
+ #:use-module (gnu packages logging)
+ #:use-module (gnu packages maths)
+ #:use-module (gnu packages polkit)
#:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages glib)
#:use-module (gnu packages linux)
- #:use-module (gnu packages base))
+ #:use-module (gnu packages qt)
+ #:use-module (gnu packages vulkan)
+ #:use-module (gnu packages xml))
(define-public hwdata
(package
@@ -173,3 +186,71 @@ (define-public pciutils
of operating systems. This includes the @command{lspci} and @command{setpci}
commands.")
(license license:gpl2+)))
+
+;; corectrl also requires the helper service.
+;; See corectrl-helper-service-type.
+;;
+;; Please read the setup instructions from:
+;; https://gitlab.com/corectrl/corectrl/-/wikis/Installation
+;; and
+;; https://gitlab.com/corectrl/corectrl/-/wikis/Setup
+;;
+;; corectrl also requires CONFIG_NETLINK_DIAG to be set to
+;; either 'y' or 'm' - 'm' is the default in Guix. In that case,
+;; the kernel module has to be loaded.
+;;
+;; To allow rootless corectrl, add user to the "corectrl" group.
+
+(define-public corectrl
+ (package
+ (name "corectrl")
+ (version "1.4.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/corectrl/corectrl")
+ (commit (string-append "v" version))))
+ (sha256
+ (base32 "0qpc04xxzv4jbqqlraqriipix4ph7bm1hfiry807jjp668i9n25d"))
+ (file-name (git-file-name name version))
+ (patches (search-patches "corectrl-polkit-install-dir.patch"))))
+ (build-system qt-build-system)
+ (arguments
+ (list
+ #:qtbase qtbase-5
+ #:tests? #t
+ #:configure-flags #~(list "-DINSTALL_DBUS_FILES_IN_PREFIX=true"
+ (string-append "-DPOLKIT_POLICY_INSTALL_DIR="
+ #$output
+ "/share/polkit-1/actions")
+ (string-append "-DWITH_PCI_IDS_PATH="
+ (search-input-file
+ %build-inputs
+ "/share/hwdata/pci.ids")))))
+ (native-inputs (list pkg-config gcc-13))
+ (propagated-inputs (list mesa-utils vulkan-tools util-linux))
+ (inputs (list dbus
+ botan
+ catch2-3
+ hwdata
+ polkit
+ procps
+ pugixml
+ qtcharts-5
+ qtdeclarative-5
+ qtquickcontrols2-5
+ qtsvg-5
+ qttools-5
+ quazip
+ spdlog
+ trompeloeil
+ units
+ zlib))
+ (home-page "https://gitlab.com/corectrl/corectrl")
+ (synopsis "Profile based system control utility")
+ (description
+ "CoreCtrl is a Free and Open Source GNU/Linux application that allows
+you to control with ease your computer hardware using application profiles.
+It aims to be flexible, comfortable and accessible to regular users.")
+ (license (list license:gpl3))))
--
2.46.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#75159] [PATCH v0 4/4] services: Add corectrl-helper-service-type.
2024-12-28 10:44 ` [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 2/4] gnu: Add trompeloeil Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 3/4] gnu: Add corectrl Ashvith Shetty
@ 2024-12-28 10:44 ` Ashvith Shetty
2024-12-28 12:49 ` [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build Zheng Junjie
3 siblings, 0 replies; 12+ messages in thread
From: Ashvith Shetty @ 2024-12-28 10:44 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
* gnu/services/pciutils.scm: New file.
(corectrl-helper-service-type): new variable.
* gnu/local.mk: Add them.
* doc/guix.texi (Miscellaneous Services): Document it.
Change-Id: I1dbeb927100a9a488909ff1950ec7e50d3797c29
---
doc/guix.texi | 15 ++++++++++++++
gnu/local.mk | 1 +
gnu/services/pciutils.scm | 43 +++++++++++++++++++++++++++++++++++++++
3 files changed, 59 insertions(+)
create mode 100644 gnu/services/pciutils.scm
diff --git a/doc/guix.texi b/doc/guix.texi
index da4d2f5ebc..a36d3cc0f1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -42550,6 +42550,21 @@ empty list means that no type is specified.
@end deftp
+@cindex corectrl-helper
+@subsubheading CoreCtrl Helper Service
+
+The @code{(gnu services pciutils)} module provides a DBus service for
+interacting with system hardware resources, such as CPU and GPU,
+enabling advanced control and management through the CoreCtrl application.
+
+@defvar corectrl-helper-service-type
+The service type for @command{corectrl}, which provides a helper service.
+
+@lisp
+(service corectrl-helper-service-type)
+@end lisp
+@end defvar
+
@c %end of fragment
@node Privileged Programs
diff --git a/gnu/local.mk b/gnu/local.mk
index 84160f407a..5ebdb72624 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -751,6 +751,7 @@ GNU_SYSTEM_MODULES = \
%D%/services/nix.scm \
%D%/services/nfs.scm \
%D%/services/pam-mount.scm \
+ %D%/services/pciutils.scm \
%D%/services/science.scm \
%D%/services/security.scm \
%D%/services/security-token.scm \
diff --git a/gnu/services/pciutils.scm b/gnu/services/pciutils.scm
new file mode 100644
index 0000000000..cfd310b584
--- /dev/null
+++ b/gnu/services/pciutils.scm
@@ -0,0 +1,43 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix 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.
+;;;
+;;; GNU Guix 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 GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu services pciutils)
+ #:use-module (gnu packages pciutils)
+ #:use-module (gnu services)
+ #:use-module (gnu services configuration)
+ #:use-module (gnu services dbus)
+ #:use-module (guix gexp)
+ #:export (corectrl-helper-configuration
+ corectrl-helper-configuration?
+ corectrl-helper-service-type))
+
+(define-configuration corectrl-helper-configuration
+ (corectrl (file-like corectrl) "The corectrl package"))
+
+(define (corectrl-helper-dbus-service config)
+ (list (corectrl-helper-configuration-corectrl config)))
+
+(define corectrl-helper-service-type
+ (service-type (name 'corectrl-helper)
+ (extensions (list (service-extension dbus-root-service-type
+ corectrl-helper-dbus-service)
+ (service-extension polkit-service-type
+ corectrl-helper-dbus-service)))
+ (default-value (corectrl-helper-configuration))
+ ;; TODO: Improve the description.
+ (description "Run corectrl-helper, an essential service for the corectrl application.")))
--
2.46.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build
2024-12-28 10:44 ` [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
` (2 preceding siblings ...)
2024-12-28 10:44 ` [bug#75159] [PATCH v0 4/4] services: Add corectrl-helper-service-type Ashvith Shetty
@ 2024-12-28 12:49 ` Zheng Junjie
3 siblings, 0 replies; 12+ messages in thread
From: Zheng Junjie @ 2024-12-28 12:49 UTC (permalink / raw)
To: Ashvith Shetty; +Cc: Rutherther, 75159
[-- Attachment #1: Type: text/plain, Size: 4512 bytes --]
Ashvith Shetty <ashvithshetty10@gmail.com> writes:
> From: Rutherther <rutherther@ditigal.xyz>
>
> Qt build doesn't provide build-variables of inputs and outputs,
> so it's not possible to refer to %outputs in arguments of
> a package that uses qt-build-system. This patch unifies
> qt-build-system's behavior with other build systems like
> cmake-build-system or gnu-build-system.
see https://mail.gnu.org/archive/html/guix-devel/2024-12/msg00124.html
Things like %outputs are outdated, please use gexp related
>
> * guix/build-system/qt.scm (qt-build): Wrap with with-build-variables to
> provide variables to arguments
>
> Change-Id: I65853a5831ce7b5dc7ebe10807c6e61bb89cab36
> ---
> guix/build-system/qt.scm | 54 +++++++++++++++++++++-------------------
> 1 file changed, 28 insertions(+), 26 deletions(-)
>
> diff --git a/guix/build-system/qt.scm b/guix/build-system/qt.scm
> index d1f721c54e..5f9a5019ae 100644
> --- a/guix/build-system/qt.scm
> +++ b/guix/build-system/qt.scm
> @@ -152,32 +152,34 @@ (define builder
> (with-imported-modules imported-modules
> #~(begin
> (use-modules #$@(sexp->gexp modules))
> - (qt-build #:source #+source
> - #:system #$system
> - #:outputs #$(outputs->gexp outputs)
> - #:inputs #$(input-tuples->gexp inputs)
> - #:search-paths '#$(sexp->gexp
> - (map search-path-specification->sexp
> - search-paths))
> - #:phases #$(if (pair? phases)
> - (sexp->gexp phases)
> - phases)
> - #:qtbase #+qtbase
> - #:qt-wrap-excluded-outputs #$qt-wrap-excluded-outputs
> - #:qt-wrap-excluded-inputs #$qt-wrap-excluded-inputs
> - #:configure-flags #$configure-flags
> - #:make-flags #$make-flags
> - #:out-of-source? #$out-of-source?
> - #:build-type #$build-type
> - #:tests? #$tests?
> - #:test-target #$test-target
> - #:parallel-build? #$parallel-build?
> - #:parallel-tests? #$parallel-tests?
> - #:validate-runpath? #$validate-runpath?
> - #:patch-shebangs? #$patch-shebangs?
> - #:strip-binaries? #$strip-binaries?
> - #:strip-flags #$strip-flags
> - #:strip-directories #$strip-directories))))
> +
> + #$(with-build-variables inputs outputs
> + #~(qt-build #:source #+source
> + #:system #$system
> + #:outputs %outputs
> + #:inputs %build-inputs
> + #:search-paths '#$(sexp->gexp
> + (map search-path-specification->sexp
> + search-paths))
> + #:phases #$(if (pair? phases)
> + (sexp->gexp phases)
> + phases)
> + #:qtbase #+qtbase
> + #:qt-wrap-excluded-outputs #$qt-wrap-excluded-outputs
> + #:qt-wrap-excluded-inputs #$qt-wrap-excluded-inputs
> + #:configure-flags #$configure-flags
> + #:make-flags #$make-flags
> + #:out-of-source? #$out-of-source?
> + #:build-type #$build-type
> + #:tests? #$tests?
> + #:test-target #$test-target
> + #:parallel-build? #$parallel-build?
> + #:parallel-tests? #$parallel-tests?
> + #:validate-runpath? #$validate-runpath?
> + #:patch-shebangs? #$patch-shebangs?
> + #:strip-binaries? #$strip-binaries?
> + #:strip-flags #$strip-flags
> + #:strip-directories #$strip-directories)))))
>
> (mlet %store-monad ((guile (package->derivation (or guile (default-guile))
> system #:graft? #f)))
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* [bug#75159] [PATCH v1 0/5] Add corectrl and corectrl-helper-service-type
2024-12-28 10:18 [bug#75159] [PATCH v0 0/4] Add corectrl and corectrl-helper-service-type Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
@ 2024-12-28 15:30 ` Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 1/5] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
` (4 more replies)
1 sibling, 5 replies; 12+ messages in thread
From: Ashvith Shetty @ 2024-12-28 15:30 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
Updated patch series replaces %outputs with #$(outputs->gexp outputs)
and %build-inputs with #$(input-tuples->gexp inputs).
Ashvith Shetty (4):
gnu: Add trompeloeil.
gnu: Add corectrl.
services: Add corectrl-helper-service-type.
guix: qt: Revert to gexp-based inputs and outputs
Rutherther (1):
guix: qt: add inputs and outputs build variables in qt-build
doc/guix.texi | 15 ++++
gnu/local.mk | 1 +
gnu/packages/check.scm | 23 +++++
.../patches/corectrl-polkit-install-dir.patch | 21 +++++
gnu/packages/pciutils.scm | 83 ++++++++++++++++++-
gnu/services/pciutils.scm | 43 ++++++++++
guix/build-system/qt.scm | 54 ++++++------
7 files changed, 213 insertions(+), 27 deletions(-)
create mode 100644 gnu/packages/patches/corectrl-polkit-install-dir.patch
create mode 100644 gnu/services/pciutils.scm
--
2.46.0
^ permalink raw reply [flat|nested] 12+ messages in thread
* [bug#75159] [PATCH v1 1/5] guix: qt: add inputs and outputs build variables in qt-build
2024-12-28 15:30 ` [bug#75159] [PATCH v1 0/5] Add corectrl and corectrl-helper-service-type Ashvith Shetty
@ 2024-12-28 15:30 ` Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 2/5] gnu: Add trompeloeil Ashvith Shetty
` (3 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Ashvith Shetty @ 2024-12-28 15:30 UTC (permalink / raw)
To: 75159; +Cc: Rutherther
From: Rutherther <rutherther@ditigal.xyz>
Qt build doesn't provide build-variables of inputs and outputs,
so it's not possible to refer to %outputs in arguments of
a package that uses qt-build-system. This patch unifies
qt-build-system's behavior with other build systems like
cmake-build-system or gnu-build-system.
* guix/build-system/qt.scm (qt-build): Wrap with with-build-variables to
provide variables to arguments
Change-Id: I65853a5831ce7b5dc7ebe10807c6e61bb89cab36
---
guix/build-system/qt.scm | 54 +++++++++++++++++++++-------------------
1 file changed, 28 insertions(+), 26 deletions(-)
diff --git a/guix/build-system/qt.scm b/guix/build-system/qt.scm
index d1f721c54e..5f9a5019ae 100644
--- a/guix/build-system/qt.scm
+++ b/guix/build-system/qt.scm
@@ -152,32 +152,34 @@ (define builder
(with-imported-modules imported-modules
#~(begin
(use-modules #$@(sexp->gexp modules))
- (qt-build #:source #+source
- #:system #$system
- #:outputs #$(outputs->gexp outputs)
- #:inputs #$(input-tuples->gexp inputs)
- #:search-paths '#$(sexp->gexp
- (map search-path-specification->sexp
- search-paths))
- #:phases #$(if (pair? phases)
- (sexp->gexp phases)
- phases)
- #:qtbase #+qtbase
- #:qt-wrap-excluded-outputs #$qt-wrap-excluded-outputs
- #:qt-wrap-excluded-inputs #$qt-wrap-excluded-inputs
- #:configure-flags #$configure-flags
- #:make-flags #$make-flags
- #:out-of-source? #$out-of-source?
- #:build-type #$build-type
- #:tests? #$tests?
- #:test-target #$test-target
- #:parallel-build? #$parallel-build?
- #:parallel-tests? #$parallel-tests?
- #:validate-runpath? #$validate-runpath?
- #:patch-shebangs? #$patch-shebangs?
- #:strip-binaries? #$strip-binaries?
- #:strip-flags #$strip-flags
- #:strip-directories #$strip-directories))))
+
+ #$(with-build-variables inputs outputs
+ #~(qt-build #:source #+source
+ #:system #$system
+ #:outputs %outputs
+ #:inputs %build-inputs
+ #:search-paths '#$(sexp->gexp
+ (map search-path-specification->sexp
+ search-paths))
+ #:phases #$(if (pair? phases)
+ (sexp->gexp phases)
+ phases)
+ #:qtbase #+qtbase
+ #:qt-wrap-excluded-outputs #$qt-wrap-excluded-outputs
+ #:qt-wrap-excluded-inputs #$qt-wrap-excluded-inputs
+ #:configure-flags #$configure-flags
+ #:make-flags #$make-flags
+ #:out-of-source? #$out-of-source?
+ #:build-type #$build-type
+ #:tests? #$tests?
+ #:test-target #$test-target
+ #:parallel-build? #$parallel-build?
+ #:parallel-tests? #$parallel-tests?
+ #:validate-runpath? #$validate-runpath?
+ #:patch-shebangs? #$patch-shebangs?
+ #:strip-binaries? #$strip-binaries?
+ #:strip-flags #$strip-flags
+ #:strip-directories #$strip-directories)))))
(mlet %store-monad ((guile (package->derivation (or guile (default-guile))
system #:graft? #f)))
--
2.46.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#75159] [PATCH v1 2/5] gnu: Add trompeloeil.
2024-12-28 15:30 ` [bug#75159] [PATCH v1 0/5] Add corectrl and corectrl-helper-service-type Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 1/5] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
@ 2024-12-28 15:30 ` Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 3/5] gnu: Add corectrl Ashvith Shetty
` (2 subsequent siblings)
4 siblings, 0 replies; 12+ messages in thread
From: Ashvith Shetty @ 2024-12-28 15:30 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
* gnu/packages/check.scm (trompeloeil): New variable.
Change-Id: I44d83ff4230a1c836bedc124acb1a40742f17021
---
gnu/packages/check.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index dd32800870..6afd7fefb5 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -3805,6 +3805,29 @@ (define-public toml-test
tests. The output format is JSON.")
(license license:expat)))
+(define-public trompeloeil
+ (package
+ (name "trompeloeil")
+ (version "49")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/rollbear/trompeloeil")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0m4bfzcj033qfk3sihbikrhk9krsdbsqk79nsambnsnqqcgc2903"))))
+ (build-system cmake-build-system)
+ (arguments
+ (list
+ #:tests? #f))
+ (home-page "https://github.com/rollbear/trompeloeil")
+ (synopsis "Header only C++14 mocking framework")
+ (description
+ "A thread-safe header-only mocking framework for C++11/14 using the Boost Software License 1.0")
+ (license license:boost1.0)))
+
(define-public unittest-cpp
(package
(name "unittest-cpp")
--
2.46.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#75159] [PATCH v1 3/5] gnu: Add corectrl.
2024-12-28 15:30 ` [bug#75159] [PATCH v1 0/5] Add corectrl and corectrl-helper-service-type Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 1/5] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 2/5] gnu: Add trompeloeil Ashvith Shetty
@ 2024-12-28 15:30 ` Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 4/5] services: Add corectrl-helper-service-type Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 5/5] guix: qt: Revert to gexp-based inputs and outputs Ashvith Shetty
4 siblings, 0 replies; 12+ messages in thread
From: Ashvith Shetty @ 2024-12-28 15:30 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
* gnu/packages/pciutils.scm (corectrl): New variable.
* gnu/packages/patches/corectrl-polkit-install-dir.patch:
New file.
Change-Id: I726c6cbfb6530abd8284f36e10a1e1f7a0fc4661
---
.../patches/corectrl-polkit-install-dir.patch | 21 +++++
gnu/packages/pciutils.scm | 83 ++++++++++++++++++-
2 files changed, 103 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/corectrl-polkit-install-dir.patch
diff --git a/gnu/packages/patches/corectrl-polkit-install-dir.patch b/gnu/packages/patches/corectrl-polkit-install-dir.patch
new file mode 100644
index 0000000000..586e096cf4
--- /dev/null
+++ b/gnu/packages/patches/corectrl-polkit-install-dir.patch
@@ -0,0 +1,21 @@
+diff --git a/src/helper/CMakeLists.txt b/src/helper/CMakeLists.txt
+index c262086..523ea97 100644
+--- a/src/helper/CMakeLists.txt
++++ b/src/helper/CMakeLists.txt
+@@ -26,15 +26,7 @@ message("D-Bus files will be installed into ${DBUS_DATADIR_PREFIX_DIR}/dbus-1")
+
+ # Find polkit
+ pkg_check_modules(POLKIT REQUIRED polkit-gobject-1)
+-execute_process(
+- COMMAND pkg-config --variable=policydir polkit-gobject-1
+- RESULT_VARIABLE POLKIT_POLICY_INSTALL_DIR_RESULT
+- OUTPUT_VARIABLE POLKIT_POLICY_INSTALL_DIR
+- OUTPUT_STRIP_TRAILING_WHITESPACE
+-)
+-if(NOT POLKIT_POLICY_INSTALL_DIR_RESULT EQUAL "0")
+- message(FATAL_ERROR "Failed to retrieve Polkit `policydir` variable using pkg-config")
+-endif()
++option(POLKIT_POLICY_INSTALL_DIR "Polkit policy directory")
+
+ list(APPEND HELPER_COMPILE_DEFINITIONS
+ SPDLOG_ACTIVE_LEVEL=SPDLOG_LEVEL_TRACE
diff --git a/gnu/packages/pciutils.scm b/gnu/packages/pciutils.scm
index 08f1634113..1ae568a8eb 100644
--- a/gnu/packages/pciutils.scm
+++ b/gnu/packages/pciutils.scm
@@ -6,6 +6,7 @@
;;; Copyright © 2020, 2023, 2024 Janneke Nieuwenhuizen <janneke@gnu.org>
;;; Copyright © 2022 Brendan Tildesley <mail@brendan.scot>
;;; Copyright © 2022 Marius Bakke <marius@gnu.org>
+;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -30,11 +31,23 @@ (define-module (gnu packages pciutils)
#:use-module (guix utils)
#:use-module (guix git-download)
#:use-module (guix build-system gnu)
+ #:use-module (guix build-system qt)
#:use-module (gnu packages)
+ #:use-module (gnu packages base)
+ #:use-module (gnu packages check)
#:use-module (gnu packages compression)
+ #:use-module (gnu packages crypto)
+ #:use-module (gnu packages gcc)
+ #:use-module (gnu packages gl)
+ #:use-module (gnu packages logging)
+ #:use-module (gnu packages maths)
+ #:use-module (gnu packages polkit)
#:use-module (gnu packages pkg-config)
+ #:use-module (gnu packages glib)
#:use-module (gnu packages linux)
- #:use-module (gnu packages base))
+ #:use-module (gnu packages qt)
+ #:use-module (gnu packages vulkan)
+ #:use-module (gnu packages xml))
(define-public hwdata
(package
@@ -173,3 +186,71 @@ (define-public pciutils
of operating systems. This includes the @command{lspci} and @command{setpci}
commands.")
(license license:gpl2+)))
+
+;; corectrl also requires the helper service.
+;; See corectrl-helper-service-type.
+;;
+;; Please read the setup instructions from:
+;; https://gitlab.com/corectrl/corectrl/-/wikis/Installation
+;; and
+;; https://gitlab.com/corectrl/corectrl/-/wikis/Setup
+;;
+;; corectrl also requires CONFIG_NETLINK_DIAG to be set to
+;; either 'y' or 'm' - 'm' is the default in Guix. In that case,
+;; the kernel module has to be loaded.
+;;
+;; To allow rootless corectrl, add user to the "corectrl" group.
+
+(define-public corectrl
+ (package
+ (name "corectrl")
+ (version "1.4.3")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://gitlab.com/corectrl/corectrl")
+ (commit (string-append "v" version))))
+ (sha256
+ (base32 "0qpc04xxzv4jbqqlraqriipix4ph7bm1hfiry807jjp668i9n25d"))
+ (file-name (git-file-name name version))
+ (patches (search-patches "corectrl-polkit-install-dir.patch"))))
+ (build-system qt-build-system)
+ (arguments
+ (list
+ #:qtbase qtbase-5
+ #:tests? #t
+ #:configure-flags #~(list "-DINSTALL_DBUS_FILES_IN_PREFIX=true"
+ (string-append "-DPOLKIT_POLICY_INSTALL_DIR="
+ #$output
+ "/share/polkit-1/actions")
+ (string-append "-DWITH_PCI_IDS_PATH="
+ (search-input-file
+ %build-inputs
+ "/share/hwdata/pci.ids")))))
+ (native-inputs (list pkg-config gcc-13))
+ (propagated-inputs (list mesa-utils vulkan-tools util-linux))
+ (inputs (list dbus
+ botan
+ catch2-3
+ hwdata
+ polkit
+ procps
+ pugixml
+ qtcharts-5
+ qtdeclarative-5
+ qtquickcontrols2-5
+ qtsvg-5
+ qttools-5
+ quazip
+ spdlog
+ trompeloeil
+ units
+ zlib))
+ (home-page "https://gitlab.com/corectrl/corectrl")
+ (synopsis "Profile based system control utility")
+ (description
+ "CoreCtrl is a Free and Open Source GNU/Linux application that allows
+you to control with ease your computer hardware using application profiles.
+It aims to be flexible, comfortable and accessible to regular users.")
+ (license (list license:gpl3))))
--
2.46.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#75159] [PATCH v1 4/5] services: Add corectrl-helper-service-type.
2024-12-28 15:30 ` [bug#75159] [PATCH v1 0/5] Add corectrl and corectrl-helper-service-type Ashvith Shetty
` (2 preceding siblings ...)
2024-12-28 15:30 ` [bug#75159] [PATCH v1 3/5] gnu: Add corectrl Ashvith Shetty
@ 2024-12-28 15:30 ` Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 5/5] guix: qt: Revert to gexp-based inputs and outputs Ashvith Shetty
4 siblings, 0 replies; 12+ messages in thread
From: Ashvith Shetty @ 2024-12-28 15:30 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
* gnu/services/pciutils.scm: New file.
(corectrl-helper-service-type): new variable.
* gnu/local.mk: Add them.
* doc/guix.texi (Miscellaneous Services): Document it.
Change-Id: I1dbeb927100a9a488909ff1950ec7e50d3797c29
---
doc/guix.texi | 15 ++++++++++++++
gnu/local.mk | 1 +
gnu/services/pciutils.scm | 43 +++++++++++++++++++++++++++++++++++++++
3 files changed, 59 insertions(+)
create mode 100644 gnu/services/pciutils.scm
diff --git a/doc/guix.texi b/doc/guix.texi
index da4d2f5ebc..a36d3cc0f1 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -42550,6 +42550,21 @@ empty list means that no type is specified.
@end deftp
+@cindex corectrl-helper
+@subsubheading CoreCtrl Helper Service
+
+The @code{(gnu services pciutils)} module provides a DBus service for
+interacting with system hardware resources, such as CPU and GPU,
+enabling advanced control and management through the CoreCtrl application.
+
+@defvar corectrl-helper-service-type
+The service type for @command{corectrl}, which provides a helper service.
+
+@lisp
+(service corectrl-helper-service-type)
+@end lisp
+@end defvar
+
@c %end of fragment
@node Privileged Programs
diff --git a/gnu/local.mk b/gnu/local.mk
index 84160f407a..5ebdb72624 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -751,6 +751,7 @@ GNU_SYSTEM_MODULES = \
%D%/services/nix.scm \
%D%/services/nfs.scm \
%D%/services/pam-mount.scm \
+ %D%/services/pciutils.scm \
%D%/services/science.scm \
%D%/services/security.scm \
%D%/services/security-token.scm \
diff --git a/gnu/services/pciutils.scm b/gnu/services/pciutils.scm
new file mode 100644
index 0000000000..cfd310b584
--- /dev/null
+++ b/gnu/services/pciutils.scm
@@ -0,0 +1,43 @@
+;;; GNU Guix --- Functional package management for GNU
+;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix 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.
+;;;
+;;; GNU Guix 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 GNU Guix. If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu services pciutils)
+ #:use-module (gnu packages pciutils)
+ #:use-module (gnu services)
+ #:use-module (gnu services configuration)
+ #:use-module (gnu services dbus)
+ #:use-module (guix gexp)
+ #:export (corectrl-helper-configuration
+ corectrl-helper-configuration?
+ corectrl-helper-service-type))
+
+(define-configuration corectrl-helper-configuration
+ (corectrl (file-like corectrl) "The corectrl package"))
+
+(define (corectrl-helper-dbus-service config)
+ (list (corectrl-helper-configuration-corectrl config)))
+
+(define corectrl-helper-service-type
+ (service-type (name 'corectrl-helper)
+ (extensions (list (service-extension dbus-root-service-type
+ corectrl-helper-dbus-service)
+ (service-extension polkit-service-type
+ corectrl-helper-dbus-service)))
+ (default-value (corectrl-helper-configuration))
+ ;; TODO: Improve the description.
+ (description "Run corectrl-helper, an essential service for the corectrl application.")))
--
2.46.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [bug#75159] [PATCH v1 5/5] guix: qt: Revert to gexp-based inputs and outputs
2024-12-28 15:30 ` [bug#75159] [PATCH v1 0/5] Add corectrl and corectrl-helper-service-type Ashvith Shetty
` (3 preceding siblings ...)
2024-12-28 15:30 ` [bug#75159] [PATCH v1 4/5] services: Add corectrl-helper-service-type Ashvith Shetty
@ 2024-12-28 15:30 ` Ashvith Shetty
4 siblings, 0 replies; 12+ messages in thread
From: Ashvith Shetty @ 2024-12-28 15:30 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
* guix/build-system/qt.scm (qt-build):
Replace %outputs with #$(outputs->gexp outputs)
Replace %build-inputs #$(input-tuples->gexp inputs)
Change-Id: I272f117cb9d1679869c15ade0f7da06abc9badc9
---
guix/build-system/qt.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/guix/build-system/qt.scm b/guix/build-system/qt.scm
index 5f9a5019ae..b3c1c2c6e9 100644
--- a/guix/build-system/qt.scm
+++ b/guix/build-system/qt.scm
@@ -156,8 +156,8 @@ (define builder
#$(with-build-variables inputs outputs
#~(qt-build #:source #+source
#:system #$system
- #:outputs %outputs
- #:inputs %build-inputs
+ #:outputs #$(outputs->gexp outputs)
+ #:inputs #$(input-tuples->gexp inputs)
#:search-paths '#$(sexp->gexp
(map search-path-specification->sexp
search-paths))
--
2.46.0
^ permalink raw reply related [flat|nested] 12+ messages in thread
end of thread, other threads:[~2024-12-28 15:34 UTC | newest]
Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-12-28 10:18 [bug#75159] [PATCH v0 0/4] Add corectrl and corectrl-helper-service-type Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 2/4] gnu: Add trompeloeil Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 3/4] gnu: Add corectrl Ashvith Shetty
2024-12-28 10:44 ` [bug#75159] [PATCH v0 4/4] services: Add corectrl-helper-service-type Ashvith Shetty
2024-12-28 12:49 ` [bug#75159] [PATCH v0 1/4] guix: qt: add inputs and outputs build variables in qt-build Zheng Junjie
2024-12-28 15:30 ` [bug#75159] [PATCH v1 0/5] Add corectrl and corectrl-helper-service-type Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 1/5] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 2/5] gnu: Add trompeloeil Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 3/5] gnu: Add corectrl Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 4/5] services: Add corectrl-helper-service-type Ashvith Shetty
2024-12-28 15:30 ` [bug#75159] [PATCH v1 5/5] guix: qt: Revert to gexp-based inputs and outputs Ashvith Shetty
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/guix.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).