[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#917458: [debian-refcard] get rid of xmlroff dependency (also disables Arabic, Hebrew and Malayalam translations)



Package: refcard
Tags: patch


Since xmlroff is kind of orphaned, it would probably be future-proof to get rid
of the Build-depends: xmlroff (also in the light of this RC bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=892348 )

However I did not manage to switch Arabic, Hebrew and Malayalam to dblatex, so
skipping xmlroff also means skipping those translations from the build as well,
unfortunately ... 
ml was already disabled, so we loose ar and he now, at least ATM.


Patch attached. 
Also the attached empty.pdf needs to be added to the repo.



Holger




-- 
Holger Wansing <hwansing@mailbox.org>
PGP-Finterprint: 496A C6E8 1442 4B34 8508  3529 59F1 87CA 156E B076

Attachment: empty.pdf
Description: Adobe PDF document

diff --git a/Makefile b/Makefile
index 8d45cd6..907234c 100644
--- a/Makefile
+++ b/Makefile
@@ -2,13 +2,12 @@
 # See COPYING for the license status of this software.
 
 # You need to install the build dependencies ('apt-get build-dep refcard'):
-# docbook-xsl texlive-extra-utils pdftk po4a xmlroff dblatex poppler-utils xsltproc
+# docbook-xsl texlive-extra-utils pdftk po4a dblatex poppler-utils xsltproc
 
 # The "--keep 0" can be removed when the translations are ready
 TRANSLATE=po4a-translate --format docbook --keep 0
 UPDATEPO=po4a-updatepo --format docbook
 XP=xsltproc --nonet --novalid
-XMLROFF=xmlroff --backend cairo --continue
 DIA=dia
 
 PDFJOIN=pdfjoin --vanilla
@@ -21,28 +20,17 @@ PDFNUP=pdfnup --vanilla
 #    ad=
 #endif
 
-# space separated list of languages to ignore
-DISABLE=ml
+# space separated list of languages to ignore.
+# disable RTL languages, currently unable to built them with dblatex
+DISABLE=ar he ml
 PO_FILES=$(sort $(filter-out $(patsubst %,po4a/%.po,$(DISABLE)), $(wildcard po4a/*.po)))
 # international standard format
 A4_LANGS=en $(patsubst po4a/%.po,%,$(PO_FILES))
 # non-standard format for north america
 LT_LANGS=en es fr
 
-# Because of current limitations of xmlroff in respect to layout, we
-# can also use dblatex. Some languages don't work well:
-# See #492365 (he), #492366 (el), #492350 (ja), # #482857 (zh_CN)
-XMLROFF_LANGS=$(A4_LANGS)
+# dblatex to be used by default.
 DBLATEX=dblatex --backend=xetex --texstyle=refcard.sty --xsl-user=dblatex.xsl
-ifdef USE_DBLATEX
-    ifeq ($(USE_DBLATEX),2)
-	XMLROFF_LANGS=
-    else
-	XMLROFF_LANGS=ar he ml
-    endif
-else
-    XMLROFF_LANGS=$(A4_LANGS)
-endif
 
 ENTRIES=$(patsubst %,entries-%.dbk,$(A4_LANGS))
 
@@ -62,16 +50,9 @@ refcard-%-lt.fo: refcard-%.dbk fo.xsl
 # the .fo is not used for dblatex, but I don't care
 refcard-%.s.pdf: refcard-%.fo dblatex.xsl refcard.sty
 	L=$$(echo $@ | sed 's/.*-\(.*\)-.*/\1/'); \
-	USE_XR=$$(echo " $(XMLROFF_LANGS) " | grep " $$L "); \
-	if [ -n "$$USE_XR" ]; then \
-	    $(XMLROFF) -o $@ $<; \
-	else \
-	    if [ -n "$$USE_DBLATEX" ]; then \
 		SRC=$$(echo $<|sed 's/-\(a4\|lt\).fo/.dbk/'); \
 		FMT=$$(echo $<|sed 's/.*-\(a4\|lt\).fo/\1/'); \
-		$(DBLATEX) --output=$@ --param=format=$$FMT $$SRC; \
-	    fi; \
-	fi
+		$(DBLATEX) --output=$@ --param=format=$$FMT $$SRC
 
 refcard-%-a4.t.pdf: refcard-%-a4.s.pdf empty.pdf
 	$(PDFJOIN) --fitpaper true --outfile $<.x.pdf $< empty.pdf empty.pdf
@@ -102,13 +83,6 @@ tidypo:
 	    msgcat $$po > $$po.tmp && mv $$po.tmp $$po; \
 	done
 
-# make sure, we have always at least six pages for pdfnup
-empty.fo: empty.dbk fo.xsl
-	$(XP) fo.xsl $< > $@
-
-empty.pdf: empty.fo
-	$(XMLROFF) -o $@ $<
-
 .PHONY: all clean count mrproper
 
 entries-en.dbk: entries.dbk
@@ -169,8 +143,7 @@ count:
 
 clean:
 	-rm -f *~ refcard-*.dbk refcard-*.fo refcard-*.[st].pdf \
-	    $(ENTRIES) statistics.xml statistics.txt messages.mo \
-	    empty.fo empty.pdf
+	    $(ENTRIES) statistics.xml statistics.txt messages.mo
 
 mrproper: clean
 	-rm -f index.html refcard.png $(PDFS) entries-*.dbk
diff --git a/debian/control b/debian/control
index 2531b66..55617b7 100644
--- a/debian/control
+++ b/debian/control
@@ -33,7 +33,6 @@ Build-Depends: dblatex,
                texlive-lang-portuguese,
                texlive-lang-spanish,
                texlive-xetex,
-               xmlroff,
                xsltproc
 Vcs-Git: https://salsa.debian.org/ddp-team/refcard.git
 Vcs-Browser: https://salsa.debian.org/ddp-team/refcard
diff --git a/debian/rules b/debian/rules
index 17b082e..a844ae8 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,7 +1,5 @@
 #!/usr/bin/make -f
 
-export USE_DBLATEX=1
-
 %:
 	dh $@
 
diff --git a/metadata.xsl b/metadata.xsl
index 0fa3c2e..5d1b1e5 100644
--- a/metadata.xsl
+++ b/metadata.xsl
@@ -60,7 +60,7 @@ InfoKey: Creator
 InfoValue: docbook-xsl, xsltproc
 InfoBegin
 InfoKey: Producer
-InfoValue: DBLaTeX|xmlroff
+InfoValue: DBLaTeX
 </xsl:text>
   </xsl:template>
 
diff --git a/refcard.dbk b/refcard.dbk
index eabb26d..6f094b4 100644
--- a/refcard.dbk
+++ b/refcard.dbk
@@ -65,7 +65,9 @@
 	<revnumber>10.0 - Debian 10 'Buster' -- </revnumber>
 	<date>2018-12-25</date>
 	<revremark>Update refcard for Buster; source repository moved
-	from svn (Alioth) to git (Salsa); updated translations.</revremark>
+	from svn (Alioth) to git (Salsa); remove dependency to xmlroff
+	(sadly ar, he and ml cannot be built now anymore);
+	updated translations.</revremark>
       </revision>
       <revision>
 	<revnumber>9.0 - Debian 9 'Stretch' -- </revnumber>
@@ -301,22 +303,6 @@
 	</thead>
 	<tbody>
 	  <row valign="top">
-	    <entry>Arabic (ar)</entry>
-	    <entry><ulink url="refcard-ar-a4.pdf">A4</ulink></entry>
-	    <entry><xi:include href="entries-ar.dbk"
-	    xmlns:xi="http://www.w3.org/2003/XInclude";
-	    xpointer="xpointer(/article/title/child::text()[1])"/> -
-	    <xi:include href="entries-ar.dbk"
-	    xmlns:xi="http://www.w3.org/2003/XInclude";
-	    xpointer="xpointer(/article/subtitle/child::text()[1])"/></entry>
-	    <entry><xi:include href="statistics.xml"
-	    xmlns:xi="http://www.w3.org/2003/XInclude";
-	    xpointer="xpointer(/statistics/t[@l='ar']/child::text()[1])"/></entry>
-	    <entry><xi:include href="statistics.xml"
-	    xmlns:xi="http://www.w3.org/2003/XInclude";
-	    xpointer="xpointer(/statistics/s[@l='ar']/child::text()[1])"/></entry>
-	  </row>
-	  <row valign="top">
 	    <entry>Bulgarian (bg)</entry>
 	    <entry><ulink url="refcard-bg-a4.pdf">A4</ulink></entry>
 	    <entry><xi:include href="entries-bg.dbk"
@@ -508,23 +494,6 @@
 	    xpointer="xpointer(/statistics/s[@l='gl']/child::text()[1])"/></entry>
 	  </row>
 	  <row valign="top">
-	    <entry>Hebrew (he)</entry>
-	    <entry><ulink
-	    url="refcard-he-a4.pdf">A4</ulink></entry>
-	    <entry><xi:include href="entries-he.dbk"
-	    xmlns:xi="http://www.w3.org/2003/XInclude";
-	    xpointer="xpointer(/article/title/child::text()[1])"/> -
-	    <xi:include href="entries-he.dbk"
-	    xmlns:xi="http://www.w3.org/2003/XInclude";
-	    xpointer="xpointer(/article/subtitle/child::text()[1])"/></entry>
-	    <entry><xi:include href="statistics.xml"
-	    xmlns:xi="http://www.w3.org/2003/XInclude";
-	    xpointer="xpointer(/statistics/t[@l='he']/child::text()[1])"/></entry>
-	    <entry><xi:include href="statistics.xml"
-	    xmlns:xi="http://www.w3.org/2003/XInclude";
-	    xpointer="xpointer(/statistics/s[@l='he']/child::text()[1])"/></entry>
-	  </row>
-	  <row valign="top">
 	    <entry>Hindi (hi)</entry>
 	    <entry><ulink
 	    url="refcard-hi-a4.pdf">A4</ulink></entry>
@@ -917,7 +886,6 @@
     <literal>texlive-extra-utils</literal>,
     <literal>pdftk</literal>,
     <literal>po4a</literal>,
-    <literal>xmlroff</literal>,
     <literal>dblatex</literal>,
     <literal>poppler-utils</literal>, and
     <literal>xsltproc</literal>.</para>

Reply to: