Fix regression in cmap that breaks sphinx builds
---
 texmf-dist/tex/latex/cmap/cmap.sty |   15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

--- a/texmf-dist/tex/latex/cmap/cmap.sty
+++ b/texmf-dist/tex/latex/cmap/cmap.sty
@@ -11,7 +11,7 @@
 %   Werner Lemberg
 %   Oleg Katsitadze
 
-\ProvidesPackage{cmap}[2021/01/29 v1.0i CMap support: searchable PDF]
+\ProvidesPackage{cmap}[2021/02/04 v1.0j CMap support: searchable PDF]
 
 \DeclareOption{resetfonts}{%
   \@for\reserved@a:=%
@@ -45,6 +45,17 @@
 %\PackageWarningNoLine{cmap}{babel already loaded - some fonts may be unprocessed}%
 %}\relax
 
+\@ifundefined{pdfnobuiltintounicode}{%
+  \@ifundefined{pdfgentounicode}\relax{
+    \pdfgentounicode=0
+  }%
+  \protected\def\cmap@nobuiltintounicode{%
+    \expandafter\@gobble\the
+  }%
+}{%
+  \let\cmap@nobuiltintounicode\pdfnobuiltintounicode
+}
+
 \def\extract@font{%
   \get@external@font
   \global\expandafter\font\font@name\external@font\relax
@@ -62,7 +73,7 @@
       %attr {/Type /CIDFile}
       file {\reserved@f}%
     \expandafter\xdef\csname cmap@set@\cmap@f@encoding\endcsname{%
-      \pdfnobuiltintounicode\noexpand\font@name
+      \cmap@nobuiltintounicode\noexpand\font@name
       \noexpand\expandafter\pdffontattr\noexpand\font@name{/ToUnicode \the\pdflastobj\space 0 R}}%
   }{%
     \global\expandafter\let\csname cmap@set@\cmap@f@encoding\endcsname\empty
