* [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
` (2 more replies)
0 siblings, 3 replies; 22+ 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] 22+ 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
2024-12-31 18:09 ` [bug#75159] [PATCH v2 0/3] Add corectrl and corectrl-helper-service-type Ashvith Shetty
2 siblings, 4 replies; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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; 22+ 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] 22+ 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)
2024-12-31 18:09 ` [bug#75159] [PATCH v2 0/3] Add corectrl and corectrl-helper-service-type Ashvith Shetty
2 siblings, 5 replies; 22+ 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] 22+ 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-30 7:03 ` Zheng Junjie
2024-12-28 15:30 ` [bug#75159] [PATCH v1 2/5] gnu: Add trompeloeil Ashvith Shetty
` (3 subsequent siblings)
4 siblings, 1 reply; 22+ 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] 22+ 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-30 6:38 ` Zheng Junjie
2024-12-28 15:30 ` [bug#75159] [PATCH v1 3/5] gnu: Add corectrl Ashvith Shetty
` (2 subsequent siblings)
4 siblings, 1 reply; 22+ 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] 22+ 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-30 6:50 ` Zheng Junjie
2024-12-30 7:48 ` Zheng Junjie
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, 2 replies; 22+ 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] 22+ 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-30 7:00 ` Zheng Junjie
2024-12-28 15:30 ` [bug#75159] [PATCH v1 5/5] guix: qt: Revert to gexp-based inputs and outputs Ashvith Shetty
4 siblings, 1 reply; 22+ 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] 22+ 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; 22+ 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] 22+ messages in thread
* [bug#75159] [PATCH v1 2/5] gnu: Add trompeloeil.
2024-12-28 15:30 ` [bug#75159] [PATCH v1 2/5] gnu: Add trompeloeil Ashvith Shetty
@ 2024-12-30 6:38 ` Zheng Junjie
0 siblings, 0 replies; 22+ messages in thread
From: Zheng Junjie @ 2024-12-30 6:38 UTC (permalink / raw)
To: Ashvith Shetty; +Cc: 75159
[-- Attachment #1: Type: text/plain, Size: 1659 bytes --]
Ashvith Shetty <ashvithshetty10@gmail.com> writes:
> * 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))
why disable test? Please fix it or add a comment to explain this.
> + (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")
maybe "Trompeloeil is a thread-safe header-only mocking framework for C++11/14."
> + (license license:boost1.0)))
> +
> (define-public unittest-cpp
> (package
> (name "unittest-cpp")
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* [bug#75159] [PATCH v1 3/5] gnu: Add corectrl.
2024-12-28 15:30 ` [bug#75159] [PATCH v1 3/5] gnu: Add corectrl Ashvith Shetty
@ 2024-12-30 6:50 ` Zheng Junjie
2024-12-30 7:48 ` Zheng Junjie
1 sibling, 0 replies; 22+ messages in thread
From: Zheng Junjie @ 2024-12-30 6:50 UTC (permalink / raw)
To: Ashvith Shetty; +Cc: 75159
[-- Attachment #1: Type: text/plain, Size: 6928 bytes --]
Ashvith Shetty <ashvithshetty10@gmail.com> writes:
> * 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
you forget add this patch to gnu/local.mk(dist_patch_DATA).
You can also mention a pr upstream that allows custom
POLKIT_POLICY_INSTALL_DIR.
> 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
i think this package should go to gnu/packages/admin.scm, because this
package is "control with ease your computer hardware using application
profiles".
> + (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
please remove it, tests should not be forced.
> + #: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")))))
please not use %build-inputs. It's an outdated thing.
use
(string-append "-DWITH_PCI_IDS_PATH=" #$(this-package-input "hwdata")
"/share/hwdata/pci.ids")
> + (native-inputs (list pkg-config gcc-13))
please add comments for why need gcc-13.
> + (propagated-inputs (list mesa-utils vulkan-tools util-linux))
why propagated them? It's easy to conflict in profiles, maybe should use wrap-program.
> + (inputs (list dbus
> + botan
> + catch2-3
> + hwdata
> + polkit
> + procps
> + pugixml
> + qtcharts-5
> + qtdeclarative-5
> + qtquickcontrols2-5
> + qtsvg-5
> + qttools-5
qttools-5 should go to native-inputs.
> + 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))))
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* [bug#75159] [PATCH v1 4/5] services: Add corectrl-helper-service-type.
2024-12-28 15:30 ` [bug#75159] [PATCH v1 4/5] services: Add corectrl-helper-service-type Ashvith Shetty
@ 2024-12-30 7:00 ` Zheng Junjie
0 siblings, 0 replies; 22+ messages in thread
From: Zheng Junjie @ 2024-12-30 7:00 UTC (permalink / raw)
To: Ashvith Shetty; +Cc: 75159
[-- Attachment #1: Type: text/plain, Size: 4531 bytes --]
Ashvith Shetty <ashvithshetty10@gmail.com> writes:
> * gnu/services/pciutils.scm: New file.
This service doesn't seem to have anything to do with pciutils. Put it
in another module or a separate corectrl module.
> (corectrl-helper-service-type): new variable.
i think should corectrl-service-type. corectr-helper doesn't mean
anything. And use profile-service-type to add corectrl to profile. This
allows only one service to use corectrl, rather than requiring the user
to add the package.
> * 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)))
also add profile-service-type.
> + (default-value (corectrl-helper-configuration))
> + ;; TODO: Improve the description.
> + (description "Run corectrl-helper, an essential service for the corectrl application.")))
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 22+ 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 1/5] guix: qt: add inputs and outputs build variables in qt-build Ashvith Shetty
@ 2024-12-30 7:03 ` Zheng Junjie
0 siblings, 0 replies; 22+ messages in thread
From: Zheng Junjie @ 2024-12-30 7:03 UTC (permalink / raw)
To: Ashvith Shetty; +Cc: Rutherther, 75159
[-- Attachment #1: Type: text/plain, Size: 4564 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.
>
This patch will cause all qt packages to be rebuilt, and the future
should be to remove cmake-build-system, gnu-build-system's %outputs, use
gexp. so this patch will not be merged.
> * 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] 22+ messages in thread
* [bug#75159] [PATCH v1 3/5] gnu: Add corectrl.
2024-12-28 15:30 ` [bug#75159] [PATCH v1 3/5] gnu: Add corectrl Ashvith Shetty
2024-12-30 6:50 ` Zheng Junjie
@ 2024-12-30 7:48 ` Zheng Junjie
1 sibling, 0 replies; 22+ messages in thread
From: Zheng Junjie @ 2024-12-30 7:48 UTC (permalink / raw)
To: Ashvith Shetty; +Cc: 75159
[-- Attachment #1: Type: text/plain, Size: 473 bytes --]
Ashvith Shetty <ashvithshetty10@gmail.com> writes:
> * gnu/packages/pciutils.scm (corectrl): New variable.
[...]
> +(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))))
and you forget Add (file-name (git-file-name name version))
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
* [bug#75159] [PATCH v2 0/3] 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 ` [bug#75159] [PATCH v1 0/5] Add corectrl and corectrl-helper-service-type Ashvith Shetty
@ 2024-12-31 18:09 ` Ashvith Shetty
2024-12-31 18:09 ` [bug#75159] [PATCH v2 1/3] gnu: Add trompeloeil Ashvith Shetty
` (3 more replies)
2 siblings, 4 replies; 22+ messages in thread
From: Ashvith Shetty @ 2024-12-31 18:09 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
Made improvements on the previous commits as per the review.
Ashvith Shetty (3):
gnu: Add trompeloeil.
gnu: Add corectrl.
services: Add corectrl-helper-service-type.
doc/guix.texi | 32 ++++++++
gnu/local.mk | 2 +
gnu/packages/admin.scm | 73 +++++++++++++++++++
gnu/packages/check.scm | 31 ++++++++
.../patches/corectrl-polkit-install-dir.patch | 21 ++++++
gnu/services/admin.scm | 27 ++++++-
6 files changed, 185 insertions(+), 1 deletion(-)
create mode 100644 gnu/packages/patches/corectrl-polkit-install-dir.patch
--
2.46.0
^ permalink raw reply [flat|nested] 22+ messages in thread
* [bug#75159] [PATCH v2 1/3] gnu: Add trompeloeil.
2024-12-31 18:09 ` [bug#75159] [PATCH v2 0/3] Add corectrl and corectrl-helper-service-type Ashvith Shetty
@ 2024-12-31 18:09 ` Ashvith Shetty
2024-12-31 18:09 ` [bug#75159] [PATCH v2 2/3] gnu: Add corectrl Ashvith Shetty
` (2 subsequent siblings)
3 siblings, 0 replies; 22+ messages in thread
From: Ashvith Shetty @ 2024-12-31 18:09 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
From: Ashvith Shetty <ashvith@noreply.codeberg.org>
* gnu/packages/check.scm (trompeloeil): New variable.
Change-Id: I442cd0b5e84e8f9956b16b7d9235f67d9f5f693e
---
gnu/packages/check.scm | 31 +++++++++++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/gnu/packages/check.scm b/gnu/packages/check.scm
index 5fef10485b..151c6fb5c4 100644
--- a/gnu/packages/check.scm
+++ b/gnu/packages/check.scm
@@ -52,6 +52,7 @@
;;; Copyright © 2024 Zheng Junjie <873216071@qq.com>
;;; Copyright © 2024 Navid Afkhami <navid.afkhami@mdc-berlin.de>
;;; Copyright © 2024 gemmaro <gemmaro.dev@gmail.com>
+;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -3806,6 +3807,36 @@ (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
+ #:configure-flags #~(list "-D TROMPELOEIL_BUILD_TESTS=yes")
+ #:test-target "test/self_test"
+ #:phases #~(modify-phases %standard-phases
+ (replace 'check
+ (lambda* (#:key tests? test-target #:allow-other-keys)
+ (when tests?
+ (invoke test-target)))))))
+ (native-inputs (list catch2-3))
+ (home-page "https://github.com/rollbear/trompeloeil")
+ (synopsis "Header only C++14 mocking framework")
+ (description
+ "Trompeloeil is a thread-safe header-only mocking framework for C++11/14.")
+ (license license:boost1.0)))
+
(define-public unittest-cpp
(package
(name "unittest-cpp")
--
2.46.0
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [bug#75159] [PATCH v2 2/3] gnu: Add corectrl.
2024-12-31 18:09 ` [bug#75159] [PATCH v2 0/3] Add corectrl and corectrl-helper-service-type Ashvith Shetty
2024-12-31 18:09 ` [bug#75159] [PATCH v2 1/3] gnu: Add trompeloeil Ashvith Shetty
@ 2024-12-31 18:09 ` Ashvith Shetty
2024-12-31 18:09 ` [bug#75159] [PATCH v2 3/3] services: Add corectrl-helper-service-type Ashvith Shetty
2025-01-03 21:58 ` [bug#75159] [PATCH v2 0/3] Add corectrl and corectrl-helper-service-type Ashvith Shetty
3 siblings, 0 replies; 22+ messages in thread
From: Ashvith Shetty @ 2024-12-31 18:09 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
From: Ashvith Shetty <ashvith@noreply.codeberg.org>
* gnu/packages/admin.scm (corectrl): New variable.
* gnu/packages/patches/corectrl-polkit-install-dir.patch:
New file.
* gnu/local.mk (dist_patch_DATA): Add reference to it.
Change-Id: I7b0f85c917eb58d7518d7ee7c5b22ef2debde7d9
---
gnu/local.mk | 2 +
gnu/packages/admin.scm | 73 +++++++++++++++++++
.../patches/corectrl-polkit-install-dir.patch | 21 ++++++
3 files changed, 96 insertions(+)
create mode 100644 gnu/packages/patches/corectrl-polkit-install-dir.patch
diff --git a/gnu/local.mk b/gnu/local.mk
index 02a6fa616e..799a1ce591 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -69,6 +69,7 @@
# Copyright © 2024 Fabio Natali <me@fabionatali.com>
# Copyright © 2024 Noé Lopez <noelopez@free.fr>
# Copyright © 2024 Runciter <runciter@whispers-vpn.org>
+# Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
#
# This file is part of GNU Guix.
#
@@ -1121,6 +1122,7 @@ dist_patch_DATA = \
%D%/packages/patches/converseen-hide-non-free-pointers.patch \
%D%/packages/patches/cool-retro-term-wctype.patch \
%D%/packages/patches/coq-autosubst-1.8-remove-deprecated-files.patch \
+ %D%/packages/patches/corectrl-polkit-install-dir.patch \
%D%/packages/patches/corefx-mono-5.4.0-patches.patch \
%D%/packages/patches/corefx-mono-pre-5.8.0-patches.patch \
%D%/packages/patches/coreutils-gnulib-tests.patch \
diff --git a/gnu/packages/admin.scm b/gnu/packages/admin.scm
index dce93e4f3a..3759b53d52 100644
--- a/gnu/packages/admin.scm
+++ b/gnu/packages/admin.scm
@@ -70,6 +70,7 @@
;;; Copyright © 2024 Vinicius Monego <monego@posteo.net>
;;; Copyright © 2024 nathan <nathan_mail@nborghese.com>
;;; Copyright © 2024 Nikita Domnitskii <nikita@domnitskii.me>
+;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -137,6 +138,7 @@ (define-module (gnu packages admin)
#:use-module (gnu packages freedesktop)
#:use-module (gnu packages gawk)
#:use-module (gnu packages gettext)
+ #:use-module (gnu packages gcc)
#:use-module (gnu packages gl)
#:use-module (gnu packages glib)
#:use-module (gnu packages gnome)
@@ -157,10 +159,12 @@ (define-module (gnu packages admin)
#:use-module (gnu packages libunwind)
#:use-module (gnu packages libusb)
#:use-module (gnu packages linux)
+ #:use-module (gnu packages logging)
#:use-module (gnu packages lua)
#:use-module (gnu packages m4)
#:use-module (gnu packages mail)
#:use-module (gnu packages man)
+ #:use-module (gnu packages maths)
#:use-module (gnu packages markup)
#:use-module (gnu packages mcrypt)
#:use-module (gnu packages mpi)
@@ -195,6 +199,7 @@ (define-module (gnu packages admin)
#:use-module (gnu packages time)
#:use-module (gnu packages tls)
#:use-module (gnu packages version-control)
+ #:use-module (gnu packages vulkan)
#:use-module (gnu packages web)
#:use-module (gnu packages xdisorg)
#:use-module (gnu packages xml)
@@ -6484,3 +6489,71 @@ (define-public sshguard
services. It aggregates system logs and blocks repeat offenders using one of
several firewall backends.")
(license license:isc)))
+
+(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
+ #: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="
+ #$(this-package-input "hwdata")
+ "/share/hwdata/pci.ids"))
+ #:phases #~(modify-phases %standard-phases
+ (add-after 'install 'wrap-program
+ (lambda* (#:key inputs #:allow-other-keys)
+ (wrap-program (string-append #$output "/bin/corectrl")
+ (list "PATH"
+ 'prefix
+ (map (lambda (binary)
+ (dirname (search-input-file inputs
+ (string-append
+ "bin/"
+ binary))))
+ '("glxinfo" "lscpu" "vulkaninfo")))))))))
+ ;; Text formatting only supported since C++20, which is available in gcc-13.
+ ;; https://en.cppreference.com/w/cpp/compiler_support#cpp_lib_format_201907L
+ (native-inputs (list pkg-config gcc-13))
+ (inputs (list dbus
+ botan
+ catch2-3
+ hwdata
+ mesa-utils
+ polkit
+ procps
+ pugixml
+ qtcharts-5
+ qtdeclarative-5
+ qtquickcontrols2-5
+ qtsvg-5
+ qttools-5
+ quazip
+ spdlog
+ trompeloeil
+ units
+ util-linux
+ vulkan-tools
+ 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))))
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
--
2.46.0
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [bug#75159] [PATCH v2 3/3] services: Add corectrl-helper-service-type.
2024-12-31 18:09 ` [bug#75159] [PATCH v2 0/3] Add corectrl and corectrl-helper-service-type Ashvith Shetty
2024-12-31 18:09 ` [bug#75159] [PATCH v2 1/3] gnu: Add trompeloeil Ashvith Shetty
2024-12-31 18:09 ` [bug#75159] [PATCH v2 2/3] gnu: Add corectrl Ashvith Shetty
@ 2024-12-31 18:09 ` Ashvith Shetty
2025-01-03 21:58 ` [bug#75159] [PATCH v2 0/3] Add corectrl and corectrl-helper-service-type Ashvith Shetty
3 siblings, 0 replies; 22+ messages in thread
From: Ashvith Shetty @ 2024-12-31 18:09 UTC (permalink / raw)
To: 75159; +Cc: Ashvith Shetty
From: Ashvith Shetty <ashvith@noreply.codeberg.org>
* gnu/services/admin.scm: New file.
(corectrl-helper-service-type): new variable.
* gnu/local.mk: Add them.
* doc/guix.texi (Miscellaneous Services): Document it.
---
doc/guix.texi | 32 ++++++++++++++++++++++++++++++++
gnu/services/admin.scm | 27 ++++++++++++++++++++++++++-
2 files changed, 58 insertions(+), 1 deletion(-)
diff --git a/doc/guix.texi b/doc/guix.texi
index 924f13f0f6..9330525c61 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -135,6 +135,7 @@ Copyright @copyright{} 2024 Nigko Yerden@*
Copyright @copyright{} 2024 Troy Figiel@*
Copyright @copyright{} 2024 Sharlatan Hellseher@*
Copyright @copyright{} 2024 45mg@*
+Copyright @copyright{} 2024 Ashvith Shetty@*
Permission is granted to copy, distribute and/or modify this document
under the terms of the GNU Free Documentation License, Version 1.3 or
@@ -42590,6 +42591,37 @@ empty list means that no type is specified.
@end deftp
+@cindex corectrl-helper
+@subsubheading CoreCtrl Helper Service
+
+The @code{(gnu services admin)} 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
+
+
+@deftp {Data Type} corectrl-helper-configuration
+This is the data type representing the configuration of corectrl-helper.
+
+@table @asis
+@item @code{corectrl} (default: @code{corectrl}) (type: package)
+
+The @command{corectrl} executable to use.
+@end table
+@end deftp
+
+For more details, please read the
+@uref{https://gitlab.com/corectrl/corectrl/-/wikis/Installation, Installation}
+and
+@uref{https://gitlab.com/corectrl/corectrl/-/wikis/Setup, Setup} wiki pages.
+
@c %end of fragment
@node Privileged Programs
diff --git a/gnu/services/admin.scm b/gnu/services/admin.scm
index 571af6a04e..42cefdf256 100644
--- a/gnu/services/admin.scm
+++ b/gnu/services/admin.scm
@@ -5,6 +5,7 @@
;;; Copyright © 2023 Giacomo Leidi <goodoldpaul@autistici.org>
;;; Copyright © 2024 Gabriel Wicki <gabriel@erlikon.ch>
;;; Copyright © 2024 Richard Sent <richard@freakingpenguin.com>
+;;; Copyright © 2024 Ashvith Shetty <ashvithshetty10@gmail.com>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -33,6 +34,7 @@ (define-module (gnu services admin)
#:use-module (gnu packages linux)
#:use-module (gnu services)
#:use-module (gnu services configuration)
+ #:use-module (gnu services dbus)
#:use-module (gnu services mcron)
#:use-module (gnu services shepherd)
#:use-module (gnu system accounts)
@@ -108,7 +110,11 @@ (define-module (gnu services admin)
resize-file-system-configuration-cloud-utils
resize-file-system-configuration-e2fsprogs
resize-file-system-configuration-btrfs-progs
- resize-file-system-configuration-bcachefs-tools))
+ resize-file-system-configuration-bcachefs-tools
+
+ corectrl-helper-service-type
+ corectrl-helper-configuration
+ corectrl-helper-configuration?))
;;; Commentary:
;;;
@@ -679,4 +685,23 @@ (define resize-file-system-service-type
(service-extension shepherd-root-service-type
(compose list resize-file-system-shepherd-service))))))
+;;;
+;;; CoreCtrl helper service.
+;;;
+
+(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))
+ (description "Run corectrl-helper, an essential service for the corectrl application.")))
+
;;; admin.scm ends here
--
2.46.0
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [bug#75159] [PATCH v2 0/3] Add corectrl and corectrl-helper-service-type
2024-12-31 18:09 ` [bug#75159] [PATCH v2 0/3] Add corectrl and corectrl-helper-service-type Ashvith Shetty
` (2 preceding siblings ...)
2024-12-31 18:09 ` [bug#75159] [PATCH v2 3/3] services: Add corectrl-helper-service-type Ashvith Shetty
@ 2025-01-03 21:58 ` Ashvith Shetty
3 siblings, 0 replies; 22+ messages in thread
From: Ashvith Shetty @ 2025-01-03 21:58 UTC (permalink / raw)
To: 75159; +Cc: zhengjunjie
[-- Attachment #1: Type: text/plain, Size: 147 bytes --]
With respect to the earlier patches, I also feel the need to mention that
the test makes use of a randomly generated seed. Would that be an issue?
[-- Attachment #2: Type: text/html, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2025-01-03 21:59 UTC | newest]
Thread overview: 22+ 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-30 7:03 ` Zheng Junjie
2024-12-28 15:30 ` [bug#75159] [PATCH v1 2/5] gnu: Add trompeloeil Ashvith Shetty
2024-12-30 6:38 ` Zheng Junjie
2024-12-28 15:30 ` [bug#75159] [PATCH v1 3/5] gnu: Add corectrl Ashvith Shetty
2024-12-30 6:50 ` Zheng Junjie
2024-12-30 7:48 ` Zheng Junjie
2024-12-28 15:30 ` [bug#75159] [PATCH v1 4/5] services: Add corectrl-helper-service-type Ashvith Shetty
2024-12-30 7:00 ` Zheng Junjie
2024-12-28 15:30 ` [bug#75159] [PATCH v1 5/5] guix: qt: Revert to gexp-based inputs and outputs Ashvith Shetty
2024-12-31 18:09 ` [bug#75159] [PATCH v2 0/3] Add corectrl and corectrl-helper-service-type Ashvith Shetty
2024-12-31 18:09 ` [bug#75159] [PATCH v2 1/3] gnu: Add trompeloeil Ashvith Shetty
2024-12-31 18:09 ` [bug#75159] [PATCH v2 2/3] gnu: Add corectrl Ashvith Shetty
2024-12-31 18:09 ` [bug#75159] [PATCH v2 3/3] services: Add corectrl-helper-service-type Ashvith Shetty
2025-01-03 21:58 ` [bug#75159] [PATCH v2 0/3] Add corectrl and corectrl-helper-service-type Ashvith Shetty
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.