manuels / texlive.js

Compiling LaTeX (TeX live) in your browser
http://manuels.github.com/texlive.js/
GNU General Public License v2.0
1.25k stars 140 forks source link

WIP - compiling with 1.34 #32

Closed fzimmermann89 closed 8 years ago

fzimmermann89 commented 8 years ago

Hi, I would like to rebuild the, but get errors as in #14, so pdf-worker doesn't build with the current version of emscripten, or does it? What is the latest version anyone has used to compile it?

Thank you Felix btw: the demo page ist broken because of some memory problem truncating the pdftex.map file (#1 )

fzimmermann89 commented 8 years ago

Using sdk-tag-1.28.2-64bit I can build after applying the fixes suggested in #13 and #14, but get "End of file on the terminal... why?" on executing. I don't get any output at all compiling with -O0...

fzimmermann89 commented 8 years ago

Using 1.34 it compiles if you apply the fix in #13 and add CFLAGS=-DELIDE_CODE (to fix #14 without modifying the emscripten source) as well as EMCONFIGURE_JS=0 to the configure run. This is necessary because otherwise -emscripten will use clang if fopen is in a source -use node if not This causes a configure check of obsdcompat to fail on 64bit systems (it detects a broken snprintf because the size of long int differs..).

To have it running you need -to add TEXMFCNF="/" to the environment variables and supply a working texmf.cnf -remove shouldrunnow=true from post.js -add Module['calledRun']=false; to post.js

I don't know yet what happend there, and how it was supposed to work and why it isn't without those changes (found by trial and error and watching the pdftex-worker in debugger). Without those modification the arguments are not considered on the run and ""End of file on the terminal... why?" is the only response.

While at it, it might be smart to change the Makefile further: Right know I have -first build the binaries -copy the binaries -tell the pdftex make that the copied files are up to date by calling" emmake make pdftex -o tangle -o tie -o web2c -o pdftex-pool.c" If doing so, you only have to call the make once!

Once I have everything together, I will create a PR with all changes necessary to recompile the project.

The reason why I am doing it is to solve the gzip error in caused by emscriptens lazyfilesystem. I dislike patching the output of emscripten, so hopefully at some point I will get everything together and the demo page will work as well ;)

I am just leaving all the information here if I get bored on the way and somebody wants to continue..

fzimmermann89 commented 8 years ago

You dont have to set texmfcnf if you copy the texmf.cnf of the used texlive to the sources, name the module latex and create the /latex in the filesystem (see post.js).

It should work with the current sources in master and emscripten 1.35 on linux.