How to get Emacs to compile with harfbuzz support?

Emacs recently landed support for harfbuzz, which I’d like to use. I thought adding it to buildInputs would do the trick, but I still get Does Emacs use HarfBuzz? no while compiling. I’ve tried nativeBuildInputs as well. What am I missing?

This is the overlay I’ve been using:

self: super:

  emacs = self.emacs27;

  emacs27 = with self; stdenv.lib.overrideDerivation
    (self.emacs26.override { srcRepo = true; }) (attrs: rec {
      name = "emacs-${version}${versionModifier}";
      version = "27.0";
      versionModifier = ".50";
      src = fetchGit {
        url = "git://";
        rev = "da6deda8d41c0a7ce4ddcc4b3569c7aa295238df";
      buildInputs = super.emacs.buildInputs ++ [ super.jansson super.harfbuzz ];
      patches = [
      postInstall = super.emacs.postInstall + ''
        for srcdir in src lisp lwlib ; do
          mkdir -p $dstdir
          find $srcdir -name "*.[chm]" -exec cp {} $dstdir \;
          cp $srcdir/TAGS $dstdir
          echo '((nil . ((tags-file-name . "TAGS"))))' > $dstdir/.dir-locals.el

Looking at the source code, you wiil probably also need freetype:

Thanks. I tweaked the overlay above to have super.freetype in buildInputs, but Emacs still doesn’t compile with harfbuzz support.

It seems like it can’t find harfbuzz: checking for harfbuzz >= 0.9.42... no

Solved it. I needed to use instead of just harfbuzz.