• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/docs/manual/adding-packages-rebar.txt
Yann E. MORINYann E. MORIN committed 0fe05ff3e1612 Jan 2015
Raw file
Source viewDiff to previous
 
1
// -*- mode:doc; -*-
2
// vim: set syntax=asciidoc:
3
​
4
=== Infrastructure for rebar-based packages
5
​
6
[[rebar-package-tutorial]]
7
​
8
==== +rebar-package+ tutorial
9
​
10
First, let's see how to write a +.mk+ file for a rebar-based package,
11
with an example :
12
​
13
------------------------------
14
01: ################################################################################
15
02: #
16
03: # erlang-foobar
17
04: #
18
05: ################################################################################
19
06:
20
07: ERLANG_FOOBAR_VERSION = 1.0
21
08: ERLANG_FOOBAR_SOURCE = erlang-foobar-$(ERLANG_FOOBAR_VERSION).tar.xz
22
09: ERLANG_FOOBAR_SITE = http://www.foosoftware.org/download
23
10: ERLANG_FOOBAR_DEPENDENCIES = host-libaaa libbbb
24
11:
25
12: $(eval $(rebar-package))
26
--------------------------------
27
​
28
On line 7, we declare the version of the package.
29
​
30
On line 8 and 9, we declare the name of the tarball (xz-ed tarball
31
recommended) and the location of the tarball on the Web. Buildroot
32
will automatically download the tarball from this location.
33
​
34
On line 10, we declare our dependencies, so that they are built
35
before the build process of our package starts.
36
​
37
Finally, on line 12, we invoke the +rebar-package+ macro that
38
generates all the Makefile rules that actually allows the package to
39
be built.
40
​
41
[[rebar-package-reference]]
42
​
43
==== +rebar-package+ reference
44
​
45
The main macro of the +rebar+ package infrastructure is
46
+rebar-package+. It is similar to the +generic-package+ macro. The
47
ability to have host packages is also available, with the
48
+host-rebar-package+ macro.
49
​
50
Just like the generic infrastructure, the +rebar+ infrastructure works
51
by defining a number of variables before calling the +rebar-package+
52
macro.
53
​
54
First, all the package metadata information variables that exist in
55
the generic infrastructure also exist in the +rebar+ infrastructure:
56
+ERLANG_FOOBAR_VERSION+, +ERLANG_FOOBAR_SOURCE+,
57
+ERLANG_FOOBAR_PATCH+, +ERLANG_FOOBAR_SITE+,
58
+ERLANG_FOOBAR_SUBDIR+, +ERLANG_FOOBAR_DEPENDENCIES+,
59
+ERLANG_FOOBAR_INSTALL_STAGING+, +ERLANG_FOOBAR_INSTALL_TARGET+,
60
+ERLANG_FOOBAR_LICENSE+ and +ERLANG_FOOBAR_LICENSE_FILES+.
61
​
62
A few additional variables, specific to the +rebar+ infrastructure,
63
can also be defined. Many of them are only useful in very specific
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.