From d126740fe55b81881abf908b5b4020a9a5af7a64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=A9clairevoyant?= <848000+eclairevoyant@users.noreply.github.com> Date: Thu, 21 Sep 2023 16:38:24 -0400 Subject: [PATCH] sunpaper: add meta.mainProgram, fix license, and other cleanup (#256437) * sunpaper: fix meta * sunpaper: replace rec with finalAttrs idiom * sunpaper: use lib.getExe * sunpaper: fix installPhase * sunpaper: move to pkgs/by-name --- .../su/sunpaper/package.nix} | 31 +++++++++++-------- pkgs/top-level/all-packages.nix | 2 -- 2 files changed, 18 insertions(+), 15 deletions(-) rename pkgs/{tools/X11/sunpaper/default.nix => by-name/su/sunpaper/package.nix} (53%) diff --git a/pkgs/tools/X11/sunpaper/default.nix b/pkgs/by-name/su/sunpaper/package.nix similarity index 53% rename from pkgs/tools/X11/sunpaper/default.nix rename to pkgs/by-name/su/sunpaper/package.nix index 116b0225ab0f..54d8d3d871ac 100644 --- a/pkgs/tools/X11/sunpaper/default.nix +++ b/pkgs/by-name/su/sunpaper/package.nix @@ -5,33 +5,37 @@ , wallutils }: -stdenvNoCC.mkDerivation rec { +stdenvNoCC.mkDerivation (finalAttrs: { pname = "sunpaper"; version = "2.0"; src = fetchFromGitHub { owner = "hexive"; repo = "sunpaper"; - rev = "v${version}"; - sha256 = "sha256-8s7SS79wCS0nRR7IpkshP5QWJqqKEeBu6EtFPDM+2cM="; + rev = "v${finalAttrs.version}"; + hash = "sha256-8s7SS79wCS0nRR7IpkshP5QWJqqKEeBu6EtFPDM+2cM="; }; buildInputs = [ - wallutils sunwait + wallutils ]; postPatch = '' substituteInPlace sunpaper.sh \ - --replace "sunwait" "${sunwait}/bin/sunwait" \ - --replace "setwallpaper" "${wallutils}/bin/setwallpaper" \ + --replace "sunwait" "${lib.getExe sunwait}" \ + --replace "setwallpaper" "${lib.getExe' wallutils "setwallpaper"}" \ --replace '$HOME/sunpaper/images/' "$out/share/sunpaper/images/" ''; installPhase = '' - mkdir -p "$out/bin" "$out/share/sunpaper/images" - cp sunpaper.sh $out/bin/sunpaper + runHook preInstall + + install -Dm555 sunpaper.sh $out/bin/sunpaper + mkdir -p "$out/share/sunpaper/images" cp -R images $out/share/sunpaper/ + + runHook postInstall ''; doInstallCheck = true; @@ -40,11 +44,12 @@ stdenvNoCC.mkDerivation rec { $out/bin/sunpaper --help > /dev/null ''; - meta = with lib; { + meta = { description = "A utility to change wallpaper based on local weather, sunrise and sunset times"; homepage = "https://github.com/hexive/sunpaper"; - license = lib.licenses.unfree; - maintainers = with maintainers; [ jevy ]; - platforms = platforms.unix; + license = lib.licenses.asl20; + mainProgram = "sunpaper"; + maintainers = with lib.maintainers; [ eclairevoyant jevy ]; + platforms = lib.platforms.linux; }; -} +}) diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ee436c759b8d..f1f03babed79 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13415,8 +13415,6 @@ with pkgs; sunwait = callPackage ../applications/misc/sunwait { }; - sunpaper = callPackage ../tools/X11/sunpaper { }; - surface-control = callPackage ../applications/misc/surface-control { }; syntex = callPackage ../tools/graphics/syntex { };