From 61f2b36624b039c1ea35e3eba72d094e6bbb1e15 Mon Sep 17 00:00:00 2001 From: rnhmjoj Date: Sat, 24 Apr 2021 11:20:05 +0200 Subject: [PATCH] ddcutil: 1.0.1 -> 1.1.0 --- pkgs/tools/misc/ddcutil/default.nix | 4 +- pkgs/tools/misc/ddcutil/nixos-paths.diff | 54 ++++++++++++------------ 2 files changed, 28 insertions(+), 30 deletions(-) diff --git a/pkgs/tools/misc/ddcutil/default.nix b/pkgs/tools/misc/ddcutil/default.nix index 1717b88f194a..b1a42f57703f 100644 --- a/pkgs/tools/misc/ddcutil/default.nix +++ b/pkgs/tools/misc/ddcutil/default.nix @@ -3,13 +3,13 @@ stdenv.mkDerivation rec { pname = "ddcutil"; - version = "1.0.1"; + version = "1.1.0"; src = fetchFromGitHub { owner = "rockowitz"; repo = "ddcutil"; rev = "v${version}"; - sha256 = "sha256-F/tKW81bAyYtwpxhl5XC8YyMB+6S0XmqqigwJY2WFDU="; + sha256 = "0wv8a8zjahzmi4qx0lc24mwyi3jklj1yxqq26fwklmfh5dv1y8yc"; }; patches = [ diff --git a/pkgs/tools/misc/ddcutil/nixos-paths.diff b/pkgs/tools/misc/ddcutil/nixos-paths.diff index e45eb88b5190..54d17ea5bfeb 100644 --- a/pkgs/tools/misc/ddcutil/nixos-paths.diff +++ b/pkgs/tools/misc/ddcutil/nixos-paths.diff @@ -1,32 +1,30 @@ -diff --git a/src/app_sysenv/query_sysenv_modules.c b/src/app_sysenv/query_sysenv_modules.c -index 59df64f1..fb244dd0 100644 ---- a/src/app_sysenv/query_sysenv_modules.c -+++ b/src/app_sysenv/query_sysenv_modules.c -@@ -50,7 +50,9 @@ bool is_module_loadable(char * module_name, int depth) { - g_snprintf(module_name_ko, 100, "%s.ko", module_name); - - char dirname[PATH_MAX]; -- g_snprintf(dirname, PATH_MAX, "/lib/modules/%s/kernel/drivers/i2c", utsbuf.release); -+ g_snprintf(dirname, PATH_MAX, -+ "/run/booted-system/kernel-modules/lib/modules/%s/kernel/drivers/i2c", -+ utsbuf.release); - - struct dirent *dent; - DIR *d; -diff --git a/src/util/linux_util.c b/src/util/linux_util.c -index 5eb8491c..3a129ccf 100644 --- a/src/util/linux_util.c +++ b/src/util/linux_util.c -@@ -29,8 +29,10 @@ bool is_module_builtin(char * module_name) - int rc = uname(&utsbuf); - assert(rc == 0); +@@ -125,6 +125,7 @@ + "lib64", + "lib32", + "usr/lib", // needed for arch? ++ "run/booted-system/kernel-modules/lib", // NixOS + NULL}; + int result = -1; + int ndx = 0; +@@ -204,14 +205,15 @@ + if (debug) + printf("(%s) machine: %s", __func__, utsbuf.machine); -- char modules_builtin_fn[100]; -- snprintf(modules_builtin_fn, 100, "/lib/modules/%s/modules.builtin", utsbuf.release); -+ char modules_builtin_fn[PATH_MAX]; -+ snprintf(modules_builtin_fn, PATH_MAX, -+ "/run/booted-system/kernel-modules/lib/modules/%s/modules.builtin", -+ utsbuf.release); +- char * libdirs[3]; ++ char * libdirs[4]; + libdirs[0] = "lib"; ++ libdirs[1] = "run/booted-system/kernel-modules/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; - char ko_name[40]; - snprintf(ko_name, 40, "%s.ko", module_name); + int libsndx = 0; + bool found = false;