1 ;;; GNU Guix --- Functional package management for GNU
2 ;;; Copyright © 2018 Tobias Geerinckx-Rice <me@tobias.gr>
4 ;;; This file is part of GNU Guix.
6 ;;; GNU Guix is free software; you can redistribute it and/or modify it
7 ;;; under the terms of the GNU General Public License as published by
8 ;;; the Free Software Foundation; either version 3 of the License, or (at
9 ;;; your option) any later version.
11 ;;; GNU Guix is distributed in the hope that it will be useful, but
12 ;;; WITHOUT ANY WARRANTY; without even the implied warranty of
13 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ;;; GNU General Public License for more details.
16 ;;; You should have received a copy of the GNU General Public License
17 ;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
19 (define-module (gnu packages hardware)
20 #:use-module (gnu packages compression)
21 #:use-module (gnu packages glib)
22 #:use-module (gnu packages libusb)
23 #:use-module (gnu packages linux)
24 #:use-module (gnu packages pkg-config)
25 #:use-module (gnu packages xdisorg)
26 #:use-module (gnu packages xorg)
27 #:use-module (guix build-system gnu)
28 #:use-module (guix download)
29 #:use-module ((guix licenses) #:prefix license:)
30 #:use-module (guix packages))
32 ;; This is a module for packages related to physical hardware that don't (yet)
33 ;; have a more specific home like gps.scm, security-token.scm, &c.
35 (define-public ddcutil
42 (uri (string-append "https://www.ddcutil.com/tarballs/"
43 name "-" version ".tar.gz"))
45 (base32 "1b4bm3zhk5vnad6fxf0mn8nrlj3fngifl7nzxgxw0n56hlv7ccv0"))))
46 (build-system gnu-build-system)
48 `(("pkg-config" ,pkg-config)))
52 ("libdrm" ,libdrm) ; enhanced diagnostics
53 ("libusb" ,libusb) ; support USB monitors
54 ("libx11" ,libx11) ; enhanced diagnostics
55 ("libxrandr" ,libxrandr)
57 (home-page "https://www.ddcutil.com/")
58 (synopsis "Control external monitor settings")
60 "ddcutil can query and modify most external monitors' settings, such as
61 brightness, colour levels, and input sources. Generally speaking, any setting
62 that can be changed by pressing buttons on the monitor can be modified by
65 ddcutil communicates directly with monitors implementing the Monitor Control
66 Command Set (@dfn{MCCS}). It usually does so through the the Display Data
67 Channel Command Interface (@dfn{DDC/CI}) protocol on the I2C bus, but can also
68 communicate over USB as per the USB Monitor Control Class Specification.
70 One particular use case is in colour profile management. Monitor calibration
71 is relative to the monitor colour settings currently in effect, e.g. red gain.
72 ddcutil allows colour-related settings to be saved at the time a monitor is
73 calibrated, and restored when the calibration is applied.")
74 (license (list license:bsd-3 ; FindDDCUtil.cmake
75 license:gpl2+)))) ; everything else
77 (define-public msr-tools
84 (uri (string-append "https://01.org/sites/default/files/downloads/"
85 name "/" name "-" version ".zip"))
87 (base32 "07hxmddg0l31kjfmaq84ni142lbbvgq6391r8bd79wpm819pnigr"))))
88 (build-system gnu-build-system)
91 (list (string-append "sbindir=" (assoc-ref %outputs "out") "/sbin"))
93 (modify-phases %standard-phases
94 (delete 'configure) ; no configure script
95 (add-before 'install 'create-output-directory
96 (lambda* (#:key outputs #:allow-other-keys)
97 ;; 'make install' assumes that sbindir exists.
98 (let* ((out (assoc-ref outputs "out"))
99 (sbin (string-append out "/sbin")))
102 #:tests? #f)) ; no test suite
105 ;; These registers and the CPUID instruction only exist on (most) x86 chips.
106 (supported-systems (list "i686-linux" "x86_64-linux"))
107 (home-page "https://01.org/msr-tools/")
108 (synopsis "Read and write Model-Specific Registers (@dfn{MSR})")
110 "The MSR Tools project provides console utilities to directly access the
111 Model-Specific Registers (@dfn{MSR}s) and CPU ID of Intel-compatible processors:
114 @item @command{cpuid}: show identification and feature information of any CPU
115 @item @command{rdmsr}: read MSRs from any CPU or all CPUs
116 @item @command{wrmsr}: write to MSRs on any CPU or all CPUs
119 These tools can be used to query and modify certain low-level CPU parameters,
120 such as the Turbo Boost ratio and Thermal Design Power (@dfn{TDP}) limits.
122 MSR addresses differ (greatly) between processors, and any such modification can
123 be dangerous and may void your CPU or system board's warranty.")
124 (license license:gpl2))) ; cpuid.c is gpl2, {rd,wr}msr.c are gpl2+