From ecb4b982dbde16946f2d87e50f4e5e4a40953f2d Mon Sep 17 00:00:00 2001 From: kyehn Date: Sun, 31 Aug 2025 22:38:16 +0800 Subject: [PATCH 1/3] kent: add updateScript --- pkgs/by-name/ke/kent/package.nix | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pkgs/by-name/ke/kent/package.nix b/pkgs/by-name/ke/kent/package.nix index c716287b77e4..7a8861dd4c2e 100644 --- a/pkgs/by-name/ke/kent/package.nix +++ b/pkgs/by-name/ke/kent/package.nix @@ -12,6 +12,9 @@ bash, fetchFromGitHub, which, + writeShellScript, + jq, + nix-update, }: stdenv.mkDerivation rec { pname = "kent"; @@ -85,6 +88,11 @@ stdenv.mkDerivation rec { runHook postInstall ''; + passthru.updateScript = writeShellScript "update-kent" '' + latestVersion=$(curl ''${GITHUB_TOKEN:+-u ":$GITHUB_TOKEN"} --fail --silent https://api.github.com/repos/ucscGenomeBrowser/kent/releases/latest | ${lib.getExe jq} --raw-output .tag_name | grep -oP '(?<=v)\d+') + ${lib.getExe nix-update} kent --version $latestVersion + ''; + meta = { description = "UCSC Genome Bioinformatics Group's suite of biological analysis tools, i.e. the kent utilities"; homepage = "http://genome.ucsc.edu"; From 270707595b87aeff54b09e59f93473d4fe0ccad8 Mon Sep 17 00:00:00 2001 From: kyehn Date: Sun, 31 Aug 2025 22:39:51 +0800 Subject: [PATCH 2/3] kent: 468 -> 486 Changelog: https://github.com/ucscGenomeBrowser/kent/releases/tag/v486_base --- pkgs/by-name/ke/kent/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/ke/kent/package.nix b/pkgs/by-name/ke/kent/package.nix index 7a8861dd4c2e..841d87548e18 100644 --- a/pkgs/by-name/ke/kent/package.nix +++ b/pkgs/by-name/ke/kent/package.nix @@ -18,13 +18,13 @@ }: stdenv.mkDerivation rec { pname = "kent"; - version = "468"; + version = "486"; src = fetchFromGitHub { owner = "ucscGenomeBrowser"; repo = "kent"; rev = "v${version}_base"; - hash = "sha256-OM/noraW2X8WV5wqWEFiI5/JPOBmsp0fTeDdcZoXxAA="; + hash = "sha256-NffQ04+5rMtG/VI7YFK4Ff39DDhdh9Wlc0i1iVbg8Js="; }; buildInputs = [ From bf210e0844c309d817a338eab6bbc20e4c03f437 Mon Sep 17 00:00:00 2001 From: kyehn Date: Sun, 31 Aug 2025 22:52:45 +0800 Subject: [PATCH 3/3] kent: use finalAttrs and tag and writableTmpDirAsHomeHook --- pkgs/by-name/ke/kent/package.nix | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/pkgs/by-name/ke/kent/package.nix b/pkgs/by-name/ke/kent/package.nix index 841d87548e18..8c0c9d8bf0f8 100644 --- a/pkgs/by-name/ke/kent/package.nix +++ b/pkgs/by-name/ke/kent/package.nix @@ -1,6 +1,7 @@ { lib, stdenv, + writableTmpDirAsHomeHook, libpng, libuuid, zlib, @@ -16,17 +17,19 @@ jq, nix-update, }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "kent"; version = "486"; src = fetchFromGitHub { owner = "ucscGenomeBrowser"; repo = "kent"; - rev = "v${version}_base"; + tag = "v${finalAttrs.version}_base"; hash = "sha256-NffQ04+5rMtG/VI7YFK4Ff39DDhdh9Wlc0i1iVbg8Js="; }; + nativeBuildInputs = [ writableTmpDirAsHomeHook ]; + buildInputs = [ libpng libuuid @@ -40,10 +43,10 @@ stdenv.mkDerivation rec { postPatch = '' substituteInPlace ./src/checkUmask.sh \ - --replace "/bin/bash" "${bash}/bin/bash" + --replace-fail "/bin/bash" "${bash}/bin/bash" substituteInPlace ./src/hg/sqlEnvTest.sh \ - --replace "which mysql_config" "${which}/bin/which ${libmysqlclient}/bin/mysql_config" + --replace-fail "which mysql_config" "${which}/bin/which ${libmysqlclient}/bin/mysql_config" ''; buildPhase = '' @@ -53,7 +56,6 @@ stdenv.mkDerivation rec { export CFLAGS="-fPIC" export MYSQLINC=$(mysql_config --include | sed -e 's/^-I//g') export MYSQLLIBS=$(mysql_config --libs) - export HOME=$TMPDIR export DESTBINDIR=$HOME/bin mkdir -p $HOME/lib $HOME/bin/${stdenv.hostPlatform.parsed.cpu.name} @@ -96,9 +98,9 @@ stdenv.mkDerivation rec { meta = { description = "UCSC Genome Bioinformatics Group's suite of biological analysis tools, i.e. the kent utilities"; homepage = "http://genome.ucsc.edu"; - changelog = "https://github.com/ucscGenomeBrowser/kent/releases/tag/v${version}_base"; + changelog = "https://github.com/ucscGenomeBrowser/kent/releases/tag/v${finalAttrs.version}_base"; license = lib.licenses.unfree; maintainers = with lib.maintainers; [ scalavision ]; platforms = lib.platforms.linux; }; -} +})