lol
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

hunspell: refactor, to by-name and add withDicts helper (#397817)

authored by

Gaétan Lepage and committed by
GitHub
35577069 1bfc985e

+49 -48
+8 -7
pkgs/by-name/hu/hunspell/package.nix
··· 58 58 hardeningDisable = [ "format" ]; 59 59 60 60 passthru = { 61 + withDicts = callPackage ./wrapper.nix { hunspell = finalAttrs.finalPackage; }; 61 62 tests = { 62 63 pkg-config = testers.hasPkgConfigModules { package = finalAttrs.finalPackage; }; 63 64 version = testers.testVersion { package = finalAttrs.finalPackage; }; 64 - wrapper = callPackage ./wrapper.nix { 65 - hunspell = finalAttrs.finalPackage; 66 - dicts = [ hunspellDicts.en_US ]; 67 - }; 65 + wrapper = finalAttrs.finalPackage.withDicts (d: [ d.en_US ]); 68 66 }; 69 67 70 68 updateScript = nix-update-script { }; ··· 95 93 homepage = "http://hunspell.github.io/"; 96 94 changelog = "https://github.com/hunspell/hunspell/releases/tag/${finalAttrs.src.rev}"; 97 95 license = with lib.licenses; [ 98 - gpl2 99 - lgpl21 96 + gpl2Plus 97 + lgpl21Plus 100 98 mpl11 101 99 ]; 102 - maintainers = with lib.maintainers; [ getchoo ]; 100 + maintainers = with lib.maintainers; [ 101 + getchoo 102 + RossSmyth 103 + ]; 103 104 mainProgram = "hunspell"; 104 105 platforms = lib.platforms.all; 105 106 pkgConfigModules = [ "hunspell" ];
+31 -25
pkgs/by-name/hu/hunspell/wrapper.nix
··· 1 1 { 2 - stdenv, 3 2 lib, 3 + buildEnv, 4 4 hunspell, 5 + hunspellDicts, 5 6 makeBinaryWrapper, 6 - dicts ? [ ], 7 7 }: 8 - let 9 - searchPath = lib.makeSearchPath "share/hunspell" dicts; 10 - in 11 - stdenv.mkDerivation { 12 - inherit (lib.appendToName "with-dicts" hunspell) name; 13 8 14 - nativeBuildInputs = [ makeBinaryWrapper ]; 9 + lib.makeOverridable ( 10 + { ... }@dicts: 11 + f: 12 + buildEnv { 13 + inherit (lib.appendToName "with-dicts" hunspell) name; 15 14 16 - buildCommand = '' 17 - makeWrapper ${lib.getExe hunspell} $out/bin/hunspell \ 18 - --prefix DICPATH : ${lib.escapeShellArg searchPath} 19 - ''; 15 + paths = f dicts; 20 16 21 - meta = { 22 - inherit (hunspell.meta) 23 - description 24 - longDescription 25 - homepage 26 - changelog 27 - license 28 - maintainers 29 - mainProgram 30 - platforms 31 - ; 32 - }; 33 - } 17 + pathsToLink = [ "/share/hunspell" ]; 18 + 19 + nativeBuildInputs = [ makeBinaryWrapper ]; 20 + 21 + postBuild = '' 22 + makeWrapper ${lib.getExe hunspell} $out/bin/hunspell \ 23 + --prefix DICPATH : $out/share/hunspell 24 + ''; 25 + 26 + meta = { 27 + inherit (hunspell.meta) 28 + description 29 + longDescription 30 + homepage 31 + changelog 32 + license 33 + maintainers 34 + mainProgram 35 + platforms 36 + ; 37 + }; 38 + } 39 + ) hunspellDicts
+3 -11
pkgs/by-name/on/onboard/package.nix
··· 15 15 gtk3, 16 16 hunspell, 17 17 hunspellDicts, 18 - hunspellWithDicts, 19 18 intltool, 20 19 isocodes, 21 20 libappindicator-gtk3, ··· 33 32 34 33 let 35 34 36 - customHunspell = hunspellWithDicts [ 37 - hunspellDicts.en-us 38 - ]; 35 + customHunspell = hunspell.withDicts (di: [ di.en-us ]); 39 36 40 37 majorVersion = "1.4"; 41 38 42 39 in 43 - 44 40 python3.pkgs.buildPythonApplication rec { 45 41 pname = "onboard"; 46 42 version = "${majorVersion}.1"; ··· 51 47 }; 52 48 53 49 patches = [ 54 - (replaceVars ./fix-paths.patch { 55 - inherit mousetweaks; 56 - }) 50 + (replaceVars ./fix-paths.patch { inherit mousetweaks; }) 57 51 # Allow loading hunspell dictionaries installed in NixOS system path 58 52 ./hunspell-use-xdg-datadirs.patch 59 53 ··· 110 104 systemd 111 105 ]; 112 106 113 - propagatedUserEnvPkgs = [ 114 - dconf 115 - ]; 107 + propagatedUserEnvPkgs = [ dconf ]; 116 108 117 109 nativeCheckInputs = [ 118 110 # for Onboard.SpellChecker.aspell_cmd doctests
pkgs/development/libraries/hunspell/dictionaries-chromium.nix pkgs/by-name/hu/hunspell/dictionaries-chromium.nix
pkgs/development/libraries/hunspell/dictionaries.nix pkgs/by-name/hu/hunspell/dictionaries.nix
pkgs/development/libraries/hunspell/update-chromium-dictionaries.py pkgs/by-name/hu/hunspell/update-chromium-dictionaries.py
+7 -5
pkgs/top-level/all-packages.nix
··· 8385 8385 8386 8386 hspellDicts = callPackage ../development/libraries/hspell/dicts.nix { }; 8387 8387 8388 - hunspellDicts = recurseIntoAttrs ( 8389 - callPackages ../development/libraries/hunspell/dictionaries.nix { } 8390 - ); 8388 + hunspellDicts = recurseIntoAttrs (callPackages ../by-name/hu/hunspell/dictionaries.nix { }); 8391 8389 8392 8390 hunspellDictsChromium = recurseIntoAttrs ( 8393 - callPackages ../development/libraries/hunspell/dictionaries-chromium.nix { } 8391 + callPackages ../by-name/hu/hunspell/dictionaries-chromium.nix { } 8394 8392 ); 8395 8393 8396 - hunspellWithDicts = dicts: callPackage ../by-name/hu/hunspell/wrapper.nix { inherit dicts; }; 8394 + hunspellWithDicts = 8395 + dicts: 8396 + lib.warn "hunspellWithDicts is deprecated, please use hunspell.withDicts instead." 8397 + hunspell.withDicts 8398 + (_: dicts); 8397 8399 8398 8400 hydra = callPackage ../by-name/hy/hydra/package.nix { nix = nixVersions.nix_2_29; }; 8399 8401