light: fetch source from gitlab; move to by-name

wxt 7edefa55 d371bd12

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