2
1

adding-packages-tips.txt 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. Tips and tricks
  4. ~~~~~~~~~~~~~~~
  5. [[package-name-variable-relation]]
  6. Package name, config entry name and makefile variable relationship
  7. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  8. In Buildroot, there is some relationship between:
  9. * the _package name_, which is the package directory name (and the
  10. name of the +*.mk+ file);
  11. * the config entry name that is declared in the +Config.in+ file;
  12. * the makefile variable prefix.
  13. It is mandatory to maintain consistency between these elements,
  14. using the following rules:
  15. * the package directory and the +*.mk+ name are the _package name_
  16. itself (e.g.: +package/foo-bar_boo/foo-bar_boo.mk+);
  17. * the _make_ target name is the _package name_ itself (e.g.:
  18. +foo-bar_boo+);
  19. * the config entry is the upper case _package name_ with `.` and `-`
  20. characters substituted with `_`, prefixed with +BR2_PACKAGE_+ (e.g.:
  21. +BR2_PACKAGE_FOO_BAR_BOO+);
  22. * the +*.mk+ file variable prefix is the upper case _package name_
  23. `.` and `-` characters substituted with `_` (e.g.:
  24. +FOO_BAR_BOO_VERSION+).
  25. [[github-download-url]]
  26. How to add a package from github
  27. ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  28. Packages on github often don't have a download area with release tarballs.
  29. However, it is possible to download tarballs directly from the repository
  30. on github.
  31. If the package version matches a tag, then this tag should be used to
  32. identify the version:
  33. ------------------------
  34. FOO_VERSION = v1.0
  35. FOO_SITE = http://github.com/<user>/<package>/tarball/$(FOO_VERSION)
  36. ------------------------
  37. If the package has no release version, or its version cannot be
  38. identified using tag, then the SHA1 of the particular commit should be
  39. used to identify the version (the first 7 characters of the SHA1 are
  40. enough):
  41. ------------------------
  42. FOO_VERSION = 1234567
  43. FOO_SITE = http://github.com/<user>/<package>/tarball/<branch>
  44. ------------------------
  45. Note that the name of the tarball is the default +foo-1234567.tar.gz+
  46. so it is not necessary to specify it in the +.mk+ file.