diff --git a/pkgs/development/libraries/hyphen/default.nix b/pkgs/development/libraries/hyphen/default.nix index 214149fc1f23..1be6ebb50247 100644 --- a/pkgs/development/libraries/hyphen/default.nix +++ b/pkgs/development/libraries/hyphen/default.nix @@ -1,33 +1,31 @@ { lib, stdenv, - fetchurl, + fetchFromGitHub, + autoreconfHook, perl, }: -let - version = "2.8.8"; - folder = - with builtins; - let - parts = splitVersion version; - in - concatStringsSep "." [ - (elemAt parts 0) - (elemAt parts 1) - ]; -in -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "hyphen"; - inherit version; + version = "2.8.9"; - nativeBuildInputs = [ perl ]; + nativeBuildInputs = [ + autoreconfHook + perl + ]; - src = fetchurl { - url = "https://sourceforge.net/projects/hunspell/files/Hyphen/${folder}/${pname}-${version}.tar.gz"; - sha256 = "01ap9pr6zzzbp4ky0vy7i1983fwyqy27pl0ld55s30fdxka3ciih"; + strictDeps = true; + + src = fetchFromGitHub { + owner = "hunspell"; + repo = "hyphen"; + tag = "v${finalAttrs.version}"; + hash = "sha256-F7PJQjEiE5t5i1gi5B8wzrwAJQl8FWzopRA8uDsaZBc="; }; + enableParallelBuilding = true; + # Do not install the en_US dictionary. installPhase = '' runHook preInstall @@ -36,14 +34,15 @@ stdenv.mkDerivation rec { make install-includeHEADERS # license - install -D -m644 COPYING "$out/share/licenses/${pname}/LICENSE" + install -D -m644 COPYING "$out/share/licenses/hyphen/LICENSE" runHook postInstall ''; meta = { + changelog = "https://github.com/hunspell/hyphen/blob/${finalAttrs.src.tag}/NEWS"; description = "Text hyphenation library"; mainProgram = "substrings.pl"; - homepage = "https://sourceforge.net/projects/hunspell/files/Hyphen/"; + homepage = "https://github.com/hunspell/hyphen"; platforms = lib.platforms.all; license = with lib.licenses; [ gpl2 @@ -51,4 +50,4 @@ stdenv.mkDerivation rec { mpl11 ]; }; -} +})