all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Brice Waegeneire <brice@waegenei.re>
To: 48984@debbugs.gnu.org
Subject: [bug#48984] [PATCH] gnu: ddcutil: Patch kernel modules paths.
Date: Sat, 12 Jun 2021 23:24:22 +0200	[thread overview]
Message-ID: <20210612212422.13271-1-brice@waegenei.re> (raw)

Without it "ddcutil detect" complain: “Module i2c-dev is not loaded and
ddcutil can't determine if it is built into the kernel”.

* gnu/packages/patches/ddcutil-modules-location.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/hardware.scm (ddcutil)[source]: Apply it.
---
 gnu/local.mk                                  |  1 +
 gnu/packages/hardware.scm                     |  6 ++--
 .../patches/ddcutil-modules-location.patch    | 32 +++++++++++++++++++
 3 files changed, 37 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/ddcutil-modules-location.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index 26b3e86e22..aa06cac37f 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -941,6 +941,7 @@ dist_patch_DATA =						\
   %D%/packages/patches/dbus-CVE-2020-12049.patch		\
   %D%/packages/patches/dbus-c++-gcc-compat.patch		\
   %D%/packages/patches/dbus-c++-threading-mutex.patch		\
+  %D%/packages/patches/ddcutil-modules-location.patch		\
   %D%/packages/patches/dbxfs-remove-sentry-sdk.patch		\
   %D%/packages/patches/debops-constants-for-external-program-names.patch \
   %D%/packages/patches/debops-debops-defaults-fall-back-to-less.patch \
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index ecbcca79b1..0612e4a068 100644
--- a/gnu/packages/hardware.scm
+++ b/gnu/packages/hardware.scm
@@ -1,7 +1,7 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2018–2021 Tobias Geerinckx-Rice <me@tobias.gr>
 ;;; Copyright © 2020 Jan (janneke) Nieuwenhuizen <janneke@gnu.org>
-;;; Copyright © 2020 Brice Waegeneire <brice@waegenei.re>
+;;; Copyright © 2020, 2021 Brice Waegeneire <brice@waegenei.re>
 ;;; Copyright © 2021 Evgeny Pisemsky <evgeny@pisemsky.com>
 ;;; Copyright © 2021 Léo Le Bouter <lle-bout@zaclys.net>
 ;;;
@@ -21,6 +21,7 @@
 ;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
 
 (define-module (gnu packages hardware)
+  #:use-module (gnu packages)
   #:use-module (gnu packages admin)
   #:use-module (gnu packages autotools)
   #:use-module (gnu packages bash)
@@ -68,7 +69,8 @@
        (uri (string-append "https://www.ddcutil.com/tarballs/"
                            "ddcutil-" version ".tar.gz"))
        (sha256
-        (base32 "19kkwb9ijzn6ya3mvjanggh1c96fcc0lkbk7xnyi2qp6wsr4nhxp"))))
+        (base32 "19kkwb9ijzn6ya3mvjanggh1c96fcc0lkbk7xnyi2qp6wsr4nhxp"))
+       (patches (search-patches "ddcutil-modules-location.patch"))))
     (build-system gnu-build-system)
     (native-inputs
      `(("pkg-config" ,pkg-config)))
diff --git a/gnu/packages/patches/ddcutil-modules-location.patch b/gnu/packages/patches/ddcutil-modules-location.patch
new file mode 100644
index 0000000000..c36fe5f2d7
--- /dev/null
+++ b/gnu/packages/patches/ddcutil-modules-location.patch
@@ -0,0 +1,32 @@
+From https://github.com/NixOS/nixpkgs/blob/nixos-21.05/pkgs/tools/misc/ddcutil/nixos-paths.diff
+
+--- a/src/util/linux_util.c
++++ b/src/util/linux_util.c
+@@ -125,6 +125,7 @@
+                   "lib64",
+                   "lib32",
+                   "usr/lib",  // needed for arch?
++                  "run/booted-system/kernel/lib",  // Guix System
+                   NULL};
+    int result = -1;
+    int ndx = 0;
+@@ -204,14 +205,15 @@
+    if (debug)
+       printf("(%s) machine: %s", __func__, utsbuf.machine);
+
+-   char * libdirs[3];
++   char * libdirs[4];
+    libdirs[0] = "lib";
++   libdirs[1] = "run/booted-system/kernel/lib";
+    if (streq(utsbuf.machine, "amd_64")){
+-      libdirs[1] = "lib64";
+-      libdirs[2] = NULL;
++      libdirs[2] = "lib64";
++      libdirs[3] = NULL;
+    }
+    else
+-      libdirs[1] = NULL;
++      libdirs[2] = NULL;
+
+    int libsndx = 0;
+    bool found = false;
-- 
2.31.1





             reply	other threads:[~2021-06-12 21:25 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-12 21:24 Brice Waegeneire [this message]
2021-06-13 10:35 ` [bug#48984] [PATCH] gnu: ddcutil: Patch kernel modules paths Tobias Geerinckx-Rice via Guix-patches via
2021-06-13 13:07   ` Brice Waegeneire
2022-01-21 23:21 ` bug#48984: " Brice Waegeneire

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

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

  git send-email \
    --in-reply-to=20210612212422.13271-1-brice@waegenei.re \
    --to=brice@waegenei.re \
    --cc=48984@debbugs.gnu.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 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.