unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Zheng Junjie <zhengjunjie@iscas.ac.cn>
To: Ashvith Shetty <ashvithshetty10@gmail.com>
Cc: 75159@debbugs.gnu.org
Subject: [bug#75159] [PATCH v1 3/5] gnu: Add corectrl.
Date: Mon, 30 Dec 2024 14:50:00 +0800	[thread overview]
Message-ID: <87cyh9u0kn.fsf@iscas.ac.cn> (raw)
In-Reply-To: <20241228153020.20233-4-ashvith@noreply.codeberg.org> (Ashvith Shetty's message of "Sat, 28 Dec 2024 21:00:05 +0530")

[-- 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 --]

  reply	other threads:[~2024-12-30  6:51 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 [this message]
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

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=87cyh9u0kn.fsf@iscas.ac.cn \
    --to=zhengjunjie@iscas.ac.cn \
    --cc=75159@debbugs.gnu.org \
    --cc=ashvithshetty10@gmail.com \
    /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).