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 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
|
## Contributing
Please read [CONTRIBUTING.md](https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/wikis/Contributing) carefully before submitting any
merge request.
In this document, it is assumed you are already familiar with the basics of
Git.
### Paperwork system-wide
Those instructions are useful if you just want to install Paperwork and don't
plan on contributing.
#### Installation
```sh
sudo apt install \
python3-virtualenv virtualenv python3-dev \
gettext \
git \
make \
meson \
build-essential \
libsane-dev \
libgirepository1.0-dev gobject-introspection \
python3-gi \
valac \
gtk-doc-tools
cd /tmp
git clone git@gitlab.gnome.org:World/OpenPaperwork/paperwork.git
cd paperwork
# switch to the stable branch ('master')
# other possible branches are 'testing' and 'develop'
git checkout master
sudo make install
cd -
rm -rf paperwork
# Install missing dependencies
paperwork-gtk chkdeps
# Add icon to menus (you may have to log out and log back in to see them)
sudo paperwork-gtk install
```
Later, if you want to update Paperwork, uninstall it (see below) and reinstall
it (see above).
#### Uninstallation
```sh
cd /tmp
git clone git@gitlab.gnome.org:World/OpenPaperwork/paperwork.git
cd paperwork
sudo make uninstall
cd -
rm -rf paperwork
```
Uninstallation never deletes your work directory nor your documents.
Uninstallation doesn't delete Paperwork icons.
## Paperwork in a Virtualenv
This is the recommended approach for development. If you intend to work on
Paperwork (or just try it), this is probably the most convenient way to
install safely a development version of Paperwork.
Virtualenv allows to run Paperwork in a specific environment, with the latest
versions of most of its dependencies. It also make it easier to remove it (you
just have to delete the directory containing the virtualenv). However the user
that did the installation will be the only one able to run Paperwork. No
shortcut will be installed in the menus of your window manager. Paperwork
won't be available directly on your PATH.
Paperwork depends on various libraries. Development should be done against the
latest versions of the OpenPaper.work's librairies (Libinsane, Libpillowfight,
PyOCR, etc). To make things simpler, Paperwork repository includes a script
to create and load a Python virtualenv (`source ./activate_test_env.sh`).
It will automatically get OpenPaper.work's librairies fresh from Git and
install them in this virtualenv.
Then the command `make install` will install Paperwork components using Python
setuptools. Python setuptools will automatically fetch and install pure-Python
dependencies. Finally, `paperwork-cli chkdeps` and `paperwork-gtk chkdeps`
will take care of installing the remaining dependencies system-wide using the
package manager of your Linux distribution (APT, Dnf, Pacman, etc).
### Requirements
You will have to install
[python3-virtualenv](https://pypi.python.org/pypi/virtualenv):
```sh
sudo apt install python3-virtualenv virtualenv python3-dev
```
[Libinsane](https://gitlab.gnome.org/World/OpenPaperwork/libinsane/-/blob/master/README.markdown)
will also be built. This build requires various dependencies:
```sh
sudo apt install \
gettext \
make \
meson \
build-essential \
libsane-dev \
libgirepository1.0-dev gobject-introspection \
python3-gi \
valac \
gtk-doc-tools
```
Paperwork requires some data files (documentation, etc) that require a lot of
dependencies and time to build. By default, if you don't have those data files,
Makefiles and scripts will download the latest version made by the CI/CD builds.
If you want to generate the data file (documentation, etc) yourself, you are
going to need a whole lot of other dependencies:
```sh
sudo apt install \
imagemagick \
po4a \
texlive \
texlive-lang-english \
texlive-lang-french \
texlive-lang-german \
texlive-latex-extra \
texlive-latex-recommended \
xvfb
```
### Setting up a virtualenv
```sh
mkdir -p ~/git
cd ~/git
git clone https://gitlab.gnome.org/World/OpenPaperwork/paperwork.git
cd paperwork
# - 'develop' is the branch where any new features, bug fixes, etc should go by
# default.
# - 'testing' is only for bug fixes, translations and documentations during
# the testing phase *only*
# - 'master' is the latest stable version of Paperwork + some bug fixes (only
# the project maintainer add commits in this branch).
git checkout develop
# Delete existing Python virtualenv if there is one.
# Delete all Paperwork data files if they have been generated or downloaded.
make clean
# Will create the Python virtualenv if it doesn't exist.
# It will compile Libinsane and some other librairies. It will then set the
# correct environment variables to use them without installing them
# system-wide.
source ./activate_test_env.sh
# you're now in the virtualenv
# 'make install' will install Paperwork in the virtualenv
make install
# takes care of the dependencies that cannot be installed in the virtualenv
# (Gtk, Tesseract, etc)
paperwork-cli chkdeps
paperwork-gtk chkdeps
```
### Running Paperwork from the virtualenv
```sh
cd ~/git/paperwork
source ./activate_test_env.sh
# you're now in a virtualenv
# Running Paperwork
paperwork-gtk
# or
paperwork-cli --help
# or
paperwork-json --help
```
### Updating
```sh
cd ~/git/paperwork
git pull
make clean
git submodule update --recursive --remote
source ./activate_test_env.sh
# you're now in a virtualenv
make install
```
### Generating data files
Data files are:
- Documentation files (.tex turned into .pdf)
- Screenshots (taken with xvfb-run + a script ; used in the documentation
files)
- Icons at various sizes
To generate the screnshots,
[the script](https://gitlab.gnome.org/World/OpenPaperwork/paperwork/-/blob/develop/paperwork-gtk/src/paperwork_gtk/model/help/screenshot.sh)
will automatically fetch test documents from here:
https://gitlab.gnome.org/World/OpenPaperwork/paperwork-test-documents
```sh
cd ~/git/paperwork
source ./activate_test_env.sh
make install
make data
```
|