Debian Codegraph @

subprojects/meson-docs/docs/markdown/Using-wraptool.md

raw
1 # Using wraptool
2
3 Wraptool is a subcommand of Meson that allows you to manage your
4 source dependencies using the WrapDB database. It gives you all things
5 you would expect, such as installing and updating dependencies. The
6 wrap tool works on all platforms, the only limitation is that the wrap
7 definition works on your target platform. If you find some Wraps that
8 don't work, please file bugs or, even better, patches.
9
10 All code examples here assume that you are running the commands in
11 your top level source directory. Lines that start with the `$` mark
12 are commands to type.
13
14 ## Simple querying
15
16 The simplest operation to do is to query the list of packages
17 available. To list them all issue the following command:
18
19 $ meson wrap list
20 box2d
21 enet
22 gtest
23 libjpeg
24 liblzma
25 libpng
26 libxml2
27 lua
28 ogg
29 sqlite
30 vorbis
31 zlib
32
33 Usually you want to search for a specific package. This can be done
34 with the `search` command:
35
36 $ meson wrap search jpeg
37 libjpeg
38
39 If a package is not found in the list of wraps, the `search` command
40 will look in all the wrap dependencies:
41
42 $ meson wrap search glib-2.0
43 Dependency glib-2.0 found in wrap glib
44
45 To determine which versions of libjpeg are available to install, issue
46 the `info` command:
47
48 $ meson wrap info libjpeg
49 Available versions of libjpeg:
50 9a 2
51
52 The first number is the upstream release version, in this case
53 `9a`. The second number is the Wrap revision number. They don't relate
54 to anything in particular, but larger numbers imply newer
55 releases. You should always use the newest available release.
56
57 ## Installing dependencies
58
59 Installing dependencies is just as straightforward. First just create
60 the `subprojects` directory at the top of your source tree and issue
61 the install command.
62
63 $ meson wrap install libjpeg
64 Installed libjpeg branch 9a revision 2
65
66 Now you can issue a `subproject('libjpeg')` in your `meson.build` file
67 to use it.
68
69 To check if your projects are up to date you can issue the `status` command.
70
71 $ meson wrap status
72 Subproject status
73 libjpeg up to date. Branch 9a, revision 2.
74 zlib not up to date. Have 1.2.8 2, but 1.2.8 4 is available.
75
76 In this case `zlib` has a newer release available. Updating it is
77 straightforward:
78
79 $ meson wrap update zlib
80 Updated zlib to branch 1.2.8 revision 4
81
82 Wraptool can do other things besides these. Documentation for these
83 can be found in the command line help, which can be accessed by
84 `meson wrap --help`.
85
86 ## Automatic dependency fallback
87
88 Since *0.64.0* Meson can use WrapDB to automatically find missing dependencies.
89
90 The user simply needs to download latest database, the following command stores
91 it in `subprojects/wrapdb.json`:
92 $ meson wrap update-db
93
94 Once the database is available locally, any dependency not found on the system
95 but available in WrapDB will automatically be downloaded.
96
97 Automatic fetch of WrapDB subprojects can be disabled by removing the file
98 `subprojects/wrapdb.json`, or by using `--wrap-mode=nodownload`.