From 48e8a5c7fcd1ef1edfe1d8a69a05403a62cdd38e Mon Sep 17 00:00:00 2001 From: Sergei Trofimovich Date: Sun, 27 Nov 2022 08:51:06 +0000 Subject: [PATCH] xterm: 375 -> 377 While at it simplified the updater. Current one fails to update xterm. Changes: https://invisible-island.net/xterm/xterm.log.html#xterm_377 --- .../terminal-emulators/xterm/default.nix | 44 +++++-------------- 1 file changed, 10 insertions(+), 34 deletions(-) diff --git a/pkgs/applications/terminal-emulators/xterm/default.nix b/pkgs/applications/terminal-emulators/xterm/default.nix index ff0856734628..581b7384463a 100644 --- a/pkgs/applications/terminal-emulators/xterm/default.nix +++ b/pkgs/applications/terminal-emulators/xterm/default.nix @@ -1,17 +1,17 @@ { lib, stdenv, fetchurl, fetchpatch, xorg, ncurses, freetype, fontconfig -, pkg-config, makeWrapper, nixosTests, writeScript, common-updater-scripts, git +, pkg-config, makeWrapper, nixosTests, gitUpdater , nixfmt, nix, gnused, coreutils, enableDecLocator ? true }: stdenv.mkDerivation rec { pname = "xterm"; - version = "375"; + version = "377"; src = fetchurl { urls = [ "ftp://ftp.invisible-island.net/xterm/${pname}-${version}.tgz" "https://invisible-mirror.net/archives/xterm/${pname}-${version}.tgz" ]; - sha256 = "sha256-MCxZor+B55xqcBUl13gWGiGNEjnyFWjYnivdMcAVIX8="; + hash = "sha256-2xCP56Rdjtl+YEchtYRDtHNknmHiY2Mb+HWfhhipkLI="; }; strictDeps = true; @@ -81,37 +81,13 @@ stdenv.mkDerivation rec { standardTest = nixosTests.terminal-emulators.xterm; }; - updateScript = let - # Tags that end in letters are unstable - suffixes = lib.concatStringsSep " " - (map (c: "-c versionsort.suffix='${c}'") - (lib.stringToCharacters "abcdefghijklmnopqrstuvwxyz")); - in writeScript "update.sh" '' - #!${stdenv.shell} - set -o errexit - PATH=${ - lib.makeBinPath [ - common-updater-scripts - git - nixfmt - nix - coreutils - gnused - ] - } - - oldVersion="$(nix-instantiate --eval -E "with import ./. {}; lib.getVersion ${pname}" | tr -d '"')" - latestTag="$(git ${suffixes} ls-remote --exit-code --refs --sort='version:refname' --tags git@github.com:ThomasDickey/xterm-snapshots.git 'xterm-*' | tail --lines=1 | cut --delimiter='/' --fields=3 | sed 's|^xterm-||g')" - - if [ ! "$oldVersion" = "$latestTag" ]; then - update-source-version ${pname} "$latestTag" --version-key=version --print-changes - nixpkgs="$(git rev-parse --show-toplevel)" - default_nix="$nixpkgs/pkgs/applications/terminal-emulators/xterm/default.nix" - nixfmt "$default_nix" - else - echo "${pname} is already up-to-date" - fi - ''; + updateScript = gitUpdater { + # No nicer place to find latest release. + url = "https://github.com/ThomasDickey/xterm-snapshots.git"; + rev-prefix = "xterm-"; + # # Tags that end in letters are unstable + ignoredVersions = "[a-z]$"; + }; }; meta = {