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
This commit is contained in:
Sergei Trofimovich 2022-11-27 08:51:06 +00:00
parent 9767049d4f
commit 48e8a5c7fc

View file

@ -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 = {