unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Ashvith Shetty <ashvithshetty10@gmail.com>
To: 75159@debbugs.gnu.org
Cc: Ashvith Shetty <ashvith@noreply.codeberg.org>
Subject: [bug#75159] [PATCH v2 2/3] gnu: Add corectrl.
Date: Tue, 31 Dec 2024 23:39:48 +0530	[thread overview]
Message-ID: <20241231181027.28121-4-ashvithshetty10@gmail.com> (raw)
In-Reply-To: <20241231181027.28121-2-ashvithshetty10@gmail.com>

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





  parent reply	other threads:[~2024-12-31 18:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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   ` Ashvith Shetty [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20241231181027.28121-4-ashvithshetty10@gmail.com \
    --to=ashvithshetty10@gmail.com \
    --cc=75159@debbugs.gnu.org \
    --cc=ashvith@noreply.codeberg.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).