summaryrefslogtreecommitdiffstats
path: root/docs/manual/adding-packages-tips.txt
blob: 21e520bcde785ecb1bfd20d42c9c845f33c012a6 (plain)
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
// -*- mode:doc; -*-
// vim: set syntax=asciidoc:

Tips and tricks
~~~~~~~~~~~~~~~

[[package-name-variable-relation]]
Package name, config entry name and makefile variable relationship
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

In Buildroot, there is some relationship between:

* the _package name_, which is the package directory name (and the
  name of the +*.mk+ file);

* the config entry name that is declared in the +Config.in+ file;

* the makefile variable prefix.

It is mandatory to maintain consistency between these elements,
using the following rules:

* the package directory and the +*.mk+ name are the _package name_
  itself (e.g.: +package/foo-bar_boo/foo-bar_boo.mk+);

* the _make_ target name is the _package name_ itself (e.g.:
  +foo-bar_boo+);

* the config entry is the upper case _package name_ with `.` and `-`
  characters substituted with `_`, prefixed with +BR2_PACKAGE_+ (e.g.:
  +BR2_PACKAGE_FOO_BAR_BOO+);

* the +*.mk+ file variable prefix is the upper case _package name_
  `.` and `-` characters substituted with `_` (e.g.:
  +FOO_BAR_BOO_VERSION+).


[[github-download-url]]
How to add a package from github
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Packages on github often don't have a download area with release tarballs.
However, it is possible to download tarballs directly from the repository
on github.

If the package version matches a tag, then this tag should be used to
identify the version:

------------------------
FOO_VERSION = v1.0
FOO_SITE = http://github.com/<user>/<package>/tarball/$(FOO_VERSION)
------------------------

If the package has no release version, or its version cannot be
identified using tag, then the SHA1 of the particular commit should be
used to identify the version (the first 7 characters of the SHA1 are
enough):

------------------------
FOO_VERSION = 1234567
FOO_SITE = http://github.com/<user>/<package>/tarball/<branch>
------------------------

Note that the name of the tarball is the default +foo-1234567.tar.gz+
so it is not necessary to specify it in the +.mk+ file.