forked from Sigil-Ebook/Sigil
-
Notifications
You must be signed in to change notification settings - Fork 0
/
INSTALL.txt
151 lines (110 loc) · 5.14 KB
/
INSTALL.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
# Introduction
Instructions for building Sigil from source, on all platforms.
Experience with compiling on your chosen platform is assumed. This is not a step
by step guide but general information to help fill in gaps.
Current releases of Sigil (as of 0.5) bundle the majority of dependencies. Qt,
CMake and general build tools are required to be installed separately. Sigil's
build setup will try to use system installed versions of any bundled
dependencies and fall back to the bundled copies. This is provided for
connivence for Linux packagers but it is not supported.
# General notes
You will need CMake 2.8.9 or later on all platforms. You can download it
[http://www.cmake.org/cmake/resources/software.html here].
CMake is a cross-platform system for build automation. It can generate Visual
Studio project files on Windows, Xcode project files on Mac OS X and Makefiles
on Unix systems. After installing CMake, you can see a list of generators
provided on your system by typing `cmake` in your terminal and pressing enter.
The supported generators should be listed near the bottom of the printout.
Qt 5.1.0 is also required on all platforms. It can be downloaded
[http://qt-project.org/downloads here].
## Compiling on Windows
Only Microsoft's Visual C++ compiler is supported.
The installer directory contains the files needed to produce a binary installer
for Windows. You need to provide the vcredist for your compiler. You need to
put it in the installer directory and name it vcredist_x86.exe or
vcredist_x64.exe.
On Windows a `makeinstaller` target is provided which will build a binary
installer. For that to work, you need to have
[http://www.jrsoftware.org/isinfo.php Inno Setup] on Windows. The installer
builder needs to be installed and on the system PATH.
### Method 1 (nmake)
Not everyone has access to or is comfortable with Visual Studio but there is an
alternative. Microsoft provides the Windows SDK which contains all of the tools
necessary to build.
First you need to install the
[http://www.microsoft.com/download/en/details.aspx?id=17851 .Net Framework 4].
You will also need the [http://msdn.microsoft.com/en-us/dd299405.aspx Windows
SDK]. Finally, if you are on a x64 platform and plan to produce x64 builds you
will need to install the hot fix refererend by
[http://support.microsoft.com/kb/2280741 this] KB article.
Once you have the necessary tools installed you can run cmake in a cmd (use the
Windows SDK Command Prompt) to produce an nmake based project (this is default).
Then you can run `nmake makeinstaller` to build and create an installer package.
### Method 2 (Visual Studio)
You can generate Visual Studio project files by creating a new folder *outside*
of the source distribution.
Now navigate to that folder with a terminal like cmd.exe or PowerShell. Then
type in and run the following:
{{{
cmake -G "Visual Studio 10" /path/to/extracted/folder
}}}
This should create SLN and vcproj files for Visual Studio in that directory.
You can also generate project files for some other VS version. You can get a
list of all supported generators by typing in and running `cmake`.
The default build procedure will build "Sigil.exe"; if you want to package that
with the required DLL's into an installer, build the `makeinstaller` project.
There is also an [http://qt-project.org/downloads Add-in] for VS on Qt's
website. It will make it easier to develop Qt applications like Sigil, but is
not strictly necessary.
## Compiling on OS X
On OS X a `makedmg` target is provided which will build a redistributable dmg.
There is also an `addframeworks` target which will add all necessary
dependencies to the .app for distribution. The `makedmg` will invoke
`addframeworks`.
### Method 1 (make)
{{{
$ mkdir build
$ cd build
$ cmake -DFORCE_BUNDLED_COPIES=1 -DCMAKE_BUILD_TYPE=Release ..
$ make
$ make makedmg
}}}
### Method 2 (XCode)
You can generate Xcode project files by creating a new folder *outside* of the
source distribution.
Now navigate to that folder with the Terminal. Then type in and run the
following:
{{{
cmake -G Xcode /path/to/extracted/folder
}}}
This should create Xcode project files in that directory. The default build
procedure will build "Sigil.app"; if you want to package that into a DMG file,
invoke the `makedmg` build target.
## Compiling on Linux
Here is an example of installing Sigil on in your Home directory.
Create the build directories and get the Sigil source code.
{{{
mkdir -p ~/sigil-x.y.z/src ~/sigil-x.y.z/build ~/sigil-x.y.z/run
cd ~/sigil-x.y.z/src
wget https://sigil.googlecode.com/files/Sigil-x.y.z-Code.zip
unzip Sigil-x.y.z-Code.zip
}}}
{{{
cd ~/sigil-x.y.z/build
cmake -G "Unix Makefiles" -DCMAKE_PREFIX_PATH=/opt/Qt5.y.z/5.y.z/gcc/lib/cmake -DCMAKE_INSTALL_PREFIX=~/sigil-x.y.z/run -DCMAKE_BUILD_TYPE=Release -DFORCE_BUNDLED_COPIES=1 ~/sigil-x.y.z/src
make install
}}}
Create a script to run Sigil:
{{{
echo "
export LD_LIBRARY_PATH=/opt/Qt5.y.z/5.y.z/gcc/lib
~/sigil-x.y.z/run/bin/sigil" > ~/sigil.sh
chmod +x ~/sigil.sh
}}}
# Run Sigil:
{{{
~/sigil.sh
}}}
Building from source in the git repository is *NOT* recommended, since code in
the git repository is not stable. Do not open a bug report against a non release
version.