From c5dd5880edfebe8f7e3cc5b315a08b8e52e2857151e649c7958f3871b5b8bc1d Mon Sep 17 00:00:00 2001
From: OBS User buildservice-autocommit <null@suse.de>
Date: Mon, 28 Oct 2013 14:33:08 +0000
Subject: [PATCH 1/2] Updating link to change in
 Publishing:TeXLive/texlive-specs revision 81.0

OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-specs-a?expand=0&rev=0852ccee3d4cfeafe05528137bea9d63
---
 luaotfload_varfonts.dif | 68 +++++++++++++++++++++++++++++++++++++++++
 texlive-specs.tar.xz    |  4 +--
 2 files changed, 70 insertions(+), 2 deletions(-)
 create mode 100644 luaotfload_varfonts.dif

diff --git a/luaotfload_varfonts.dif b/luaotfload_varfonts.dif
new file mode 100644
index 0000000..a2a4fa4
--- /dev/null
+++ b/luaotfload_varfonts.dif
@@ -0,0 +1,68 @@
+--- texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-merged.lua
++++ texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-merged.lua	2013-10-28 13:58:12.000000000 +0000
+@@ -77,11 +77,34 @@ if not caches.namespace or caches.namesp
+ end
+ do
+   local cachepaths
++  local mktex=kpse.find_file('mktex.cnf','cnf') or ""
+   if kpse.expand_var('$TEXMFCACHE')~='$TEXMFCACHE' then
+     cachepaths=kpse.expand_var('$TEXMFCACHE')
+   elseif kpse.expand_var('$TEXMFVAR')~='$TEXMFVAR' then
+     cachepaths=kpse.expand_var('$TEXMFVAR')
+   end
++  if mktex~="" then
++    local varfonts="no"
++    local features=io.open(mktex,'r')
++    local cache
++    for line in features:lines() do
++      if string.find(line, 'MT_FEATURES=') then
++       if string.find(line, 'varfonts') then
++         varfonts="yes"
++        end
++        break
++      end
++    end
++    features:close()
++    cache=kpse.expand_var('$VARTEXFONTS')
++    if varfonts=="yes" and cache~="" then
++      if false == file.is_writable(cache) then
++        cachepaths=os.getenv("HOME") .. "/.cache/texmf/fonts"
++      else
++        cachepaths=cache
++      end
++    end
++  end
+   if not cachepaths then
+     cachepaths="."
+   end
+--- texmf-dist/tex/luatex/luaotfload/luaotfload-merged.lua
++++ texmf-dist/tex/luatex/luaotfload/luaotfload-merged.lua	2013-10-28 13:52:09.000000000 +0000
+@@ -3012,6 +3012,28 @@ if not caches.namespace or caches.namesp
+ end
+ do
+   local cachepaths=kpse.expand_var('$TEXMFCACHE') or ""
++  local mktex=kpse.find_file('mktex.cnf','cnf') or ""
++  if mktex~="" then
++    local varfonts="no"
++    local features=io.open(mktex,'r')
++    for line in features:lines() do
++      if string.find(line, 'MT_FEATURES=') then
++        if string.find(line, 'varfonts') then
++          varfonts="yes"
++        end
++        break
++      end
++    end
++    features:close()
++    cachepaths=kpse.expand_var('$VARTEXFONTS')
++    if varfonts=="yes" and cachepaths~="" then
++      if false == file.is_writable(cachepaths) then
++        cachepaths=os.getenv("HOME") .. "/.cache/texmf/fonts"
++      end
++    else
++      cachepaths=""
++    end
++  end
+   if cachepaths=="" then
+     cachepaths=kpse.expand_var('$TEXMFVAR') or ""
+   end
diff --git a/texlive-specs.tar.xz b/texlive-specs.tar.xz
index 1b5063c..2ff0044 100644
--- a/texlive-specs.tar.xz
+++ b/texlive-specs.tar.xz
@@ -1,3 +1,3 @@
 version https://git-lfs.github.com/spec/v1
-oid sha256:23678fa96f3db685248ada06a29c64604d842255e9033d64de596d0ac1f120db
-size 958304
+oid sha256:42eb662a1843518b092cbe74c332e7499317616a3b67435e4a5fe18ba0de38d8
+size 959372

From 35c5555aef34aea66e73de789b9295d43ddc3d276405a201a75b1c73095677f7 Mon Sep 17 00:00:00 2001
From: "Dr. Werner Fink" <werner@suse.com>
Date: Mon, 28 Oct 2013 14:37:25 +0000
Subject: [PATCH 2/2] .

OBS-URL: https://build.opensuse.org/package/show/Publishing:TeXLive/texlive-specs-a?expand=0&rev=39
---
 luaotfload_varfonts.dif | 68 -----------------------------------------
 texlive-specs-a.changes |  5 +++
 2 files changed, 5 insertions(+), 68 deletions(-)
 delete mode 100644 luaotfload_varfonts.dif

diff --git a/luaotfload_varfonts.dif b/luaotfload_varfonts.dif
deleted file mode 100644
index a2a4fa4..0000000
--- a/luaotfload_varfonts.dif
+++ /dev/null
@@ -1,68 +0,0 @@
---- texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-merged.lua
-+++ texmf-dist/tex/luatex/luaotfload/luaotfload-legacy-merged.lua	2013-10-28 13:58:12.000000000 +0000
-@@ -77,11 +77,34 @@ if not caches.namespace or caches.namesp
- end
- do
-   local cachepaths
-+  local mktex=kpse.find_file('mktex.cnf','cnf') or ""
-   if kpse.expand_var('$TEXMFCACHE')~='$TEXMFCACHE' then
-     cachepaths=kpse.expand_var('$TEXMFCACHE')
-   elseif kpse.expand_var('$TEXMFVAR')~='$TEXMFVAR' then
-     cachepaths=kpse.expand_var('$TEXMFVAR')
-   end
-+  if mktex~="" then
-+    local varfonts="no"
-+    local features=io.open(mktex,'r')
-+    local cache
-+    for line in features:lines() do
-+      if string.find(line, 'MT_FEATURES=') then
-+       if string.find(line, 'varfonts') then
-+         varfonts="yes"
-+        end
-+        break
-+      end
-+    end
-+    features:close()
-+    cache=kpse.expand_var('$VARTEXFONTS')
-+    if varfonts=="yes" and cache~="" then
-+      if false == file.is_writable(cache) then
-+        cachepaths=os.getenv("HOME") .. "/.cache/texmf/fonts"
-+      else
-+        cachepaths=cache
-+      end
-+    end
-+  end
-   if not cachepaths then
-     cachepaths="."
-   end
---- texmf-dist/tex/luatex/luaotfload/luaotfload-merged.lua
-+++ texmf-dist/tex/luatex/luaotfload/luaotfload-merged.lua	2013-10-28 13:52:09.000000000 +0000
-@@ -3012,6 +3012,28 @@ if not caches.namespace or caches.namesp
- end
- do
-   local cachepaths=kpse.expand_var('$TEXMFCACHE') or ""
-+  local mktex=kpse.find_file('mktex.cnf','cnf') or ""
-+  if mktex~="" then
-+    local varfonts="no"
-+    local features=io.open(mktex,'r')
-+    for line in features:lines() do
-+      if string.find(line, 'MT_FEATURES=') then
-+        if string.find(line, 'varfonts') then
-+          varfonts="yes"
-+        end
-+        break
-+      end
-+    end
-+    features:close()
-+    cachepaths=kpse.expand_var('$VARTEXFONTS')
-+    if varfonts=="yes" and cachepaths~="" then
-+      if false == file.is_writable(cachepaths) then
-+        cachepaths=os.getenv("HOME") .. "/.cache/texmf/fonts"
-+      end
-+    else
-+      cachepaths=""
-+    end
-+  end
-   if cachepaths=="" then
-     cachepaths=kpse.expand_var('$TEXMFVAR') or ""
-   end
diff --git a/texlive-specs-a.changes b/texlive-specs-a.changes
index 5970c02..2e6e19d 100644
--- a/texlive-specs-a.changes
+++ b/texlive-specs-a.changes
@@ -1,3 +1,8 @@
+-------------------------------------------------------------------
+Mon Oct 28 14:07:37 UTC 2013 - werner@suse.de
+
+- Make Lua(La)TeX knowing about varfonts from mktex.cnf (bnc#847102) 
+
 -------------------------------------------------------------------
 Wed Sep 25 09:00:27 UTC 2013 - werner@suse.de