adding-packages-qmake.adoc 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. // -*- mode:doc; -*-
  2. // vim: set syntax=asciidoc:
  3. === Infrastructure for QMake-based packages
  4. [[qmake-package-tutorial]]
  5. ==== +qmake-package+ tutorial
  6. First, let's see how to write a +.mk+ file for a QMake-based package, with
  7. an example :
  8. ----
  9. 01: ################################################################################
  10. 02: #
  11. 03: # libfoo
  12. 04: #
  13. 05: ################################################################################
  14. 06:
  15. 07: LIBFOO_VERSION = 1.0
  16. 08: LIBFOO_SOURCE = libfoo-$(LIBFOO_VERSION).tar.gz
  17. 09: LIBFOO_SITE = http://www.foosoftware.org/download
  18. 10: LIBFOO_CONF_OPTS = QT_CONFIG+=bar QT_CONFIG-=baz
  19. 11: LIBFOO_DEPENDENCIES = bar
  20. 12:
  21. 13: $(eval $(qmake-package))
  22. ----
  23. On line 7, we declare the version of the package.
  24. On line 8 and 9, we declare the name of the tarball (xz-ed tarball
  25. recommended) and the location of the tarball on the Web. Buildroot
  26. will automatically download the tarball from this location.
  27. On line 10, we tell Buildroot what options to enable for libfoo.
  28. On line 11, we tell Buildroot the dependencies of libfoo.
  29. Finally, on line line 13, we invoke the +qmake-package+
  30. macro that generates all the Makefile rules that actually allows the
  31. package to be built.
  32. [[qmake-package-reference]]
  33. ==== +qmake-package+ reference
  34. The main macro of the QMake package infrastructure is +qmake-package+.
  35. It is similar to the +generic-package+ macro.
  36. Just like the generic infrastructure, the QMake infrastructure works
  37. by defining a number of variables before calling the +qmake-package+
  38. macro.
  39. All the package metadata information variables that exist in the
  40. xref:generic-package-reference[generic package infrastructure] also
  41. exist in the QMake infrastructure.
  42. A few additional variables, specific to the QMake infrastructure, can
  43. also be defined.
  44. * +LIBFOO_CONF_ENV+, to specify additional environment variables to
  45. pass to the +qmake+ script for the configuration step. By default, empty.
  46. * +LIBFOO_CONF_OPTS+, to specify additional options to pass to the
  47. +qmake+ script for the configuration step. By default, empty.
  48. * +LIBFOO_MAKE_ENV+, to specify additional environment variables to the
  49. +make+ command during the build and install steps. By default, empty.
  50. * +LIBFOO_MAKE_OPTS+, to specify additional targets to pass to the
  51. +make+ command during the build step. By default, empty.
  52. * +LIBFOO_INSTALL_STAGING_OPTS+, to specify additional targets to pass
  53. to the +make+ command during the staging installation step. By default,
  54. +install+.
  55. * +LIBFOO_INSTALL_TARGET_OPTS+, to specify additional targets to pass
  56. to the +make+ command during the target installation step. By default,
  57. +install+.
  58. * +LIBFOO_SYNC_QT_HEADERS+, to run syncqt.pl before qmake. Some packages
  59. need this to have a properly populated include directory before
  60. running the build.