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