readme update from Lucas Malor @ mobileread

see http://www.mobileread.com/forums/showpost.php?p=2488740&postcount=979
pull/80/head
Qingping Hou 11 years ago
parent 4df8ac4d4d
commit 2f25b90f8b

@ -19,84 +19,89 @@ at its fork Librerator.
The application is licensed under the GPLv3 (see COPYING file). The application is licensed under the GPLv3 (see COPYING file).
Building Prerequisites
======== ========
Instructions about how to get and compile the source are intended for a *nix
OS. Windows users are suggested to develop in a Linux VM or use
andLinux, Wubi.
Follow these steps: To get and compile the source you must have `patch`, `wget`, `unzip`, `git`,
`svn` and `cmake` installed.
* fetch thirdparty sources You might also need SDL library packages if you want to compile and run the PC
* manually fetch all the thirdparty sources: emulator. Fedora user can install `SDL` and `SDL-devel`. Ubuntu users can
* init and update submodule koreader-base install `libsdl1.2-dev`.
* within koreader-base:
* install muPDF sources into subfolder "mupdf"
* install muPDF third-party sources (see muPDF homepage) into a new
subfolder "mupdf/thirdparty"
* install libDjvuLibre sources into subfolder "djvulibre"
* install CREngine sources into subfolder "kpvcrlib/crengine"
* install LuaJit sources into subfolder "luajit-2.0"
* install popen_noshell sources into subfolder "popen-noshell"
* install libk2pdfopt sources into subfolder "libk2pdfopt"
* automatically fetch thirdparty sources with Makefile:
* make sure you have patch, wget, unzip, git and svn installed
* run `make fetchthirdparty`.
* adapt Makefile to your needs - have a look at Makefile.defs in koreader-base Getting the source
========
* run `make thirdparty`. This will build MuPDF (plus the libraries it depends
on), libDjvuLibre, CREngine, libk2pdfopt and Lua.
* run `make`. This will build the KOReader application (see below if you want ```
to build in emulation mode so you can test it on PC) git clone https://github.com/koreader/koreader.git
cd koreader
make fetchthirdparty
```
Running Building & Running
======= ========
In real eink devices For real eink devices
--------------------- ---------------------
The user interface is scripted in Lua. See "reader.lua".
It uses the Linux feature to run scripts by using a corresponding line at its
start.
So you might just call that script. Note that the script and the koreader-base If you already done an emulator build, you must do:
binary currently must be in the same directory. ```
make clean && make cleanthirdparty
```
You would then just call reader.lua, giving the document file path, or any To build:
directory path, as its first argument. Run reader.lua without arguments to see ```
usage notes. The reader.lua script can also show a file chooser: it will do make thirdparty && make
this when you call it with a directory (instead of a file) as first argument. ```
To run, you must call the script reader.lua. Run it without arguments to see
usage notes. Note that the script and the koreader-base binary currently must
be in the same directory.
In emulator For emulating
----------- -----------
You need to first compile KOReader-base in emulation mode.
* If you have built KOReader in real mode before, you need to clean it up:
If you already done a real device build, you must do:
``` ```
make clean && make cleanthirdparty make clean && make cleanthirdparty
``` ```
* Then compile with emulation mode flag: To build
``` ```
EMULATE_READER=1 make EMULATE_READER=1 make thirdparty koreader-base
make bootstrapemu
``` ```
* You may want to see README.md in koreader-base for more information. To run:
cd emu
./reader.lua -d ./
Next run `make bootstrapemu` to setup basic runtime environment needed by
emulation mode. A new emu directory will be created.
Use ccache
==========
Last, run the emulator with following command: Ccache can speed up recompilation by caching previous compilations and detecting
``` when the same compilation is being done again. In other words, it will decrease
cd emu && reader.lua -d ./ build time when the source have been built. Ccache support has been added to
``` KOReader's build system. Before using it, you need to install a ccache in your
system.
* in ubuntu use:`sudo apt-get install ccache`
* in fedora use:`sudo yum install ccache`
* install from source:
* get latest ccache source from http://ccache.samba.org/download.html
* unarchieve the source package in a directory
* cd to that directory and use:`./configure && make && sudo make install`
* after using ccache, make a clean build will only take 15sec. Enjoy!
* to disable ccache, use `export USE_NO_CCACHE=1` before make.
* for more detail about ccache. visit:
You can also specify size of emulator's screen via environment variables. http://ccache.samba.org
For more information, please refer to [koreader-base's README][base-readme].
[base-readme]:https://github.com/koreader/koreader-base/blob/master/README.md

Loading…
Cancel
Save