unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 9a3fa86edc130fafa4d6bac0ad0335c020c2fdc1 53375 bytes (raw)
name: gnu/packages/hardware.scm 	 # note: path name is non-authoritative(*)

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
 
;;; 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 © 2021 Evgeny Pisemsky <evgeny@pisemsky.com>
;;; Copyright © 2021 Léo Le Bouter <lle-bout@zaclys.net>
;;; Copyright © 2021 Denis Carikli <GNUtoo@cyberdimension.org>
;;; Copyright © 2021 Petr Hodina <phodina@protonmail.com>
;;; Copyright © 2021 Raghav Gururajan <rg@raghavgururajan.name>
;;;
;;; This file is part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (gnu packages hardware)
  #:use-module (gnu packages admin)
  #:use-module (gnu packages autotools)
  #:use-module (gnu packages avahi)
  #:use-module (gnu packages base)
  #:use-module (gnu packages bash)
  #:use-module (gnu packages compression)
  #:use-module (gnu packages check)
  #:use-module (gnu packages cpp)
  #:use-module (gnu packages crypto)
  #:use-module (gnu packages cups)
  #:use-module (gnu packages curl)
  #:use-module (gnu packages debian)
  #:use-module (gnu packages disk)
  #:use-module (gnu packages documentation)
  #:use-module (gnu packages flex)
  #:use-module (gnu packages freedesktop)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages gettext)
  #:use-module (gnu packages gl)
  #:use-module (gnu packages glib)
  #:use-module (gnu packages gnome)
  #:use-module (gnu packages gtk)
  #:use-module (gnu packages libusb)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages package-management)
  #:use-module (gnu packages ncurses)
  #:use-module (gnu packages openldap)
  #:use-module (gnu packages pciutils)
  #:use-module (gnu packages perl)
  #:use-module (gnu packages pkg-config)
  #:use-module (gnu packages polkit)
  #:use-module (gnu packages protobuf)
  #:use-module (gnu packages python)
  #:use-module (gnu packages python-web)
  #:use-module (gnu packages python-xyz)
  #:use-module (gnu packages qt)
  #:use-module (gnu packages scanner)
  #:use-module (gnu packages security-token)
  #:use-module (gnu packages tls)
  #:use-module (gnu packages video)
  #:use-module (gnu packages virtualization)
  #:use-module (gnu packages vulkan)
  #:use-module (gnu packages web)
  #:use-module (gnu packages xdisorg)
  #:use-module (gnu packages xml)
  #:use-module (gnu packages xorg)
  #:use-module (guix build-system cmake)
  #:use-module (guix build-system gnu)
  #:use-module (guix build-system perl)
  #:use-module (guix build-system python)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix svn-download)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (guix utils))

;; This is a module for packages related to physical hardware that don't (yet)
;; have a more specific home like gps.scm, security-token.scm, &c.

(define-public hw-probe
  (package
    (name "hw-probe")
    (version "1.5")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url "https://github.com/linuxhw/hw-probe")
         (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1zyaardfw6r9nwxbkbb68hyl8719xn8sxpbgm7czkvsbjrim11n8"))))
    (build-system perl-build-system)
    (arguments
     `(#:tests? #f                      ;no test target
       #:imported-modules
       (,@%perl-build-system-modules)
       #:modules
       ((guix build perl-build-system)
        (guix build utils)
        (srfi srfi-26))
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch
           (lambda* (#:key inputs outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out")))
               ;; Correct install prefix.
               (substitute* "Makefile"
                 (("/usr") out)))
             ;; Use absolute paths to referenced programs.
             (substitute* "hw-probe.pl"
               (("Cmd\\(\"acpi")
                (format #f "Cmd(\"~a/bin/acpi"
                        (assoc-ref inputs "acpi")))
               (("Cmd\\(\"acpidump")
                (format #f "Cmd(\"~a/bin/acpidump"
                        (assoc-ref inputs "acpica")))
               (("Cmd\\(\"acpixtract")
                (format #f "Cmd(\"~a/bin/acpixtract"
                        (assoc-ref inputs "acpica")))
               (("Cmd\\(\"alsactl")
                (format #f "Cmd(\"~a/bin/alsactl"
                        (assoc-ref inputs "alsa-utils")))
               #;(("Cmd\\(\"amdconfig")
               (format #f "Cmd(\"~a/bin/amdconfig"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"amixer")
                (format #f "Cmd(\"~a/bin/amixer"
                        (assoc-ref inputs "alsa-utils")))
               #;(("Cmd\\(\"apk")
               (format #f "Cmd(\"~a/bin/apk"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"aplay")
                (format #f "Cmd(\"~a/bin/aplay"
                        (assoc-ref inputs "alsa-utils")))
               #;(("Cmd\\(\"arcconf")
               (format #f "Cmd(\"~a/bin/arcconf"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"arecord")
                (format #f "Cmd(\"~a/bin/arecord"
                        (assoc-ref inputs "alsa-utils")))
               (("Cmd\\(\"avahi-browse")
                (format #f "Cmd(\"~a/bin/avahi-browse"
                        (assoc-ref inputs "avahi")))
               (("Cmd\\(\"biosdecode")
                (format #f "Cmd(\"~a/sbin/biosdecode"
                        (assoc-ref inputs "dmidecode")))
               (("=cat")
                (format #f "=~a/bin/cat"
                        (assoc-ref inputs "coreutils")))
               (("Cmd\\(\"chmod")
                (format #f "Cmd(\"~a/bin/chmod"
                        (assoc-ref inputs "coreutils")))
               (("\"chmod\"")
                (format #f "\"~a/bin/chmod\""
                        (assoc-ref inputs "coreutils")))
               (("\"chown\"")
                (format #f "\"~a/bin/chown\""
                        (assoc-ref inputs "coreutils")))
               (("Cmd\\(\"cpuid")
                (format #f "Cmd(\"~a/bin/cpuid"
                        (assoc-ref inputs "cpuid")))
               (("Cmd\\(\"cpupower")
                (format #f "Cmd(\"~a/bin/cpupower"
                        (assoc-ref inputs "cpupower")))
               (("Cmd\\(\"curl")
                (format #f "Cmd(\"~a/bin/curl"
                        (assoc-ref inputs "curl")))
               (("Cmd = \"curl")
                (format #f "Cmd = \"~a/bin/curl"
                        (assoc-ref inputs "curl")))
               (("Cmd = \\(\"curl")
                (format #f "Cmd = (\"~a/bin/curl"
                        (assoc-ref inputs "curl")))
               (("\"date\"")
                (format #f "\"~a/bin/date\""
                        (assoc-ref inputs "coreutils")))
               (("Cmd\\(\"dd")
                (format #f "Cmd(\"~a/bin/dd"
                        (assoc-ref inputs "coreutils")))
               (("\"dd ")
                (format #f "\"~a/bin/dd "
                        (assoc-ref inputs "coreutils")))
               (("Cmd\\(\"df")
                (format #f "Cmd(\"~a/bin/df"
                        (assoc-ref inputs "coreutils")))
               #;(("Cmd\\(\"dkms")
               (format #f "Cmd(\"~a/bin/dkms"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"dmesg")
                (format #f "Cmd(\"~a/bin/dmesg"
                        (assoc-ref inputs "util-linux")))
               (("Cmd\\(\"dmidecode")
                (format #f "Cmd(\"~a/sbin/dmidecode"
                        (assoc-ref inputs "dmidecode")))
               (("Cmd\\(\"dpkg")
                (format #f "Cmd(\"~a/bin/dpkg"
                        (assoc-ref inputs "dpkg")))
               #;(("echo")
               (format #f "~a/bin/echo"
               (assoc-ref inputs "coreutils")))
               (("Cmd\\(\"edid-decode")
                (format #f "Cmd(\"~a/bin/edid-decode"
                        (assoc-ref inputs "edid-decode")))
               (("Cmd\\(\"efibootmgr")
                (format #f "Cmd(\"~a/sbin/efibootmgr"
                        (assoc-ref inputs "efibootmgr")))
               (("Cmd\\(\"efivar")
                (format #f "Cmd(\"~a/bin/efivar"
                        (assoc-ref inputs "efivar")))
               #;(("Cmd\\(\"eopkg")
               (format #f "Cmd(\"~a/bin/eopkg"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"ethtool")
                (format #f "Cmd(\"~a/sbin/ethtool"
                        (assoc-ref inputs "ethtool")))
               (("Cmd\\(\".*ethtool")
                (format #f "Cmd(\"~a/sbin/ethtool"
                        (assoc-ref inputs "ethtool")))
               (("Cmd\\(\"fdisk")
                (format #f "Cmd(\"~a/sbin/fdisk"
                        (assoc-ref inputs "util-linux")))
               #;(("Cmd\\(\"fglrxinfo")
               (format #f "Cmd(\"~a/bin/fglrxinfo"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"find")
                (format #f "Cmd(\"~a/bin/find"
                        (assoc-ref inputs "findutils")))
               (("Cmd\\(\"findmnt")
                (format #f "Cmd(\"~a/bin/findmnt"
                        (assoc-ref inputs "util-linux")))
               (("Cmd = \"findmnt")
                (format #f "Cmd = \"~a/bin/findmnt"
                        (assoc-ref inputs "util-linux")))
               (("Cmd\\(\"glxgears")
                (format #f "Cmd(\"~a/bin/glxgears"
                        (assoc-ref inputs "mesa-utils")))
               (("Cmd\\(\"glxinfo")
                (format #f "Cmd(\"~a/bin/glxinfo"
                        (assoc-ref inputs "mesa-utils")))
               #;(("grep")
               (format #f "~a/bin/grep"
               (assoc-ref inputs "grep")))
               (("`head")
                (format #f "`~a/bin/head"
                        (assoc-ref inputs "coreutils")))
               #;(("Cmd\\(\"hciconfig")
               (format #f "Cmd(\"~a/bin/hciconfig"
               (assoc-ref inputs "foobar")))
               #;(("Cmd\\(\"hcitool")
               (format #f "Cmd(\"~a/bin/hcitool"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"hddtemp")
                (format #f "Cmd(\"~a/sbin/hddtemp"
                        (assoc-ref inputs "hddtemp")))
               (("Cmd\\(\"hdparm")
                (format #f "Cmd(\"~a/sbin/hdparm"
                        (assoc-ref inputs "hdparm")))
               (("Cmd = \"hdparm")
                (format #f "Cmd = \"~a/bin/hdparm"
                        (assoc-ref inputs "hdparm")))
               #;(("Cmd\\(\"hp-probe")
               (format #f "Cmd(\"~a/bin/hp-probe"
               (assoc-ref inputs "foobar")))
               #;(("Cmd\\(\"hwinfo")
               (format #f "Cmd(\"~a/bin/hwinfo"
               (assoc-ref inputs "hwinfo")))
               #;(("Cmd = \"hwinfo")
               (format #f "Cmd = \"~a/bin/hwinfo"
               (assoc-ref inputs "hwinfo")))
               (("Cmd\\(\"i2cdetect")
                (format #f "Cmd(\"~a/sbin/i2cdetect"
                        (assoc-ref inputs "i2c-tools")))
               (("Cmd\\(\"iasl")
                (format #f "Cmd(\"~a/bin/iasl"
                        (assoc-ref inputs "acpica")))
               (("Cmd\\(\"ifconfig")
                (format #f "Cmd(\"~a/bin/ifconfig"
                        (assoc-ref inputs "net-tools")))
               (("Cmd\\(\"inxi")
                (format #f "Cmd(\"~a/bin/inxi"
                        (assoc-ref inputs "inxi")))
               (("Cmd\\(\"iostat")
                (format #f "Cmd(\"~a/bin/iostat"
                        (assoc-ref inputs "sysstat")))
               (("Cmd\\(\"ip")
                (format #f "Cmd(\"~a/sbin/ip"
                        (assoc-ref inputs "iproute2")))
               (("Cmd\\(\".*ip")
                (format #f "Cmd(\"~a/sbin/ip"
                        (assoc-ref inputs "iproute2")))
               (("Cmd\\(\"iw")
                (format #f "Cmd(\"~a/sbin/iw"
                        (assoc-ref inputs "iw")))
               (("Cmd\\(\".*iw")
                (format #f "Cmd(\"~a/sbin/iw"
                        (assoc-ref inputs "iw")))
               #;(("Cmd\\(\"iwconfig")
               (format #f "Cmd(\"~a/bin/iwconfig"
               (assoc-ref inputs "foobar")))
               #;(("join")
               (format #f "~a/bin/join"
               (assoc-ref inputs "coreutils")))
               #;(("Cmd\\(\"journalctl")
               (format #f "Cmd(\"~a/bin/journalctl"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"ls")
                (format #f "Cmd(\"~a/bin/ls"
                        (assoc-ref inputs "coreutils")))
               #;(("Cmd\\(\"lsb_release")
               (format #f "Cmd(\"~a/bin/lsb_release"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"lsblk")
                (format #f "Cmd(\"~a/bin/lsblk"
                        (assoc-ref inputs "util-linux")))
               (("Cmd = \"lsblk")
                (format #f "Cmd = \"~a/bin/lsblk"
                        (assoc-ref inputs "util-linux")))
               (("Cmd\\(\"lscpu")
                (format #f "Cmd(\"~a/bin/lscpu"
                        (assoc-ref inputs "util-linux")))
               #;(("Cmd\\(\"lsinitrd")
               (format #f "Cmd(\"~a/bin/lsinitrd"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"lsmod")
                (format #f "Cmd(\"~a/bin/lsmod"
                        (assoc-ref inputs "module-init-tools")))
               (("Cmd\\(\"lspci")
                (format #f "Cmd(\"~a/sbin/lspci"
                        (assoc-ref inputs "pciutils")))
               #;(("Cmd\\(\"lspnp")
               (format #f "Cmd(\"~a/bin/lspnp"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"lsusb")
                (format #f "Cmd(\"~a/bin/lsusb"
                        (assoc-ref inputs "usbutils")))
               (("Cmd\\(\"mcelog")
                (format #f "Cmd(\"~a/sbin/mcelog"
                        (assoc-ref inputs "mcelog")))
               (("Cmd\\(\"md5sum")
                (format #f "Cmd(\"~a/bin/md5sum"
                        (assoc-ref inputs "coreutils")))
               #;(("Cmd\\(\"megactl")
               (format #f "Cmd(\"~a/bin/megactl"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"memtester")
                (format #f "Cmd(\"~a/bin/memtester"
                        (assoc-ref inputs "memtester")))
               (("Cmd\\(\"mmcli")
                (format #f "Cmd(\"~a/bin/mmcli"
                        (assoc-ref inputs "modem-manager")))
               (("Cmd\\(\"modinfo")
                (format #f "Cmd(\"~a/sbin/modinfo"
                        (assoc-ref inputs "module-init-tools")))
               #;(("Cmd\\(\"monitor-get-edid")
               (format #f "Cmd(\"~a/bin/monitor-get-edid"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"mount")
                (format #f "Cmd(\"~a/bin/mount"
                        (assoc-ref inputs "util-linux")))
               #;(("Cmd\\(\"nm-tool")
               (format #f "Cmd(\"~a/bin/nm-tool"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"nmcli")
                (format #f "Cmd(\"~a/bin/nmcli"
                        (assoc-ref inputs "network-manager")))
               (("Cmd\\(\"numactl")
                (format #f "Cmd(\"~a/bin/numactl"
                        (assoc-ref inputs "numactl")))
               (("Cmd\\(\"nvme")
                (format #f "Cmd(\"~a/sbin/nvme"
                        (assoc-ref inputs "nvme-cli")))
               (("Cmd\\(\"opensc-tool")
                (format #f "Cmd(\"~a/bin/opensc-tool"
                        (assoc-ref inputs "opensc")))
               #;(("Cmd\\(\"optirun")
               (format #f "Cmd(\"~a/bin/optirun"
               (assoc-ref inputs "foobar")))
               #;(("Cmd\\(\"pacman")
               (format #f "Cmd(\"~a/bin/pacman"
               (assoc-ref inputs "foobar")))
               #;(("Cmd\\(\"pstree")
               (format #f "Cmd(\"~a/bin/pstree"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"rfkill")
                (format #f "Cmd(\"~a/sbin/rfkill"
                        (assoc-ref inputs "util-linux")))
               (("Cmd\\(\"route")
                (format #f "Cmd(\"~a/bin/route"
                        (assoc-ref inputs "net-tools")))
               (("Cmd\\(\"rpm")
                (format #f "Cmd(\"~a/bin/rpm"
                        (assoc-ref inputs "rpm")))
               (("Cmd\\(\"sane-find-scanner")
                (format #f "Cmd(\"~a/bin/sane-find-scanner"
                        (assoc-ref inputs "sane-backends")))
               (("Cmd\\(\"scanimage")
                (format #f "Cmd(\"~a/bin/scanimage"
                        (assoc-ref inputs "sane-backends")))
               (("Cmd\\(\"sensors")
                (format #f "Cmd(\"~a/bin/sensors"
                        (assoc-ref inputs "lm-sensors")))
               #;(("sha512sum")
               (format #f "~a/bin/sha512sum"
               (assoc-ref inputs "coreutils")))
               (("Cmd\\(\"slabtop")
                (format #f "Cmd(\"~a/bin/slabtop"
                        (assoc-ref inputs "procps")))
               #;(("sleep")
               (format #f "~a/bin/sleep"
               (assoc-ref inputs "coreutils")))
               (("Cmd\\(\"smartctl")
                (format #f "Cmd(\"~a/sbin/smartctl"
                        (assoc-ref inputs "smartmontools")))
               (("Cmd = \"smartctl")
                (format #f "Cmd = \"~a/bin/smartctl"
                        (assoc-ref inputs "smartmontools")))
               #;(("sort")
               (format #f "~a/bin/sort"
               (assoc-ref inputs "coreutils")))
               #;(("split")
               (format #f "~a/bin/split"
               (assoc-ref inputs "coreutils")))
               #;(("= stat")
               (format #f "= ~a/bin/stat"
               (assoc-ref inputs "coreutils")))
               #;(("Cmd\\(\"superiotool")
               (format #f "Cmd(\"~a/bin/superiotool"
               (assoc-ref inputs "foobar")))
               #;(("Cmd\\(\"swupd")
               (format #f "Cmd(\"~a/bin/swupd"
               (assoc-ref inputs "foobar")))
               #;(("Cmd\\(\"systemctl")
               (format #f "Cmd(\"~a/bin/systemctl"
               (assoc-ref inputs "foobar")))
               #;(("Cmd\\(\"systemd-analyze")
               (format #f "Cmd(\"~a/bin/systemd-analyze"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"top")
                (format #f "Cmd(\"~a/bin/top"
                        (assoc-ref inputs "procps")))
               (("Cmd\\(\"udevadm")
                (format #f "Cmd(\"~a/bin/udevadm"
                        (assoc-ref inputs "eudev")))
               (("Cmd\\(\"uname")
                (format #f "Cmd(\"~a/bin/uname"
                        (assoc-ref inputs "coreutils")))
               #;(("unlink")
               (format #f "~a/bin/unlink"
               (assoc-ref inputs "coreutils")))
               #;(("Cmd\\(\"update-alternatives")
               (format #f "Cmd(\"~a/bin/update-alternatives"
               (assoc-ref inputs "foobar")))
               (("Cmd\\(\"upower")
                (format #f "Cmd(\"~a/bin/upower"
                        (assoc-ref inputs "upower")))
               (("Cmd\\(\"uptime")
                (format #f "Cmd(\"~a/bin/uptime"
                        (assoc-ref inputs "coreutils")))
               (("Cmd\\(\"usb-devices")
                (format #f "Cmd(\"~a/bin/usb-devices"
                        (assoc-ref inputs "usbutils")))
               (("Cmd\\(\"vainfo")
                (format #f "Cmd(\"~a/bin/vainfo"
                        (assoc-ref inputs "libva-utils")))
               (("Cmd\\(\"vdpauinfo")
                (format #f "Cmd(\"~a/bin/vdpauinfo"
                        (assoc-ref inputs "vdpauinfo")))
               (("Cmd\\(\"vulkaninfo")
                (format #f "Cmd(\"~a/bin/vulkaninfo"
                        (assoc-ref inputs "vulkan-tools")))
               (("Cmd\\(\"xdpyinfo")
                (format #f "Cmd(\"~a/bin/xdpyinfo"
                        (assoc-ref inputs "xdpyinfo")))
               (("Cmd\\(\"xinput")
                (format #f "Cmd(\"~a/bin/xinput"
                        (assoc-ref inputs "xinput")))
               (("Cmd\\(\"xrandr")
                (format #f "Cmd(\"~a/bin/xrandr"
                        (assoc-ref inputs "xrandr")))
               (("Cmd\\(\"xvinfo")
                (format #f "Cmd(\"~a/bin/xvinfo"
                        (assoc-ref inputs "xvinfo"))))))
         (delete 'configure)
         (add-after 'install 'wrap-programs
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (bin-dir (string-append out "/bin/"))
                    (perl-lib (getenv "PERL5LIB")))
               (for-each
                (cut wrap-program <>
                     `("PERL5LIB" ":" prefix (,perl-lib)))
                (find-files bin-dir))))))))
    (inputs
     `(("acpi" ,acpi)
       ("acpica" ,acpica)
       ("alsa-utils" ,alsa-utils)
       ("avahi" ,avahi)
       ("coreutils" ,coreutils)
       ("cpuid" ,cpuid)
       ("cpupower" ,cpupower)
       ("curl" ,curl)
       ("dmidecode" ,dmidecode)
       ("dpkg" ,dpkg)
       ("edid-decode" ,edid-decode)
       ("efibootmgr" ,efibootmgr)
       ("efivar" ,efivar)
       ("eudev" ,eudev)
       ("findutils" ,findutils)
       ("grep" ,grep)
       ("hddtemp" ,hddtemp)
       ("hdparm" ,hdparm)
       ("hplip" ,hplip-minimal)
       ("i2c-tools" ,i2c-tools)
       ("inxi" ,inxi)
       ("iproute" ,iproute)
       ("libva-utils" ,libva-utils)
       ("lm-sensors" ,lm-sensors)
       ("mcelog" ,mcelog)
       ("memtester" ,memtester)
       ("mesa-utils" ,mesa-utils)
       ("modem-manager" ,modem-manager)
       ("module-init-tools" ,module-init-tools)
       ("net-tools" ,net-tools)
       ("network-manager" ,network-manager)
       ("numactl" ,numactl)
       ("nvme-cli" ,nvme-cli)
       ("opensc" ,opensc)
       ("pciutils" ,pciutils)
       ("perl-data-dumper" ,perl-data-dumper)
       ("perl-digest-sha" ,perl-digest-sha)
       ("perl-libwww" ,perl-libwww)
       ;; ("pnputils" ,pnputils)
       ("procps" ,procps)
       ("rpm" ,rpm)
       ("sane-backends" ,sane-backends)
       ("smartmontools" ,smartmontools)
       ("sysstat" ,sysstat)
       ("upower" ,upower)
       ("usbutils" ,usbutils)
       ("util-linux" ,util-linux)
       ("vdpauinfo" ,vdpauinfo)
       ("vulkan-tools" ,vulkan-tools)
       ("xdpyinfo" ,xdpyinfo)
       ("xinput" ,xinput)
       ("xrandr" ,xrandr)
       ("xvinfo" ,xvinfo)))
    (propagated-inputs
     `(("hwinfo" ,hwinfo)))
    (home-page "https://linux-hardware.org")
    (synopsis "Hardware Probe")
    (description "Hardware Probe is a tool to probe for hardware, check its
operability and find drivers.")
    (license license:lgpl2.1+)))

(define-public hwinfo
  (package
    (name "hwinfo")
    (version "21.76")
    (home-page "https://github.com/openSUSE/hwinfo")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url home-page)
         (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "1910wzpdyp1ma1z2v0dripaljgrpl7vjq0f6b7qq9y220899hihb"))
       (modules
        '((guix build utils)))
       (snippet
        `(begin
           ;; Remove git2log program file.
           (delete-file "git2log")
           ;; Remove variables that depends on git2log.
           (substitute* "Makefile"
             (("GIT2LOG.*\\:=.*$") "")
             (("GITDEPS.*\\:=.*$") "")
             (("BRANCH.*\\:=.*$") ""))
           ;; Create version file.
           (call-with-output-file "VERSION"
             (lambda (port)
               (format port ,version)))
           #t))))
    (build-system gnu-build-system)
    (outputs '("out" "dev" "doc"))
    (arguments
     `(#:tests? #f                      ; no test-suite available
       #:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (dev (assoc-ref outputs "dev"))
                    (doc (assoc-ref outputs "doc"))
                    (incl-dir (string-append dev "/include"))
                    (lib-dir (string-append dev "/lib"))
                    (sbin-dir (string-append out "/sbin"))
                    (share-dir (string-append out "/share"))
                    (doc-dir (string-append doc "/share/doc")))
               ;; Generate HTML documentation in the output "doc".
               (mkdir-p doc-dir)
               (substitute* "doc/libhd.doxy"
                 (("OUTPUT_DIRECTORY.*=.*libhd")
                  (string-append "OUTPUT_DIRECTORY = " doc-dir "/libhd")))
               ;; Correct values of the version and install directories.
               (substitute* "Makefile"
                 (("VERSION.*\\:=.*$")
                  (string-append "VERSION := " ,version "\n"))
                 (("LIBDIR.*\\?=.*$")
                  (string-append "LIBDIR ?= " lib-dir "\n"))
                 (("/usr/include") incl-dir)
                 (("/(usr|var)/(lib|lib64)") lib-dir)
                 (("/usr/sbin") sbin-dir)
                 (("/usr/share") share-dir)
                 (("\\$\\(DESTDIR\\)/sbin ") ""))
               ;; Add output "dev" to the run-path.
               (substitute* "Makefile.common"
                 (("-Lsrc")
                  (string-append "-Lsrc " "-Wl,-rpath=" lib-dir)))
               ;; Correct program name of the lexical analyzer.
               (substitute* "src/isdn/cdb/Makefile"
                 (("lex isdn_cdb.lex") "flex isdn_cdb.lex"))
               ;; Patch pkgconfig file to point to output "dev".
               (substitute* "hwinfo.pc.in"
                 (("/usr") dev)))))
         (delete 'configure)
         (replace 'build
           (lambda _
             (setenv "CC" ,(cc-for-target))
             (invoke "make" "shared")
             (invoke "make" "doc")))
         (add-after 'install 'install-manpages
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (man-dir (string-append out "/share/man"))
                    (man1-dir (string-append man-dir "/man1"))
                    (man8-dir (string-append man-dir "/man8")))
               (for-each
                (lambda (x) (install-file x man1-dir))
                (find-files "doc" "\\.1$"))
               (for-each
                (lambda (y) (install-file y man8-dir))
                (find-files "doc" "\\.8$"))))))))
    (native-inputs
     `(("doxygen" ,doxygen)
       ("flex" ,flex)
       ("perl" ,perl)
       ("pkg-config" ,pkg-config)))
    (inputs
     `(("libx86emu" ,libx86emu)
       ("util-linux:lib" ,util-linux "lib")))
    (synopsis "Hardware information tool")
    (description "HwInfo is used to probe for the hardware present in the system.
It can be used to generate a system overview log which can be later used for
support.")
    (license license:gpl2+)))

(define-public ddcutil
  (package
    (name "ddcutil")
    (version "1.1.0")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://www.ddcutil.com/tarballs/"
                           "ddcutil-" version ".tar.gz"))
       (sha256
        (base32 "19kkwb9ijzn6ya3mvjanggh1c96fcc0lkbk7xnyi2qp6wsr4nhxp"))))
    (build-system gnu-build-system)
    (native-inputs
     `(("pkg-config" ,pkg-config)))
    (inputs
     `(("eudev" ,eudev)
       ("glib" ,glib)
       ("libdrm" ,libdrm)               ; enhanced diagnostics
       ("libusb" ,libusb)               ; support USB monitors
       ("libx11" ,libx11)               ; enhanced diagnostics
       ("libxrandr" ,libxrandr)
       ("zlib" ,zlib)))
    (home-page "https://www.ddcutil.com/")
    (synopsis "Control external monitor settings")
    (description
     "ddcutil can query and modify most external monitors' settings, such as
brightness, colour levels, and input sources.  Generally speaking, any setting
that can be changed by pressing buttons on the monitor can be modified by
ddcutil.

ddcutil communicates directly with monitors implementing the Monitor Control
Command Set (@dfn{MCCS}).  It usually does so through the the Display Data
Channel Command Interface (@dfn{DDC/CI}) protocol on the I2C bus, but can also
communicate over USB as per the USB Monitor Control Class Specification.

One particular use case is in colour profile management.  Monitor calibration
is relative to the monitor colour settings currently in effect, e.g. red gain.
ddcutil allows colour-related settings to be saved at the time a monitor is
calibrated, and restored when the calibration is applied.")
    (license (list license:bsd-3        ; FindDDCUtil.cmake
                   license:gpl2+))))    ; everything else

(define-public ddcui
  (package
    (name "ddcui")
    (version "0.1.2")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/rockowitz/ddcui")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0myma1zw6dlygv3xbin662d91zcnwss10syf12q2fppkrd8qdgqf"))))
    (build-system cmake-build-system)
    (arguments
     '(#:tests? #f))                    ; No test suite
    (native-inputs
     `(("pkg-config" ,pkg-config)
       ("qttools" ,qttools)))
    (inputs
     `(("ddcutil" ,ddcutil)
       ("glib" ,glib)
       ("qtbase" ,qtbase-5)))
    (home-page "https://www.ddcutil.com/")
    (synopsis "Graphical user interface for ddcutil")
    (description "ddcui is a graphical user interface for ddcutil, implemented
using Qt.  It provide a dynamic way to inspect and configure external monitors
through the Display Data Channel Command Interface (@dfn{DDC/CI}) protocol.")
    (license (list license:gpl2+))))

(define-public edid-decode
  (let ((commit "74b64180d67bb009d8d9ea1b6f18ad41aaa16396") ; 2020-04-22
        (revision "1"))
    (package
      (name "edid-decode")
      (version (git-version "0.0.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (file-name (git-file-name name version))
         (uri (git-reference
               (url "git://linuxtv.org/edid-decode.git")
               (commit commit)))
         (sha256
          (base32 "0nirp5bza08zj5d8bjgcm0p869hdg3qg3mwa7999pjdrzmn7s2ah"))))
      (build-system gnu-build-system)
      (arguments
       `(#:tests? #f                     ; No test suite
         #:make-flags
         (list (string-append "DESTDIR=" (assoc-ref %outputs "out"))
               "bindir=/bin" "mandir=/share/man")
         #:phases
         (modify-phases %standard-phases
           (add-after 'unpack 'fix-cross-compilation
             (lambda* (#:key native-inputs target #:allow-other-keys)
               (when target
                 (substitute* "Makefile"
                   (("\\$\\(CXX\\)")
                    (string-append target "-g++"))))
               #t))
           (delete 'configure))))
      (home-page "https://git.linuxtv.org/edid-decode.git/")
      (synopsis "Decode @dfn{EDID} data in human-readable format")
      (description "edid-decode decodes @dfn{EDID} monitor description data in
human-readable format and checks if it conforms to the standards.")
      (license license:expat))))

(define-public h-client
  (let ((version "0.0a0")
        (revision 138))
    (package
      (name "h-client")
      (version (string-append version "-" (number->string revision)))
      (source
       (origin
         (method svn-fetch)
         (uri
          (svn-reference
           (url "https://svn.savannah.nongnu.org/svn/h-client/trunk/h-client")
           (revision revision)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "1pdd2qhyaa5vh7z4rkpwjlby1flkwhzmp8zlglalx5y5sv95l4kp"))))
      (build-system python-build-system)
      (arguments
       `(#:python ,python-2
         ;; Tests depends on /etc/os-release which does not exist in the
         ;; build container.
         #:tests? #f))
      (inputs
       `(("python2" ,python-2)
         ("python2-pycurl", python2-pycurl)
         ("python2-pygtk", python2-pygtk)
         ("pciutils", pciutils)
         ("usbutils", usbutils)))
      (synopsis "Graphical client for the h-node hardware database
project")
      (description
       "The h-node project (https://www.h-node.org) aims to build a database of
hardware that works with fully free operating systems.
h-client is a GTK+ graphical client that is able to retrieves information on
the hardware inside the computer it's running on, and on peripherals connected
to it, and help you submit that information to the h-node project along with
whether the hardware works with a fully free operating system or not.")
      (home-page "https://savannah.nongnu.org/projects/h-client/")
      (license license:gpl3+))))

(define-public i7z
  (let ((revision "0")
        (commit "1a41ff13db747e962456ddbb5ccb2b7fc43ca0cb"))
    (package
      (name "i7z")
      (version (git-version "0.28" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/afontenot/i7z")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0jxm63a8y1mfl1sa4mzzfs3bgnym6achj1yc0jglmp05xal16lm1"))
         (modules '((guix build utils)))
         (snippet
          '(begin
             (for-each delete-file-recursively
                       (list "src/GUI"
                             "src/perfmon-i7z"
                             "scripts"))))))
      (build-system gnu-build-system)
      (arguments
       `(#:make-flags
         (list (string-append "prefix=" (assoc-ref %outputs "out"))
               (string-append "CC=" ,(cc-for-target)))
         #:tests? #f                    ; no test suite
         #:phases
         (modify-phases %standard-phases
           (delete 'configure))))       ; no configure script
      (inputs
       `(("ncurses" ,ncurses)))
      (home-page "https://github.com/afontenot/i7z")
      (synopsis "Thermal and C-state reporting on older Intel Core CPUs")
      (description
       "The @command{i7z} utility accurately measures the current frequency
and temperature of older Intel Core (i3, i5, and i7) processors including the
Nehalem, Sandy Bridge, and Ivy Bridge generations.  Reliable support for newer
CPUs is not guaranteed, as this package has not seen significant development
since 2013.

If your processor is supported, you'll get detailed reports on Turbo Boost and
clock multipliers, core voltage, and time spent in different C-states.  This
information can be viewed in real time and/or logged to a file.")
      (supported-systems (list "x86_64-linux"))
      (license license:gpl2))))

(define-public libsmbios
  (package
    (name "libsmbios")
    (version "2.4.3")
    (source
     (origin
       (method git-fetch)
       (uri
        (git-reference
         (url (string-append "https://github.com/dell/" name))
         (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0krwwydyvb9224r884y1mlmzyxhlfrcqw73vi1j8787rl0gl5a2i"))))
    (build-system gnu-build-system)
    (native-inputs
     `(("autoconf" ,autoconf)
       ("automake" ,automake)
       ("gettext" ,gettext-minimal)
       ("libtool" ,libtool)
       ("pkg-config" ,pkg-config)
       ("perl" ,perl)
       ("python" ,python)))
    (inputs
     `(("libxml2" ,libxml2)))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (replace 'bootstrap
           (lambda _ (invoke "autoreconf" "-vfi"))))))
    (synopsis "Library for interacting with Dell SMBIOS tables")
    (description
     "libsmbios provides a library to interface with the SMBIOS tables.  It
also provides extensions for proprietary methods of interfacing with Dell
specific SMBIOS tables.")
    (home-page "https://github.com/dell/libsmbios")
    (license
     (list license:osl2.1 license:gpl2+ license:bsd-3 license:boost1.0))))

;; Distinct from memtest86, which is obsolete.
(define-public memtest86+
  (package
    (name "memtest86+")
    ;; Update the description when/if UEFI support is released.
    (version "5.01")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://www.memtest.org/download/5.01/memtest86+-"
                           version ".tar.gz"))
       (sha256
        (base32 "0fch1l55753y6jkk0hj8f6vw4h1kinkn9ysp22dq5g9zjnvjf88l"))))
    (build-system gnu-build-system)
    (arguments
     `(#:system "i686-linux"            ; the result runs outside of any OS
       #:tests? #f                      ; no way to test this
       #:phases
       (modify-phases %standard-phases
         (delete 'configure)            ; no configure script
         (replace 'build
           ;; The default 'make all' does wonderful things, like scp(1) a file to
           ;; 192.168.0.12. Build the bootable images and nothing more.
           (lambda _
             (invoke "make"
                     "memtest"          ; ELF executable
                     "memtest.bin")))   ; DOS/MBR boot sector
         (replace 'install
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (lib (string-append out "/lib/memtest86+"))
                    (doc (string-append out "/share/doc/memtest86+-" ,version)))
               (for-each
                (lambda (file)
                  (install-file file lib))
                (list "memtest"
                      "memtest.bin"))
               (for-each
                (lambda (file)
                  (install-file file doc))
                (list "FAQ"
                      "README"))
               #t))))))
    (native-inputs
     ;; Newer GCCs fail with a deluge of "multiple definition of `__foo'" errors.
     `(("gcc" ,gcc-4.9)))
    (supported-systems (list "i686-linux" "x86_64-linux"))
    (home-page "https://www.memtest.org/")
    (synopsis "Thorough real-mode memory tester")
    (description
     "Memtest86+ is a thorough, stand-alone memory test for x86 systems.  It
repeatedly writes different patterns to all memory locations, reads them back
again, and verifies whether the result is the same as what was written.  This
can help debug even intermittent and non-deterministic errors.

It runs independently of any operating system, at computer boot-up, so that it
can scan as much of your RAM as possible for hardware defects.

Memtest86+ cannot currently be used on computers booted with UEFI.")
    (license license:gpl2)))

(define-public memtester
  (package
    (name "memtester")
    (version "4.5.1")
    (source
     (origin
       (method url-fetch)
       ;; Even the latest release is available under 'old-versions/'.
       (uri (string-append "http://pyropus.ca/software/memtester/old-versions/"
                           "memtester-" version ".tar.gz"))
       (sha256
        (base32 "0issrasdihav8jgsqb49cfyj0v564z8k9lyg2jrq9h3n4lwc4pqw"))))
    (build-system gnu-build-system)
    (arguments
     `(#:make-flags
       (list ,(string-append "CC=" (cc-for-target)))
       #:phases
       (modify-phases %standard-phases
         (replace 'configure
           ;; This is a home-brewed configuration system where the cc/ld command
           ;; lines are stored in one-line files.
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out")))
               (substitute* (list "conf-cc" "conf-ld")
                 (("^cc") "gcc"))
               (substitute* "Makefile"
                 (("(INSTALLPATH.*=).*" _ assignment)
                  (string-append assignment out)))
               #t)))
         (replace 'check
           ;; There is no test suite. Test some RAM for a single iteration.
           (lambda _
             (invoke "./memtester" "64K" "1"))))))
    (home-page "http://pyropus.ca/software/memtester/")
    (synopsis "User-space memory subsystem tester")
    (description
     "Memtester stress-tests the memory subsystem of your operating system and
computer.  It repeatedly writes different patterns to all memory locations,
reads them back again, and verifies whether the result is the same as what was
written.  This can help debug even intermittent and non-deterministic errors.

Memtester runs entirely in user space.  This means that you don't need to reboot
to test your memory, but also that it's not possible to test all of the RAM
installed in the system.

It can also be told to test memory starting at a particular physical address.")
    (license license:gpl2)))

(define-public msr-tools
  (package
    (name "msr-tools")
    (version "1.3")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://01.org/sites/default/files/downloads/"
                           name "/" name "-" version ".zip"))
       (sha256
        (base32 "07hxmddg0l31kjfmaq84ni142lbbvgq6391r8bd79wpm819pnigr"))))
    (build-system gnu-build-system)
    (arguments
     `(#:make-flags
       (list (string-append "sbindir=" (assoc-ref %outputs "out") "/sbin"))
       #:phases
       (modify-phases %standard-phases
         (delete 'configure)            ; no configure script
         (add-before 'install 'create-output-directory
           (lambda* (#:key outputs #:allow-other-keys)
             ;; 'make install' assumes that sbindir exists.
             (let* ((out  (assoc-ref outputs "out"))
                    (sbin (string-append out "/sbin")))
               (mkdir-p sbin)
               #t))))
       #:tests? #f))                    ; no test suite
    (native-inputs
     `(("unzip" ,unzip)))
    ;; These registers and the CPUID instruction only exist on (most) x86 chips.
    (supported-systems (list "i686-linux" "x86_64-linux"))
    (home-page "https://01.org/msr-tools/")
    (synopsis "Read and write Model-Specific Registers (@dfn{MSR})")
    (description
     "The MSR Tools project provides console utilities to directly access the
Model-Specific Registers (@dfn{MSR}s) and CPU ID of Intel-compatible processors:

@itemize
@item @command{cpuid}: show identification and feature information of any CPU
@item @command{rdmsr}: read MSRs from any CPU or all CPUs
@item @command{wrmsr}: write to MSRs on any CPU or all CPUs
@end itemize

These tools can be used to query and modify certain low-level CPU parameters,
such as the Turbo Boost ratio and Thermal Design Power (@dfn{TDP}) limits.

MSR addresses differ (greatly) between processors, and any such modification can
be dangerous and may void your CPU or system board's warranty.")
    (license license:gpl2)))     ; cpuid.c is gpl2, {rd,wr}msr.c are gpl2+

(define-public wavemon
  (package
    (name "wavemon")
    (version "0.9.3")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/uoaerg/wavemon")
             (commit (string-append "v" version))))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0m9n5asjxs1ir5rqprigqcrm976mgjvh4yql1jhfnbszwbf95193"))))
    (build-system gnu-build-system)
    (arguments
     `(#:make-flags
       (list "CC=gcc"
             ;; Makefile.in (ab)uses $(datadir) as $(docdir). Set it to Guix's
             ;; standard --docdir since it's only used as such.
             (string-append "datadir=" (assoc-ref %outputs "out")
                            "/share/doc/" ,name "-" ,version))
       #:tests? #f))                    ; no tests
    (native-inputs
     `(("pkg-config" ,pkg-config)))
    (inputs
     `(("libcap" ,libcap)
       ("libnl" ,libnl)
       ("ncurses" ,ncurses)))
    (home-page "https://github.com/uoaerg/wavemon")
    (synopsis "Wireless network device monitor")
    (description
     "Wavemon is a wireless device monitor with an interactive ncurses terminal
interface.  It can display and plot signal and noise levels in real time.  It
also reports packet statistics, device configuration, network parameters, and
access points and other wireless clients of your wireless network hardware.

Wavemon should work (with varying levels of detail and features) with any device
supported by the Linux kernel.")
    ;; Source file headers still say GPL2+, but the authorial intent
    ;; (from COPYING and the F9 'about' screen) is clearly GPL3+.
    (license license:gpl3+)))

(define-public rkdeveloptool
  (let ((commit "6e92ebcf8b1812da02663494a68972f956e490d3")
        (revision "0"))
    (package
      (name "rkdeveloptool")
      (version (git-version "1.3" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/rockchip-linux/rkdeveloptool")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0zwrkqfxd671iy69v3q0844gfdpm1yk51i9qh2rqc969bd8glxga"))))
      (build-system gnu-build-system)
      (native-inputs
       `(("autoconf" ,autoconf)
         ("automake" ,automake)
         ("pkg-config" ,pkg-config)))
      (inputs
       `(("libusb" ,libusb)))
      (home-page "https://github.com/rockchip-linux/rkdeveloptool")
      (synopsis "Read from and write to RockChicp devices over USB")
      (description
       "Rkdeveloptool can read from and write to RockChip devices over USB, such
as the Pinebook Pro.")
      (license license:gpl2+))))

(define-public libqb
  (package
    (name "libqb")
    ;; NOTE: We are using a Release Candidate version (for 2.0) here because
    ;; of the linker issues with the previous release.
    (version "1.9.1")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://github.com/ClusterLabs/libqb/releases/download/v"
                    version "/libqb-" version ".tar.xz"))
              (sha256
               (base32
                "008vvw504kh40br5v2xkqavnp9vpmjvf768faqzv1d00fd53ingn"))))
    (build-system gnu-build-system)
    (native-inputs
     `(("pkg-config" ,pkg-config)
       ("xmllint" ,libxml2)))
    (home-page "https://clusterlabs.github.io/libqb/")
    (synopsis "Library providing high performance logging, tracing, ipc, and poll")
    (description "Libqb is a library with the primary purpose of providing
high-performance, reusable features for client-server architecture, such as
logging, tracing, inter-process communication (IPC), and polling.  Libqb is
not intended to be an all-encompassing library, but instead provide focused
APIs that are highly tuned for maximum performance for client-server
applications.")
    (license license:lgpl2.1)))

(define-public usbguard
  (package
    (name "usbguard")
    (version "0.7.8")
    (source (origin
              (method url-fetch)
              (uri (string-append
                    "https://github.com/USBGuard/usbguard/releases/download/usbguard-"
                    version "/usbguard-" version ".tar.gz"))
              (file-name (git-file-name name version))
              (sha256
               (base32 "1il5immqfxh2cj8wn1bfk7l42inflzgjf07yqprpz7r3lalbxc25"))))
    (build-system gnu-build-system)
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'patch-build-scripts
           (lambda* (#:key inputs #:allow-other-keys)
             (substitute* "configure"
               (("/usr/include/catch")
                (string-append (assoc-ref inputs "catch") "/include")))
             ;; Do not create log directory.
             (substitute* "Makefile.in" ((".*/log/usbguard.*") ""))
             ;; Disable LDAP tests: they use 'sudo'.
             (substitute* "src/Tests/Makefile.in"
               (("\\$\\(am__append_2\\)") ""))
             #t))
         (add-after 'install 'delete-static-library
           (lambda* (#:key outputs #:allow-other-keys)
             ;; It can't be direclty disabled since it's needed for the tests.
             (delete-file (string-append (assoc-ref outputs "out")
                                         "/lib/libusbguard.a"))
             #t))
         (add-after 'install 'install-zsh-completion
           (lambda* (#:key outputs #:allow-other-keys)
             (let* ((out (assoc-ref outputs "out"))
                    (site-functions
                     (string-append out "/share/zsh/site-functions")))
               (mkdir-p site-functions)
               (copy-file "scripts/usbguard-zsh-completion"
                          (string-append site-functions "/_usbguard"))
               #t))))
       #:make-flags
       (list (string-append "BASH_COMPLETION_DIR="
                            (assoc-ref %outputs "out")
                            "/etc/bash_completion.d"))
       #:configure-flags
       (list
        "--localstatedir=/var"
        "--enable-systemd=no"
        "--with-ldap"
        "--with-dbus"
        "--with-polkit")))
    (inputs
     `(("audit" ,audit)
       ("catch" ,catch-framework)
       ("dbus-glib" ,dbus-glib)
       ("ldap" ,openldap)
       ("libcap-ng" ,libcap-ng)
       ("libseccomp" ,libseccomp)
       ("libsodium" ,libsodium)
       ("pegtl" ,pegtl)
       ("polkit" ,polkit)
       ("protobuf" ,protobuf)
       ("libqb" ,libqb)))
    (native-inputs
     `(("asciidoc" ,asciidoc)
       ("bash-completion" ,bash-completion)
       ("gdbus-codegen" ,glib "bin")
       ("umockdev" ,umockdev)
       ("xmllint" ,libxml2)
       ("xsltproc" ,libxslt)
       ("pkg-config" ,pkg-config)))
    (home-page "https://usbguard.github.io")
    (synopsis "Helps to protect your computer against rogue USB devices (a.k.a. BadUSB)")
    (description "USBGuard is a software framework for implementing USB device
authorization policies (what kind of USB devices are authorized) as well as
method of use policies (how a USB device may interact with the system).
Simply put, it is a USB device whitelisting tool.")
    (license license:gpl2)))

(define-public screentest
  (package
    (name "screentest")
    (version "2.1")
    (source
     (origin
       (method git-fetch)
       (uri (git-reference
             (url "https://github.com/TobiX/screentest")
             (commit version)))
       (file-name (git-file-name name version))
       (sha256
        (base32 "0gv3xj9sbk1wsyijfw9xjnvy8pg7j4arjnma2r2kfi18qy32wd30"))))
    (build-system gnu-build-system)
    (inputs
     `(("glib" ,glib)
       ("gtk+" ,gtk+-2)))
    (native-inputs
     `(("autoconf" ,autoconf)
       ("intltool" ,intltool)
       ("libtool" ,libtool)
       ("glib" ,glib "bin")
       ("automake" ,automake)
       ("pkg-config" ,pkg-config)))
    (synopsis "Simple screen testing tool")
    (description "This is a program for testing the quality of CRT/LCD
screens.  It displays various patterns and allows you to estimate the quality
of your CRT/LCD monitor.")
    (home-page "https://github.com/TobiX/screentest")
    (license license:gpl2)))

(define-public tpm2-tss
  (package
    (name "tpm2-tss")
    (version "3.0.3")
    (source
     (origin
       (method url-fetch)
       (uri (string-append "https://github.com/tpm2-software/tpm2-tss"
                           "/releases/download/" version "/tpm2-tss-" version
                           ".tar.gz"))
       (sha256
        (base32 "05xynpwq851fp8f5fy7ac0blvz8mr5m5cbqj3gslgbwv63kjnfbq"))))
    (build-system gnu-build-system)
    (native-inputs
     `(("pkg-config" ,pkg-config)))
    (inputs
     `(("curl" ,curl)
       ("json-c" ,json-c)
       ("openssl" ,openssl)))
    (home-page "https://tpm2-software.github.io/")
    (synopsis "OSS Implementation of the TCG TPM2 Software Stack (TSS2)")
    (description
     "This package provides the @acronym{TCG, Trusted Computing Group}
@acronym{TSS2, TPM2 Software Stack}.  The stack contains libtss2-fapi,
libtss2-esys, libtss2-sys, libtss2-mu, libtss2-tcti-device, libtss2-tcti-swtpm
and libtss2-tcti-mssim.")
    (license license:bsd-2)))

debug log:

solving 9a3fa86edc ...
found 9a3fa86edc in https://yhetil.org/guix-patches/20211001231901.24230-1-rg@raghavgururajan.name/
found d000ab8ce6 in https://git.savannah.gnu.org/cgit/guix.git
preparing index
index prepared:
100644 d000ab8ce6b19fa302327b36e5ef3feb0b06c870	gnu/packages/hardware.scm

applying [1/1] https://yhetil.org/guix-patches/20211001231901.24230-1-rg@raghavgururajan.name/
diff --git a/gnu/packages/hardware.scm b/gnu/packages/hardware.scm
index d000ab8ce6..9a3fa86edc 100644

Checking patch gnu/packages/hardware.scm...
Applied patch gnu/packages/hardware.scm cleanly.

index at:
100644 9a3fa86edc130fafa4d6bac0ad0335c020c2fdc1	gnu/packages/hardware.scm

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

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).