shlomif / fortune-mod

Implementation of the Unix fortune command for displaying a random quotation, for Linux and other systems.
http://www.shlomifish.org/open-source/projects/fortune-mod/
Other
430 stars 60 forks source link

How to build document at native. #45

Closed Vonfry closed 3 years ago

Vonfry commented 4 years ago

I try to build fortune-mod from github source(rev: fortune-mod-3.2.0). I meet problem when building the document. I have installed perl packages from cpan.

I cannot find fortune_with_offensive.template.man and fortune_without_offensive.template.man under the directory and the cmake file seems to use them with process-fortune-man-template.pl.

part log ``` Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/fortune/fortune_without_offensive.docbook5.xml] Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/fortune/fortune_with_offensive.docbook5.xml] I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl <> failed. at /nix/store/6g1niqgs85p4m4awddddxrl0hvfdrpn9-perl5.32.0-App-XML-DocBook-Builder-0.1002/lib/perl5/site_perl/5.32.0/App/XML/DocBook/Docmake.pm line 175. Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/strfile.docbook5.xml] failed! at /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/FortuneMod/ManPage/Generate/App.pm line 18. make[2]: *** [CMakeFiles/generate_man_page.dir/build.make:107: ../util/strfile.man] Error 2 make[2]: *** Waiting for unfinished jobs.... I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl <> failed. at /nix/store/6g1niqgs85p4m4awddddxrl0hvfdrpn9-perl5.32.0-App-XML-DocBook-Builder-0.1002/lib/perl5/site_perl/5.32.0/App/XML/DocBook/Docmake.pm line 175. Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/randstr.docbook5.xml] failed! at /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/FortuneMod/ManPage/Generate/App.pm line 18. make[2]: *** [CMakeFiles/generate_man_page.dir/build.make:111: ../util/randstr.man] Error 2 [ 7%] Linking C executable strfile [ 7%] Built target randstr [ 7%] Built target unstr I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl <> failed. at /nix/store/6g1niqgs85p4m4awddddxrl0hvfdrpn9-perl5.32.0-App-XML-DocBook-Builder-0.1002/lib/perl5/site_perl/5.32.0/App/XML/DocBook/Docmake.pm line 175. Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/fortune/fortune_without_offensive.docbook5.xml] failed! at /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/FortuneMod/ManPage/Generate/App.pm line 18. make[2]: *** [CMakeFiles/generate_man_page.dir/build.make:103: ../fortune/fortune_without_offensive.template.man] Error 2 I/O error : Attempt to load network entity http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl warning: failed to load external entity "http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl" cannot parse http://docbook.sourceforge.net/release/xsl/current/manpages/docbook.xsl <> failed. at /nix/store/6g1niqgs85p4m4awddddxrl0hvfdrpn9-perl5.32.0-App-XML-DocBook-Builder-0.1002/lib/perl5/site_perl/5.32.0/App/XML/DocBook/Docmake.pm line 175. Running [docmake manpages /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/fortune/fortune_with_offensive.docbook5.xml] failed! at /tmp/nix-build-fortune-mod-3.2.0.drv-1/source/fortune-mod/util/FortuneMod/ManPage/Generate/App.pm line 18. make[2]: *** [CMakeFiles/generate_man_page.dir/build.make:95: ../fortune/fortune_with_offensive.template.man] Error 2 make[1]: *** [CMakeFiles/Makefile2:281: CMakeFiles/generate_man_page.dir/all] Error 2 make[1]: *** Waiting for unfinished jobs.... [ 7%] Built target strfile [ 7%] Linking C executable fortune [ 7%] Built target fortune make: *** [Makefile:171: all] Error 2 note: keeping build directory '/tmp/nix-build-fortune-mod-3.2.0.drv-1' builder for '/nix/store/jgzkin7k2lbx59b9cjmiqg0wlx6lv5yg-fortune-mod-3.2.0.drv' failed with exit code 2 error: build of '/nix/store/jgzkin7k2lbx59b9cjmiqg0wlx6lv5yg-fortune-mod-3.2.0.drv' failed ```
shlomif commented 4 years ago

Hi @Vonfry !

First of all, note that neither perl nor docbook/xsl are "native", as the CPU machine code and the kernel only have at most some shabang support - which can be used with any interpreter including #!/bin/cat. But they are the "sources" and what is kept inside the github repo.

I try to build fortune-mod from github source(rev: fortune-mod-3.2.0). I meet problem when building the document. I have installed perl packages from cpan.

I cannot find fortune_with_offensive.template.man and fortune_without_offensive.template.man under the directory and the cmake file seems to use them with process-fortune-man-template.pl. part log

I think you need to install the docbook 5/xsl toolchain and configure it in the xml catalogs. Also see https://news.ycombinator.com/item?id=18318771 . I admit that the DocBook toolchain is a bit complicated to get up to speed with, whereas the "tags are easy" (to quote an earlier user whom I consulted when getting started).

Anyway, you can try consulting the .travis.yml: https://github.com/shlomif/fortune-mod/blob/master/.travis.yml . The documentation can lie or be incomplete: https://blog.codinghorror.com/learn-to-read-the-source-luke/ . On the other hand CI is working code that runs starting from a pristine environment: https://github.com/shlomif/Freenode-programming-channel-FAQ/blob/master/FAQ_with_ToC__generated.md#what-do-continuous-integration-ci-services-such-as-travis-ci-jenkins-or-appveyor-provide .

That put aside, that edge case can likely be better handled (see: https://www.shlomifish.org/humour/fortunes/show.cgi?id=joel-remarkable-customer-service-3 ) to make the build process more "idiot-proof" ("idiot" here means a layman or an inexperienced/unitiated person, not someone unintelligent or foolish, the Greek original term had these meanings and more: https://en.wikipedia.org/wiki/Idiot ). In the modern FOSS world, some codevs can be "idiots" as this 2016 feature brilliantly shows: https://hackernoon.com/how-it-feels-to-learn-javascript-in-2016-d3a717dd577f (but note that if the experienced front end dev just told him that jQuery will be adequate for that use case, it would be much shorter).

Anyway, hope that helps for now. ♥

Vonfry commented 4 years ago

Thank for your reply.

I think you need to install the docbook 5/xsl toolchain and configure it in the xml catalogs. Also see https://news.ycombinator.com/item?id=18318771 . I admit that the DocBook toolchain is a bit complicated to get up to speed with, whereas the "tags are easy" (to quote an earlier user whom I consulted when getting started).

I have installed libxslt, but never configured it.

Anyway, you can try consulting the .travis.yml: https://github.com/shlomif/fortune-mod/blob/master/.travis.yml . The documentation can lie or be incomplete: https://blog.codinghorror.com/learn-to-read-the-source-luke/ . On the other hand CI is working code that runs starting from a pristine environment: https://github.com/shlomif/Freenode-programming-channel-FAQ/blob/master/FAQ_with_ToC__generated.md#what-do-continuous-integration-ci-services-such-as-travis-ci-jenkins-or-appveyor-provide .

This really help me.

First of all, note that neither perl nor docbook/xsl are "native", as the CPU machine code and the kernel only have at most some shabang support - which can be used with any interpreter including #!/bin/cat. But they are the "sources" and what is kept inside the github repo.

Sorry for wrong statement. I mean native is building document at my own computer instead of using the release one.

shlomif commented 4 years ago

Hi @Vonfry !

Thank for your reply.

I think you need to install the docbook 5/xsl toolchain and configure it in the xml catalogs. Also see https://news.ycombinator.com/item?id=18318771 . I admit that the DocBook toolchain is a bit complicated to get up to speed with, whereas the "tags are easy" (to quote an earlier user whom I consulted when getting started).

I have installed libxslt, but never configured it.

libxslt is not the only dependency required by docmake and the rest of the DocBook 5/XSL toolchain.

Anyway, you can try consulting the .travis.yml: https://github.com/shlomif/fortune-mod/blob/master/.travis.yml . The documentation can lie or be incomplete: https://blog.codinghorror.com/learn-to-read-the-source-luke/ . On the other hand CI is working code that runs starting from a pristine environment: https://github.com/shlomif/Freenode-programming-channel-FAQ/blob/master/FAQ_with_ToC__generated.md#what-do-continuous-integration-ci-services-such-as-travis-ci-jenkins-or-appveyor-provide .

This really help me.

Great!

First of all, note that neither perl nor docbook/xsl are "native", as the CPU machine code and the kernel only have at most some shabang support - which can be used with any interpreter including #!/bin/cat. But they are the "sources" and what is kept inside the github repo.

Sorry for wrong statement. I mean native is building document at my own computer instead of using the release one.

Ah, I see. Anyway, I'm going to reopen this ticket until I can figure out a more permanent fix. You can unsubscribe from notifications if you wish.

shlomif commented 3 years ago

This error should be handled better in version 0.1003 of docmake. Closing. Thanks!

BrianInglis commented 3 years ago

I think the short answer to the additional dependencies for building and running the package appears to be: cmake, docbook-xsl and docbook-xsl-ns for stylesheets, libcrypt-dev(el), libssp/-dev(el), libxslt/-dev(el) for xsltproc, perl-App-XML-DocBook-Builder, perl-Module-Build, perl-Class-XSAccessor, perl-Data-Dump, perl-Path-Tiny, perl-Test-Trap.