Commit Graph

527 Commits

Author SHA1 Message Date
Matthieu Gautier 62d26c27ff Merge pull request #33 from kiwix/snippets
Snippets
2017-03-28 11:37:45 +02:00
Matthieu Gautier 074c1bcffa Try to generate the snippet if it is not present in the database.
We generate the snippet from the content of the article in the zim so
we need to have a access to the reader.
2017-03-21 16:28:03 +01:00
Matthieu Gautier 9be2abedf3 Check if a valuemaps metadata is available in the database and use it.
This way, we do not make assumption of where the values are stored.
2017-03-21 16:26:03 +01:00
Matthieu Gautier 83d27255cf Do not create all the results at once. Be a bit lazy.
We don't need to generate a vector of result when we do a search.
We better to just keep the handle to the current MSetIterator and
generate the wanted values when needed.
2017-03-21 16:20:17 +01:00
Matthieu Gautier 72a6b578e6 Fix meson's project version. 2017-03-21 16:01:07 +01:00
Matthieu Gautier 22d9117a56 Fix missing virtual destructors. 2017-03-21 16:00:46 +01:00
Matthieu Gautier 92dc6b3065 Merge pull request #32 from kiwix/android-wrapper
Add JNI wrapper for android.
2017-03-20 11:05:38 +01:00
Matthieu Gautier 43703a9d58 Add JNI wrapper for android.
This wrapper mainly come from the already existing android part.
2017-03-07 20:14:29 +01:00
Matthieu Gautier aafe9a4435 [ANDROID] Deactivate some features if we are compiling for android.
Android libc doesn't support all thread feature (as pthread_cancel).
Do not compile those files if we are compiling for android.
2017-02-22 16:56:21 +01:00
Matthieu Gautier 9616530648 Correctly discover if we have libiconv and use it if necessary. 2017-02-22 12:06:31 +01:00
Matthieu Gautier 84796abb4c Make use of ctpp2 optional. 2017-02-22 12:05:44 +01:00
Matthieu Gautier 7b76d432a7 Do not link with iconv when cross-compilating to windows.
Ideally we should check if iconv is present to know if ctpp2 has been
build with iconv.
This may be a bit too complex for our present case. As we know our
cross-compilation environment. It is better to remove the use of iconv
everywhere for now.
2017-02-07 12:24:13 +01:00
Emmanuel Engelhart 8e8724b6be Fix typo in the README 2017-02-06 20:52:47 +01:00
Emmanuel Engelhart 094e05ac8a ctpp2 static lib as a non std name 2017-02-03 07:15:21 +01:00
Matthieu Gautier 50071d1053 Do not try to link with ctpp2-st.
ctpp2-st is not a standard name, all other projects use the same base name
for dynamic and static libs.

Debian already patch the lib name in the ctpp2 package.
As we also patch it in kiwix-build, we can ignore ctpp2-st and always
try to link on ctpp2.

This is even necessary if we use the ctpp2-install-prefix. As we ctpp2 is
in a custom directory, meson fails in the foreach loop as it cannot find
ctpp2.
We could fix, the ctpp2 lib search to also search ctpp2-st in standard
directory AND the custom one but it seems to be a lot of work for nothing
as ctpp2-st is not used at all in our usecases.
2017-01-30 17:58:29 +01:00
Emmanuel Engelhart 7a03cb7712 Better (static) ctpp2 lib detection #14 2017-01-27 22:15:09 +01:00
Matthieu Gautier a3d01b6303 Use correct include in generated resource file.
std::runtime_error is defined in <stdexcept> not <exception>.

Recent gcc version compiled the resource file without complain but old
version need a correct include.
2017-01-24 15:36:01 +01:00
Matthieu Gautier 5a9fd265d3 Correctly compare version of meson 2017-01-24 11:59:15 +01:00
Emmanuel Engelhart c15339a972 Small remark to install deps locally 2017-01-23 22:04:50 +01:00
Emmanuel Engelhart ffb1f40671 Do not forget pkg-config 2017-01-23 21:33:55 +01:00
Emmanuel Engelhart 121693bcfa Typo on the README 2017-01-23 21:31:44 +01:00
Emmanuel Engelhart d2c3eeb337 More simple/robus README 2017-01-23 21:25:07 +01:00
Kelson 25a55acdae Merge pull request #19 from kiwix/doc_ubuntu
Update README.
2017-01-23 19:37:38 +01:00
Matthieu Gautier ed800e4f00 Update README.
Also add a COMPILE_ubuntu-16.04.md to let people compile on ubuntu 16.04.
2017-01-23 15:24:24 +01:00
Matthieu Gautier 317b13b56b Use old find_library to found ctpp2 lib if meson version < 0.31.0.
We need to support as far as possible the meson version installed on
ubuntu 16.04 (LTS).

In meson 0.31.0, the find_library has moved as a method of the compiler.

Fix #10
2017-01-17 17:34:32 +01:00
Matthieu Gautier 88f6b3a0f9 On Windows, ctpp2 use the iconv libraries.
If we are cross-compiling to windows, we need to also link with the
iconv library.

We do not check for the iconv library existance here. We assume that
if the ctpp2 library is present all its own dependencies are present also.
2017-01-17 17:33:35 +01:00
Matthieu Gautier 12f148974f Remove the need of the aria2c dependency.
Aria2c is not use at all in kiwix-lib.

Fix #13
2017-01-17 15:56:02 +01:00
Matthieu Gautier 72f1be3dbd We must include <time.h> with mingw.
This is a error anyway, linux or window. So just add the include.
2017-01-17 15:54:44 +01:00
Matthieu Gautier 753a39beb0 Fix header include for cross-compilation to Windows.
On unix, filenames are case sensitive and all include files are lowercase.
2017-01-17 10:20:59 +01:00
Matthieu Gautier d9798414c3 Update README.md
- Mention kiwix-build to build kiwix-lib.
- Separate the real dependencies from the package to install.
- Mention the (standard meson) --default-library option.
2017-01-10 10:50:04 +01:00
Matthieu Gautier d5191a18f0 Merge pull request #15 from kiwix/readme-ctpp
Document libctpp2-dev dependency (fixes #11)
2017-01-10 09:57:16 +01:00
Kunal Mehta 3bfcd89e22 Document libctpp2-dev dependency (fixes #11) 2017-01-09 23:12:30 -08:00
Matthieu Gautier 4afe3e8ddc "myhtmlparse.h" is a private header. Remove it from indexer.h. 2017-01-03 11:51:31 +01:00
Kelson 72971bba2a Merge pull request #7 from legoktm/patch-1
meson: Use 'libzim' name as a dependency
2017-01-02 16:18:54 +01:00
Kelson 772bda7056 Merge pull request #8 from legoktm/readme
Add README with build instructions (closes #3, #6)
2017-01-02 16:09:45 +01:00
Kunal Mehta 12b6a50dba Add README with build instructions (closes #3, #6) 2017-01-02 06:57:01 -08:00
Kunal Mehta baf4c9050f meson: Use 'libzim' name as a dependency
With <https://gerrit.wikimedia.org/r/#/c/329759/>, the library is now
registered with pkg-config as "libzim".
2016-12-31 23:49:42 -08:00
Emmanuel Engelhart 4895af59e8 + GPL license 2016-12-31 09:29:53 +01:00
Matthieu Gautier 97bdc17651 All static compilation with several generated resource code.
If there are several uses of the compile_resource script it will have
several definition of getResource function.

So, define a custum getResource function per resources "pack" and add
a define to have a nice API.

A developer must take care of not include two generated .h in the same
compilation unit as there will be a redefine error.
The best way to avoid this is to always include the generated .h in the
c(pp) file and never in a header.
If a compilation unit need to use two pack at the same time, we have to
undef 'getResource' and use the real getResource_* methods.
2016-12-23 14:27:58 +01:00
Matthieu Gautier cba71b4e75 Add a new script to compile resources.
- No more dependency to reswrap binary (everything is done in python)
- Resource strings can be directly accessed.
  As side effect, it add a check at compilation if the resource is
  declared and compiled in the binary.
- The resource content can be overwritten at runtime with a env variable.

There is also few clean in the static as some files shoul be in the tools
directory.

The compile_resource script is install to let other project use it.
2016-12-23 13:06:12 +01:00
Matthieu Gautier 8b34414458 There is no need for zlib/bzip/lzma dependencies.
They are provided by libzim.
2016-12-22 12:01:20 +01:00
Matthieu Gautier 8ce1fb0ba8 Switch build system to mesonbuild.
There is no more integrated build of dependencies in the build system.
Dependencies are discovered using pkg-config except for ctpp2 where there
is no pkg-config file.
2016-12-22 12:01:20 +01:00
Kelson 1c68cf87b9 Fix ft index open for chunked files #346 2016-10-17 13:16:43 +02:00
mhutti1 5ff4abfab2 Merge branch 'master' of https://github.com/kiwix/kiwix 2016-10-15 15:33:46 +01:00
Kelson d328c4ffb0 Remove exec permission on source files 2016-10-14 17:04:47 +02:00
Kelson 75da598ba8 Add kiwix::removeAccents for Android 2016-10-14 16:59:32 +02:00
Kelson 2889d7c651 Make fulltext searcher Android compatible 2016-10-14 13:12:26 +02:00
Kelson 01794e6e91 New Reader::getZimFilePath() 2016-10-14 13:11:14 +02:00
Kelson e21c1b2c75 Merge pull request #340 from kiwix/perf_kiwix_serve
Perf kiwix serve
2016-10-10 07:42:02 +01:00
Matthieu Gautier 82cba79179 Do not make unnecessary copy when serving binary content.
Binary content do not need to be modified, so we don't need to copy it.
We can directly serve it from the internal zim (cluster) buffer.

The handle_content function now getArticleObjectByDecodedUrl instead of
getContentByDecodedUrl.

This is to get the mimetype of the article and copy the content only when
needed (getContentByDecodedUrl always copy the content).
Thus, handle_content is a bit more complex as it need to do some
manipulation previously made in getContentByDecodedUrl.

The main change is that if the content is binary, we serve the content
with a callback response who will get the content chunks directly from
the blob buffer.
2016-10-07 18:23:47 +02:00