xref: /openbsd-src/share/man/man5/port-modules.5 (revision 4b70baf6e17fc8b27fc1f7fa7929335753fa94c3)
1.\"	$OpenBSD: port-modules.5,v 1.239 2019/04/23 12:31:33 kmos Exp $
2.\"
3.\" Copyright (c) 2008 Marc Espie
4.\"
5.\" All rights reserved.
6.\"
7.\" Redistribution and use in source and binary forms, with or without
8.\" modification, are permitted provided that the following conditions
9.\" are met:
10.\" 1. Redistributions of source code must retain the above copyright
11.\"    notice, this list of conditions and the following disclaimer.
12.\" 2. Redistributions in binary form must reproduce the above copyright
13.\"    notice, this list of conditions and the following disclaimer in the
14.\"    documentation and/or other materials provided with the distribution.
15.\"
16.\" THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY EXPRESS OR
17.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
18.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
19.\" IN NO EVENT SHALL THE DEVELOPERS BE LIABLE FOR ANY DIRECT, INDIRECT,
20.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
21.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
22.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
23.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
25.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd $Mdocdate: April 23 2019 $
28.Dt PORT-MODULES 5
29.Os
30.Sh NAME
31.Nm port-modules
32.Nd documentation and conventions used in port modules
33.Sh DESCRIPTION
34The
35.Ox
36Ports framework is based on a gigantic makefile named
37.Xr bsd.port.mk 5 .
38.Pp
39In order to curb unwieldy growth, parts of the framework
40that are not always needed have been set apart in optional
41files called
42.Nm port modules ,
43which are retrieved as needed through the
44.Ev MODULES
45variable of
46.Xr bsd.port.mk 5 .
47.Pp
48Some of these modules correspond to basic mechanisms which are not
49always needed, such as GNU autoconf, or perl5.
50.Pp
51For convenience, setting
52.Ev CONFIGURE_STYLE
53in a port's main Makefile is enough to get perl5 or autoconf support, but
54.Ar gnu ,
55.Ar imake
56and
57.Ar perl5
58are actually modules, and there is some glue in
59.Xr bsd.port.mk 5
60that magically adds the required module in that case.
61This doesn't work when parsing modules.
62For instance, if you set
63.Li CONFIGURE_STYLE=gnu
64in a module, you also need to
65.Li MODULES += gnu .
66.Pp
67Other modules correspond to shortcuts for using some other ports as
68dependencies without needing to hardcode too much, such as
69the qt ports.
70.Sh THE MODULES LOOK-UP MECHANISM
71The variable
72.Ev MODULES
73should contain a list of module names.
74Some core modules are a single word, all other modules should be
75${PKGPATH}.
76If the module is
77.Pa some/dir/portname ,
78the ports framework will look for a file named
79.Pa ${PORTSDIR}/some/dir/portname/portname.port.mk
80and include it.
81.Pp
82Most modules should conform to this syntax.
83The historic practice of having a redirection file directly under
84.Pa ${PORTSDIR}/infrastructure/mk
85is deprecated for new modules.
86.Pp
87Modules may refer to each other.
88The modules mechanism has specific recursion handling such that
89adding
90.Li MODULES += foo/bar
91to a module will work as expected.
92.Sh NAMING CONVENTIONS
93Since there is no actual scope in makefiles, everything defined within
94a module will be global to the ports framework, and thus may interfere
95with other ports.
96.Pp
97As far as possible, all variables and targets belonging to a module named
98.Pa some/dir/foo
99should be named
100.Ev MODFOO_*
101and
102.Ar modfoo_* .
103.Pp
104Following the same conventions as
105.Xr bsd.port.mk 5 ,
106internal variables and targets not intended for user consumption should be
107named
108.Ev _MODFOO_*
109and
110.Ar _modfoo_* .
111.Pp
112For instance, if a module wants some value to be available for the rest
113of the world, it should define
114.Ev MODFOO_VARNAME ,
115with a name matching the basic infrastructure as far as possible.
116That is, a port that defines specific dependencies will usually
117define
118.Ev MODFOO_WANTLIB ,
119.Ev MODFOO_LIB_DEPENDS ,
120and
121.Ev MODFOO_RUN_DEPENDS ,
122as appropriate.
123.Pp
124As an exception to the naming mechanism, some ports have several distinct
125versions in the ports tree, say
126.Pa x11/qt3
127and
128.Pa x11/qt4 .
129Instead of using the namespace
130.Ev MODQT3* ,
131variables will usually drop the version suffix and be simply called
132.Ev MODQT_*
133so that a port using the module can be switched from version to version
134without needing to change everything.
135.Pp
136It is highly desirable to define names in both namespaces for such ports,
137for example to define both
138.Ev MODQT3_LIB_DEPENDS
139and
140.Ev MODQT_LIB_DEPENDS .
141Normal client ports will use
142.Ev MODQT_LIB_DEPENDS ,
143but a port may exceptionally import both modules with
144.Li MODULES += x11/qt3 x11/qt4
145and differentiate between qt3 and qt4 needs with
146.Ev MODQT3_LIB_DEPENDS
147and
148.Ev MODQT4_LIB_DEPENDS .
149See
150.Pa print/poppler
151for an example.
152.Sh OVERRIDING TARGET BEHAVIOR
153The main framework contains several hooks that allow ports to override
154normal behavior.
155This evolved as an ad-hoc framework, where only hooks that turned out
156to be needed were added.
157If several modules define the same hook, hook behaviors will be
158invoked in sequence.
159.Bl -tag -width do-configure
160.It Cm extract
161There is a
162.Cm post-extract
163hook that can be activated by defining
164.Ev MODFOO_post-extract .
165It will be run right after
166.Cm post-extract .
167.It Cm patch
168There is a
169.Cm post-patch
170hook that can be activated by defining
171.Ev MODFOO_post-patch .
172It will be run right after
173.Cm post-patch .
174.It Cm gen
175There is a
176.Cm gen
177hook that can be activated by defining
178.Ev MODFOO_gen .
179It will be run right after
180.Cm do-gen
181and before
182.Ev REORDER_DEPENDENCIES
183touches things.
184.It Cm configure
185There is a
186.Cm pre-configure
187hook that can be activated by defining
188.Ev MODFOO_pre-configure .
189It will be run right after
190.Cm pre-configure .
191The normal
192.Cm do-configure
193behavior is to invoke all
194.Ev MODFOO_configure
195contents that are defined in
196.Ev CONFIGURE_STYLE .
197By default,
198.Cm configure
199will do nothing.
200.Pp
201Some
202.Ev CONFIGURE_STYLE
203values, namely perl, gnu, imake, and autoconf,
204will automatically import the correct module.
205User-defined modules must both add to
206.Ev CONFIGURE_STYLE
207and import the correct module to override behavior.
208.Pp
209Contrary to other hooks, module behavior is not invoked in
210addition to
211.Cm do-configure ,
212but as the normal configure process.
213If
214.Cm do-configure
215is overridden, normal hook processing will not happen.
216.It Cm fake
217There is a
218.Cm pre-fake
219hook that can be activated by defining
220.Ev MODFOO_pre-fake .
221This will be invoked right after
222.Xr mtree 8 ,
223and before the normal
224.Cm pre-fake
225behavior.
226.Pp
227This can occasionally be used for ports that require some specific
228fake installation setup that will be provided by runtime dependencies.
229.It Cm install
230There is a
231.Cm post-install
232hook that can be activated by defining
233.Ev MODFOO_post-install .
234This will be invoked at the end of
235.Cm install ,
236right after the normal
237.Cm post-install
238behavior.
239.El
240.Pp
241Some targets, such as
242.Cm do-build
243or
244.Cm do-install ,
245can't be overridden simply.
246A module that, for instance, requires specific
247.Cm do-build
248behavior should do so in two steps:
249.Bl -bullet
250.It
251Define a variable named
252.Ev MODFOO_BUILD_TARGET
253that contains the commands necessary for
254.Cm do-build :
255.Bd -literal -offset indent
256MODFOO_BUILD_TARGET = cmd1; cmd2
257.Ed
258.It
259Override
260.Cm do-build
261only if it's not already defined by the port proper:
262.Bd -literal -offset indent
263\&.if !target(do-build)
264do-build:
265	@${MODFOO_BUILD_TARGET}
266\&.endif
267.Ed
268.El
269That way, if several modules require specific actions for those targets,
270the end user can choose the appropriate order in which to run the actions:
271.Bd -literal -offset indent
272do-build:
273	@${MODBAR_BUILD_TARGET}
274	@${MODFOO_BUILD_TARGET}
275	...
276.Ed
277.Sh OVERRIDING VARIABLE BEHAVIOR
278Some variables can be overridden by modules.
279Be very cautious, as this can make the module difficult to use,
280or interact badly with other modules.
281As a rule, always provide the override as:
282.Pp
283.Dl VARIABLE ?= value
284.Pp
285and provide a module-specific variable with the same value:
286.Pp
287.Dl MODFOO_VARIABLE = value .
288.Pp
289The following variables can be overridden in a relatively safe fashion:
290.Ev ALL_TARGET ,
291.Ev CONFIGURE_SCRIPT ,
292.Ev DESTDIRNAME ,
293.Ev DIST_SUBDIR ,
294.Ev DISTNAME ,
295.Ev DISTFILES ,
296.Ev EXTRACT_SUFX ,
297.Ev FAKE_FLAGS ,
298.Ev FETCH_MANUALLY ,
299.Ev HOMEPAGE ,
300.Ev IGNORE ,
301.Ev IS_INTERACTIVE ,
302.Ev LIBTOOL_FLAGS ,
303.Ev MAKE_FILE ,
304.Ev MASTER_SITES ,
305.Ev MULTI_PACKAGES ,
306.Ev NO_BUILD ,
307.Ev NO_TEST ,
308.Ev PATCH_LIST ,
309.Ev PKG_ARCH ,
310.Ev PKGNAME* ,
311.Ev PREFIX ,
312.Ev TEST_TARGET ,
313.Ev TEST_IS_INTERACTIVE ,
314.Ev REORDER_DEPENDENCIES ,
315.Ev SEPARATE_BUILD ,
316.Ev USE_GMAKE ,
317.Ev USE_LIBTOOL .
318.Pp
319The following variables can be added to in a relatively safe fashion:
320.Ev BUILD_DEPENDS ,
321.Ev CATEGORIES ,
322.Ev CONFIGURE_ARGS ,
323.Ev CONFIGURE_ENV ,
324.Ev ERRORS ,
325.Ev FAKE_FLAGS ,
326.Ev FLAVOR ,
327.Ev FLAVORS ,
328.Ev INSTALL_TARGET ,
329.Ev LIB_DEPENDS ,
330.Ev MAKE_ENV ,
331.Ev MAKE_FLAGS ,
332.Ev PKG_ARGS ,
333.Ev PSEUDO_FLAVORS ,
334.Ev TEST_DEPENDS ,
335.Ev REORDER_DEPENDENCIES ,
336.Ev RUN_DEPENDS ,
337.Ev SUBST_VARS ,
338.Ev WANTLIB .
339.Sh SPECIFIC MODULE INTERACTIONS
340Some modules correspond to extra ports that will be used mostly as
341.Ev BUILD_DEPENDS
342or
343.Ev RUN_DEPENDS .
344Such modules can safely append values directly to the
345.Ev BUILD_DEPENDS ,
346.Ev RUN_DEPENDS ,
347.Ev LIB_DEPENDS ,
348and
349.Ev WANTLIB
350variables, as long as they also define module-specific variables for
351all runtime dependencies.
352.Pp
353Simple client ports will use the module directly, and thus inherit extra
354build and runtime dependencies.
355.Pp
356More sophisticated ports can use
357.Ev MULTI_PACKAGES
358to select specific behavior: build-time dependencies will always be
359needed.
360Runtime dependencies will be selected on a subpackage basis,
361since runtime dependencies such as
362.Ev LIB_DEPENDS-sub
363do not inherit the default
364.Ev LIB_DEPENDS
365value.
366The client port's author must only bear in mind that external modules
367may add values to the default
368.Ev WANTLIB ,
369.Ev LIB_DEPENDS ,
370and
371.Ev RUN_DEPENDS ,
372and thus that it is not safe to inherit from it blindly.
373.Pp
374Modules are imported during
375.Pp
376.Dl .include <bsd.port.mk>
377.Pp
378Thus they can be affected by user choices such as setting a variable
379to Yes or No.
380Modules may make decisions based on documented
381.Ev MODFOO_BEHAVIOR
382values.
383.Pp
384When modules are processed, only a few
385.Xr bsd.port.mk 5
386variables are already defined.
387Modules may depend upon the following variables already having a sane
388value:
389.Ev DISTDIR ,
390.Ev LOCALBASE ,
391.Ev NO_DEPENDS ,
392.Ev PKGPATH ,
393.Ev PORTSDIR ,
394.Ev X11BASE
395and all arch-dependent constants from
396.Xr bsd.port.arch.mk 5 ,
397such as
398.Ev PROPERTIES
399or
400.Ev LP64_ARCHS .
401Note that this is only relevant for tests.
402It is perfectly okay to define variables or targets that depend on the
403basic ports framework without having to care whether that variable is
404already defined, since
405.Xr make 1
406performs lazy evaluation.
407.Sh CORE MODULES DOCUMENTATION
408The following modules are available.
409.Bl -tag -width do-configure
410.It apache-module
411.It cpan
412For perl ports coming from CPAN.
413Wrapper around the normal perl module that fetches the file from
414the correct location depending on
415.Ev DISTNAME ,
416and sets a default
417.Ev PKGNAME .
418Also affects
419.Ev TEST_DEPENDS ,
420.Ev CONFIGURE_STYLE ,
421.Ev PKG_ARCH ,
422and
423.Ev CATEGORIES .
424.Pp
425Some CPAN modules are only indexed by author, set
426.Li CPAN_AUTHOR=ID
427to locate the right directory.
428.Pp
429If no
430.Ev HOMEPAGE
431is defined, it will default to
432.Pa http://search.cpan.org/dist/${DISTNAME:C/-[^-]*$//}/
433.Pp
434User settings: set
435.Ev CPAN_REPORT
436to Yes,
437.Ev CPAN_REPORT_DB
438to a valid directory,
439and
440.Ev CPAN_REPORT_FROM
441to a valid email address to automate the reporting
442of regression tests to CPAN.
443.Pp
444If
445.Ev MODCPAN_EXAMPLES
446is set, the following variables will be set.
447.Ev MODCPAN_EXAMPLES_DIST
448will hold the default directory in the distfile with
449example scripts.
450.Ev MODCPAN_EXAMPLES_DIR
451will be set to the standard installation directory for
452examples.
453Sets the
454.Cm post-install
455target if none has been defined to install the examples,
456otherwise
457.Ev MODCPAN_POST_INSTALL
458should be used as such:
459.Bd -literal
460post-install:
461	...
462	${MODCPAN_POST_INSTALL}
463.Ed
464.It databases/mariadb
465Adds small framework for testing ports that require running MariaDB.
466Defines
467.Ev MODMARIADB_TEST_TARGET
468which consists actual commands to run in
469.Cm do-test
470target.
471If this target isn't defined, it will be added automatically.
472.Pp
473The actual test command to be run could be specified in the
474.Ev MODMARIADB_TEST_CMD .
475Default is similar to what
476.Xr bsd.port.mk 5
477runs itself.
478.Pp
479The MariaDB server being started will listen on UNIX domain socket
480only, minimizing impact on running system.
481The path to socket is recorded in
482.Ev MODMARIADB_TEST_SOCKET .
483Any local user will be able to connect without password.
484.Pp
485If the
486.Ev MODMARIADB_TEST_DBNAME
487variable is set, the database with such name will be set up before
488running actual test command.
489Otherwise (default), the test is responsible to call
490.Xr mysqladmin 1
491itself, if needed.
492.Pp
493The
494.Pa databases/mariadb,-server
495will get added to
496.Ev TEST_DEPENDS ,
497but not to any other
498.Ev *_DEPENDS .
499The
500.Ev MODMARIADB_CLIENT_ARGS
501and
502.Ev MODMARIADB_ADMIN_ARGS
503variables hold arguments for
504.Xr mysql 1
505and
506.Xr mysqladmin 1 ,
507respectively; those argument lists could be used in test scripts
508for connecting to test server, if they aren't satisfied by environment.
509.It databases/postgresql
510Adds small framework for testing ports that require running Postgres.
511Defines
512.Ev MODPOSTGRESQL_TEST_TARGET
513which consists actual commands to run in
514.Cm do-test
515target.
516If this target isn't defined, it will be added automatically.
517.Pp
518The actual test command to be run could be specified in the
519.Ev MODPOSTGRESQL_TEST_CMD .
520Default is similar to what
521.Xr bsd.port.mk 5
522runs itself.
523.Pp
524The Postgres server being started will listen on UNIX domain socket
525only, minimizing impact on running system.
526The path to directory where socket will be created is set by
527.Ev MODPOSTGRESQL_TEST_PGHOST ,
528defaulting to
529.Pa ${WRKDIR} .
530Any local user will be able to connect without password.
531.Pp
532If the
533.Ev MODPOSTGRESQL_TEST_DBNAME
534variable is set, the database with such name will be set up before
535running actual test command.
536Otherwise (default), the test is responsible to call
537.Xr initdb 1
538itself.
539.Pp
540The
541.Pa databases/postgresql,-server
542will get added to
543.Ev TEST_DEPENDS ,
544but not to any other
545.Ev *_DEPENDS .
546.It devel/cmake
547Adds
548.Pa devel/cmake
549to
550.Ev BUILD_DEPENDS
551and fills up
552.Ev CONFIGURE_ARGS ,
553.Ev CONFIGURE_ENV
554and
555.Ev MAKE_ENV .
556Sets up
557.Cm configure
558target.
559If
560.Ev CONFIGURE_STYLE
561was not set before, sets its value to `cmake'.
562Changes default value of
563.Ev SEPARATE_BUILD
564to `Yes' because modern CMake requires out-of-source build anyway.
565Changes
566.Ev TEST_TARGET
567to `test' as this is standard for CMake projects.
568Also this module has the following knobs:
569.Bl -tag -width Ds
570.It MODCMAKE_WANTCOLOR
571If set to `Yes', CMake will colorize its output.
572Should not be used in ports Makefiles.
573Default value is `No'.
574.It MODCMAKE_VERBOSE
575If set to `Yes', CMake will print details during configure and build
576stages about exact command being run, etc.
577Should not be used in ports Makefiles.
578Default value is `Yes'.
579.It MODCMAKE_DEBUG
580If set to `Yes', CMake will produce a debug build instead of a release
581build.
582The exact effects on the build process depend on settings specified in
583the CMake config files.
584Default value is `No'.
585.El
586Also,
587.Sq nojunk
588is added to DPB_PROPERTIES because CMake's include files parser cheats
589too much.
590.It devel/cargo
591Automates download and compilation of dependencies of a Rust project using
592.Xr cargo 1 .
593During
594.Cm fetch ,
595static dependencies ("crates") listed in
596.Ev MODCARGO_CRATES
597are downloaded using
598.Ev MODCARGO_DIST_SUBDIR
599as
600.Ev DIST_SUBDIR .
601During
602.Cm post-extract ,
603crates defined in
604.Ev MODCARGO_CRATES
605are moved to the
606.Ev MODCARGO_VENDOR_DIR
607directory.
608During
609.Cm post-patch ,
610crate-metadata are generated using
611.Pa devel/cargo-generate-vendor .
612With
613.Ev CONFIGURE_STYLE
614set to
615.Sq cargo ,
616cargo is configured to use
617.Ev MODCARGO_VENDOR_DIR
618instead of the standard crates-io network source.
619Finally, any crates listed in
620.Ev MODCARGO_CRATES_UPDATE
621are updated.
622.Ev MODCARGO_RUSTFLAGS
623can be used to pass custom flags to all
624.Xr rustc 1
625invocations.
626.Pp
627.Pa lang/rust ,
628.Pa devel/cargo
629and
630.Pa devel/cargo-generate-vendor
631are added to
632.Ev BUILD_DEPENDS .
633By default
634.Ev MASTER_SITES9
635is used to download the crates.
636.Pp
637This module defines:
638.Bl -tag -width MODCARGO_CRATES_UPDATE
639.It MODCARGO_CARGOTOML
640Path to cargo manifest.
641Defaults to
642.Pa ${WRKSRC}/Cargo.toml .
643.It MODCARGO_CRATES
644Crates that will be downloaded by the module.
645.It MODCARGO_CRATES_UPDATE
646List of crates to update, overriding the version listed in Cargo.lock.
647.It MODCARGO_FEATURES
648List of features to be used when building.
649.It MODCARGO_VENDOR_DIR
650Name of the local directory for vendoring crates.
651Defaults to
652.Pa ${WRKSRC}/modcargo-crates .
653.El
654.Pp
655This module adds three
656.Xr make 1
657targets:
658.Bl -tag -width modcargo-gen-crates-licenses
659.It Cm modcargo-metadata
660Rerun the generation of crates' metadata.
661.It Cm modcargo-gen-crates
662Generate the
663.Ev MODCARGO_CRATES
664list from Cargo.lock (a preliminary crates list is not required).
665.It Cm modcargo-gen-crates-licenses
666Generate the
667.Ev MODCARGO_CRATES
668list with license information from crates present in the
669.Ev MODCARGO_VENDOR_DIR
670directory.
671.El
672.It devel/dconf
673Sets
674.Ev CONFIGURE_ARGS ,
675.Ev BUILD_DEPENDS
676and
677.Ev RUN_DEPENDS .
678This module is used by ports installing gsettings schemas under
679.Pa ${PREFIX}/share/glib-2.0/schemas/ .
680It requires the following goo in the PLIST:
681.Bd -literal -offset indent
682@exec %D/bin/glib-compile-schemas %D/share/glib-2.0/schemas >/dev/null
683@unexec-delete %D/bin/glib-compile-schemas %D/share/glib-2.0/schemas >/dev/null
684.Ed
685.It devel/gconf2
686A link from
687.Xr gconftool-2 1
688to
689.Xr true 1
690will be put at the front of the
691.Ev PATH .
692Sets
693.Ev CONFIGURE_ARGS ,
694.Ev BUILD_DEPENDS
695and
696.Ev RUN_DEPENDS .
697According to the values of
698.Ev MODGCONF2_LIBDEP ,
699sets
700.Ev LIB_DEPENDS .
701User settings: set
702.Ev MODGCONF2_SCHEMAS_DIR
703to the directory name under
704.Pa ${LOCALBASE}/share/schemas/
705where schemas files will be installed.
706.It devel/meson
707Adds
708.Pa devel/meson
709and
710.Pa devel/ninja
711to
712.Ev BUILD_DEPENDS .
713Sets up
714.Cm configure
715target.
716If
717.Ev CONFIGURE_STYLE
718was not set before, sets its value to `meson'.
719Changes default value of
720.Ev SEPARATE_BUILD
721to `Yes' because meson requires out-of-source build.
722If
723.Ev CONFIGURE_STYLE
724is 'meson',
725.Ev MODMESON_CONFIGURE_ARGS
726and
727.Ev MODMESON_CONFIGURE_ENV
728will add default values to
729.Ev CONFIGURE_ARGS
730and
731.Ev CONFIGURE_ENV .
732Also this module has the following knob:
733.Bl -tag -width Ds
734.It MODMESON_WANTCOLOR
735If set to `Yes', meson will colorize its output.
736Should not be used in ports Makefiles.
737Default value is `No'.
738.El
739.It devel/pmk
740Sets
741.Ev CONFIGURE_SCRIPT ,
742.Ev CONFIGURE_ARGS
743and
744.Ev MODPMK_configure .
745It appends
746.Pa devel/pmk
747to
748.Ev BUILD_DEPENDS .
749.It devel/qmake
750This module automates usage of qmake, independently of the actual
751version of Qt being used.
752This module requires that one of the
753.Pa x11/qt3 ,
754.Pa x11/qt4
755or
756.Pa x11/qt5
757to be used as well.
758.Pp
759If
760.Ev CONFIGURE_STYLE
761was not set before, sets its value to
762.Sq qmake .
763If
764.Ev CONFIGURE_STYLE
765contains
766.Sq qmake
767the module will define each of the
768.Ar do-build
769and
770.Ar do-install
771targets, unless port already defines one; also,
772.Ev SEPARATE_BUILD
773will be set to
774.Sq Yes
775unless it's already set to some value.
776Also, unless
777.Ev NO_TEST
778is set, the
779.Ar do-test
780target will be defined.
781.Pp
782The following variables could be used in qmake-based ports:
783.Bl -tag -width 1234
784.It Ev MODQMAKE_ARGS
785Additional arguments for qmake invocation.
786The module already defines some.
787.It Ev MODQMAKE_INSTALL_ROOT
788Root directory for fake install.
789Normally, it's a WRKINST, but some (broken) ports require another value,
790like PREFIX.
791.It Ev MODQMAKE_PROJECTS
792List of qmake project files to be used, relative to WRKSRC.
793Directories containing those projects could be used as well,
794see qmake documentation for details.
795Defaults to
796.Sq \&. ,
797which means the (only) project in WRKSRC directory.
798.It Ev MODQMAKE_RECURSIVE
799If
800.Sq Yes ,
801then qmake will be run recursively during configure stage;
802otherwise, only projects mentioned in
803.Ev MODQMAKE_PROJECTS
804will be processed during configure stage, and their descendants will
805be visited during main build phase.
806Sometimes a qmake project processing depends on files generated
807by other qmake project during build, and recursive builds break this.
808For Qt4+ defaults to
809.Sq Yes ,
810and Qt3 doesn't support recursive configuring.
811.It Ev MODQMAKE_build
812Actual commands that module will use to build all
813.Ev MODQMAKE_PROJECTS
814provided.
815To be used in complicated cases, when port have to use its own
816.Ar do-build
817target or mix different
818.Ev CONFIGURE_STYLE
819values.
820.It Ev MODQMAKE_install
821Same as for
822.Ev MODQMAKE_build ,
823but used in
824.Ar do-install
825stage.
826.El
827.It devel/scons
828Adds
829.Pa devel/scons
830to
831.Ev BUILD_DEPENDS .
832Sets
833.Ev MODSCONS_BIN
834and
835.Ev MODSCONS_ENV .
836Also defines an overridable
837.Ev MODSCONS_FLAGS .
838It provides a
839.Cm do-build
840and
841.Cm do-install
842targets that can be overridden in the port Makefile.
843.It font
844.It fortran
845Sets
846.Ev MODFORTRAN_LIB_DEPENDS ,
847.Ev MODFORTRAN_WANTLIB ,
848.Ev MODFORTRAN_BUILD_DEPENDS .
849Set
850.Ev MODFORTRAN_COMPILER
851to `g77' or `gfortran', depending on what the port requires.
852The default is `g77'.
853The dependencies are chosen according to
854.Ev MODFORTRAN_COMPILER .
855.It gcc4
856If
857.Ev COMPILER_VERSION
858is not gcc4 (defined by
859.Pa /usr/share/mk/bsd.own.mk ) ,
860and architecture is in
861.Ev MODGCC4_ARCHS ,
862then the gcc4 compilers will be put at the front of the path.
863By default, only C language support is included by this module.
864If other languages are needed, they must be listed in
865.Ev MODGCC4_LANGS
866(e.g. c++, fortran).
867The
868.Ev MODGCC4_VERSION
869variable can be used to change the version of gcc.
870By default gcc 4.9 is used.
871If
872.Ev MODGCC4_LANGS
873contains c++, this module provides
874.Ev MODGCC4_CPPLIBDEP
875and
876.Ev MODGCC4_CPPWANTLIB .
877.It gnu
878This module is documented in the main
879.Xr bsd.port.mk 5
880manpage.
881.It imake
882This module is documented in the main
883.Xr bsd.port.mk 5
884manpage.
885.It java
886Set
887.Li MODJAVA_VER=x.y
888to use exactly the JDK x.y,
889.Li MODJAVA_VER=x.y+
890to use any x.y or higher version.
891Set
892.Li MODJAVA_JRERUN=Yes
893if the port only needs the JRE at runtime.
894The module sets
895.Ev JAVA_HOME ,
896.Ev ONLY_FOR_ARCHS ,
897.Ev MODJAVA_RUN_DEPENDS ,
898.Ev MODJAVA_SHARE_DIR ,
899.Ev MODJAVA_JAR_DIR ,
900.Ev MODJAVA_EXAMPLE_DIR
901and
902.Ev MODJAVA_DOC_DIR .
903It appends to
904.Ev BUILD_DEPENDS ,
905.Ev RUN_DEPENDS ,
906.Ev CATEGORIES
907and
908.Ev SUBST_VARS .
909If
910.Li MODJAVA_BUILD=ant
911then this module provides
912.Ev MODJAVA_BUILD_DIR ,
913.Ev MODJAVA_BUILD_FILE
914and
915.Ev MODJAVA_BUILD_TARGET_NAME ,
916as well as a
917.Cm do-build
918target (if not already defined).
919It heeds
920.Ev NO_BUILD .
921.It lang/clang
922Similar to gcc3 and gcc4 modules.
923If architecture is in MODCLANG_ARCHS, the CLang compilers will be
924put at the front of the path.
925By default, only C language support is included by this module.
926If other languages are needed, they must be listed in
927.Ev MODCLANG_LANGS
928(e.g. c++).
929Sets
930.Ev MODCLANG_VERSION
931which is also appended to
932.Ev SUBST_VARS .
933.It lang/erlang
934.It lang/ghc
935Sets
936.Ev ONLY_FOR_ARCHS ,
937.Ev MODGHC_VER ,
938.Ev BUILD_DEPENDS ,
939and
940.Ev RUN_DEPENDS .
941Build and further actions are based on the list of values in
942.Ev MODGHC_BUILD :
943.Bl -tag -width register
944.It Ar nort
945no runtime dependency on
946.Pa lang/ghc
947nor the hs- prefix to
948.Ev PKGNAME
949will be added,
950.It Ar cabal
951get the typical Cabal targets defined,
952.It Ar haddock
953generate API documentation using
954.Pa devel/haddock ,
955.It Ar register
956create and include register/unregister scripts,
957.It Ar hackage
958the distfiles are available on Hackage.
959.El
960.Pp
961Also affects
962.Ev CATEGORIES ,
963.Ev CONFIGURE_STYLE
964and
965.Ev SUBST_VARS .
966.Cm do-build ,
967.Cm do-install
968and
969.Cm do-test
970targets are provided if the port itself didn't set them.
971If
972.Ar register
973has been set, the PLIST needs to be modified in order to
974add the relevant @exec/@unexec lines.
975This module will run the Setup script and ensure the documentation
976will be built (if
977.Ar haddock
978has been set), and that the package is
979registered as a library usable by
980.Pa lang/ghc
981(if
982.Ar register
983has been set).
984Extra arguments and environment additions for the Setup configure
985command can be specified with
986.Ev MODGHC_SETUP_CONF_ARGS
987and
988.Ev MODGHC_SETUP_CONF_ENV .
989.It lang/go
990Adds Go toolchain support.
991Requires
992.Ev ALL_TARGET
993to be set to canonical Go import path of port.
994(Module sets it automatically for ports that use
995.Ev GH_ACCOUNT
996and
997.Ev GH_PROJECT
998macros.)
999.Pp
1000During execution of
1001.Cm pre-configure
1002target module moves source code from
1003.Pa ${MODGO_SUBDIR}
1004to
1005.Pa ${WRKSRC} ,
1006subdirectory of
1007.Pa ${MODGO_WORKSPACE}
1008- specially-crafted Go workspace located at
1009.Pa ${WRKDIR}/go .
1010During
1011.Cm do-build
1012module calls
1013.Dq go install
1014with
1015.Ev GOPATH
1016set to
1017.Pa ${MODGO_WORKSPACE} ,
1018runs its output through sed to prevent writes outside
1019.Ev WRKDIR
1020sandbox and sends output to
1021.Xr sh 1 .
1022During
1023.Cm do-install
1024it copies executables from
1025.Pa ${MODGO_WORKSPACE}/bin
1026to
1027.Pa ${PREFIX}/bin ,
1028and/or directories
1029.Pa ${MODGO_WORKSPACE}/pkg
1030and
1031.Pa ${MODGO_WORKSPACE}/src
1032to
1033.Pa ${PREFIX}/go ,
1034depending on
1035.Ev MODGO_TYPE
1036contents.
1037.Pp
1038Sets
1039.Ev BUILD_DEPENDS ,
1040.Ev RUN_DEPENDS ,
1041.Ev ALL_TARGET ,
1042.Ev TEST_TARGET ,
1043.Ev ONLY_FOR_ARCHS ,
1044.Ev SEPARATE_BUILD ,
1045and
1046.Ev WRKSRC .
1047.Pp
1048Appends to
1049.Ev CATEGORIES .
1050.Pp
1051Defines:
1052.Bl -tag -width MODGO_WORKSPACE
1053.It Ev MODGO_TYPE
1054Type of port.
1055May be any combination of:
1056.Bl -tag -width lib
1057.It bin
1058ordinary binary, which should be installed to
1059.Pa ${PREFIX}/bin ,
1060.It lib
1061library, which should come with source code.
1062.El
1063.Pp
1064Defaults to
1065.Ar bin .
1066.It Ev MODGO_WORKSPACE
1067Path to Go workspace set up for port build process.
1068Defaults to
1069.Pa ${WRKDIR}/go .
1070See Go documentation for details.
1071.It Ev MODGO_SUBDIR
1072Path to Go source code within port's sources tarball.
1073Defaults to
1074.Pa ${WRKDIST} .
1075.It Ev MODGO_SETUP_WORKSPACE
1076Commands setting up Go workspace for building ports.
1077By default, happens during execution of
1078.Cm pre-configure
1079target.
1080.It Ev MODGO_BUILDDEP
1081Controls whether contents of
1082.Ev MODGO_BUILD_DEPENDS
1083are appended to port's
1084.Ev BUILD_DEPENDS .
1085Defaults to
1086.Ar Yes .
1087.El
1088.Pp
1089Additionally defines
1090.Ev MODGO_PACKAGES ,
1091.Ev MODGO_SOURCES
1092and
1093.Ev MODGO_TOOLS
1094(paths for installed Go packages, sources and tools respectively),
1095.Ev MODGO_CMD
1096and
1097.Ev MODGO_FLAGS
1098(source code build command and flags passed as its arguments),
1099.Ev MODGO_LDFLAGS ,
1100.Ev MODGO_BUILD_CMD
1101and
1102.Ev MODGO_TEST_CMD
1103(commands for building and testing go packages; normally called with canonical
1104Go package names as arguments),
1105.Ev MODGO_{BUILD,INSTALL,TEST}_TARGET
1106and
1107.Ev MODGO_{BUILD,RUN}_DEPENDS .
1108.It lang/lua
1109Sets
1110.Ev MODLUA_BIN ,
1111.Ev MODLUA_DATADIR ,
1112.Ev MODLUA_DEP ,
1113.Ev MODLUA_DEP_VERSION ,
1114.Ev MODLUA_DOCDIR ,
1115.Ev MODLUA_EXAMPLEDIR ,
1116.Ev MODLUA_INCL_DIR ,
1117.Ev MODLUA_LIB ,
1118.Ev MODLUA_LIBDIR ,
1119.Ev MODLUA_VERSION ,
1120.Ev MODLUA_WANTLIB .
1121Appends to
1122.Ev CATEGORIES .
1123Also appends to
1124.Ev BUILD_DEPENDS ,
1125unless
1126.Ev NO_BUILD
1127has been set to Yes.
1128Also appends to
1129.Ev RUN_DEPENDS ,
1130unless
1131.Ev MODLUA_RUNDEP
1132is set to No.
1133Appends
1134.Ev MODLUA_VERSION ,
1135.Ev MODLUA_LIB ,
1136.Ev MODLUA_INCL_DIR ,
1137.Ev MODLUA_EXAMPLEDIR ,
1138.Ev MODLUA_DOCDIR ,
1139.Ev MODLUA_LIBDIR ,
1140.Ev MODLUA_DATADIR ,
1141.Ev MODLUA_DEP ,
1142.Ev MODLUA_DEP_VERSION ,
1143.Ev MODLUA_BIN
1144to
1145.Ev SUBST_VARS .
1146.Ev MODLUA_DEFAULT_VERSION
1147is set to 5.1.
1148.Ev MODLUA_VERSION is set to
1149.Ev MODLUA_DEFAULT_VERSION
1150by default.
1151Ports can be built with several lua versions.
1152If no FLAVOR is set it defaults to MODLUA_DEFAULT_VERSION.
1153Otherwise the FULLPKGNAME is adjusted, if MODLUA_SA is not set.
1154In order to set a build, run or test dependency on a lua port,
1155use the following, which will propagate the currently used flavor:
1156.Ev MODLUA_BUILD_DEPENDS ,
1157.Ev MODLUA_TEST_DEPENDS ,
1158.Ev MODLUA_RUN_DEPENDS .
1159.It lang/mono
1160Sets
1161.Ev MODMONO_ONLY_FOR_ARCHS ,
1162.Ev CONFIGURE_ENV ,
1163.Ev MAKE_FLAGS ,
1164.Ev MODMONO_BUILD_DEPENDS
1165and
1166.Ev MODMONO_RUN_DEPENDS .
1167If
1168.Ev MODMONO_DEPS
1169is set to Yes,
1170.Pa lang/mono
1171is appended to
1172.Ev BUILD_DEPENDS
1173and
1174.Ev RUN_DEPENDS .
1175.Ev DLLMAP_FILES
1176defines in which files the module will substitute hardcoded
1177shared library versions using a
1178.Cm post-configure
1179target.
1180.It lang/node
1181Adds common dependencies to
1182.Ev RUN_DEPENDS
1183and
1184.Ev BUILD_DEPENDS .
1185Recognizes two additional types of
1186.Ev CONFIGURE_STYLE Ns s ,
1187"npm" and "npm ext".
1188"npm ext" should be used for npm packages that contain C++ extensions which
1189need to be compiled.
1190"npm" should be used for other npm packages.
1191If regression tests are included that can be run using
1192.Pa devel/node-expresso ,
1193append "expresso" to
1194.Ev CONFIGURE_STYLE .
1195.Pa devel/node-expresso
1196will be appended to
1197.Ev TEST_DEPENDS
1198and a default
1199.Ev MODNODE_TEST_TARGET
1200will be defined, along with a
1201.Cm do-test
1202target if it has not already been set.
1203If "expresso" isn't appended to
1204.Ev CONFIGURE_STYLE ,
1205.Ev TEST_TARGET
1206will be set to "test".
1207One of these two
1208.Ev CONFIGURE_STYLE Ns s
1209should be used or the module doesn't affect anything except
1210.Ev RUN_DEPENDS
1211and
1212.Ev BUILD_DEPENDS .
1213Requires
1214.Ev NPM_NAME
1215to be set to the name of the npm package.
1216Uses
1217.Ev NPM_NAME
1218and
1219.Ev NPM_VERSION
1220to set
1221.Ev DISTNAME ,
1222and
1223.Ev PKGNAME ,
1224and
1225.Ev MASTER_SITES .
1226If the npm package depends on other npm packages, the npm package names it
1227depends on should be listed in
1228.Ev MODNODE_DEPENDS .
1229Adds default
1230.Cm do_build
1231and
1232.Cm do_install
1233tasks, and you can reference the default implementations via
1234.Ev MODNODE_BUILD_TARGET
1235and
1236.Ev MODNODE_INSTALL_TARGET .
1237.It lang/ocaml
1238Appends to
1239.Ev BUILD_DEPENDS
1240and
1241.Ev MAKE_ENV .
1242This selects a %%native%% plist fragment and
1243.Ev ocaml_native
1244property depending on whether the architecture supports native
1245compilation.
1246If dynamic linking is supported on the native architecture,
1247the %%dynlink%% plist fragment and
1248.Ev ocaml_native_dynlink
1249property is set.
1250When
1251.Ev CONFIGURE_STYLE
1252is set to `oasis',
1253overrides for the
1254.Cm do-build ,
1255.Cm do-install ,
1256and
1257.Cm do-test
1258targets are added.
1259.It lang/php
1260Used for ports using PHP in some way:
1261either extensions to PHP, or software written in PHP.
1262Sets
1263.Ev MODPHP_RUN_DEPENDS ,
1264.Ev MODPHP_LIB_DEPENDS ,
1265.Ev MODPHP_WANTLIB ,
1266.Ev MODPHP_BIN ,
1267.Ev MODPHP_PHPIZE ,
1268.Ev MODPHP_PHP_CONFIG ,
1269.Ev MODPHP_INCDIR
1270and
1271.Ev MODPHP_LIBDIR .
1272Adds to
1273.Ev RUN_DEPENDS
1274and
1275.Ev BUILD_DEPENDS
1276unless
1277.Ev MODPHP_RUNDEP
1278or
1279.Ev MODPHP_BUILDDEP
1280are set.
1281If
1282.Ev MODPHP_DO_PHPIZE
1283is set, prepares a build environment for extensions that use phpize.
1284.Pp
1285Ports using PDO for database connectivity often have a choice of
1286dependencies (pdo_sqlite, pdo_mysql, pdo_pgsql and others).
1287The module constructs
1288.Ev MODPHP_PDO_DEPENDS
1289from the PDO types listed in
1290.Ev MODPHP_PDO_ALLOWED
1291(defaulting to "sqlite mysql pgsql").
1292This can be added to
1293.Ev RUN_DEPENDS
1294and allows any of these PDO packages to satisfy the dependency, with
1295.Ev MODPHP_PDO_PREF
1296(sqlite by default) chosen if none are installed.
1297.It lang/php/pecl
1298Used for ports for PHP PECL extensions.
1299Sets default
1300.Ev MASTER_SITES ,
1301.Ev HOMEPAGE ,
1302.Ev EXTRACT_SUFX ,
1303.Ev DESTDIRNAME ,
1304.Ev MODPHP_DO_SAMPLE ,
1305.Ev MODPHP_DO_PHPIZE ,
1306.Ev AUTOCONF_VERSION ,
1307.Ev AUTOMAKE_VERSION ,
1308.Ev LIBTOOL_FLAGS .
1309Provides a default
1310.Ev TEST_TARGET
1311and
1312.Ev TEST_FLAGS
1313unless
1314.Ev NO_TEST
1315or a
1316.Cm do-test
1317target is defined.
1318Adds common dependencies to
1319.Ev RUN_DEPENDS
1320and
1321.Ev BUILD_DEPENDS .
1322Sets a default
1323.Ev PKGNAME
1324and appends to
1325.Ev CATEGORIES .
1326.It lang/python
1327Sets
1328.Ev MODPY_VERSION ,
1329.Ev MODPY_BIN ,
1330.Ev MODPY_INCDIR ,
1331.Ev MODPY_LIBDIR ,
1332.Ev MODPY_SITEPKG ,
1333.Ev MODPY_SETUP ,
1334.Ev MODPY_TEST_DIR ,
1335.Ev MODPY_TEST_LOCALE ,
1336.Ev MODPY_WANTLIB ,
1337.Ev MODPY_LIB_DEPENDS ,
1338.Ev MODPY_RUN_DEPENDS ,
1339.Ev MODPY_TEST_DEPENDS ,
1340.Ev MODPY_BUILD_DEPENDS ,
1341and
1342.Ev MODPY_ADJ_FILES .
1343Appends to
1344.Ev RUN_DEPENDS
1345unless
1346.Ev MODPY_RUNDEP
1347is set to No.
1348Appends to
1349.Ev BUILD_DEPENDS
1350unless
1351.Ev MODPY_BUILDDEP
1352is set to No or
1353.Ev NO_BUILD
1354is set to Yes.
1355Appends to
1356.Ev TEST_DEPENDS
1357if
1358.Ev MODPY_PYTEST
1359is set to Yes
1360unless
1361.Ev MODPY_TESTDEP
1362is set to No.
1363Appends
1364.Ev MODPY_TEST_LOCALE
1365to
1366.Ev TEST_ENV .
1367Changes to the directory specified in
1368.Ev MODPY_TEST_DIR ,
1369by default WRKSRC, before running tests.
1370.Ev MODPY_VERSION
1371is the default version used by all python modules.
1372Ports which use the setuptools module should set
1373.Ev MODPY_SETUPTOOLS
1374to Yes.
1375Ports which use the pytest module should set
1376.Ev MODPY_PYTEST
1377to Yes.
1378Arguments can be passed to pytest during
1379.Cm test
1380with
1381.Ev MODPY_PYTEST_ARGS .
1382All ports that generate egg-info files should set
1383.Ev MODPY_EGG_VERSION
1384to the version string used by the port's setup.py setup() function.
1385Arguments can be passed to setup.py during
1386.Cm configure
1387with
1388.Ev MODPY_SETUP_ARGS .
1389Extra arguments to the build and install commands can be passed via
1390.Ev MODPY_DISTUTILS_BUILDARGS
1391and
1392.Ev MODPY_DISTUTILS_INSTALLARGS .
1393If any files have a python shebang line which needs to be replaced
1394using MODPY_BIN, list them in
1395.Ev MODPY_ADJ_FILES .
1396These are prefixed with WRKSRC and replaced automatically
1397at the end of
1398.Cm pre-configure .
1399Also affects
1400.Ev CATEGORIES ,
1401.Ev MAKE_ENV ,
1402.Ev CONFIGURE_ENV ,
1403and
1404.Ev SUBST_VARS .
1405May affect the
1406.Cm test
1407target.
1408If
1409.Ev MODPY_PI
1410is set to Yes it will set
1411.Ev HOMEPAGE
1412and
1413.Ev MASTER_SITES .
1414The subdirectory can be overridden with
1415.Ev MODPY_PI_DIR .
1416.Pp
1417Python 2.x places .pyc files in the same directory as the associated .py file.
1418Python 3.x places these in a separate __pycache__ directory and uses an
1419additional suffix.
1420In some cases, an ABI tag is also used for names of compiled extensions.
1421The python module defines variables to allow a single PLIST to be
1422used for both versions.
1423Generate or update the PLIST using the python3
1424.Ev FLAVOR ,
1425then edit it to prefix any lines creating
1426.Ev MODPY_PYCACHE
1427directories with
1428.Ev MODPY_COMMENT .
1429As python2 and python3 packages should permit being installed together,
1430it may be necessary to suffix names of common binaries or directories,
1431or split common files into a subpackage.
1432If updating the PLIST without using the python3 flavor,
1433take care not to remove ${MODPY_PYCACHE}, ${MODPY_PYC_MAGIC_TAG}, or
1434${MODPY_ABI_TAG} variables from the PLIST.
1435.It lang/ruby
1436See
1437.Xr ruby-module 5 .
1438.It lang/tcl
1439Sets
1440.Ev MODTCL_VERSION ,
1441.Ev MODTCL_BIN ,
1442.Ev MODTCL_INCDIR ,
1443.Ev MODTCL_LIBDIR ,
1444.Ev MODTCL_BUILD_DEPENDS ,
1445.Ev MODTCL_RUN_DEPENDS ,
1446.Ev MODTCL_LIB ,
1447.Ev MODTCL_LIB_DEPENDS ,
1448and
1449.Ev MODTCL_CONFIG .
1450.Ev MODTCL_VERSION
1451is the default version used by all Tcl ports and may be overridden.
1452Provides
1453.Ev MODTCL_TCLSH_ADJ
1454and
1455.Ev MODTCL_WISH_ADJ
1456shell fragments to patch the interpreter path in executable scripts.
1457Also affects
1458.Ev CATEGORIES
1459and
1460.Ev SUBST_VARS .
1461.It perl
1462This module is documented in the main
1463.Xr bsd.port.mk 5
1464manpage.
1465.It security/heimdal
1466A link from ${LOCALBASE}/heimdal/bin/krb5-config
1467to
1468.Xr krb5-config 1
1469will be put at the front of the path.
1470Sets
1471.Ev LIB_DEPENDS
1472and
1473.Ev WANTLIB
1474according to the values of
1475.Ev MODHEIMDAL_LIB_DEPENDS ,
1476and
1477.Ev MODHEIMDAL_WANTLIB .
1478.It textproc/intltool
1479Sets
1480.Ev MODINTLTOOL_OVERRIDE .
1481.Pa textproc/intltool
1482is added to
1483.Ev BUILD_DEPENDS .
1484.Ev MODINTLTOOL_OVERRIDE
1485changes the paths of
1486.Ev INTLTOOL_EXTRACT ,
1487.Ev INTLTOOL_MERGE
1488and
1489.Ev INTLTOOL_UPDATE
1490to use the installed versions of intltool-extract,
1491intltool-merge and intltool-update, instead of the version's packages into the
1492distfile of the port using this module.
1493Also affects
1494.Ev CONFIGURE_ENV ,
1495.Ev MAKE_ENV
1496and
1497.Ev MAKE_FLAGS
1498by appending
1499.Ev MODINTLTOOL_OVERRIDE
1500to them.
1501.It www/drupal7
1502Can be used to install plugins (default), themes if
1503.Ev MODDRUPAL_THEME
1504is yes, or languages packs if
1505.Ev DRUPAL_LANG
1506is set to the desired language.
1507.Pp
1508The module may set or add to default values for
1509.Ev HOMEPAGE ,
1510.Ev MASTER_SITES ,
1511.Ev PREFIX ,
1512.Ev DISTNAME ,
1513.Ev DIST_SUBDIR ,
1514.Ev CATEGORIES ,
1515.Ev PKGNAME ,
1516.Ev PKG_ARCH ,
1517.Ev WRKDIST ,
1518.Ev RUN_DEPENDS .
1519Drupal modules normally don't have any build part, just an installation part
1520that defaults to copying the plugin/theme/language files into the right
1521location through
1522.Ev MODDRUPAL_INSTALL .
1523.Pp
1524The module sets
1525.Ev DRUPAL
1526to drupal7,
1527.Ev DRUPAL_ROOT
1528to htdocs/${DRUPAL}
1529.Ev DRUPAL_MODS
1530to ${DRUPAL_ROOT}/site/all/modules
1531.Ev DRUPAL_THEMES
1532to ${DRUPAL_ROOT}/site/all/themes
1533and
1534.Ev DRUPAL_TRANSLATIONS
1535to ${DRUPAL_ROOT}/profiles/standard/translations.
1536So, by default, modules and themes are installed for all sites,
1537and translations are activated at install.
1538.Pp
1539.Ev DRUPAL_OWNER , DRUPAL_GROUP
1540are set to root, daemon, since drupal doesn't need to write
1541to any file except the files/ directory and the site settings (those
1542belong to www instead).
1543.Pp
1544Most modules are actually separate projects on the drupal site.
1545If
1546.Ev MODDRUPAL_PROJECT
1547is set,
1548.Ev HOMEPAGE
1549will lead to the corresponding project.
1550If
1551.Ev MODDRUPAL_VERSION
1552is also set,
1553.Ev DISTNAME
1554will default to
1555.Pa ${MODDRUPAL_PROJECT}-7.x-${MODDRUPAL_VERSION} ,
1556MODDRUPAL_PKGNAME
1557will default to
1558.Pa ${MODDRUPAL_PROJECT}
1559and
1560.Ev PKGNAME
1561will default to
1562.Pa drupal7-${MODDRUPAL_PKGNAME}-${MODDRUPAL_VERSION} .
1563.Pp
1564Translations are handled by setting
1565.Ev DRUPAL_LANG
1566to the language letter code, and by setting
1567.Ev LANGFILES
1568to a list of module names/version pairs.
1569.Pp
1570With drupal7, all translations have been put in separate .po files.
1571It has been deemed simplest to pack all translations for a given language
1572into a single package, since translations for non installed modules won't
1573affect anything.
1574.It www/mozilla
1575Sets
1576.Ev PKGNAME ,
1577.Ev HOMEPAGE ,
1578.Ev MASTER_SITES ,
1579.Ev DISTNAME ,
1580.Ev USE_GMAKE ,
1581and
1582.Ev ONLY_FOR_ARCHS .
1583.Ev EXTRACT_SUFX
1584defaults to .tar.bz2.
1585.Pp
1586Adds common dependencies to
1587.Ev LIB_DEPENDS ,
1588.Ev WANTLIB ,
1589.Ev RUN_DEPENDS
1590and
1591.Ev BUILD_DEPENDS .
1592Sets common
1593.Ev CONFIGURE_ARGS ,
1594.Ev MAKE_ENV
1595and
1596.Ev CONFIGURE_ENV .
1597Sets
1598.Ev MOB
1599variable as source directory
1600and
1601.Ev MOZ
1602as target directory within
1603.Cm do-install .
1604.Pp
1605Individual port Makefile must set
1606.Ev MOZILLA_PROJECT ,
1607.Ev MOZILLA_CODENAME ,
1608.Ev MOZILLA_VERSION ,
1609.Ev MOZILLA_BRANCH ,
1610.Ev MOZILLA_LIBS
1611and
1612.Ev MOZILLA_DATADIRS
1613variables.
1614Port can also append values to
1615.Ev MOZILLA_SUBST_FILES
1616which contains the list of
1617files to run
1618.Ev SUBST_CMD
1619on during
1620.Cm pre-configure ,
1621and
1622.Ev MOZILLA_AUTOCONF_DIRS
1623which
1624contains the list of dirs where
1625.Ev AUTOCONF
1626will be run during
1627.Cm pre-configure .
1628.It www/pear
1629Used for PHP PEAR ports.
1630Sets default
1631.Ev MASTER_SITES ,
1632.Ev EXTRACT_SUFX ,
1633.Ev PKGNAME .
1634Sets
1635.Ev PREFIX
1636to
1637.Pa /var/www .
1638Sets
1639.Ev NO_TEST
1640unless a
1641.Cm do-test
1642target is defined.
1643Adds common dependencies to
1644.Ev RUN_DEPENDS
1645and
1646.Ev BUILD_DEPENDS ,
1647sets
1648.Ev MAKE_FILE
1649and
1650.Ev FAKE_FLAGS
1651appropriately.
1652Makes
1653.Ev PEAR_LIBDIR
1654and
1655.Ev PEAR_PHPBIN
1656available for use in the port.
1657Sets a default
1658.Ev PKGNAME
1659and appends to
1660.Ev CATEGORIES .
1661.It www/plone
1662Sets
1663.Ev MODPLONE_VERSION
1664and
1665.Ev MODZOPE_VERSION .
1666.Ev MODPLONE_VERSION
1667is the default version used by all Plone ports and may be overridden.
1668It appends
1669.Pa www/plone
1670to
1671.Ev RUN_DEPENDS
1672and also sets
1673.Ev NO_TEST
1674to Yes.
1675.It x11/gnome
1676This module has full support for the
1677.Ar gnu ,
1678.Ar simple
1679and
1680.Ar cmake
1681CONFIGURE_STYLE.
1682.Pp
1683If both
1684.Ev GNOME_PROJECT
1685and
1686.Ev GNOME_VERSION
1687are set, this module defines
1688.Ev DISTNAME ,
1689.Ev VERSION ,
1690.Ev MASTER_SITES ,
1691adds x11/gnome to
1692.Ev CATEGORIES
1693and
1694.Ev EXTRACT_SUFX
1695will default to .tar.xz if unset.
1696Unless
1697.Li NO_BUILD=Yes ,
1698.Pa textproc/intltool
1699is also appended to
1700.Ev MODULES
1701and when CONFIGURE_STYLE is set to
1702.Ar gnu
1703or
1704.Ar simple ,
1705.Ev USE_GMAKE
1706is set to "Yes".
1707.Pp
1708When CONFIGURE_STYLE is set to
1709.Ar gnu
1710or
1711.Ar simple ,
1712if none of
1713.Ev AUTOCONF_VERSION
1714nor
1715.Ev AUTOMAKE_VERSION
1716are defined, then "--disable-maintainer-mode" is appended to
1717.Ev CONFIGURE_ARGS .
1718When CONFIGURE_STYLE is set to
1719.Ar cmake ,
1720"-DENABLE_MAINTAINER_MODE=OFF" and -DSYSCONF_INSTALL_DIR=${SYSCONFDIR}
1721are appended to CONFIGURE_ARGS.
1722.Pp
1723MODGNOME_CPPFLAGS and MODGNOME_LDFLAGS can be used to add compiler and linker
1724flags.
1725.Li CPPFLAGS="-I${LOCALBASE}/include"
1726and
1727.Li LDFLAGS="-L${LOCALBASE}/lib"
1728are always appended to
1729.Ev CONFIGURE_ENV .
1730.Pp
1731Certain build/run dependencies and configure arguments and environment
1732can be set by appending desktop-file-utils, docbook, gobject-introspection,
1733gtk-update-icon-cache, shared-mime-info, vala and/or yelp to
1734.Ev MODGNOME_TOOLS .
1735They are disabled otherwise.
1736If
1737.Ev MODGNOME_TOOLS
1738is set to desktop-file-utils,
1739a dependency on
1740.Pa devel/desktop-file-utils
1741is appended to
1742.Ev MODGNOME_RUN_DEPENDS
1743and a link to /usr/bin/true is created under
1744.Pa ${WRKDIR}/bin/desktop-file-validate .
1745If
1746.Ev MODGNOME_TOOLS
1747is set to docbook,
1748.Pa textproc/docbook-xsl
1749is appended to
1750.Ev MODGNOME_BUILD_DEPENDS .
1751This option is used when the generation of the man pages included in the
1752source tarball requires docbook XML/SGML/XSL definitions and stylesheets.
1753If
1754.Ev MODGNOME_TOOLS
1755is set to gtk-update-icon-cache, a dependency on
1756.Pa x11/gtk+3,-guic
1757is appended to
1758.Ev MODGNOME_RUN_DEPENDS .
1759If
1760.Ev MODGNOME_TOOLS
1761is set to shared-mime-info, a dependency on
1762.Pa misc/shared-mime-info
1763is appended to
1764.Ev MODGNOME_RUN_DEPENDS
1765and a link to /usr/bin/true is created under
1766.Pa ${WRKDIR}/bin/update-mime-database .
1767If
1768.Ev MODGNOME_TOOLS
1769is set to yelp,
1770.Pa textproc/itstool
1771and
1772.Pa x11/gnome/doc-utils
1773are appended to
1774.Ev MODGNOME_BUILD_DEPENDS .
1775Furthermore,
1776.Pa x11/gnome/yelp
1777is appended to
1778.Ev MODGNOME_RUN_DEPENDS
1779if
1780.Ev MODGNOME_TOOLS
1781also contains "desktop-file-utils"
1782This option is to be used when any files are installed into
1783.Pa share/gnome/help/
1784or page files are installed into
1785.Pa share/help/ .
1786.Ev MODGNOME_BUILD_DEPENDS
1787and
1788.Ev MODGNOME_RUN_DEPENDS
1789are appended to the
1790corresponding
1791.Ev BUILD_DEPENDS
1792and
1793.Ev RUN_DEPENDS .
1794.Pp
1795Some tools require the following goo in the PLIST:
1796.Pp
1797.Ar desktop-file-utils
1798.Bd -literal -offset indent
1799@exec %D/bin/update-desktop-database
1800@unexec-delete %D/bin/update-desktop-database
1801.Ed
1802.Pp
1803.Ar gtk-update-icon-cache
1804($icon-theme is the theme directory)
1805.Bd -literal -offset indent
1806@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/$icon-theme
1807@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/$icon-theme
1808.Ed
1809.Pp
1810.Ar shared-mime-info
1811.Bd -literal -offset indent
1812@exec %D/bin/update-mime-database %D/share/mime
1813@unexec-delete %D/bin/update-mime-database %D/share/mime
1814.Ed
1815.It x11/gnustep
1816.It x11/kde
1817Used for building KDE3-enabled ports.
1818Main variables there is
1819.Ev MODKDE_VERSION ,
1820which defines what patches and tweaks should be applied,
1821depending of exact KDE version the ported software is build
1822against of.
1823.It x11/kde4
1824Required for building KDE4-enabled ports.
1825Main variables are: MODKDE4_USE,
1826MODKDE4_VERSION, MODKDE4_DEP_DIR, MODKDE4_DEP_VERSION, MODKDE4_FLAVOR.
1827It's used both for KDE4 SC itself and for software built on top of it,
1828e.g., Digikam.
1829This module supports several KDE4 trees at the same time, see below.
1830The following variables are designed to be used in both types of ports:
1831.Bl -tag -width KDE4LIB
1832.It Ev MODKDE4_USE
1833Defines the core components of KDE4 to be used by the port.
1834Could have zero or more of the following values, in any order:
1835.Sq libs ,
1836.Sq runtime ,
1837.Sq pim ,
1838.Sq games ,
1839.Sq workspace .
1840Could be forced to be empty, this will mean no automated dependencies.
1841If
1842.Sq libs
1843is specified, no dependencies on runtime (kde-runtime or kdepim-runtime)
1844will be recorded.
1845The
1846.Sq workspace
1847component implies
1848.Sq runtime .
1849The
1850.Sq games
1851component is to be used by games and affects default HOMEPAGE, too.
1852If neither
1853.Sq libs
1854or
1855.Sq runtime
1856are specified, the
1857.Sq runtime
1858is implied.
1859If both
1860.Sq libs
1861and
1862.Sq runtime
1863are specified, then
1864.Sq runtime
1865takes precedence (actually, it's a libs+ anyway).
1866The
1867.Sq pim libs
1868combination adds dependencies on both kdelibs and kdepimlibs,
1869and
1870.Sq pim runtime (
1871or just
1872.Sq pim )
1873also adds dependencies on both kde-runtime and kdepim-runtime.
1874Defaults to
1875.Sq libs
1876when
1877.Ev MODKDE4_RESOURCES
1878is set to
1879.Sq Yes ,
1880and
1881.Sq runtime
1882otherwise.
1883.It Ev MODKDE4_DEP_DIR
1884Expands to
1885.Sq x11/kdeVERSION
1886where version depends on current
1887.Ev MODKDE4_VERSION ,
1888see below.
1889Read-only.
1890.It Ev MODKDE4_DEP_VERSION
1891Expands to a string to be used in dependency lines, see
1892examples in
1893.Pa x11/kde4/*
1894ports.
1895Read-only.
1896.It Ev MODKDE4_RESOURCES
1897Should be set to
1898.Sq Yes
1899for ports that only provide non-executable stuff like icons,
1900localization files and so on.
1901Affects
1902.Ev FLAVORS ,
1903.Ev MODKDE4_NO_QT ,
1904.Ev MODKDE4_USE ,
1905.Ev MODULES ,
1906.Ev PKG_ARCH
1907and
1908.Ev SUBST_VARS
1909variables.
1910Defaults to
1911.Sq \&No .
1912.It Ev MODKDE4_INCLUDE_DIR
1913Path where KDE4 headers to be placed/searched for, relative to
1914.Ev PREFIX .
1915Read-only.
1916.It Ev MODKDE4_LIB_DIR
1917Path where KDE4 headers to be placed/searched for, relative to
1918.Ev PREFIX .
1919Read-only.
1920.It Ev KDE4LIB
1921Shorter synonym for
1922.Ev MODKDE4_LIB_DIR ,
1923to be used in plists and
1924.Ev WANTLIB
1925declarations.
1926Read-only.
1927.It Ev MODKDE4_FIX_GETTEXT
1928If set to
1929.Sq Yes ,
1930adds an additional step before building port that
1931searches for KDE-specific calls of GETTEXT_PROCESS_PO_FILES()
1932CMake command and tweaks them to be compatible with the one from
1933FindGettext.cmake module provided by CMake itself.
1934Defaults to
1935.Sq Yes .
1936.It Ev MODKDE4_SYSCONF_FILES
1937Some KDE ports install files under
1938.Pa ${SYSCONFDIR} .
1939We want to have them under
1940.Ev ${PREFIX}/share/examples
1941or such, and just be @sample'd under
1942.Pa ${SYSCONFDIR} .
1943So add
1944.Sq file/dir destination
1945pairs to this variable, and appropriate @sample lines to packing list, e.g.:
1946.Bd -literal -offset indent
1947# in Makefile:
1948MODKDE4_SYSCONF_FILES = dbus-1      share/examples
1949
1950# in PLIST:
1951share/examples/dbus-1/system.d/org.kde.baloo.filewatch.conf
1952@sample ${SYSCONFDIR}/dbus-1/system.d/org.kde.baloo.filewatch.conf
1953.Ed
1954.El
1955.Pp
1956The following variables are mostly used only inside KDE4 SC:
1957.Bl -tag -width KDE4LIB
1958.It MODKDE4_LIB_LINKS
1959If set to
1960.Sq Yes ,
1961soft links for shared libraries in
1962.Pa ${PREFIX}/lib
1963to
1964.Pa ${MODKDE4_LIB_DIR}
1965will be created.
1966Used to distinguish libraries from different KDE versions (3, 4...).
1967Defaults to
1968.Sq \&No .
1969.It KDE4_ONLY
1970If set to
1971.Sq Yes ,
1972sets the
1973.Xr dpb 1
1974tag to
1975.Sq kde4 .
1976Defaults to
1977.Sq \&No
1978when
1979.Ev MODKDE4_USE
1980is empty, and to
1981.Sq Yes
1982otherwise.
1983.El
1984.Pp
1985The following variables are likely to be used only outside KDE4 SC:
1986.Bl -tag -width KDE4LIB
1987.It MODKDE4_NO_QT
1988If set to
1989.Sq Yes ,
1990avoids automatic addition of x11/qt4 to
1991.Ev MODULES .
1992.El
1993.Pp
1994The x11/kde4 module supports co-existence of different KDE4 SC version
1995ports subtrees.
1996There always is a so-called stable tree in
1997.Pa ${PORTSDIR}/x11/kde4
1998and additional trees are placed in
1999.Pa ${PORTSDIR}/x11/kdeXYZ ,
2000where
2001.Sq XYZ
2002correspond to the
2003.Sq X.Y.Z
2004KDE version.
2005So, say, KDE 4.12.4 tree should be placed in
2006.Pa ${PORTSDIR}/x11/kde4124
2007directory.
2008The process of preparing a new KDE SC version subtree is automated,
2009just use kde-release-helper script:
2010.Bd -literal -offset indent
2011cd ${PORTSDIR}/x11/kde4
2012\&./kde-release-helper prepare 4.12.4
2013.Ed
2014This will copy the x11/kde4 subtree to x11/kde4124 and strip it:
2015remove
2016.Ev REVISION
2017marks, remove distinfo files and so on.
2018.Pp
2019To access the new version then you'll need to add appropriate
2020values at the top of x11/kde4 module file itself.
2021Then you be able to use automatically created
2022.Sq kdeXYZ
2023.Ev FLAVOR
2024to reference corresponding KDE4 SC version outside x11/kde4*.
2025.Pp
2026The x11/kde4 module sets the following variables unless they're already
2027set by a port:
2028.Ev CONFIGURE_STYLE ,
2029.Ev EXTRACT_SUFX ,
2030.Ev ONLY_FOR_ARCHS ,
2031.Ev PORTHOME ,
2032and
2033.Ev SEPARATE_BUILD .
2034.Pp
2035The x11/kde4 module modifies the following variables if needed:
2036.Ev BUILD_DEPENDS ,
2037.Ev CONFIGURE_ARGS ,
2038.Ev CONFIGURE_ENV ,
2039.Ev LIB_DEPENDS ,
2040.Ev RUN_DEPENDS ,
2041and
2042.Ev WANTLIB .
2043.Pp
2044The x11/kde4 module automatically adds devel/cmake to
2045.Ev MODULES
2046unless
2047.Ev NO_BUILD
2048is set to
2049.Sq Yes .
2050The x11/kde4 module automatically adds x11/qt4 to
2051.Ev MODULES
2052unless
2053.Ev MODKDE4_NO_QT
2054is set to
2055.Sq Yes .
2056The x11/kde4 module automatically adds gcc4 to
2057.Ev MODULES
2058unless
2059.Ev MODKDE4_RESOURCES
2060is set to
2061.Sq Yes .
2062.It x11/qt3, x11/qt4 and x11/qt5
2063All qt* modules share a common
2064.Ev MODQT_*
2065namespace for simple ports.
2066The qt3 module also defines the same variables under
2067.Ev MODQT3_* ,
2068the qt4 module also defines the same variables under
2069.Ev MODQT4_*
2070and the qt5 module also defines the same variables under
2071.Ev MODQT5_* ,
2072to allow ports to use both modules, such as
2073.Pa print/poppler .
2074.Pp
2075Those modules define
2076.Ev MODQT*_LIBDIR
2077as the libraries location,
2078.Ev MODQT*_INCDIR
2079as the include files location,
2080.Ev MODQT*_QTDIR
2081as the global qt directory location,
2082.Ev MODQT*_CONFIGURE_ARGS
2083as standard GNU configure-style parameters to locate the include and libraries.
2084.Pp
2085The location of Qt-specific tools
2086.Nm lrelease ,
2087.Nm moc ,
2088.Nm qmake
2089and
2090.Nm uic
2091is available through
2092.Ev MODQT*_LRELEASE ,
2093.Ev MODQT*_MOC ,
2094.Ev MODQT*_QMAKE
2095and
2096.Ev MODQT*_UIC .
2097.Ev MODQT*_OVERRIDE_UIC
2098controls whether the default setup will force a value of
2099.Ev UIC
2100or not.
2101The value of
2102.Ev MOC
2103is always forced to ${MODQT*_MOC}.
2104.Pp
2105In most cases the
2106.Pa devel/qmake
2107module should be used instead of using
2108.Ev MODQT*_QMAKE
2109directly.
2110.Pp
2111qt4 includes
2112.Xr pkg-config 1
2113files under a specific location recorded in
2114.Ev MODQT_PKG_CONFIG_PATH .
2115Qt3 requires the use of
2116.Ev MODQT3_PLUGINS
2117to correctly locate plugins.
2118.Pp
2119The modules add to
2120.Ev CONFIGURE_ENV , MAKE_ENV
2121and
2122.Ev MAKE_FLAGS .
2123They define appropriate
2124.Ev MODQT*_LIB_DEPENDS
2125and
2126.Ev MODQT*_WANTLIB .
2127.Pp
2128Note that Qt 4 and Qt 5 has their code split over several libraries.
2129For the qt4 module the basic
2130.Ev WANTLIB
2131only refers to QtCore, and other libraries should be added as needed.
2132The qt5 module doesn't set
2133.Ev MODQT*_WANTLIB
2134at all.
2135Also, Qt 5 consists of many so called Qt modules, and qt5 port module
2136only refers to qtbase Qt 5 module; other Qt modules should be added to
2137.Ev LIB_DEPENDS ,
2138.Ev BUILD_DEPENDS
2139or
2140.Ev RUN_DEPENDS
2141manually.
2142.It x11/tk
2143Sets
2144.Ev MODTK_VERSION ,
2145.Ev MODTK_BIN ,
2146.Ev MODTK_INCDIR ,
2147.Ev MODTK_LIBDIR ,
2148.Ev MODTK_BUILD_DEPENDS ,
2149.Ev MODTK_RUN_DEPENDS ,
2150.Ev MODTK_LIB ,
2151.Ev MODTK_LIB_DEPENDS ,
2152and
2153.Ev MODTK_CONFIG .
2154.Ev MODTK_VERSION
2155is the default version used by all Tk ports and
2156may be overridden.
2157Automatically adds the
2158.Pa lang/tcl
2159module, provides a default
2160.Ev MODTCL_VERSION
2161to match
2162.Ev MODTK_VERSION ,
2163and affects
2164.Ev CATEGORIES
2165and
2166.Ev SUBST_VARS .
2167Note the
2168.Ev MODTCL_WISH_ADJ
2169shell fragment in the
2170.Pa lang/tcl
2171module.
2172.It x11/xfce4
2173Sets
2174.Ev DIST_SUBDIR ,
2175.Ev EXTRACT_SUFX ,
2176.Ev CONFIGURE_STYLE ,
2177.Ev CONFIGURE_ENV
2178and
2179.Ev USE_GMAKE .
2180If
2181.Ev MODXFCE_ICON_CACHE
2182is set to yes, it adds
2183.Pa x11/gtk+3,-guic
2184to
2185.Ev RUN_DEPENDS .
2186Unless
2187.Ev XFCE_NO_SRC
2188is set,
2189.Pa textproc/intltool
2190is added to
2191.Ev MODULES .
2192Also affects
2193.Ev CATEGORIES .
2194.Pp
2195Xfce ports can be divided into five categories: core libraries and
2196applications, goodies, artwork, thunar plugins, and panel plugins.
2197.Ev HOMEPAGE ,
2198.Ev MASTER_SITES
2199and
2200.Ev DISTNAME
2201are built using
2202.Ev XFCE_VERSION
2203(which defaults to
2204.Ev XFCE_DESKTOP_VERSION
2205if not set) and either
2206.Ev XFCE_PROJECT ,
2207.Ev XFCE_GOODIE ,
2208.Ev XFCE_ARTWORK ,
2209.Ev THUNAR_PLUGIN
2210or
2211.Ev XFCE_PLUGIN .
2212One of the latter has to be provided by the port Makefile.
2213.El
2214.Sh SEE ALSO
2215.Xr make 1 ,
2216.Xr bsd.port.mk 5 ,
2217.Xr ports 7
2218