Kaynağa Gözat

build: try to build PDF (4th try)

Xℹ Ruoyao 4 yıl önce
ebeveyn
işleme
049178352a
2 değiştirilmiş dosya ile 17 ekleme ve 8 silme
  1. 9 1
      Makefile
  2. 8 7
      zh_CN/fix.sh

+ 9 - 1
Makefile

@@ -44,7 +44,10 @@ pdf: booksrc
 	pushd $(MLANG)/book; sh ../fetch_fonts.sh; popd
 	make -C $(MLANG)/book REV=$(REV) BASEDIR=pdf pdf
 
-booksrc: $(MBOOK_FILES) $(PATCHES) $(MLANG)/book/general.ent.orig
+ORIG_FILES = $(MLANG)/book/general.ent.orig \
+			 $(MLANG)/book/Makefile.orig
+
+booksrc: $(MBOOK_FILES) $(PATCHES) $(ORIG_FILES)
 	[ ! -e $(MLANG)/fix.sh ] || (pushd $(MLANG)/book; sh ../fix.sh; popd)
 
 $(MLANG)/book/%.xml: $(LFS_EN)/%.xml $(MLANG)/%.po
@@ -59,3 +62,8 @@ $(MLANG)/book/%: $(LFS_EN)/%
 $(MLANG)/book/general.ent.orig: $(LFS_EN)/general.ent
 	mkdir -pv "$(@D)"
 	cp -v $< $@
+
+$(MLANG)/book/Makefile.orig: $(LFS_EN)/Makefile
+	mkdir -pv "$(@D)"
+	cp -v $< $@
+

+ 8 - 7
zh_CN/fix.sh

@@ -9,9 +9,6 @@ sed -e '/encoding=/s|ISO-8859-1|UTF-8|' -i $(find -name \*.xml)
 # Let tidy output UTF-8
 sed -e '/output-encoding:/s|latin1|utf8|' -i tidy.conf
 
-# Remove two seds causing encoding error in UTF-8
-sed -e '/xa9/d' -i Makefile
-
 sed -e 's|<book>|<book lang="zh_cn">|' -i index.xml
 
 sed -e '/xreflabel/s|Chapter.nbsp.1 - Mailing Lists|第 1 章 - 邮件列表|' \
@@ -106,9 +103,13 @@ grep zh_CN-fonts stylesheets/lfs-xsl/pdf.xsl ||
 	sed '/<\/xsl:stylesheet>/i <xsl:include href="pdf/zh_CN-fonts.xsl"/>' \
 	    -i stylesheets/lfs-xsl/pdf.xsl
 
+# Edit Makefile
+cp -v Makefile.orig Makefile
+
+# Remove two seds causing encoding error in UTF-8
+sed -e '/xa9/d' -i Makefile
+
 # Copy fonts to tmp dir, and let fop to use our custom config
-grep '\-c fop.xml' Makefile ||
-	sed 's|fop -q|& -c ../fop.xml|' -i Makefile
+sed '/fop -q/i \\tmkdir -pv $(RENDERTMP)/fonts; cp -v fonts/* $(RENDERTMP)/fonts' -i Makefile
 
-grep 'RENDERTMP)/fonts' Makefile ||
-	sed '/fop -q/i \\tmkdir -pv $(RENDERTMP)/fonts; cp -v fonts/* $(RENDERTMP)/fonts' -i Makefile
+sed 's|fop -q|& -c ../fop.xml|' -i Makefile