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