diff --git a/pkgs/by-name/un/unicode-paracode/package.nix b/pkgs/by-name/un/unicode-paracode/package.nix index cbc960f22ff2..ffd7de1ce02d 100644 --- a/pkgs/by-name/un/unicode-paracode/package.nix +++ b/pkgs/by-name/un/unicode-paracode/package.nix @@ -1,7 +1,6 @@ { lib, fetchFromGitHub, - fetchurl, python3Packages, installShellFiles, gitUpdater, @@ -9,38 +8,42 @@ }: python3Packages.buildPythonApplication (finalAttrs: { - pname = "unicode"; - version = "2.9"; + pname = "unicode-paracode"; + version = "3.2-unstable-2025-01-31"; pyproject = true; src = fetchFromGitHub { owner = "garabik"; repo = "unicode"; - rev = "v${finalAttrs.version}"; - sha256 = "sha256-FHAlZ5HID/FE9+YR7Dmc3Uh7E16QKORoD8g9jgTeQdY="; + rev = "7df103ee988bbfe999f457e23cbc0e954dd0e813"; + hash = "sha256-4u/tp+KQMfgo8zS4INB8MJBOLgHqMBj3Tk2yj7Sp3YU="; }; - patches = [ - # Fix 3.13+ mutable locals() - (fetchurl { - url = "https://github.com/garabik/unicode/commit/412952b9b4730263f5b560924b84f8934ea4ba21.patch"; - hash = "sha256-Rfm6Jc7V5n7ggQzA/yeDrYedGMWqRkeUX6FRCUkBWcI="; - }) - ]; - nativeBuildInputs = [ installShellFiles ]; build-system = with python3Packages; [ setuptools ]; postFixup = '' + mkdir -p "$out/share/unicode" + ln -s "${unicode-character-database}/share/unicode/UnicodeData.txt" "$out/share/unicode/UnicodeData.txt" + # We want to keep /usr/share/unicode in the list for the Unihan files substituteInPlace "$out/bin/.unicode-wrapped" \ - --replace-fail "/usr/share/unicode/UnicodeData.txt" "${unicode-character-database}/share/unicode/UnicodeData.txt" + --replace-fail "'/usr/share/unicode', " "'$out/share/unicode', '/usr/share/unicode', " ''; postInstall = '' installManPage paracode.1 unicode.1 ''; + checkPhase = '' + runHook preCheck + + echo Testing: $out/bin/unicode --brief z + diff -u <(echo z U+007A LATIN SMALL LETTER Z) <($out/bin/unicode --brief z 2>&1) && echo Success + + runHook postCheck + ''; + passthru.updateScript = gitUpdater { rev-prefix = "v"; }; meta = { @@ -48,6 +51,7 @@ python3Packages.buildPythonApplication (finalAttrs: { homepage = "https://github.com/garabik/unicode"; license = lib.licenses.gpl3; maintainers = [ lib.maintainers.woffs ]; + mainProgram = "unicode"; platforms = lib.platforms.all; }; })