{ stdenv, hspell }:

let
  dict = variant: a: stdenv.mkDerivation ({
    inherit (hspell) src patchPhase nativeBuildInputs;
    meta = hspell.meta // {
      broken = true;
      description = "${variant} Hebrew dictionary";
    } // (if a ? meta then a.meta else {});
  } // (removeAttrs a ["meta"]));
in
{
  recurseForDerivations = true;

  aspell = dict "aspell" {
    name = "aspell-dict-he-${hspell.version}";

    installPhase = ''
      mkdir -p $out/lib/aspell
      cp -v he_affix.dat he.wl $out/lib/aspell'';
  };

  myspell = dict "myspell" {
    name = "myspell-dict-he-${hspell.version}";

    installPhase = ''
      mkdir -p $out/lib/myspell
      cp -v he.dic he.aff $out/lib/myspell'';
  };

  hunspell = dict "hunspell" {
    name = "hunspell-dict-he-${hspell.version}";

    installPhase = ''
      mkdir -p $out/lib
      cp -rv hunspell $out/lib'';
  };
}

{ stdenv, hspell }:

let
  dict = variant: a: stdenv.mkDerivation ({
    inherit (hspell) src patchPhase nativeBuildInputs;
    meta = hspell.meta // {
      broken = true;
      description = "${variant} Hebrew dictionary";

      buildFlags = [ variant ];

    } // (if a ? meta then a.meta else {});
  } // (removeAttrs a ["meta"]));
in
{
  recurseForDerivations = true;

  aspell = dict "aspell" {
    name = "aspell-dict-he-${hspell.version}";

    installPhase = ''
      mkdir -p $out/lib/aspell
      cp -v he_affix.dat he.wl $out/lib/aspell'';
  };

  myspell = dict "myspell" {
    name = "myspell-dict-he-${hspell.version}";

    installPhase = ''
      mkdir -p $out/lib/myspell
      cp -v he.dic he.aff $out/lib/myspell'';
  };

  hunspell = dict "hunspell" {
    name = "hunspell-dict-he-${hspell.version}";

    installPhase = ''
      mkdir -p $out/lib
      cp -rv hunspell $out/lib'';
  };
}

Revert "hspellDicts.*: remove invalid buildFlags meta attr"
Revert "hspellDicts.*: remove invalid buildFlags meta attr"

This reverts commit 7084c052a0f12af6271290a9e71d463bf1c834e7.
