tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
lol
0
fork
atom
overview
issues
pulls
pipelines
light: fetch source from gitlab; move to by-name
wxt
1 year ago
7edefa55
d371bd12
+85
-54
4 changed files
expand all
collapse all
unified
split
pkgs
by-name
li
light
0001-define-light-loglevel-as-extern.patch
package.nix
os-specific
linux
light
default.nix
top-level
all-packages.nix
+38
pkgs/by-name/li/light/0001-define-light-loglevel-as-extern.patch
···
1
1
+
From 47f163f6bcd1d66bebc49d96abcf46853a0708fb Mon Sep 17 00:00:00 2001
2
2
+
From: wxt <3264117476@qq.com>
3
3
+
Date: Tue, 22 Oct 2024 07:48:34 +0800
4
4
+
Subject: [PATCH] fix build
5
5
+
6
6
+
---
7
7
+
src/helpers.c | 1 +
8
8
+
src/helpers.h | 2 +-
9
9
+
2 files changed, 2 insertions(+), 1 deletion(-)
10
10
+
11
11
+
diff --git a/src/helpers.c b/src/helpers.c
12
12
+
index c7bc4de..00e6098 100644
13
13
+
--- a/src/helpers.c
14
14
+
+++ b/src/helpers.c
15
15
+
@@ -9,6 +9,7 @@
16
16
+
#include <errno.h> // errno
17
17
+
#include <libgen.h> // dirname
18
18
+
19
19
+
+light_loglevel_t light_loglevel;
20
20
+
21
21
+
bool light_file_read_uint64(char const *filename, uint64_t *val)
22
22
+
{
23
23
+
diff --git a/src/helpers.h b/src/helpers.h
24
24
+
index f73714b..4a92753 100644
25
25
+
--- a/src/helpers.h
26
26
+
+++ b/src/helpers.h
27
27
+
@@ -21,7 +21,7 @@ typedef enum {
28
28
+
LIGHT_NOTE_LEVEL
29
29
+
} light_loglevel_t;
30
30
+
31
31
+
-light_loglevel_t light_loglevel;
32
32
+
+extern light_loglevel_t light_loglevel;
33
33
+
34
34
+
#define LIGHT_LOG(lvl, fp, fmt, args...)\
35
35
+
if(light_loglevel >= lvl)\
36
36
+
--
37
37
+
2.46.1
38
38
+
+47
pkgs/by-name/li/light/package.nix
···
1
1
+
{
2
2
+
lib,
3
3
+
stdenv,
4
4
+
fetchFromGitLab,
5
5
+
fetchpatch,
6
6
+
autoreconfHook,
7
7
+
coreutils,
8
8
+
}:
9
9
+
10
10
+
stdenv.mkDerivation {
11
11
+
version = "1.2.2";
12
12
+
pname = "light";
13
13
+
14
14
+
src = fetchFromGitLab {
15
15
+
owner = "dpeukert";
16
16
+
repo = "light";
17
17
+
rev = "2a54078cbe3814105ee4f565f451b1b5947fbde0";
18
18
+
hash = "sha256-OmHdVJvBcBjJiPs45JqOHxFoJYvKIEIpt9pFhBz74Kg=";
19
19
+
};
20
20
+
21
21
+
configureFlags = [ "--with-udev" ];
22
22
+
23
23
+
nativeBuildInputs = [ autoreconfHook ];
24
24
+
25
25
+
patches = [
26
26
+
./0001-define-light-loglevel-as-extern.patch
27
27
+
];
28
28
+
29
29
+
# ensure udev rules can find the commands used
30
30
+
postPatch = ''
31
31
+
substituteInPlace 90-backlight.rules \
32
32
+
--replace-fail '/bin/chgrp' '${coreutils}/bin/chgrp' \
33
33
+
--replace-fail '/bin/chmod' '${coreutils}/bin/chmod'
34
34
+
'';
35
35
+
36
36
+
meta = {
37
37
+
description = "GNU/Linux application to control backlights";
38
38
+
homepage = "https://gitlab.com/dpeukert/light";
39
39
+
license = lib.licenses.gpl3Only;
40
40
+
mainProgram = "light";
41
41
+
maintainers = with lib.maintainers; [
42
42
+
puffnfresh
43
43
+
dtzWill
44
44
+
];
45
45
+
platforms = lib.platforms.linux;
46
46
+
};
47
47
+
}
-52
pkgs/os-specific/linux/light/default.nix
···
1
1
-
{
2
2
-
lib,
3
3
-
stdenv,
4
4
-
fetchFromGitHub,
5
5
-
fetchpatch,
6
6
-
autoreconfHook,
7
7
-
coreutils,
8
8
-
}:
9
9
-
10
10
-
stdenv.mkDerivation (finalAttrs: {
11
11
-
version = "1.2.2";
12
12
-
pname = "light";
13
13
-
src = fetchFromGitHub {
14
14
-
owner = "haikarainen";
15
15
-
repo = "light";
16
16
-
rev = "refs/tags/v${version}";
17
17
-
sha256 = "1a70zcf88ifsnwll486aicjnh48zisdf8f7vi34ihw61kdadsq9s";
18
18
-
};
19
19
-
20
20
-
patches = [
21
21
-
# Pull upstream fix for -fno-common toolchains:
22
22
-
# https://github.com/haikarainen/light/pull/135
23
23
-
(fetchpatch {
24
24
-
name = "fno-common.patch";
25
25
-
url = "https://github.com/haikarainen/light/commit/eae912ca7ff3356805e47739114861d2b6ae7ec0.patch";
26
26
-
sha256 = "15jp8hm5scl0myiy1jmvd6m52lhx5jscvi3rgb5siwakmnkgzx9j";
27
27
-
})
28
28
-
];
29
29
-
30
30
-
configureFlags = [ "--with-udev" ];
31
31
-
32
32
-
nativeBuildInputs = [ autoreconfHook ];
33
33
-
34
34
-
# ensure udev rules can find the commands used
35
35
-
postPatch = ''
36
36
-
substituteInPlace 90-backlight.rules \
37
37
-
--replace '/bin/chgrp' '${coreutils}/bin/chgrp' \
38
38
-
--replace '/bin/chmod' '${coreutils}/bin/chmod'
39
39
-
'';
40
40
-
41
41
-
meta = {
42
42
-
description = "GNU/Linux application to control backlights";
43
43
-
homepage = "https://haikarainen.github.io/light/";
44
44
-
license = lib.licenses.gpl3;
45
45
-
mainProgram = "light";
46
46
-
maintainers = with lib.maintainers; [
47
47
-
puffnfresh
48
48
-
dtzWill
49
49
-
];
50
50
-
platforms = lib.platforms.linux;
51
51
-
};
52
52
-
})
-2
pkgs/top-level/all-packages.nix
···
25413
25413
then util-linuxMinimal
25414
25414
else null;
25415
25415
25416
25416
-
light = callPackage ../os-specific/linux/light { };
25417
25417
-
25418
25416
lightum = callPackage ../os-specific/linux/lightum { };
25419
25417
25420
25418
ebtables = callPackage ../os-specific/linux/ebtables { };