From 489562d3b1e895ac40b02ae8766093095b27641d Mon Sep 17 00:00:00 2001 From: tree-sapii <144389458+tree-sapii@users.noreply.github.com> Date: Wed, 1 Jul 2026 14:34:28 -0400 Subject: [PATCH] ncdu: 2.9.2 -> 2.10.0, update source --- pkgs/by-name/nc/ncdu/1.nix | 21 ++++++++---- pkgs/by-name/nc/ncdu/package.nix | 55 ++++++++++++++++++++++++-------- pkgs/by-name/nc/ncdu/update.sh | 5 --- 3 files changed, 57 insertions(+), 24 deletions(-) delete mode 100755 pkgs/by-name/nc/ncdu/update.sh diff --git a/pkgs/by-name/nc/ncdu/1.nix b/pkgs/by-name/nc/ncdu/1.nix index b4f3de7afabf9..d73ddd58536a7 100644 --- a/pkgs/by-name/nc/ncdu/1.nix +++ b/pkgs/by-name/nc/ncdu/1.nix @@ -1,8 +1,9 @@ { lib, stdenv, - fetchurl, + fetchFromGitHub, pkg-config, + autoreconfHook, ncurses, versionCheckHook, }: @@ -11,12 +12,20 @@ stdenv.mkDerivation (finalAttrs: { pname = "ncdu"; version = "1.22"; - src = fetchurl { - url = "https://dev.yorhel.nl/download/ncdu-${finalAttrs.version}.tar.gz"; - sha256 = "sha256-CtbAltwE1RIFgRBHYMAbj06X1BkdbJ73llT6PGkaF2s="; + src = fetchFromGitHub { + owner = "BratishkaErik"; + repo = "ncdu"; + tag = "v${finalAttrs.version}"; + hash = "sha256-KcI3sXyD/gt+n8JbSdzdoQYNmjKMPLlIPpZSPAHGb40="; }; - nativeBuildInputs = [ pkg-config ]; + __structuredAttrs = true; + strictDeps = true; + + nativeBuildInputs = [ + pkg-config + autoreconfHook + ]; buildInputs = [ ncurses ]; @@ -25,7 +34,7 @@ stdenv.mkDerivation (finalAttrs: { meta = { description = "Disk usage analyzer with an ncurses interface"; - homepage = "https://dev.yorhel.nl/ncdu"; + homepage = "https://github.com/BratishkaErik/ncdu"; license = lib.licenses.mit; platforms = lib.platforms.all; maintainers = with lib.maintainers; [ pSub ]; diff --git a/pkgs/by-name/nc/ncdu/package.nix b/pkgs/by-name/nc/ncdu/package.nix index ad12df23228e3..2dc325e53794d 100644 --- a/pkgs/by-name/nc/ncdu/package.nix +++ b/pkgs/by-name/nc/ncdu/package.nix @@ -1,27 +1,35 @@ { lib, stdenv, - fetchurl, ncurses, + fetchFromGitHub, pkg-config, - zig_0_15, + zig_0_16, + nix-update-script, zstd, installShellFiles, versionCheckHook, pie ? stdenv.hostPlatform.isDarwin, }: - +let + zig = zig_0_16; +in stdenv.mkDerivation (finalAttrs: { pname = "ncdu"; - version = "2.9.2"; + version = "2.10.0"; - src = fetchurl { - url = "https://dev.yorhel.nl/download/ncdu-${finalAttrs.version}.tar.gz"; - hash = "sha256-6RE1KBy2ZWnyykwLrCdyRpkeflJSTAyoy6PeXI6Bzsk="; + src = fetchFromGitHub { + owner = "BratishkaErik"; + repo = "ncdu"; + tag = "v${finalAttrs.version}"; + hash = "sha256-YfvuXW0IaRaUNReLe/hMgYA2geDLvt1bprJAbOCFCQk="; }; + __structuredAttrs = true; + strictDeps = true; + nativeBuildInputs = [ - zig_0_15 + zig.hook installShellFiles pkg-config ]; @@ -31,7 +39,28 @@ stdenv.mkDerivation (finalAttrs: { zstd ]; - zigBuildFlags = lib.optional pie "-Dpie=true"; + deps = zig.fetchDeps { + inherit (finalAttrs) pname version src; + fetchAll = true; + hash = "sha256-vk4wMIpKEQObFXuNd5szQQU6z0NyVJKInOMDiEn4A5k="; + }; + + postPatch = '' + mkdir -p zig-system-dir + + for file in ${finalAttrs.deps}/*; do + dir="zig-system-dir/$(basename "$file" .tar.gz)" + mkdir -p "$dir" + + tar -xzf "$file" -C "$dir" --strip-components=1 + done + ''; + + zigBuildFlags = [ + "--system" + "zig-system-dir" + ] + ++ lib.optional pie "-Dpie=true"; postInstall = '' installManPage ncdu.1 @@ -40,12 +69,12 @@ stdenv.mkDerivation (finalAttrs: { nativeInstallCheckInputs = [ versionCheckHook ]; doInstallCheck = true; - passthru.updateScript = ./update.sh; + passthru.updateScript = nix-update-script { }; meta = { - homepage = "https://dev.yorhel.nl/ncdu"; + homepage = "https://github.com/BratishkaErik/ncdu"; description = "Disk usage analyzer with an ncurses interface"; - changelog = "https://dev.yorhel.nl/ncdu/changes2"; + changelog = "https://github.com/BratishkaErik/ncdu/releases"; license = lib.licenses.mit; maintainers = with lib.maintainers; [ pSub @@ -53,7 +82,7 @@ stdenv.mkDerivation (finalAttrs: { defelo ryan4yin ]; - inherit (zig_0_15.meta) platforms; + inherit (zig.meta) platforms; mainProgram = "ncdu"; }; }) diff --git a/pkgs/by-name/nc/ncdu/update.sh b/pkgs/by-name/nc/ncdu/update.sh deleted file mode 100755 index 430c83649ac35..0000000000000 --- a/pkgs/by-name/nc/ncdu/update.sh +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env nix-shell -#!nix-shell -i bash -p common-updater-scripts coreutils gnused nix-update - -version=$(list-git-tags --url=https://g.blicky.net/ncdu.git | tail -1 | sed 's/^v//') -nix-update --version="$version" ncdu