xref: /openbsd-src/share/man/man5/port-modules.5 (revision 5ad04d351680822078003e2b066cfc9680d6157d)
1.\"	$OpenBSD: port-modules.5,v 1.172 2014/04/02 15:00:27 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: April 2 2014 $
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
51Other modules correspond to shortcuts for using some other ports as
52dependencies without needing to hardcode too much, such as libiconv or
53the qt ports.
54.Sh THE MODULES LOOK-UP MECHANISM
55The variable
56.Ev MODULES
57should contain a list of module names.
58Some core modules are a single word, all other modules should be
59${PKGPATH}.
60If the module is
61.Pa some/dir/portname ,
62the ports framework will look for a file named
63.Pa ${PORTSDIR}/some/dir/portname/portname.port.mk
64and include it.
65.Pp
66Most modules should conform to this syntax.
67The historic practice of having a redirection file directly under
68.Pa ${PORTSDIR}/infrastructure/mk
69is deprecated for new modules.
70.Pp
71Modules may refer to each other.
72The modules mechanism has specific recursion handling such that
73adding
74.Li MODULES += foo/bar
75to a module will work as expected.
76.Sh NAMING CONVENTIONS
77Since there is no actual scope in makefiles, everything defined within
78a module will be global to the ports framework, and thus may interfere
79with other ports.
80.Pp
81As far as possible, all variables and targets belonging to a module named
82.Pa some/dir/foo
83should be named
84.Ev MODFOO_*
85and
86.Ar modfoo_* .
87.Pp
88Following the same conventions as
89.Xr bsd.port.mk 5 ,
90internal variables and targets not intended for user consumption should be
91named
92.Ev _MODFOO_*
93and
94.Ar _modfoo_* .
95.Pp
96For instance, if a module wants some value to be available for the rest
97of the world, it should define
98.Ev MODFOO_VARNAME ,
99with a name matching the basic infrastructure as far as possible.
100That is, a port that defines specific dependencies will usually
101define
102.Ev MODFOO_WANTLIB ,
103.Ev MODFOO_LIB_DEPENDS ,
104and
105.Ev MODFOO_RUN_DEPENDS ,
106as appropriate.
107.Pp
108As an exception to the naming mechanism, some ports have several distinct
109versions in the ports tree, say
110.Pa x11/qt3
111and
112.Pa x11/qt4 .
113Instead of using the namespace
114.Ev MODQT3* ,
115variables will usually drop the version suffix and be simply called
116.Ev MODQT_*
117so that a port using the module can be switched from version to version
118without needing to change everything.
119.Pp
120It is highly desirable to define names in both namespaces for such ports,
121for example to define both
122.Ev MODQT3_LIB_DEPENDS
123and
124.Ev MODQT_LIB_DEPENDS .
125Normal client ports will use
126.Ev MODQT_LIB_DEPENDS ,
127but a port may exceptionally import both modules with
128.Li MODULES += x11/qt3 x11/qt4
129and differentiate between qt3 and qt4 needs with
130.Ev MODQT3_LIB_DEPENDS
131and
132.Ev MODQT4_LIB_DEPENDS .
133See
134.Pa print/poppler
135for an example.
136.Sh OVERRIDING TARGET BEHAVIOR
137The main framework contains several hooks that allow ports to override
138normal behavior.
139This evolved as an ad-hoc framework, where only hooks that turned out
140to be needed were added.
141If several modules define the same hook, hook behaviors will be
142invoked in sequence.
143.Bl -tag -width do-configure
144.It Ar patch
145There is a
146.Ar post-patch
147hook that can be activated by defining
148.Ev MODFOO_post-patch .
149It will be run right after
150.Ar post-patch
151and before
152.Ev REORDER_DEPENDENCIES
153touches things.
154.It Ar configure
155There is a
156.Ar pre-configure
157hook that can be activated by defining
158.Ev MODFOO_pre-configure .
159It will be run right after
160.Ar pre-configure .
161The normal
162.Ar do-configure
163behavior is to invoke all
164.Ev MODFOO_configure
165contents that are defined in
166.Ev CONFIGURE_STYLE .
167By default,
168.Ar configure
169will do nothing.
170.Pp
171Some
172.Ev CONFIGURE_STYLE
173values, namely perl, gnu, imake, automake, autoconf, and autoupdate
174will automatically import the correct module.
175User-defined modules must both add to
176.Ev CONFIGURE_STYLE
177and import the correct module to override behavior.
178.Pp
179Contrary to other hooks, module behavior is not invoked in
180addition to
181.Ar do-configure ,
182but as the normal configure process.
183If
184.Ar do-configure
185is overridden, normal hook processing will not happen.
186.It Ar fake
187There is a
188.Ar pre-fake
189hook that can be activated by defining
190.Ev MODFOO_pre-fake .
191This will be invoked right after
192.Xr mtree 8 ,
193and before the normal
194.Ar pre-fake
195behavior.
196.Pp
197This can occasionnally be used for ports that require some specific
198fake installation setup that will be provided by runtime dependencies.
199.It Ar install
200There is a
201.Ar post-install
202hook that can be activated by defining
203.Ev MODFOO_post-install .
204This will be invoked at the end of
205.Ar install ,
206right after the normal
207.Ar post-install
208behavior.
209.El
210.Pp
211Some targets, such as
212.Ar do-build
213or
214.Ar do-install ,
215can't be overridden simply.
216A module that, for instance, requires specific
217.Ar do-build
218behavior should do so in two steps:
219.Bl -bullet
220.It
221Define a variable named
222.Ev MODFOO_BUILD_TARGET
223that contains the commands necessary for
224.Ar do-build :
225.Bd -literal -offset indent
226MODFOO_BUILD_TARGET = cmd1; cmd2
227.Ed
228.It
229Override
230.Ar do-build
231only if it's not already defined by the port proper:
232.Bd -literal -offset indent
233\&.if !target(do-build)
234do-build:
235	@${MODFOO_BUILD_TARGET}
236\&.endif
237.Ed
238.El
239That way, if several modules require specific actions for those targets,
240the end user can choose the appropriate order in which to run the actions:
241.Bd -literal -offset indent
242do-build:
243	@${MODBAR_BUILD_TARGET}
244	@${MODFOO_BUILD_TARGET}
245	...
246.Ed
247.Sh OVERRIDING VARIABLE BEHAVIOR
248Some variables can be overridden by modules.
249Be very cautious, as this can make the module difficult to use,
250or interact badly with other modules.
251As a rule, always provide the override as:
252.Pp
253.Dl VARIABLE ?= value
254.Pp
255and provide a module-specific variable with the same value:
256.Pp
257.Dl MODFOO_VARIABLE = value .
258.Pp
259The following variables can be overridden in a relatively safe fashion:
260.Ev ALL_TARGET ,
261.Ev CONFIGURE_SCRIPT ,
262.Ev DESTDIRNAME ,
263.Ev DIST_SUBDIR ,
264.Ev DISTNAME ,
265.Ev DISTFILES ,
266.Ev EXTRACT_SUFX ,
267.Ev FAKE_FLAGS ,
268.Ev FETCH_MANUALLY ,
269.Ev HOMEPAGE ,
270.Ev IGNORE ,
271.Ev IS_INTERACTIVE ,
272.Ev LIBTOOL_FLAGS ,
273.Ev MAKE_FILE ,
274.Ev MASTER_SITES ,
275.Ev MULTI_PACKAGES ,
276.Ev NO_BUILD ,
277.Ev NO_TEST ,
278.Ev PATCH_LIST ,
279.Ev PKG_ARCH ,
280.Ev PKGNAME* ,
281.Ev PREFIX ,
282.Ev TEST_TARGET ,
283.Ev TEST_IS_INTERACTIVE ,
284.Ev REORDER_DEPENDENCIES ,
285.Ev SEPARATE_BUILD ,
286.Ev SHARED_ONLY ,
287.Ev USE_GMAKE ,
288.Ev USE_LIBTOOL .
289.Pp
290The following variables can be added to in a relatively safe fashion:
291.Ev BUILD_DEPENDS ,
292.Ev CATEGORIES ,
293.Ev CONFIGURE_ARGS ,
294.Ev CONFIGURE_ENV ,
295.Ev ERRORS ,
296.Ev FAKE_FLAGS ,
297.Ev FLAVOR ,
298.Ev FLAVORS ,
299.Ev INSTALL_TARGET ,
300.Ev LIB_DEPENDS ,
301.Ev MAKE_ENV ,
302.Ev MAKE_FLAGS ,
303.Ev PKG_ARGS ,
304.Ev PSEUDO_FLAVORS ,
305.Ev TEST_DEPENDS ,
306.Ev REORDER_DEPENDENCIES ,
307.Ev RUN_DEPENDS ,
308.Ev SUBST_VARS ,
309.Ev WANTLIB .
310.Sh SPECIFIC MODULE INTERACTIONS
311Some modules correspond to extra ports that will be used mostly as
312.Ev BUILD_DEPENDS
313or
314.Ev RUN_DEPENDS .
315Such modules can safely append values directly to the
316.Ev BUILD_DEPENDS ,
317.Ev RUN_DEPENDS ,
318.Ev LIB_DEPENDS ,
319and
320.Ev WANTLIB
321variables, as long as they also define module-specific variables for
322all runtime dependencies.
323.Pp
324Simple client ports will use the module directly, and thus inherit extra
325build and runtime dependencies.
326.Pp
327More sophisticated ports can use
328.Ev MULTI_PACKAGES
329to select specific behavior: build-time dependencies will always be
330needed.
331Runtime dependencies will be selected on a subpackage basis,
332since runtime dependencies such as
333.Ev LIB_DEPENDS-sub
334do not inherit the default
335.Ev LIB_DEPENDS
336value.
337The client port's author must only bear in mind that external modules
338may add values to the default
339.Ev WANTLIB ,
340.Ev LIB_DEPENDS ,
341and
342.Ev RUN_DEPENDS ,
343and thus that it is not safe to inherit from it blindly.
344.Pp
345Modules are imported during
346.Pp
347.Dl .include <bsd.port.mk>
348.Pp
349Thus they can be affected by user choices such as setting a variable
350to Yes or No.
351Modules may make decisions based on documented
352.Ev MODFOO_BEHAVIOR
353values.
354.Pp
355When modules are processed, only a few
356.Xr bsd.port.mk 5
357variables are already defined.
358Modules may depend upon the following variables already having a sane
359value:
360.Ev DISTDIR ,
361.Ev LOCALBASE ,
362.Ev NO_DEPENDS ,
363.Ev PKGPATH ,
364.Ev PORTSDIR ,
365.Ev X11BASE
366and all arch-dependent constant from
367.Xr bsd.port.arch.mk 5 ,
368such as
369.Ev PROPERTIES
370or
371.Ev NO_SHARED_ARCHS .
372Note that this is only relevant for tests.
373It is perfectly okay to define variables or targets that depend on the
374basic ports framework without having to care whether that variable is
375already defined, since
376.Xr make 1
377performs lazy evaluation.
378.Sh CORE MODULES DOCUMENTATION
379The following modules are available.
380.Bl -tag -width do-configure
381.It apache-module
382.It converters/libiconv
383.It cpan
384For perl ports coming from CPAN.
385Wrapper around the normal perl module that fetches the file from
386the correct location depending on
387.Ev DISTNAME ,
388and sets a default
389.Ev PKGNAME .
390Also affects
391.Ev TEST_DEPENDS ,
392.Ev CONFIGURE_STYLE ,
393.Ev PKG_ARCH ,
394and
395.Ev CATEGORIES .
396.Pp
397Some CPAN modules are only indexed by author, set
398.Li CPAN_AUTHOR=ID
399to locate the right directory.
400.Pp
401If no
402.Ev HOMEPAGE
403is defined, it will default to
404.Pa http://search.cpan.org/dist/${DISTNAME:C/-[^-]*$//}/
405.Pp
406User settings: set
407.Ev CPAN_REPORT
408to Yes,
409.Ev CPAN_REPORT_DB
410to a valid directory,
411and
412.Ev CPAN_REPORT_FROM
413to a valid email address to automate the reporting
414of regression tests to CPAN.
415.Pp
416If
417.Ev MODCPAN_EXAMPLES
418is set, the following variables will be set.
419.Ev MODCPAN_EXAMPLES_DIST
420will hold the default directory in the distfile with
421example scripts.
422.Ev MODCPAN_EXAMPLES_DIR
423will be set to the standard installation directory for
424examples.
425Sets the
426.Ar post-install
427target if none has been defined to install the examples,
428otherwise
429.Ev MODCPAN_POST_INSTALL
430should be used as such:
431.Bd -literal
432post-install:
433	...
434	${MODCPAN_POST_INSTALL}
435.Ed
436.It devel/cmake
437.It devel/dconf
438Sets
439.Ev CONFIGURE_ARGS ,
440.Ev BUILD_DEPENDS
441and
442.Ev RUN_DEPENDS .
443This module is used by ports installing gsettings schemas under
444.Pa ${PREFIX}/share/glib-2.0/schemas/ .
445It requires the following goo in the PLIST:
446.Bd -literal -offset indent
447@exec %D/bin/glib-compile-schemas %D/share/glib-2.0/schemas >/dev/null
448@unexec-delete %D/bin/glib-compile-schemas %D/share/glib-2.0/schemas >/dev/null
449.Ed
450.It devel/gconf2
451A link from
452.Xr gconftool-2 1
453to
454.Xr true 1
455will be put at the front of the path.
456Sets
457.Ev CONFIGURE_ARGS ,
458.Ev BUILD_DEPENDS
459and
460.Ev RUN_DEPENDS .
461According to the values of
462.Ev MODGCONF2_LIBDEP ,
463sets
464.Ev LIB_DEPENDS .
465User settings: set
466.Ev MODGCONF2_SCHEMAS_DIR
467to the directory name under
468.Pa ${LOCALBASE}/share/schemas/
469where schemas files will be installed.
470.It devel/gettext
471.It devel/pmk
472Sets
473.Ev CONFIGURE_SCRIPT ,
474.Ev CONFIGURE_ARGS
475and
476.Ev MODPMK_configure .
477It appends
478.Pa devel/pmk
479to
480.Ev BUILD_DEPENDS .
481.It devel/scons
482Adds
483.Pa devel/scons
484to
485.Ev BUILD_DEPENDS .
486Sets
487.Ev MODSCONS_BIN
488and
489.Ev MODSCONS_ENV .
490Also defines an overridable
491.Ev MODSCONS_FLAGS .
492It provides a
493.Ar do-build
494and
495.Ar do-install
496targets that can be overridden in the port Makefile.
497.It devel/waf
498Adds
499.Pa devel/waf
500to
501.Ev BUILD_DEPENDS ,
502.Pa lang/python
503to
504.Ev MODULES ,
505and provides
506.Ar do-configure ,
507.Ar do-build ,
508.Ar do-install
509and
510.Ar post-install
511targets.
512.Ar do-build ,
513.Ar do-install
514and
515.Ar post-install
516can be overridden in the port Makefile.
517.It fortran
518Sets
519.Ev MODFORTRAN_LIB_DEPENDS ,
520.Ev MODFORTRAN_WANTLIB ,
521.Ev MODFORTRAN_BUILD_DEPENDS .
522Set
523.Ev MODFORTRAN_COMPILER
524to `g77' or `gfortran', depending on what the port requires.
525The default is `g77'.
526The dependencies are chosen according to
527.Ev COMPILER_VERSION
528and
529.Ev MODFORTRAN_COMPILER .
530.It gcc4
531If
532.Ev COMPILER_VERSION
533is not gcc4 (defined by
534.Pa /usr/share/mk/bsd.own.mk ) ,
535and architecture is in
536.Ev MODGCC4_ARCHS ,
537then the gcc4 compilers will be put at the front of the path.
538By default, only C language support is included by this module.
539If other languages are needed, they must be listed in
540.Ev MODGCC4_LANGS
541(e.g. c++, fortran).
542The
543.Ev MODGCC4_VERSION
544variable can be used to change the version of gcc.
545By default gcc 4.6 is used.
546If
547.Ev MODGCC4_LANGS
548contains c++, this module provides
549.Ev MODGCC4_CPPLIBDEP
550and
551.Ev MODGCC4_CPPWANTLIB .
552.It gnu
553This module is documented in the main
554.Xr bsd.port.mk 5
555manpage.
556.It imake
557This module is documented in the main
558.Xr bsd.port.mk 5
559manpage.
560.It java
561Set
562.Li MODJAVA_VER=x.y
563to use exactly the JDK x.y,
564.Li MODJAVA_VER=x.y+
565to use any x.y or higher version.
566Set
567.Li MODJAVA_JRERUN=Yes
568if the port only needs the JRE at runtime.
569The module sets
570.Ev JAVA_HOME ,
571.Ev ONLY_FOR_ARCHS ,
572.Ev MODJAVA_RUN_DEPENDS ,
573.Ev MODJAVA_SHARE_DIR ,
574.Ev MODJAVA_JAR_DIR ,
575.Ev MODJAVA_EXAMPLE_DIR
576and
577.Ev MODJAVA_DOC_DIR .
578It appends to
579.Ev BUILD_DEPENDS ,
580.Ev RUN_DEPENDS ,
581.Ev CATEGORIES
582and
583.Ev SUBST_VARS .
584If
585.Li MODJAVA_BUILD=ant
586then this module provides
587.Ev MODJAVA_BUILD_DIR ,
588.Ev MODJAVA_BUILD_FILE
589and
590.Ev MODJAVA_BUILD_TARGET_NAME ,
591as well as a
592.Ar do-build
593target (if not already defined).
594It heeds
595.Ev NO_BUILD .
596.It lang/clang
597Similar to gcc3 and gcc4 modules.
598If architecture is in MODCLANG_ARCHS, the CLang compilers will be
599put at the front of the path.
600By default, only C language support is included by this module.
601If other languages are needed, they must be listed in
602.Ev MODCLANG_LANGS
603(e.g. c++).
604Sets
605.Ev MODCLANG_VERSION
606which is also appended to
607.Ev SUBST_VARS .
608.It lang/erlang
609.It lang/ghc
610Sets
611.Ev ONLY_FOR_ARCHS ,
612.Ev MODGHC_VER ,
613.Ev BUILD_DEPENDS ,
614and
615.Ev RUN_DEPENDS .
616Build and further actions are based on the list of values in
617.Ev MODGHC_BUILD :
618.Bl -tag -width register
619.It Ar nort
620no runtime dependency on
621.Pa lang/ghc
622and hs- prefix will not be added,
623.It Ar cabal
624get the typical Cabal targets defined,
625.It Ar haddock
626generate API documentation using
627.Pa devel/haddock ,
628.It Ar register
629create and include register/unregister scripts,
630.It Ar hackage
631the distfiles are available on Hackage.
632.El
633.Pp
634Also affects
635.Ev CATEGORIES ,
636.Ev CONFIGURE_STYLE
637and
638.Ev SUBST_VARS .
639.Ar do-build ,
640.Ar do-install
641and
642.Ar do-test
643targets are provided if the port itself didn't set them.
644If
645.Ar register
646has been set, the PLIST needs to be modified in order to
647add the relevant @exec/@unexec lines.
648This module will run the Setup script and ensure the documentation
649will be built (if
650.Ar haddock
651has been set), and that the package is
652registered as a library usable by
653.Pa lang/ghc
654(if
655.Ar register
656has been set).
657Extra arguments and environment additions for the Setup configure
658command can be specified with
659.Ev MODGHC_SETUP_CONF_ARGS
660and
661.Ev MODGHC_SETUP_CONF_ENV .
662.It lang/lua
663Sets
664.Ev MODLUA_BIN ,
665.Ev MODLUA_DATADIR ,
666.Ev MODLUA_DEP ,
667.Ev MODLUA_DEP_VERSION ,
668.Ev MODLUA_DOCDIR ,
669.Ev MODLUA_EXAMPLEDIR ,
670.Ev MODLUA_INCL_DIR ,
671.Ev MODLUA_LIB ,
672.Ev MODLUA_LIBDIR ,
673.Ev MODLUA_VERSION ,
674.Ev MODLUA_WANTLIB .
675Appends to
676.Ev CATEGORIES .
677Also appends to
678.Ev BUILD_DEPENDS ,
679unless
680.Ev NO_BUILD
681has been set to Yes.
682Also appends to
683.Ev RUN_DEPENDS ,
684unless
685.Ev MODLUA_RUNDEP
686is set to No.
687Appends
688.Ev MODLUA_VERSION ,
689.Ev MODLUA_LIB ,
690.Ev MODLUA_INCL_DIR ,
691.Ev MODLUA_EXAMPLEDIR ,
692.Ev MODLUA_DOCDIR ,
693.Ev MODLUA_LIBDIR ,
694.Ev MODLUA_DATADIR ,
695.Ev MODLUA_DEP ,
696.Ev MODLUA_DEP_VERSION ,
697.Ev MODLUA_BIN
698to
699.Ev SUBST_VARS .
700.Ev MODLUA_DEFAULT_VERSION
701is set to 5.1.
702.Ev MODLUA_VERSION is set to
703.Ev MODLUA_DEFAULT_VERSION
704by default.
705Ports can be built with two lua versions.
706If no FLAVOR is set it defaults to MODLUA_DEAFULT_VERSION.
707Otherwise the FULLPKGNAME is adjusted, if MODLUA_SA is not set.
708In order to set a build, run or test dependency on a lua port,
709use the following, which will propagate the currently used flavor:
710.Ev MODLUA_BUILD_DEPENDS ,
711.Ev MODLUA_TEST_DEPENDS ,
712.Ev MODLUA_RUN_DEPENDS .
713.It lang/mono
714Sets
715.Ev MODMONO_ONLY_FOR_ARCHS ,
716.Ev CONFIGURE_ENV ,
717.Ev MAKE_FLAGS ,
718.Ev MODMONO_BUILD_DEPENDS
719and
720.Ev MODMONO_RUN_DEPENDS .
721If
722.Ev MODMONO_DEPS
723is set to Yes,
724.Pa lang/mono
725is appended to
726.Ev BUILD_DEPENDS
727and
728.Ev RUN_DEPENDS .
729If
730.Ev MODMONO_NANT
731is set to Yes,
732.Ev NANT
733and
734.Ev NANT_FLAGS
735are set,
736.Pa devel/nant
737is appended to
738.Ev BUILD_DEPENDS
739and a
740.Ar do-build
741and
742.Ar do-install
743targets are provided to use nant for building.
744If these targets are already defined, one can use
745.Ev MODMONO_BUILD_TARGET
746and
747.Ev MODMONO_INSTALL_TARGET
748instead in the corresponding target.
749.Ev DLLMAP_FILES
750defines in which files the module will substitute hardcoded
751shared library versions using a
752.Ar post-configure
753target.
754.It lang/node
755Adds common dependencies to
756.Ev RUN_DEPENDS
757and
758.Ev BUILD_DEPENDS .
759Recognizes two additional types of
760.Ev CONFIGURE_STYLE Ns s ,
761"npm" and "npm ext".
762"npm ext" should be used for npm packages that contain C++ extensions which
763need to be compiled.
764"npm" should be used for other npm packages.
765If regression tests are included that can be run using
766.Pa devel/node-expresso ,
767append "expresso" to
768.Ev CONFIGURE_STYLE .
769.Pa devel/node-expresso
770will be appened to
771.Ev TEST_DEPENDS
772and a default
773.Ev MODNODE_TEST_TARGET
774will be defined, along with a do-test target if it has not
775already been set.
776If "expresso" isn't appended to
777.Ev CONFIGURE_STYLE ,
778.Ev TEST_TARGET
779will be set to "test".
780One of these two
781.Ev CONFIGURE_STYLE Ns s
782should be used or the module doesn't affect anything except
783.Ev RUN_DEPENDS
784and
785.Ev BUILD_DEPENDS .
786Requires
787.Ev NPM_NAME
788to be set to the name of the npm package.
789Uses
790.Ev NPM_NAME
791and
792.Ev NPM_VERSION
793to set
794.Ev DISTNAME ,
795and
796.Ev PKGNAME ,
797and
798.Ev MASTER_SITES .
799If the npm package depends on other npm packages, the npm package names it
800depends on should be listed in
801.Ev MODNODE_DEPENDS .
802Adds default do_build and do_install tasks, and you can reference the default
803implementations via
804.Ev MODNODE_BUILD_TARGET
805and
806.Ev MODNODE_INSTALL_TARGET .
807.It lang/ocaml
808Sets
809.Ev OCAML_VERSION .
810Appends to
811.Ev BUILD_DEPENDS
812and
813.Ev MAKE_ENV .
814This selects a %%native%% plist fragment and
815.Ev ocaml_native
816property depending on whether the architecture supports native
817compilation.
818If dynamic linking is supported on the native architecture,
819the %%dynlink%% plist fragment and
820.Ev ocaml_native_dynlink
821property is set.
822.It lang/php/pecl
823Used for ports for PHP PECL extensions.
824Sets default
825.Ev MASTER_SITES ,
826.Ev HOMEPAGE ,
827.Ev EXTRACT_SUFX ,
828.Ev DESTDIRNAME ,
829.Ev MODPHP_DO_SAMPLE ,
830.Ev MODPHP_DO_PHPIZE ,
831.Ev AUTOCONF_VERSION ,
832.Ev AUTOMAKE_VERSION ,
833.Ev LIBTOOL_FLAGS .
834Provides a default
835.Ev TEST_TARGET
836and
837.Ev TEST_FLAGS
838unless
839.Ev NO_TEST
840or a
841.Ar do-test
842target is defined.
843Adds common dependencies to
844.Ev RUN_DEPENDS
845and
846.Ev BUILD_DEPENDS .
847Sets a default
848.Ev PKGNAME
849and appends to
850.Ev CATEGORIES .
851.It lang/python
852Sets
853.Ev MODPY_VERSION ,
854.Ev MODPY_BIN ,
855.Ev MODPY_INCDIR ,
856.Ev MODPY_LIBDIR ,
857.Ev MODPY_SITEPKG ,
858.Ev MODPY_SETUP ,
859.Ev MODPY_WANTLIB ,
860.Ev MODPY_LIB_DEPENDS ,
861.Ev MODPY_RUN_DEPENDS ,
862.Ev MODPY_BUILD_DEPENDS
863and
864.Ev MODPY_ADJ_FILES .
865Appends to
866.Ev RUN_DEPENDS
867unless
868.Ev MODPY_RUNDEP
869is set to No.
870Appends to
871.Ev BUILD_DEPENDS
872unless
873.Ev MODPY_BUILDDEP
874is set to No or
875.Ev NO_BUILD
876is set to Yes.
877.Ev MODPY_VERSION
878is the default version used by all python modules.
879Ports which use the setuptools module should set
880.Ev MODPY_SETUPTOOLS
881to Yes.
882All ports that generate egg-info files should set
883.Ev MODPY_EGG_VERSION
884to the version string used by the port's setup.py setup() function.
885Extra arguments to the build and install commands can be passed via
886.Ev MODPY_DISTUTILS_BUILDARGS
887and
888.Ev MODPY_DISTUTILS_INSTALLARGS .
889If any files have a python shebang line which needs to be replaced
890using MODPY_BIN, list them in
891.Ev MODPY_ADJ_FILES .
892These are prefixed with WRKSRC and replaced automatically
893at the end of
894.Ar pre-configure .
895Also affects
896.Ev CATEGORIES ,
897.Ev MAKE_ENV ,
898.Ev CONFIGURE_ENV ,
899.Ev SHARED_ONLY ,
900and
901.Ev SUBST_VARS .
902May affect the
903.Ar test
904target.
905.Pp
906Python 2.x places .pyc files in the same directory as the associated .py file.
907Python 3.x places these in a separate __pycache__ directory and uses an
908additional suffix.
909The python module defines variables to allow a single PLIST to be
910used for both versions.
911Generate or update the PLIST using the python3
912.Ev FLAVOR ,
913then edit it to prefix any lines creating
914.Ev MODPY_PYCACHE
915directories with
916.Ev MODPY_PYCOMMENT .
917As python2 and python3 packages should permit being installed together,
918it may be necessary to suffix names of common binaries or directories,
919or split common files into a subpackage.
920If updating the PLIST without using the python3 flavor,
921take care not to remove ${MODPY_PYCACHE} and ${MODPY_PYC_MAGIC_TAG}
922variables from the PLIST.
923.It lang/ruby
924See
925.Xr ruby-module 5 .
926.It lang/tcl
927Sets
928.Ev MODTCL_VERSION ,
929.Ev MODTCL_BIN ,
930.Ev MODTCL_INCDIR ,
931.Ev MODTCL_LIBDIR ,
932.Ev MODTCL_BUILD_DEPENDS ,
933.Ev MODTCL_RUN_DEPENDS ,
934.Ev MODTCL_LIB ,
935.Ev MODTCL_LIB_DEPENDS ,
936and
937.Ev MODTCL_CONFIG .
938.Ev MODTCL_VERSION
939is the default version used by all Tcl ports and may be overridden.
940Provides
941.Ev MODTCL_TCLSH_ADJ
942and
943.Ev MODTCL_WISH_ADJ
944shell fragments to patch the interpreter path in executable scripts.
945Also affects
946.Ev CATEGORIES
947and
948.Ev SUBST_VARS .
949.It perl
950This module is documented in the main
951.Xr bsd.port.mk 5
952manpage.
953.It textproc/intltool
954Sets
955.Ev MODINTLTOOL_OVERRIDE .
956.Pa textproc/intltool
957is added to
958.Ev BUILD_DEPENDS .
959.Ev MODINTLTOOL_OVERRIDE
960changes the paths of
961.Ev INTLTOOL_EXTRACT ,
962.Ev INTLTOOL_MERGE
963and
964.Ev INTLTOOL_UPDATE
965to use the installed versions of intltool-extract,
966intltool-merge and intltool-update, instead of the version's packages into the
967distfile of the port using this module.
968Also affects
969.Ev CONFIGURE_ENV ,
970.Ev MAKE_ENV
971and
972.Ev MAKE_FLAGS
973by appending
974.Ev MODINTLTOOL_OVERRIDE
975to them.
976.It www/drupal6
977This module is legacy.
978drupal6 is still supported, but new work should mostly happen in drupal7 land.
979.It www/drupal7
980Can be used to install plugins (default), themes if
981.Ev MODDRUPAL_THEME
982is yes, or languages packs if
983.Ev DRUPAL_LANG
984is set to the desired language.
985.Pp
986The module will set or add to default values for
987.Ev HOMEPAGE ,
988.Ev MASTER_SITES ,
989.Ev PREFIX ,
990.Ev DIST_SUBDIR ,
991.Ev CATEGORIES ,
992.Ev PKG_ARCH ,
993.Ev WRKDIST ,
994.Ev RUN_DEPENDS .
995Drupal modules normally don't have any build part, just an installation part
996that defaults to copying the plugin/theme/language files into the right
997location through
998.Ev MODDRUPAL_INSTALL .
999.Pp
1000The module sets
1001.Ev DRUPAL
1002to drupal7,
1003.Ev DRUPAL_ROOT
1004to htdocs/${DRUPAL}
1005.Ev DRUPAL_MODS
1006to ${DRUPAL_ROOT}/site/all/modules
1007.Ev DRUPAL_THEMES
1008to ${DRUPAL_ROOT}/site/all/themes
1009and
1010.Ev DRUPAL_TRANSLATIONS
1011to ${DRUPAL_ROOT}/profiles/standard/translations.
1012So, by default, modules and themes are installed for all sites,
1013and translations are activated at install.
1014.Pp
1015.Ev DRUPAL_OWNER , DRUPAL_GROUP
1016are set to root, daemon, since drupal doesn't need to write
1017to any file except the files/ directory and the site settings (those
1018belong to www instead).
1019.Pp
1020Translations are handled by setting
1021.Ev DRUPAL_LANG
1022to the language letter code, and by setting
1023.Ev LANGFILES
1024to a list of module names/version pairs.
1025.Pp
1026With drupal7, all translations have been put in separate .po files.
1027It has been deemed simplest to pack all translations for a given language
1028into a single package, since translations for non installed modules won't
1029affect anything.
1030.It www/horde
1031.It www/mozilla
1032Sets
1033.Ev PKGNAME ,
1034.Ev HOMEPAGE ,
1035.Ev MASTER_SITES ,
1036.Ev DISTNAME ,
1037.Ev USE_GMAKE ,
1038.Ev ONLY_FOR_ARCHS
1039and
1040.Ev SHARED_ONLY .
1041.Ev EXTRACT_SUFX
1042defaults to .tar.bz2.
1043.Pp
1044Adds common dependencies to
1045.Ev LIB_DEPENDS ,
1046.Ev WANTLIB ,
1047.Ev RUN_DEPENDS
1048and
1049.Ev BUILD_DEPENDS .
1050Sets common
1051.Ev CONFIGURE_ARGS ,
1052.Ev MAKE_ENV
1053and
1054.Ev CONFIGURE_ENV .
1055Sets
1056.Ev MOB
1057variable as source directory
1058and
1059.Ev MOZ
1060as target directory within
1061.Ar do-install .
1062.Pp
1063Individual port Makefile must set
1064.Ev MOZILLA_PROJECT ,
1065.Ev MOZILLA_CODENAME ,
1066.Ev MOZILLA_VERSION ,
1067.Ev MOZILLA_BRANCH ,
1068.Ev MOZILLA_LIBS
1069and
1070.Ev MOZILLA_DATADIRS
1071variables.
1072Port can also append values to
1073.Ev MOZILLA_SUBST_FILES
1074which contains the list of
1075files to run
1076.Ev SUBST_CMD
1077on during
1078.Ar pre-configure ,
1079and
1080.Ev MOZILLA_AUTOCONF_DIRS
1081which
1082contains the list of dirs where
1083.Ev AUTOCONF
1084will be run during
1085.Ar pre-configure .
1086.It www/pear
1087Used for PHP PEAR ports.
1088Sets default
1089.Ev MASTER_SITES ,
1090.Ev EXTRACT_SUFX ,
1091.Ev PKGNAME .
1092Sets
1093.Ev PREFIX
1094to
1095.Pa /var/www .
1096Sets
1097.Ev NO_TEST
1098unless a
1099.Ar do-test
1100target is defined.
1101Adds common dependencies to
1102.Ev RUN_DEPENDS
1103and
1104.Ev BUILD_DEPENDS ,
1105sets
1106.Ev MAKE_FILE
1107and
1108.Ev FAKE_FLAGS
1109appropriately.
1110Makes
1111.Ev PEAR_LIBDIR
1112and
1113.Ev PEAR_PHPBIN
1114available for use in the port.
1115Sets a default
1116.Ev PKGNAME
1117and appends to
1118.Ev CATEGORIES .
1119.It www/plone
1120Sets
1121.Ev MODPLONE_VERSION
1122and
1123.Ev MODZOPE_VERSION .
1124.Ev MODPLONE_VERSION
1125is the default version used by all Plone ports and may be overridden.
1126It appends
1127.Pa www/plone
1128to
1129.Ev RUN_DEPENDS
1130and also sets
1131.Ev NO_TEST
1132to Yes.
1133.It www/zope
1134.It x11/gnome
1135If both
1136.Ev GNOME_PROJECT
1137and
1138.Ev GNOME_VERSION
1139are set, this module defines
1140.Ev DISTNAME ,
1141.Ev VERSION ,
1142.Ev MASTER_SITES ,
1143adds x11/gnome to
1144.Ev CATEGORIES
1145and
1146.Ev EXTRACT_SUFX
1147will default to .tar.xz if unset.
1148Also unconditionally sets
1149.Ev USE_GMAKE .
1150.Pp
1151Unless
1152.Li NO_BUILD=Yes ,
1153.Ev CONFIGURE_SHARED
1154is appended to
1155.Ev CONFIGURE_ARGS ,
1156.Li CPPFLAGS="-I${LOCALBASE}/include"
1157and
1158.Li LDFLAGS="-L${LOCALBASE}/lib"
1159are appended to
1160.Ev CONFIGURE_ENV
1161and
1162.Pa textproc/intltool
1163is appended to
1164.Ev MODULES .
1165.Pp
1166If none of
1167.Ev AUTOCONF_VERSION
1168nor
1169.Ev AUTOMAKE_VERSION
1170are defined, then "--disable-maintainer-mode" is appended to
1171.Ev CONFIGURE_ARGS .
1172.Pp
1173Certain build/run dependencies and configure arguments and environment
1174can be set by appending desktop-file-utils, docbook, gobject-introspection,
1175gtk-doc, gtk-update-icon-cache, shared-mime-info, vala and/or yelp to
1176.Ev MODGNOME_TOOLS .
1177They are disabled otherwise.
1178If
1179.Ev MODGNOME_TOOLS
1180is set to desktop-file-utils,
1181a dependency on
1182.Pa devel/desktop-file-utils
1183is appended to
1184.Ev MODGNOME_RUN_DEPENDS
1185and a link to /usr/bin/true is created under
1186.Pa ${WRKDIR}/bin/desktop-file-validate .
1187.Ev MODGNOME_TOOLS
1188is set to docbook,
1189.Pa textproc/docbook-xsl
1190is appended to
1191.Ev MODGNOME_BUILD_DEPENDS .
1192This option is used when the generation of the man pages included in the
1193source tarball requires docbook XML/SGML/XSL definitions and stylesheets.
1194If
1195.Ev MODGNOME_TOOLS
1196is set to gtk-update-icon-cache, a dependency on
1197.Pa x11/gtk+2,-guic
1198is appended to
1199.Ev MODGNOME_RUN_DEPENDS .
1200If
1201.Ev MODGNOME_TOOLS
1202is set to shared-mime-info, a dependency on
1203.Pa misc/shared-mime-info
1204is appended to
1205.Ev MODGNOME_RUN_DEPENDS
1206and a link to /usr/bin/true is created under
1207.Pa ${WRKDIR}/bin/update-mime-database .
1208If
1209.Ev MODGNOME_TOOLS
1210is set to yelp,
1211.Pa textproc/itstool
1212and
1213.Pa x11/gnome/doc-utils
1214are appended to
1215.Ev MODGNOME_BUILD_DEPENDS .
1216Furthermore,
1217.Pa x11/gnome/yelp
1218is appended to
1219.Ev MODGNOME_RUN_DEPENDS
1220if
1221.Ev MODGNOME_TOOLS
1222also contains "desktop-file-utils"
1223This option is to be used when any files are installed into
1224.Pa share/gnome/help/
1225or page files are installed into
1226.Pa share/help/ .
1227.Ev MODGNOME_BUILD_DEPENDS
1228and
1229.Ev MODGNOME_RUN_DEPENDS
1230are appended to the
1231corresponding
1232.Ev BUILD_DEPENDS
1233and
1234.Ev RUN_DEPENDS .
1235.Pp
1236Some tools require the following goo in the PLIST:
1237.Pp
1238.Ar desktop-file-utils
1239.Bd -literal -offset indent
1240@exec %D/bin/update-desktop-database
1241@unexec-delete %D/bin/update-desktop-database
1242.Ed
1243.Pp
1244.Ar gtk-update-icon-cache
1245($icon-theme is the theme directory)
1246.Bd -literal -offset indent
1247@exec %D/bin/gtk-update-icon-cache -q -t %D/share/icons/$icon-theme
1248@unexec-delete %D/bin/gtk-update-icon-cache -q -t %D/share/icons/$icon-theme
1249.Ed
1250.Pp
1251.Ar shared-mime-info
1252.Bd -literal -offset indent
1253@exec %D/bin/update-mime-database %D/share/mime
1254@unexec-delete %D/bin/update-mime-database %D/share/mime
1255.Ed
1256.It x11/gnustep
1257.It x11/kde
1258.It x11/kde4
1259.It x11/qt3 and x11/qt4
1260Both qt modules share a common
1261.Ev MODQT_*
1262namespace for simple ports.
1263The qt3 module also defines the same variables under
1264.Ev MODQT3_*
1265and the qt4 module also defines the same variables under
1266.Ev MODQT4_* ,
1267to allow ports to use both modules, such as
1268.Pa print/poppler .
1269.Pp
1270Those modules define
1271.Ev MODQT*_LIBDIR
1272as the libraries location,
1273.Ev MODQT*_INCDIR
1274as the include files location ,
1275.Ev MODQT*_QTDIR
1276as the global qt directory location ,
1277.Ev MODQT*_CONFIGURE_ARGS
1278as standard GNU configure-style parameters to locate the include and libraries.
1279.Pp
1280The location of qt specific tools
1281.Nm moc
1282and
1283.Nm uic
1284is available through
1285.Ev MODQT*_MOC
1286and
1287.Ev MODQT*_UIC .
1288.Ev MODQT*_OVERRIDE_UIC
1289controls whether the default setup will force a value of
1290.Ev UIC
1291or not.
1292The value of
1293.Ev MOC
1294is always forced to ${MODQT*_MOC}.
1295qt4 includes
1296.Xr pkg-config 1
1297files under a specific location recorded in
1298.Ev MODQT_PKG_CONFIG_PATH .
1299qt3 requires the use of
1300.Ev MODQT3_PLUGINS
1301to correctly locate plugins.
1302.Pp
1303The modules add to
1304.Ev CONFIGURE_ENV , MAKE_ENV
1305and
1306.Ev MAKE_FLAGS .
1307They define appropriate
1308.Ev MODQT*_LIB_DEPENDS
1309and
1310.Ev MODQT*_WANTLIB .
1311Note that qt4 has split its code over several libraries, so the basic
1312.Ev WANTLIB
1313only refers to QtCore.
1314Other libraries should be added as needed.
1315.It x11/tk
1316Sets
1317.Ev MODTK_VERSION ,
1318.Ev MODTK_BIN ,
1319.Ev MODTK_INCDIR ,
1320.Ev MODTK_LIBDIR ,
1321.Ev MODTK_BUILD_DEPENDS ,
1322.Ev MODTK_RUN_DEPENDS ,
1323.Ev MODTK_LIB ,
1324.Ev MODTK_LIB_DEPENDS ,
1325and
1326.Ev MODTK_CONFIG .
1327.Ev MODTK_VERSION
1328is the default version used by all Tk ports and
1329may be overridden.
1330Automatically adds the
1331.Pa lang/tcl
1332module, provides a default
1333.Ev MODTCL_VERSION
1334to match
1335.Ev MODTK_VERSION ,
1336and affects
1337.Ev CATEGORIES
1338and
1339.Ev SUBST_VARS .
1340Note the
1341.Ev MODTCL_WISH_ADJ
1342shell fragment in the
1343.Pa lang/tcl
1344module.
1345.It x11/xfce4
1346Sets
1347.Ev DIST_SUBDIR ,
1348.Ev EXTRACT_SUFX ,
1349.Ev CONFIGURE_STYLE ,
1350.Ev CONFIGURE_ENV
1351and
1352.Ev USE_GMAKE .
1353If
1354.Ev MODXFCE_ICON_CACHE
1355is set to yes, it adds
1356.Pa x11/gtk+2,-guic
1357to
1358.Ev RUN_DEPENDS .
1359Unless
1360.Ev XFCE_NO_SRC
1361is set,
1362.Pa devel/gettext
1363and
1364.Pa textproc/intltool
1365are added to
1366.Ev MODULES .
1367Also affects
1368.Ev CATEGORIES .
1369.Pp
1370Xfce ports can be divided into five categories: core libraries and
1371applications, goodies, artwork, thunar plugins, and panel plugins.
1372.Ev HOMEPAGE ,
1373.Ev MASTER_SITES
1374and
1375.Ev DISTNAME
1376are built using
1377.Ev XFCE_VERSION
1378(which defaults to
1379.Ev XFCE_DESKTOP_VERSION
1380if not set) and either
1381.Ev XFCE_PROJECT ,
1382.Ev XFCE_GOODIE ,
1383.Ev XFCE_ARTWORK ,
1384.Ev THUNAR_PLUGIN
1385or
1386.Ev XFCE_PLUGIN .
1387One of the latter has to be provided by the port Makefile.
1388.El
1389.Sh SEE ALSO
1390.Xr make 1 ,
1391.Xr bsd.port.mk 5 ,
1392.Xr ports 7
1393