From d18c23b3551035023a50c5d1afe35a3e2cedc3e6 Mon Sep 17 00:00:00 2001 From: Peter Hoeg Date: Tue, 19 Oct 2021 14:02:30 +0800 Subject: [PATCH] ddcutil: 1.1.0 -> 1.2.0 --- pkgs/tools/misc/ddcutil/default.nix | 52 ++++++++++++++++-------- pkgs/tools/misc/ddcutil/nixos-paths.diff | 30 -------------- 2 files changed, 34 insertions(+), 48 deletions(-) delete mode 100644 pkgs/tools/misc/ddcutil/nixos-paths.diff diff --git a/pkgs/tools/misc/ddcutil/default.nix b/pkgs/tools/misc/ddcutil/default.nix index b1a42f57703f..0deca19a2663 100644 --- a/pkgs/tools/misc/ddcutil/default.nix +++ b/pkgs/tools/misc/ddcutil/default.nix @@ -1,33 +1,49 @@ -{ lib, stdenv, fetchFromGitHub, autoreconfHook, pkg-config -, glib, i2c-tools, udev, libgudev, libusb1, libdrm, xorg }: +{ lib +, stdenv +, fetchFromGitHub +, autoreconfHook +, pkg-config +, glib +, i2c-tools +, udev +, kmod +, libgudev +, libusb1 +, libdrm +, xorg +}: stdenv.mkDerivation rec { pname = "ddcutil"; - version = "1.1.0"; + version = "1.2.0"; src = fetchFromGitHub { - owner = "rockowitz"; - repo = "ddcutil"; - rev = "v${version}"; - sha256 = "0wv8a8zjahzmi4qx0lc24mwyi3jklj1yxqq26fwklmfh5dv1y8yc"; + owner = "rockowitz"; + repo = "ddcutil"; + rev = "v${version}"; + sha256 = "sha256-MH7WnJgROgLvttQEbd/21mLRFElObp4KINy8RarqkRo="; }; - patches = [ - # Look for kernel modules in /run/booted-system/kernel-modules/lib/modules/* - ./nixos-paths.diff + nativeBuildInputs = [ autoreconfHook pkg-config ]; + + buildInputs = [ + glib + i2c-tools + kmod + libdrm + libgudev + libusb1 + udev + xorg.libXrandr ]; - nativeBuildInputs = [ autoreconfHook pkg-config ]; - buildInputs = [ - i2c-tools udev libgudev - glib libusb1 libdrm xorg.libXrandr - ]; + enableParallelBuilding = true; meta = with lib; { - homepage = "http://www.ddcutil.com/"; + homepage = "http://www.ddcutil.com/"; description = "Query and change Linux monitor settings using DDC/CI and USB"; - license = licenses.gpl2; - platforms = platforms.linux; + license = licenses.gpl2; + platforms = platforms.linux; maintainers = with maintainers; [ rnhmjoj ]; }; } diff --git a/pkgs/tools/misc/ddcutil/nixos-paths.diff b/pkgs/tools/misc/ddcutil/nixos-paths.diff deleted file mode 100644 index 54d17ea5bfeb..000000000000 --- a/pkgs/tools/misc/ddcutil/nixos-paths.diff +++ /dev/null @@ -1,30 +0,0 @@ ---- 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-modules/lib", // NixOS - 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-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; - - int libsndx = 0; - bool found = false;