Menu

#278 Unable to build pdf from source

en-1.8
WontFix
nobody
None
High
Defect
2021-08-26
2018-05-03
Thomas Due
No

I have next to no experience with Unix systems, so I found and followed this guide to getting the book to build on my Windows 10 system:
https://www.red-bean.com/pipermail/svnbook-dev/2017-August/016695.html

This works fine for HTML, but I want a PDF. And here it fails with this:

make all
xmllint --noout --valid book/book.xml
if ! test -e "../tools/xsl"; then ../tools/bin/find-xsl.py; fi
xsltproc --param fop1.extensions 1 --output book/svn-book.fo \ [ -d stylesheets ] && echo stylesheets || echo ../tools/fo-stylesheet.xsl book/book.xml
Making portrait pages on USletter paper (8.5inx11in)
../tools/bin/run-fop.sh -fo book/svn-book.fo -pdf book/svn-book.pdf
: not foundn/run-fop.sh: 2: ../tools/bin/run-fop.sh:
: not foundn/run-fop.sh: 9: ../tools/bin/run-fop.sh:
../tools/bin/run-fop.sh: 35: ../tools/bin/run-fop.sh: Syntax error: word unexpected (expecting "do")
../tools/Makefile.base-rules:69: recipe for target 'book/svn-book.pdf' failed
make: *** [book/svn-book.pdf] Error 2

I am guessing I am missing something on my Linux sub-system, but what?

Discussion

  • Daniel Sahlberg

    Daniel Sahlberg - 2021-08-25

    I believe this error might come from the fact that the working copy, as configured in the linked e-mail, is checked out using Windows line-endings (\r\n). However the script is executed by bash in WSL, expecting Linux line-endings (\n).

    I was able to make it work by converting the line endings in run-fop.sh from "Windows (CRLF)" to "Unix (LF)" in Notepad++. It should be possible to make this conversion automatic by changing the svn:eol-style property but that might break things for anyone expecting to have CRLF line endings in a Windows working copy.

    I had to install a few additional tools (apt install fop libxml2-utils) but I have now built both epub and pdf versions (changing the make target from all-html to epub or pdf).

     
    • C. Michael Pilato

      I agree that line endings are the likely problem. I suspect that the average non-SVN-dev building the book from source are a rarity (sorry Thomas -- it just means you're special!). For such, the workaround you've suggested should be sufficient. I don't see a reason to change the svn:eol-style property to accommodate this scenario, especially when one can also choose to use svn export --native-eol=LF on such systems to get the book sources (albeit not in a working copy) into the necessary line-ending format without additional tooling/scripting required.

       
  • Daniel Shahaf

    Daniel Shahaf - 2021-08-25

    Let's continue this discussion on the list? These tickets don't get Cc'd to it, AFAIK.

     
    • C. Michael Pilato

      I've tweaked the configuration to hopefully do said notification to svnbook-dev@.

       
  • C. Michael Pilato

    • status: New --> WontFix
     

Log in to post a comment.