]> Git Repo - VerusCoin.git/blob - depends/README.packages
Merge pull request #5847
[VerusCoin.git] / depends / README.packages
1 Each recipe consists of 3 main parts: defining identifiers, setting build
2 variables, and defining build commands.
3
4 The package "mylib" will be used here as an example
5
6 General tips:
7 mylib_foo is written as $(package)_foo in order to make recipes more similar.
8
9 Identifiers:
10 Each package is required to define at least these variables:
11   $(package)_version:
12     Version of the upstream library or program. If there is no version, a
13     placeholder such as 1.0 can be used.
14   $(package)_download_path:
15     Location of the upstream source, without the file-name. Usually http or
16     ftp.
17   $(package)_file_name:
18     The upstream source filename available at the download path.
19   $(package)_sha256_hash:
20     The sha256 hash of the upstream file
21
22 These variables are optional:
23   $(package)_build_subdir:
24     cd to this dir before running configure/build/stage commands.
25   $(package)_download_file:
26     The file-name of the upstream source if it differs from how it should be
27     stored locally. This can be used to avoid storing file-names with strange
28     characters.
29   $(package)_dependencies:
30     Names of any other packages that this one depends on.
31   $(package)_patches:
32     Filenames of any patches needed to build the package
33
34
35 Build Variables:
36 After defining the main identifiers, build variables may be added or customized
37 before running the build commands. They should be added to a function called
38 $(package)_set_vars. For example:
39
40 define $(package)_set_vars
41 ...
42 endef
43
44 Most variables can be prefixed with the host, architecture, or both, to make
45 the modifications specific to that case. For example:
46
47   Universal:         $(package)_cc=gcc
48   Linux only:        $(package)_linux_cc=gcc
49   x86_64 only:       $(package)_x86_64_cc = gcc
50   x86_64 linux only: $(package)_x86_64_linux_cc = gcc
51
52 These variables may be set to override or append their default values.
53   $(package)_cc
54   $(package)_cxx
55   $(package)_objc
56   $(package)_objcxx
57   $(package)_ar
58   $(package)_ranlib
59   $(package)_libtool
60   $(package)_nm
61   $(package)_cflags
62   $(package)_cxxflags
63   $(package)_ldflags
64   $(package)_cppflags
65   $(package)_config_env
66   $(package)_build_env
67   $(package)_stage_env
68   $(package)_build_opts
69   $(package)_config_opts
70
71 The *_env variables are used to add environment variables to the respective
72 commands.
73
74 Many variables respect a debug/release suffix as well, in order to use them for
75 only the appropriate build config. For example:
76   $(package)_cflags_release = -O3
77   $(package)_cflags_i686_debug = -g
78   $(package)_config_opts_release = --disable-debug
79
80 These will be used in addition to the options that do not specify
81 debug/release. All builds are considered to be release unless DEBUG=1 is set by
82 the user.
83
84 Other variables may be defined as needed.
85
86 Build commands:
87
88   For each build, a unique build dir and staging dir are created. For example,
89   work/build/mylib/1.0-1adac830f6e and work/staging/mylib/1.0-1adac830f6e.
90
91   The following build commands are available for each recipe:
92
93   $(package)_fetch_cmds:
94     Runs from: build dir
95     Fetch the source file. If undefined, it will be fetched and verified
96     against its hash.
97   $(package)_extract_cmds:
98     Runs from: build dir
99     Verify the source file against its hash and extract it. If undefined, the
100     source is assumed to be a tarball.
101   $(package)_preprocess_cmds:
102     Runs from: build dir/$(package)_build_subdir
103     Preprocess the source as necessary. If undefined, does nothing.
104   $(package)_config_cmds:
105     Runs from: build dir/$(package)_build_subdir
106     Configure the source. If undefined, does nothing.
107   $(package)_build_cmds:
108     Runs from: build dir/$(package)_build_subdir
109     Build the source. If undefined, does nothing.
110   $(package)_stage_cmds:
111     Runs from: build dir/$(package)_build_subdir
112     Stage the build results. If undefined, does nothing.
113
114   The following variables are available for each recipe:
115   $(1)_staging_dir: package's destination sysroot path
116   $(1)_staging_prefix_dir: prefix path inside of the package's staging dir
117   $(1)_extract_dir: path to the package's extracted sources
118   $(1)_build_dir: path where configure/build/stage commands will be run
119   $(1)_patch_dir: path where the package's patches (if any) are found
120
121 Notes on build commands:
122
123 For packages built with autotools, $($(package)_autoconf) can be used in the
124 configure step to (usually) correctly configure automatically. Any
125 $($(package)_config_opts) will be appended.
126
127 Most autotools projects can be properly staged using:
128   $(MAKE) DESTDIR=$($(package)_staging_dir) install
This page took 0.030796 seconds and 4 git commands to generate.