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