| 1 |
# Using the WrapDB |
| 2 |
|
| 3 |
The Wrap database is a web service that provides Meson build |
| 4 |
definitions to projects that do not have it natively. Using it is |
| 5 |
simple. The service can be found |
| 6 |
[here](https://wrapdb.mesonbuild.com). |
| 7 |
|
| 8 |
The front page lists all projects that are on the service. Select the |
| 9 |
one you want and click it. The detail page lists available versions by |
| 10 |
branch and revision id. The branch names come from upstream releases |
| 11 |
and revision ids are version numbers internal to the database. |
| 12 |
Whenever the packaging is updated a new revision is released to the |
| 13 |
service a new revision with a bigger revision id is added. Usually you |
| 14 |
want to select the newest branch with the highest revision id. |
| 15 |
|
| 16 |
You can get the actual wrap file which tells Meson how to fetch the |
| 17 |
project by clicking on the download link on the page. As an example, |
| 18 |
the wrap file for [zlib-1.2.8, revision |
| 19 |
4](https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.8/4/get_wrap) |
| 20 |
looks like this. You can find detailed documentation about it in [the |
| 21 |
Wrap manual](Wrap-dependency-system-manual.md). |
| 22 |
|
| 23 |
[wrap-file] |
| 24 |
directory = zlib-1.2.8 |
| 25 |
|
| 26 |
source_url = http://zlib.net/zlib-1.2.8.tar.gz |
| 27 |
source_filename = zlib-1.2.8.tar.gz |
| 28 |
source_hash = 36658cb768a54c1d4dec43c3116c27ed893e88b02ecfcb44f2166f9c0b7f2a0d |
| 29 |
|
| 30 |
patch_url = https://wrapdb.mesonbuild.com/v1/projects/zlib/1.2.8/4/get_zip |
| 31 |
patch_filename = zlib-1.2.8-4-wrap.zip |
| 32 |
patch_hash = 2327a42c8f73a4289ee8c9cd4abc43b324d0decc28d6e609e927f0a50321af4a |
| 33 |
|
| 34 |
Add this file to your project with the name `subprojects/zlib.wrap`. |
| 35 |
Then you can use it in your `meson.build` file with this directive: |
| 36 |
|
| 37 |
zproj = subproject('zlib') |
| 38 |
|
| 39 |
When Meson encounters this it will automatically download, unpack and |
| 40 |
patch the source files. |
| 41 |
|
| 42 |
## Contributing build definitions |
| 43 |
|
| 44 |
The contents of the Wrap database are tracked in git repos of the |
| 45 |
[Mesonbuild project](https://github.com/mesonbuild). The actual |
| 46 |
process is simple and described in [submission |
| 47 |
documentation](Adding-new-projects-to-wrapdb.md). |