Merge pull request #325290 from theCapypara/fix-hyphen-libreoffice

libreoffice, hyphen: Load hyphen dicts in LibreOffice, modularize hyphen dicts, add german hyphen dict

authored by 7c6f434c and committed by GitHub ddbd789f 12a3f8bb

+120 -3
+8
maintainers/maintainer-list.nix
··· 19952 19952 githubId = 34945377; 19953 19953 name = "John Smith"; 19954 19954 }; 19955 + theCapypara = { 19956 + name = "Marco Köpcke"; 19957 + email = "hello@capypara.de"; 19958 + matrix = "@capypara:matrix.org"; 19959 + github = "theCapypara"; 19960 + githubId = 3512122; 19961 + keys = [ { fingerprint = "5F29 132D EFA8 5DA0 B598 5BF2 5941 754C 1CDE 33BB"; } ]; 19962 + }; 19955 19963 thedavidmeister = { 19956 19964 email = "thedavidmeister@gmail.com"; 19957 19965 github = "thedavidmeister";
+7 -3
pkgs/applications/office/libreoffice/wrapper.nix
··· 50 50 # Add dictionaries from all NIX_PROFILES 51 51 "--run" (lib.escapeShellArg '' 52 52 for PROFILE in $NIX_PROFILES; do 53 - HDIR="$PROFILE/share/hunspell" 54 - if [ -d "$HDIR" ]; then 55 - export DICPATH=$DICPATH''${DICPATH:+:}$HDIR 53 + HU_DIR="$PROFILE/share/hunspell" 54 + HY_DIR="$PROFILE/share/hyphen" 55 + if [ -d "$HU_DIR" ]; then 56 + export DICPATH=$DICPATH''${DICPATH:+:}$HU_DIR 57 + fi 58 + if [ -d "$HY_DIR" ]; then 59 + export DICPATH=$DICPATH''${DICPATH:+:}$HY_DIR 56 60 fi 57 61 done 58 62 '')
+12
pkgs/development/libraries/hyphen/default.nix
··· 17 17 sha256 = "01ap9pr6zzzbp4ky0vy7i1983fwyqy27pl0ld55s30fdxka3ciih"; 18 18 }; 19 19 20 + # Do not install the en_US dictionary. 21 + installPhase = '' 22 + runHook preInstall 23 + make install-libLTLIBRARIES 24 + make install-binSCRIPTS 25 + make install-includeHEADERS 26 + 27 + # license 28 + install -D -m644 COPYING "$out/share/licenses/${pname}/LICENSE" 29 + runHook postInstall 30 + ''; 31 + 20 32 meta = with lib; { 21 33 description = "Text hyphenation library"; 22 34 mainProgram = "substrings.pl";
+91
pkgs/development/libraries/hyphen/dictionaries.nix
··· 1 + /* hyphen dictionaries */ 2 + 3 + { hyphen, stdenv, lib, fetchgit, fetchurl }: 4 + 5 + 6 + let 7 + libreofficeRepository = "https://anongit.freedesktop.org/git/libreoffice/dictionaries.git"; 8 + libreofficeCommit = "9e27d044d98e65f89af8c86df722a77be827bdc8"; 9 + libreofficeSubdir = "de"; 10 + 11 + mkDictFromLibreofficeGit = 12 + { subdir, shortName, shortDescription, dictFileName, readmeFileName }: 13 + stdenv.mkDerivation rec { 14 + version = "24.8"; 15 + pname = "hyphen-dict-${shortName}-libreoffice"; 16 + src = fetchgit { 17 + url = "https://anongit.freedesktop.org/git/libreoffice/dictionaries.git"; 18 + rev = "a2bf59878dd76685803ec260e15d875746ad6e25"; 19 + sha256 = "sha256-3CvjgNjsrm4obATK6LmtYob8i2ngTbwP6FB4HlJMPCE="; 20 + }; 21 + meta = with lib; { 22 + description = "Hyphen dictionary for ${shortDescription} from LibreOffice"; 23 + homepage = "https://wiki.documentfoundation.org/Development/Dictionaries"; 24 + license = with licenses; [ mpl20 ]; 25 + maintainers = with maintainers; [ theCapypara ]; 26 + platforms = platforms.all; 27 + }; 28 + phases = [ "unpackPhase" "installPhase" ]; 29 + installPhase = '' 30 + runHook preInstall 31 + cd $src/${subdir} 32 + install -dm755 "$out/share/hyphen" 33 + install -m644 "hyph_${dictFileName}.dic" "$out/share/hyphen" 34 + # docs 35 + install -dm755 "$out/share/doc/" 36 + install -m644 "README_hyph_${readmeFileName}.txt" "$out/share/doc/${pname}.txt" 37 + runHook postInstall 38 + ''; 39 + }; 40 + 41 + in 42 + rec { 43 + 44 + /* ENGLISH */ 45 + 46 + en_US = en-us; 47 + en-us = stdenv.mkDerivation rec { 48 + nativeBuildInputs = hyphen.nativeBuildInputs; 49 + version = hyphen.version; 50 + pname = "hyphen-dict-en-us"; 51 + src = hyphen.src; 52 + meta = { 53 + inherit (hyphen.meta) homepage platforms license maintainers; 54 + description = "Hyphen dictionary for English (United States)"; 55 + }; 56 + installPhase = '' 57 + runHook preInstall 58 + make install-hyphDATA 59 + runHook postInstall 60 + ''; 61 + }; 62 + 63 + /* GERMAN */ 64 + 65 + de_DE = de-de; 66 + de-de = mkDictFromLibreofficeGit { 67 + subdir = "de"; 68 + shortName = "de-de"; 69 + shortDescription = "German (Germany)"; 70 + dictFileName = "de_DE"; 71 + readmeFileName = "de"; 72 + }; 73 + 74 + de_AT = de-at; 75 + de-at = mkDictFromLibreofficeGit { 76 + subdir = "de"; 77 + shortName = "de-at"; 78 + shortDescription = "German (Austria)"; 79 + dictFileName = "de_AT"; 80 + readmeFileName = "de"; 81 + }; 82 + 83 + de_CH = de-ch; 84 + de-ch = mkDictFromLibreofficeGit { 85 + subdir = "de"; 86 + shortName = "de-ch"; 87 + shortDescription = "German (Switzerland)"; 88 + dictFileName = "de_CH"; 89 + readmeFileName = "de"; 90 + }; 91 + }
+2
pkgs/top-level/all-packages.nix
··· 8953 8953 8954 8954 hyphen = callPackage ../development/libraries/hyphen { }; 8955 8955 8956 + hyphenDicts = recurseIntoAttrs (callPackages ../development/libraries/hyphen/dictionaries.nix {}); 8957 + 8956 8958 i2c-tools = callPackage ../os-specific/linux/i2c-tools { }; 8957 8959 8958 8960 i2pd = callPackage ../tools/networking/i2pd { };