source: wkhtmltox/trunk/fuentes/INSTALL.md @ 51

Last change on this file since 51 was 51, checked in by mabarracus, 4 years ago

wip

File size: 7.3 KB
Line 
1Clone this repository by running the following command:
2
3    git clone --recursive https://github.com/wkhtmltopdf/wkhtmltopdf.git
4
5If you are on Windows, make sure that you are cloning in a location without
6spaces/special characters in the name. In case you already have a cloned
7repository, update to the latest version by running the following commands:
8
9    git pull
10    git submodule update
11
12Please ensure that you have enough disk space in the location you have cloned
13the source code, as it will require approximately 1.2GiB for both the `qt` and
14`wkhtmltopdf` repositories. Each target that is built will require an
15additional 2.5GiB for compiling the source code and producing the final
16installer (for Windows) or packages (for other OSes), which will be generated
17in the `static-build/` folder.
18
19You can create a debug build by passing the `-debug` flag to the build script.
20It is recommended to always pass the `-clean` flag, which removes the
21existing build folder and performs a clean build. Note that passing `-debug`
22may increase the disk space required for the build and final binaries for
23storing the additional debug information.
24
25Linux
26-----
27
28Please ensure that the cloned repository is in the user's home directory
29e.g. `~/wkhtmltopdf`. If you clone it in a different directory, it may
30fail with `E: Failed to change to directory /your/dir: No such file or directory`.
31Please note that [encrypted home directories](https://bugs.launchpad.net/ubuntu/+source/schroot/+bug/791908)
32and [non standard home directories](https://github.com/wkhtmltopdf/wkhtmltopdf/issues/1804)
33(i.e. not located in `/home`) are not supported -- you are advised to
34use a VM instead to build wkhtmltopdf.
35
36Building is supported only on 64-bit Debian Jessie (i.e. stable release), and
37the binaries are produced in a self-contained chroot environment for the
38target distribution -- you will need to first setup the build environment
39and then only you can perform the build for a 32-bit or 64-bit binary.
40The following targets are currently supported:
41
42Target         | Setup of Build Environment                    | Building 32-bit binaries                 |  Building 64-bit binaries
43------         | --------------------------                    | ------------------------                 |  ------------------------
44Generic        | `sudo scripts/build.py setup-schroot-generic` | `scripts/build.py linux-generic-i386`    | `scripts/build.py linux-generic-amd64`
45Debian Wheezy  | `sudo scripts/build.py setup-schroot-wheezy`  | `scripts/build.py wheezy-i386`           | `scripts/build.py wheezy-amd64`
46Debian Jessie  | `sudo scripts/build.py setup-schroot-jessie`  | `scripts/build.py jessie-i386`           | `scripts/build.py jessie-amd64`
47Ubuntu Trusty  | `sudo scripts/build.py setup-schroot-trusty`  | `scripts/build.py trusty-i386`           | `scripts/build.py trusty-amd64`
48Ubuntu Precise | `sudo scripts/build.py setup-schroot-precise` | `scripts/build.py precise-i386`          | `scripts/build.py precise-amd64`
49CentOS 7       | `sudo scripts/build.py setup-schroot-centos7` | not available                            | `scripts/build.py centos7-amd64`
50MinGW-w64      | `sudo scripts/build.py setup-mingw-w64`       | `scripts/build.py mingw-w64-cross-win32` | `scripts/build.py mingw-w64-cross-win64`
51
52The MinGW-w64 toolchain can cross-compile 32/64-bit Windows binaries from
53Linux -- it is useful for targetting Windows XP/Windows 2003, which are not
54supported by default when compiling with MSVC 2013. You may require a
55working internet connection during the build to download and compile
56the dependent libraries (e.g. OpenSSL).
57
58Each target will require approximately 1.5GiB of disk space to hold both
59the `i386` and `amd64` chroot environments for that target. By default,
60the chroot environments are created under `/var/chroot` -- in case you
61want to create them under another location (e.g. due to insufficient disk
62space), please run the command `export WKHTMLTOX_CHROOT=/some/other/dir`
63**before** the command for setup of the build environment.
64
65While setting up the build environments, please ensure that you are logged
66in as a regular user who has `sudo` access. It is possible to run the script
67without `sudo` but you will need to have root privileges (e.g. via `su`). In
68that scenario, you may get the error `Unable to determine the login for which schroot access is to be given`
69-- you will have to set `export SUDO_USER=<username>` and try to run it again.
70Other than the setup of build environment, **do not run any other command
71with `root` privileges!** The compilation process can be run as a normal
72user and running it as `root` may lead to errors or complete loss of data.
73
74After the build environment is setup, you can run the command mentioned above
75to build either the 32-bit or 64-bit binaries, which should generate a
76native package (either DEB or RPM, depending on the distribution) in the
77`static-build/` folder.
78
79Windows
80-------
81
82* Install Visual Studio 2013 Update 4 -- [Community Edition](http://go.microsoft.com/?linkid=9863609)
83  should also work.
84* Do "Windows Update" to ensure that VC/SDK security patches are up-to-date
85* Install the latest [ActivePerl](http://www.activestate.com/activeperl/downloads) release
86* Install the latest [Python 2.7](http://www.python.org/downloads/windows/) release
87* Install [NSIS 2.46](http://nsis.sourceforge.net/Download)
88* Make sure that you can run "git". If not, add it to the PATH or reinstall
89  with option "Run Git from the Windows Command Prompt".
90
91Target          | Building 32-bit binaries               |  Building 64-bit binaries
92------          | ------------------------               |  ------------------------
93MSVC 2013       | `scripts\build.py msvc2013-win32`      | `scripts/build.py msvc2013-win64`
94
95During the build, a working internet connection is required to download and
96compile the dependent libraries (e.g. OpenSSL). The output installers should
97be generated in the `static-build` folder.
98
99Please note that if you want to target Windows XP/Windows 2003 (i.e. NT 5.x)
100you should use the MinGW-w64 builds cross-compiled from Linux as the MSVC builds
101target Windows Vista or later (i.e. NT 6.x) by default.
102
103OS X
104----
105
106Building is supported only on OS X 10.7 or newer. You will need to have the
107latest Xcode for your OS X version. Additionally, you will need to run the command
108`sudo gem install fpm --no-ri --no-rdoc` in the terminal to install
109[fpm](https://github.com/jordansissel/fpm), which is used for building the package.
110
111Target          | Build Command
112------          | -------------
11332-bit Carbon   | `scripts/build.py osx-carbon-i386`
11464-bit Cocoa    | `scripts/build.py osx-cocoa-x86-64`
115
116During the build, a working internet connection is required to download and
117compile the dependent libraries (e.g. libpng and libjpeg). The output package
118should be generated in the `static-build` folder.
119
120Others
121------
122
123In case you are running on a non-Debian/Ubuntu Linux distribution or want to
124target a Linux distribution not listed above or another Unix-like OS, you
125will need to use the `posix-local` target. It assumes that you already have
126all the build dependencies installed beforehand and will generate a tarball
127with the specification of `local-MACHINENAME` in the `static-build/` folder.
128
129If you are able to get such a build running, contacting the developers via
130the mailing list or submitting a patch with the build instructions would be
131appreciated.
Note: See TracBrowser for help on using the repository browser.