1// -*- mode:doc; -*- 2// vim: set syntax=asciidoc: 3 4=== Infrastructure for QMake-based packages 5 6[[qmake-package-tutorial]] 7 8==== +qmake-package+ tutorial 9 10First, let's see how to write a +.mk+ file for a QMake-based package, with 11an example : 12 13------------------------ 1401: ################################################################################ 1502: # 1603: # libfoo 1704: # 1805: ################################################################################ 1906: 2007: LIBFOO_VERSION = 1.0 2108: LIBFOO_SOURCE = libfoo-$(LIBFOO_VERSION).tar.gz 2209: LIBFOO_SITE = http://www.foosoftware.org/download 2310: LIBFOO_CONF_OPTS = QT_CONFIG+=bar QT_CONFIG-=baz 2411: LIBFOO_DEPENDENCIES = bar 2512: 2613: $(eval $(qmake-package)) 27------------------------ 28 29On line 7, we declare the version of the package. 30 31On line 8 and 9, we declare the name of the tarball (xz-ed tarball 32recommended) and the location of the tarball on the Web. Buildroot 33will automatically download the tarball from this location. 34 35On line 10, we tell Buildroot what options to enable for libfoo. 36 37On line 11, we tell Buildroot the dependencies of libfoo. 38 39Finally, on line line 13, we invoke the +qmake-package+ 40macro that generates all the Makefile rules that actually allows the 41package to be built. 42 43[[qmake-package-reference]] 44 45==== +qmake-package+ reference 46 47The main macro of the QMake package infrastructure is +qmake-package+. 48It is similar to the +generic-package+ macro. 49 50Just like the generic infrastructure, the QMake infrastructure works 51by defining a number of variables before calling the +qmake-package+ 52macro. 53 54First, all the package metadata information variables that exist in 55the generic infrastructure also exist in the QMake infrastructure: 56+LIBFOO_VERSION+, +LIBFOO_SOURCE+, +LIBFOO_PATCH+, +LIBFOO_SITE+, 57+LIBFOO_SUBDIR+, +LIBFOO_DEPENDENCIES+, +LIBFOO_INSTALL_STAGING+, 58+LIBFOO_INSTALL_TARGET+. 59 60An additional variable, specific to the QMake infrastructure, can 61also be defined. 62 63* +LIBFOO_CONF_ENV+, to specify additional environment variables to 64 pass to the +qmake+ script for the configuration step. By default, empty. 65 66* +LIBFOO_CONF_OPTS+, to specify additional options to pass to the 67 +qmake+ script for the configuration step. By default, empty. 68 69* +LIBFOO_MAKE_ENV+, to specify additional environment variables to the 70 +make+ command during the build and install steps. By default, empty. 71 72* +LIBFOO_MAKE_OPTS+, to specify additional targets to pass to the 73 +make+ command during the build step. By default, empty. 74 75* +LIBFOO_INSTALL_STAGING_OPTS+, to specify additional targets to pass 76 to the +make+ command during the staging installation step. By default, 77 +install+. 78 79* +LIBFOO_INSTALL_TARGET_OPTS+, to specify additional targets to pass 80 to the +make+ command during the target installation step. By default, 81 +install+. 82 83* +LIBFOO_SYNC_QT_HEADERS+, to run syncqt.pl before qmake. Some packages 84 need this to have a properly populated include directory before 85 running the build. 86