2
1

adding-packages-tips.txt 2.0 KB

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