From 7e298ddcd9facad3ab643f8cd27fe5559a1ad9e5 Mon Sep 17 00:00:00 2001
From: Mike Sperber <sperber@deinprogramm.de>
Date: Fri, 3 Jan 2020 11:11:02 +0100
Subject: [PATCH 1/3] texlive: make updmap actually regenerate (#76826)

The --syncwithtrees flag only updates the config files, so run it
again without --syncwithtrees to generate the actual map files.
---
 pkgs/tools/typesetting/tex/texlive/combine.nix | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/pkgs/tools/typesetting/tex/texlive/combine.nix b/pkgs/tools/typesetting/tex/texlive/combine.nix
index 6622a03decc5..ab40cdb86d09 100644
--- a/pkgs/tools/typesetting/tex/texlive/combine.nix
+++ b/pkgs/tools/typesetting/tex/texlive/combine.nix
@@ -214,7 +214,11 @@ in buildEnv {
     texlinks.sh "$out/bin" && wrapBin
     (perl `type -P fmtutil.pl` --sys --all || true) | grep '^fmtutil' # too verbose
     #texlinks.sh "$out/bin" && wrapBin # do we need to regenerate format links?
+    # Note that --syncwithtrees *only* removes the missing files from the configuration,
+    # but does not generate map files.
     echo y | perl `type -P updmap.pl` --sys --syncwithtrees --force
+    # This does generate the map files.
+    perl `type -P updmap.pl` --sys --force
     perl `type -P mktexlsr.pl` ./share/texmf-* # to make sure
   '' +
     # install (wrappers for) scripts, based on a list from upstream texlive

From f9d18e5ddc7d37787feb52226d56e60f66a3a48b Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Tue, 7 Jan 2020 11:00:36 -0500
Subject: [PATCH 2/3] ! fixup

---
 pkgs/tools/typesetting/tex/texlive/combine.nix | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/pkgs/tools/typesetting/tex/texlive/combine.nix b/pkgs/tools/typesetting/tex/texlive/combine.nix
index ab40cdb86d09..42003cf55f3d 100644
--- a/pkgs/tools/typesetting/tex/texlive/combine.nix
+++ b/pkgs/tools/typesetting/tex/texlive/combine.nix
@@ -128,8 +128,6 @@ in buildEnv {
       mkdir $out/share/texmf-local
     )
   '' +
-    # updmap.cfg seems like not needing changes
-
     # now filter hyphenation patterns, in a hacky way ATM
   (let
     pnames = uniqueStrings (map (p: p.pname) pkgList.splitBin.wrong);
@@ -214,10 +212,9 @@ in buildEnv {
     texlinks.sh "$out/bin" && wrapBin
     (perl `type -P fmtutil.pl` --sys --all || true) | grep '^fmtutil' # too verbose
     #texlinks.sh "$out/bin" && wrapBin # do we need to regenerate format links?
-    # Note that --syncwithtrees *only* removes the missing files from the configuration,
-    # but does not generate map files.
+    # Disable unavailable map files
     echo y | perl `type -P updmap.pl` --sys --syncwithtrees --force
-    # This does generate the map files.
+    # Regenerate the map files (this is optional)
     perl `type -P updmap.pl` --sys --force
     perl `type -P mktexlsr.pl` ./share/texmf-* # to make sure
   '' +

From 00b7680f28eeb335873303c4b745810da733aa95 Mon Sep 17 00:00:00 2001
From: Dmitry Kalinkin <dmitry.kalinkin@gmail.com>
Date: Tue, 7 Jan 2020 11:08:13 -0500
Subject: [PATCH 3/3] ! fixup

---
 pkgs/tools/typesetting/tex/texlive/combine.nix | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pkgs/tools/typesetting/tex/texlive/combine.nix b/pkgs/tools/typesetting/tex/texlive/combine.nix
index 42003cf55f3d..a4b0fb99f3e9 100644
--- a/pkgs/tools/typesetting/tex/texlive/combine.nix
+++ b/pkgs/tools/typesetting/tex/texlive/combine.nix
@@ -212,10 +212,12 @@ in buildEnv {
     texlinks.sh "$out/bin" && wrapBin
     (perl `type -P fmtutil.pl` --sys --all || true) | grep '^fmtutil' # too verbose
     #texlinks.sh "$out/bin" && wrapBin # do we need to regenerate format links?
+
     # Disable unavailable map files
     echo y | perl `type -P updmap.pl` --sys --syncwithtrees --force
     # Regenerate the map files (this is optional)
     perl `type -P updmap.pl` --sys --force
+
     perl `type -P mktexlsr.pl` ./share/texmf-* # to make sure
   '' +
     # install (wrappers for) scripts, based on a list from upstream texlive