adding-packages-tips.txt 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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. ------------------------
  32. FOO_VERSION = v1.0 # tag or (abbreviated) commit ID
  33. FOO_SITE = http://github.com/<user>/<package>/tarball/$(FOO_VERSION)
  34. ------------------------
  35. .Notes
  36. - The FOO_VERSION can either be a tag or a commit ID.
  37. - The tarball name generated by github matches the default one from
  38. Buildroot (e.g.: +foo-1234567.tar.gz+),
  39. so it is not necessary to specify it in the +.mk+ file.
  40. - When using a commit ID as version, usually the first 7 characters of
  41. the SHA1 are enough.