Skip to content

Commit 283bdd3

Browse files
committed
Integrate zimwriterfs sources into zim-tools source tree
1 parent 379b43a commit 283bdd3

33 files changed

+59
-1113
lines changed
File renamed without changes.
File renamed without changes.

.github/workflows/ci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
- name: Install packages
1616
uses: mstksg/get-package@v1
1717
with:
18-
brew: gcovr pkg-config ninja
18+
brew: gcovr pkg-config ninja libmagic
1919
- name: Install python modules
2020
run: pip3 install meson==0.49.2 pytest
2121
- name: Install deps

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -27,3 +27,10 @@
2727
*.exe
2828
*.out
2929
*.app
30+
zimwriterfs
31+
32+
# Temporary and test files
33+
*.kate-swp
34+
.*.swp
35+
*.zim
36+
pip-selfcheck.json

ChangeLog

+5
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
zim-tools 1.2.2
2+
===============
3+
4+
* zimwriterfs: the tool version 1.3.10 migrated to zim-tools sources tree
5+
16
zim-tools 1.2.1
27
===============
38

README.md

+27-2
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,18 @@ and the [openZIM project](https://openzim.org).
66

77
[![latest release](https://img.shields.io/github/v/tag/openzim/zim-tools?label=latest%20release&sort=semver)](https://download.openzim.org/release/zim-tools/)
88
[![Build Status](https://github.com/openzim/zim-tools/workflows/CI/badge.svg?query=branch%3Amaster)](https://github.com/openzim/zim-tools/actions?query=branch%3Amaster)
9+
[![Docker Build Status](https://img.shields.io/docker/build/openzim/zim-tools)](https://hub.docker.com/r/openzim/zim-tools)
910
[![CodeFactor](https://www.codefactor.io/repository/github/openzim/zim-tools/badge)](https://www.codefactor.io/repository/github/openzim/zim-tools)
1011
[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
1112

13+
`zimwriterfs` is a console tool to create [ZIM](https://openzim.org)
14+
files from a locally-stored directory containing "self-sufficient"
15+
HTML content (with pictures, javascript and stylesheets). The result
16+
will contain all the files of the local directory compressed and
17+
merged in the ZIM file. Nothing more, nothing less. The generated file
18+
can be opened with a ZIM reader; [Kiwix](https://kiwix.org) is one
19+
example, but there are [others](https://openzim.org/wiki/ZIM_Readers).
20+
1221

1322
Releases
1423
----------
@@ -29,18 +38,27 @@ with the ZIM libary compilation itself, we recommend to have a look to
2938
Dependencies
3039
------------
3140

32-
The Kiwix library relies on the libzim.
41+
Most of the utilities form zim-tools programs relies on the libzim:
3342

3443
* [ZIM](https://openzim.org) (package `libzim-dev` on Debian/Ubuntu)
3544

45+
`zimwriterfs` relies on many third parts software libraries. They are
46+
prerequisites to the Zimwriterfs compilation. Following libraries
47+
need to be available:
48+
49+
* [Magic](https://www.darwinsys.com/file/) (package `libmagic-dev` on Debian/Ubuntu)
50+
* [Z](https://zlib.net/) (package `zlib1g-dev` on Debian/Ubuntu)
51+
* [Gumbo](https://github.com/google/gumbo-parser) (package `libgumbo-dev` on Debian/Ubuntu)
52+
* [ICU](http://site.icu-project.org/) (package `libicu-dev` on Debian/Ubuntu)
53+
3654
These dependencies may or may not be packaged by your operating
3755
system. They may also be packaged but only in an older version. The
3856
compilation script will tell you if one of them is missing or too old.
3957
In the worse case, you will have to download and compile a more recent
4058
version by hand.
4159

4260
If you want to install these dependencies locally, then ensure that
43-
meson (through pkg-config) will properly find them.
61+
meson (through `pkg-config`) will properly find them.
4462

4563
Environment
4664
-------------
@@ -98,6 +116,13 @@ ninja -C build uninstall
98116
Like for the installation, you might need to run the command as user
99117
`root` (or using `sudo`).
100118

119+
Docker
120+
------
121+
122+
A Docker image with `zimwriterfs` can be built from the `docker`
123+
directory. The project maintains an official image available at
124+
https://hub.docker.com/r/openzim/mwoffliner.
125+
101126
Troubleshooting
102127
---------------
103128

File renamed without changes.
File renamed without changes.

meson.build

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ endif
1515
libzim_dep = dependency('libzim', version : '>=6.1.1', static:static_linkage)
1616

1717
compiler = meson.get_compiler('cpp')
18+
find_library_in_compiler = meson.version().version_compare('>=0.31.0')
1819
rt_dep = compiler.find_library('rt', required:false)
1920

2021
subdir('src')

meson_options.txt

+2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
option('static-linkage', type : 'boolean', value : false,
22
description : 'Create statically linked binaries.')
3+
option('magic-install-prefix', type : 'string', value : '',
4+
description : 'Prefix where libmagic has been installed')

src/meson.build

+2
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,5 @@ executable('zimcheck', 'zimcheck.cpp',
3333
executable('zimrecreate', 'zimrecreate.cpp',
3434
dependencies: libzim_dep,
3535
install: true)
36+
37+
subdir('zimwriterfs')
File renamed without changes.
File renamed without changes.

zimwriterfs/meson.build src/zimwriterfs/meson.build

+14-16
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,3 @@
1-
project('zimwriterfs', ['c', 'cpp'],
2-
version : '1.3.10',
3-
license : 'GPL-3.0-or-later',
4-
default_options : ['c_std=c11', 'cpp_std=c++11', 'werror=true'])
5-
6-
add_global_arguments('-DVERSION="@0@"'.format(meson.project_version()), language : 'cpp')
7-
8-
compiler = meson.get_compiler('cpp')
9-
find_library_in_compiler = meson.version().version_compare('>=0.31.0')
10-
11-
static_linkage = get_option('static-linkage')
12-
if static_linkage
13-
add_global_link_arguments('-static-libstdc++', '--static', language:'cpp')
14-
endif
15-
161
thread_dep = dependency('threads')
172
libzim_dep = dependency('libzim', version : '>=6.1.2', static:static_linkage)
183
zlib_dep = dependency('zlib', static:static_linkage)
@@ -52,5 +37,18 @@ else
5237
endif
5338
endif
5439

55-
subdir('src')
5640

41+
sources = [
42+
'zimwriterfs.cpp',
43+
'tools.cpp',
44+
'article.cpp',
45+
'zimcreatorfs.cpp',
46+
'mimetypecounter.cpp'
47+
]
48+
49+
deps = [thread_dep, libzim_dep, zlib_dep, gumbo_dep, magic_dep]
50+
51+
zimwriterfs = executable('zimwriterfs',
52+
sources,
53+
dependencies : deps,
54+
install : true)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

zimwriterfs/.github/FUNDING.yml

-12
This file was deleted.

zimwriterfs/.github/workflows/ci.yml

-87
This file was deleted.

zimwriterfs/.gitignore

-22
This file was deleted.

zimwriterfs/AUTHORS

-1
This file was deleted.

zimwriterfs/ChangeLog

-84
This file was deleted.

zimwriterfs/Dockerfile

-1
This file was deleted.

0 commit comments

Comments
 (0)