adding-packages-tips.txt 1.9 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. As github is known to have changed download mechanisms in the
  31. past, the 'github' helper function should be used as shown below.
  32. ------------------------
  33. FOO_VERSION = v1.0 # tag or full commit ID
  34. FOO_SITE = $(call github,<user>,<package>,$(FOO_VERSION))
  35. ------------------------
  36. .Notes
  37. - The FOO_VERSION can either be a tag or a commit ID.
  38. - The tarball name generated by github matches the default one from
  39. Buildroot (e.g.: +foo-f6fb6654af62045239caed5950bc6c7971965e60.tar.gz+),
  40. so it is not necessary to specify it in the +.mk+ file.
  41. - When using a commit ID as version, you should use the full 40 hex characters.