From 64e6e3f26a748bef854b6ffca49048a49bbeabf7 Mon Sep 17 00:00:00 2001 From: Guy Chronister Date: Mon, 17 Nov 2025 15:01:53 +0000 Subject: [PATCH] clight,clight-gui,clightd: migrate to pkgs/by-name, modernize - Moved clight, clight-gui, and clightd from pkgs/applications/misc/clight/ into pkgs/by-name/cl/. - Updated derivations to use `stdenv.mkDerivation (finalAttrs: { ... })` style instead of `rec`. - Switched from `rev`/`sha256` to `tag`/`hash` in fetchFromGitHub. - Applied `libsForQt5` consistently for clight-gui buildInputs and hooks. - Added postPatch to clight-gui to require cmake >= 3.10. - Adjusted `meta` blocks to avoid `with lib;` and use explicit `lib.*`. - Removed old package references from all-packages.nix. --- pkgs/applications/misc/clight/clight-gui.nix | 41 ----------------- pkgs/by-name/cl/clight-gui/package.nix | 45 +++++++++++++++++++ .../cl/clight/package.nix} | 16 +++---- .../cl/clightd/package.nix} | 14 +++--- pkgs/top-level/all-packages.nix | 6 --- 5 files changed, 60 insertions(+), 62 deletions(-) delete mode 100644 pkgs/applications/misc/clight/clight-gui.nix create mode 100644 pkgs/by-name/cl/clight-gui/package.nix rename pkgs/{applications/misc/clight/default.nix => by-name/cl/clight/package.nix} (80%) rename pkgs/{applications/misc/clight/clightd.nix => by-name/cl/clightd/package.nix} (92%) diff --git a/pkgs/applications/misc/clight/clight-gui.nix b/pkgs/applications/misc/clight/clight-gui.nix deleted file mode 100644 index 495ebc5024cd..000000000000 --- a/pkgs/applications/misc/clight/clight-gui.nix +++ /dev/null @@ -1,41 +0,0 @@ -{ - lib, - stdenv, - fetchFromGitHub, - cmake, - qtbase, - qtcharts, - wrapQtAppsHook, -}: - -stdenv.mkDerivation rec { - pname = "clight-gui"; - version = "unstable-2023-02-21"; - - src = fetchFromGitHub { - owner = "nullobsi"; - repo = "clight-gui"; - rev = "29e7216bfcc68135350a695ce446134bcb0463a6"; - hash = "sha256-U4vaMwnVDZnYLc+K3/yD81Q1vyBL8uSrrhOHbjbox5U="; - }; - - buildInputs = [ - qtbase - qtcharts - ]; - nativeBuildInputs = [ - cmake - wrapQtAppsHook - ]; - - sourceRoot = "${src.name}/src"; - - meta = with lib; { - description = "Qt GUI for clight"; - homepage = "https://github.com/nullobsi/clight-gui"; - license = licenses.gpl3Only; - maintainers = with maintainers; [ nickhu ]; - mainProgram = "clight-gui"; - platforms = platforms.linux; - }; -} diff --git a/pkgs/by-name/cl/clight-gui/package.nix b/pkgs/by-name/cl/clight-gui/package.nix new file mode 100644 index 000000000000..981e6a796028 --- /dev/null +++ b/pkgs/by-name/cl/clight-gui/package.nix @@ -0,0 +1,45 @@ +{ + lib, + stdenv, + fetchFromGitHub, + cmake, + libsForQt5, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "clight-gui"; + version = "0-unstable-2023-02-21"; + + src = fetchFromGitHub { + owner = "nullobsi"; + repo = "clight-gui"; + rev = "29e7216bfcc68135350a695ce446134bcb0463a6"; + hash = "sha256-U4vaMwnVDZnYLc+K3/yD81Q1vyBL8uSrrhOHbjbox5U="; + }; + + postPatch = '' + substituteInPlace CMakeLists.txt \ + --replace-fail "cmake_minimum_required(VERSION 3.0)" \ + "cmake_minimum_required(VERSION 3.10)" + ''; + + buildInputs = with libsForQt5; [ + qtbase + qtcharts + ]; + nativeBuildInputs = [ + cmake + libsForQt5.wrapQtAppsHook + ]; + + sourceRoot = "${finalAttrs.src.name}/src"; + + meta = { + description = "Qt GUI for clight"; + homepage = "https://github.com/nullobsi/clight-gui"; + license = lib.licenses.gpl3Only; + maintainers = with lib.maintainers; [ nickhu ]; + mainProgram = "clight-gui"; + platforms = lib.platforms.linux; + }; +}) diff --git a/pkgs/applications/misc/clight/default.nix b/pkgs/by-name/cl/clight/package.nix similarity index 80% rename from pkgs/applications/misc/clight/default.nix rename to pkgs/by-name/cl/clight/package.nix index 9211941c5ebf..12c3f814fd80 100644 --- a/pkgs/applications/misc/clight/default.nix +++ b/pkgs/by-name/cl/clight/package.nix @@ -18,15 +18,15 @@ upower, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "clight"; version = "4.11"; src = fetchFromGitHub { owner = "FedeDP"; repo = "Clight"; - rev = version; - sha256 = "sha256-Fu38HRP83Yn2jsq9xnCWOXNlV/0hJKD1/cOOp3EV45Q="; + tag = finalAttrs.version; + hash = "sha256-Fu38HRP83Yn2jsq9xnCWOXNlV/0hJKD1/cOOp3EV45Q="; }; nativeBuildInputs = [ @@ -55,14 +55,14 @@ stdenv.mkDerivation rec { "-DZSH_COMPLETIONS_DIR=${placeholder "out"}/share/zsh/site-functions" ]; - meta = with lib; { + meta = { description = "C daemon that turns your webcam into a light sensor"; homepage = "https://github.com/FedeDP/Clight"; - platforms = platforms.linux; - license = licenses.gpl3; - maintainers = with maintainers; [ + platforms = lib.platforms.linux; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ eadwu ]; mainProgram = "clight"; }; -} +}) diff --git a/pkgs/applications/misc/clight/clightd.nix b/pkgs/by-name/cl/clightd/package.nix similarity index 92% rename from pkgs/applications/misc/clight/clightd.nix rename to pkgs/by-name/cl/clightd/package.nix index 53678a29813e..0d4881e449f0 100644 --- a/pkgs/applications/misc/clight/clightd.nix +++ b/pkgs/by-name/cl/clightd/package.nix @@ -28,14 +28,14 @@ enableYoctolight ? true, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "clightd"; version = "5.9"; src = fetchFromGitHub { owner = "FedeDP"; repo = "Clightd"; - rev = version; + tag = finalAttrs.version; hash = "sha256-LOhBBd7QL5kH4TzMFgrh70C37WsFdsiKArP+tIEiPWo="; }; @@ -98,14 +98,14 @@ stdenv.mkDerivation rec { ln -svT $out/libexec/clightd $out/bin/clightd ''; - meta = with lib; { + meta = { description = "Linux bus interface that changes screen brightness/temperature"; mainProgram = "clightd"; homepage = "https://github.com/FedeDP/Clightd"; - platforms = platforms.linux; - license = licenses.gpl3; - maintainers = with maintainers; [ + platforms = lib.platforms.linux; + license = lib.licenses.gpl3; + maintainers = with lib.maintainers; [ eadwu ]; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c71f9f91683a..62c69179903a 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -10721,12 +10721,6 @@ with pkgs; inherit (darwin) DarwinTools; }; - clight = callPackage ../applications/misc/clight { }; - - clight-gui = libsForQt5.callPackage ../applications/misc/clight/clight-gui.nix { }; - - clightd = callPackage ../applications/misc/clight/clightd.nix { }; - clipgrab = libsForQt5.callPackage ../applications/video/clipgrab { }; cmus = callPackage ../applications/audio/cmus {