1.\" $OpenBSD: port-modules.5,v 1.270 2024/07/11 12:55:33 bentley 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: July 11 2024 $ 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/qt5 127and 128.Pa x11/qt6 . 129Instead of using the namespace 130.Ev MODQT5* , 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 MODQT4_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/qt5 x11/qt6 145and differentiate between qt5 and qt6 needs with 146.Ev MODQT5_LIB_DEPENDS 147and 148.Ev MODQT6_LIB_DEPENDS . 149See 150.Pa print/poppler 151for an example. 152.Sh OVERRIDING TARGET BEHAVIOR 153The main framework contains several hooks that allow ports to override 154normal behavior. 155This evolved as an ad-hoc framework, where only hooks that turned out 156to be needed were added. 157If several modules define the same hook, hook behaviors will be 158invoked in sequence. 159.Bl -tag -width do-configure 160.It Cm extract 161There is a 162.Cm post-extract 163hook that can be activated by defining 164.Ev MODFOO_post-extract . 165It will be run right after 166.Cm post-extract . 167.It Cm patch 168There is a 169.Cm post-patch 170hook that can be activated by defining 171.Ev MODFOO_post-patch . 172It will be run right after 173.Cm post-patch . 174.It Cm gen 175There is a 176.Cm gen 177hook that can be activated by defining 178.Ev MODFOO_gen . 179It will be run right after 180.Cm do-gen 181and before 182.Ev REORDER_DEPENDENCIES 183touches things. 184.It Cm configure 185There is a 186.Cm pre-configure 187hook that can be activated by defining 188.Ev MODFOO_pre-configure . 189It will be run right after 190.Cm pre-configure . 191The normal 192.Cm do-configure 193behavior is to invoke all 194.Ev MODFOO_configure 195contents that are defined in 196.Ev CONFIGURE_STYLE . 197By default, 198.Cm configure 199will do nothing. 200.Pp 201Some 202.Ev CONFIGURE_STYLE 203values, namely perl, gnu, imake, and autoconf, 204will automatically import the correct module. 205User-defined modules must both add to 206.Ev CONFIGURE_STYLE 207and import the correct module to override behavior. 208.Pp 209Contrary to other hooks, module behavior is not invoked in 210addition to 211.Cm do-configure , 212but as the normal configure process. 213If 214.Cm do-configure 215is overridden, normal hook processing will not happen. 216.It Cm fake 217There is a 218.Cm pre-fake 219hook that can be activated by defining 220.Ev MODFOO_pre-fake . 221This will be invoked right after 222.Xr mtree 8 , 223and before the normal 224.Cm pre-fake 225behavior. 226.Pp 227This can occasionally be used for ports that require some specific 228fake installation setup that will be provided by runtime dependencies. 229.It Cm install 230There is a 231.Cm post-install 232hook that can be activated by defining 233.Ev MODFOO_post-install . 234This will be invoked at the end of 235.Cm install , 236right after the normal 237.Cm post-install 238behavior. 239.El 240.Pp 241Some targets, such as 242.Cm do-build 243or 244.Cm do-install , 245can't be overridden simply. 246A module that, for instance, requires specific 247.Cm do-build 248behavior should do so in two steps: 249.Bl -bullet 250.It 251Define a variable named 252.Ev MODFOO_BUILD_TARGET 253that contains the commands necessary for 254.Cm do-build : 255.Bd -literal -offset indent 256MODFOO_BUILD_TARGET = cmd1; cmd2 257.Ed 258.It 259Override 260.Cm do-build 261only if it's not already defined by the port proper: 262.Bd -literal -offset indent 263\&.if !target(do-build) 264do-build: 265 @${MODFOO_BUILD_TARGET} 266\&.endif 267.Ed 268.El 269That way, if several modules require specific actions for those targets, 270the end user can choose the appropriate order in which to run the actions: 271.Bd -literal -offset indent 272do-build: 273 @${MODBAR_BUILD_TARGET} 274 @${MODFOO_BUILD_TARGET} 275 ... 276.Ed 277.Sh OVERRIDING VARIABLE BEHAVIOR 278Some variables can be overridden by modules. 279Be very cautious, as this can make the module difficult to use, 280or interact badly with other modules. 281As a rule, always provide the override as: 282.Pp 283.Dl VARIABLE ?= value 284.Pp 285and provide a module-specific variable with the same value: 286.Pp 287.Dl MODFOO_VARIABLE = value . 288.Pp 289The following variables can be overridden in a relatively safe fashion: 290.Ev ALL_TARGET , 291.Ev CONFIGURE_SCRIPT , 292.Ev DESTDIRNAME , 293.Ev DIST_SUBDIR , 294.Ev DISTNAME , 295.Ev DISTFILES , 296.Ev EXTRACT_SUFX , 297.Ev FAKE_FLAGS , 298.Ev FETCH_MANUALLY , 299.Ev HOMEPAGE , 300.Ev IGNORE , 301.Ev IS_INTERACTIVE , 302.Ev LIBTOOL_FLAGS , 303.Ev MAKE_FILE , 304.Ev MASTER_SITES , 305.Ev MULTI_PACKAGES , 306.Ev NO_BUILD , 307.Ev NO_TEST , 308.Ev PATCH_LIST , 309.Ev PKG_ARCH , 310.Ev PKGNAME* , 311.Ev PREFIX , 312.Ev TEST_TARGET , 313.Ev TEST_IS_INTERACTIVE , 314.Ev REORDER_DEPENDENCIES , 315.Ev SEPARATE_BUILD , 316.Ev USE_GMAKE , 317.Ev USE_LIBTOOL . 318.Pp 319The following variables can be added to in a relatively safe fashion: 320.Ev BUILD_DEPENDS , 321.Ev CATEGORIES , 322.Ev CONFIGURE_ARGS , 323.Ev CONFIGURE_ENV , 324.Ev ERRORS , 325.Ev FAKE_FLAGS , 326.Ev FLAVOR , 327.Ev FLAVORS , 328.Ev INSTALL_TARGET , 329.Ev LIB_DEPENDS , 330.Ev MAKE_ENV , 331.Ev MAKE_FLAGS , 332.Ev PKG_ARGS , 333.Ev PSEUDO_FLAVORS , 334.Ev TEST_DEPENDS , 335.Ev REORDER_DEPENDENCIES , 336.Ev RUN_DEPENDS , 337.Ev SUBST_VARS , 338.Ev WANTLIB . 339.Sh SPECIFIC MODULE INTERACTIONS 340Some modules correspond to extra ports that will be used mostly as 341.Ev BUILD_DEPENDS 342or 343.Ev RUN_DEPENDS . 344Such modules can safely append values directly to the 345.Ev BUILD_DEPENDS , 346.Ev RUN_DEPENDS , 347.Ev LIB_DEPENDS , 348and 349.Ev WANTLIB 350variables, as long as they also define module-specific variables for 351all runtime dependencies. 352.Pp 353Simple client ports will use the module directly, and thus inherit extra 354build and runtime dependencies. 355.Pp 356More sophisticated ports can use 357.Ev MULTI_PACKAGES 358to select specific behavior: build-time dependencies will always be 359needed. 360Runtime dependencies will be selected on a subpackage basis, 361since runtime dependencies such as 362.Ev LIB_DEPENDS-sub 363do not inherit the default 364.Ev LIB_DEPENDS 365value. 366The client port's author must only bear in mind that external modules 367may add values to the default 368.Ev WANTLIB , 369.Ev LIB_DEPENDS , 370and 371.Ev RUN_DEPENDS , 372and thus that it is not safe to inherit from it blindly. 373.Pp 374Modules are imported during 375.Pp 376.Dl .include <bsd.port.mk> 377.Pp 378Thus they can be affected by user choices such as setting a variable 379to Yes or No. 380Modules may make decisions based on documented 381.Ev MODFOO_BEHAVIOR 382values. 383.Pp 384When modules are processed, only a few 385.Xr bsd.port.mk 5 386variables are already defined. 387Modules may depend upon the following variables already having a sane 388value: 389.Ev DISTDIR , 390.Ev LOCALBASE , 391.Ev NO_DEPENDS , 392.Ev PKGPATH , 393.Ev PORTSDIR , 394.Ev X11BASE 395and all arch-dependent constants from 396.Xr bsd.port.arch.mk 5 , 397such as 398.Ev PROPERTIES 399or 400.Ev LP64_ARCHS . 401Note that this is only relevant for tests. 402It is perfectly okay to define variables or targets that depend on the 403basic ports framework without having to care whether that variable is 404already defined, since 405.Xr make 1 406performs lazy evaluation. 407.Sh CORE MODULES DOCUMENTATION 408The following modules are available. 409.Bl -tag -width do-configure 410.It apache-module 411.It cpan 412For perl ports coming from CPAN. 413Wrapper around the normal perl module that fetches the file from 414the correct location depending on 415.Ev DISTNAME , 416and sets a default 417.Ev PKGNAME . 418Also affects 419.Ev TEST_DEPENDS , 420.Ev CONFIGURE_STYLE , 421.Ev PKG_ARCH , 422and 423.Ev CATEGORIES . 424.Pp 425Some CPAN modules are only indexed by author, set 426.Li CPAN_AUTHOR=ID 427to locate the right directory. 428.Pp 429If no 430.Ev HOMEPAGE 431is defined, it will default to 432.Pa http://search.cpan.org/dist/${DISTNAME:C/-[^-]*$//}/ 433.Pp 434User settings: set 435.Ev CPAN_REPORT 436to Yes, 437.Ev CPAN_REPORT_DB 438to a valid directory, 439and 440.Ev CPAN_REPORT_FROM 441to a valid email address to automate the reporting 442of regression tests to CPAN. 443.Pp 444If 445.Ev MODCPAN_EXAMPLES 446is set, the following variables will be set. 447.Ev MODCPAN_EXAMPLES_DIST 448will hold the default directory in the distfile with 449example scripts. 450.Ev MODCPAN_EXAMPLES_DIR 451will be set to the standard installation directory for 452examples. 453Sets the 454.Cm post-install 455target if none has been defined to install the examples, 456otherwise 457.Ev MODCPAN_POST_INSTALL 458should be used as such: 459.Bd -literal 460post-install: 461 ... 462 ${MODCPAN_POST_INSTALL} 463.Ed 464.It databases/mariadb 465Adds small framework for testing ports that require running MariaDB. 466Defines 467.Ev MODMARIADB_TEST_TARGET 468which consists actual commands to run in 469.Cm do-test 470target. 471If this target isn't defined, it will be added automatically. 472.Pp 473The actual test command to be run could be specified in the 474.Ev MODMARIADB_TEST_CMD . 475Default is similar to what 476.Xr bsd.port.mk 5 477runs itself. 478.Pp 479The MariaDB server being started will listen on UNIX domain socket 480only, minimizing impact on running system. 481The path to socket is recorded in 482.Ev MODMARIADB_TEST_SOCKET . 483Any local user will be able to connect without password. 484.Pp 485If the 486.Ev MODMARIADB_TEST_DBNAME 487variable is set, the database with such name will be set up before 488running actual test command. 489Otherwise (default), the test is responsible to call 490.Xr mysqladmin 1 491itself, if needed. 492.Pp 493The 494.Pa databases/mariadb,-server 495will get added to 496.Ev TEST_DEPENDS , 497but not to any other 498.Ev *_DEPENDS . 499The 500.Ev MODMARIADB_CLIENT_ARGS 501and 502.Ev MODMARIADB_ADMIN_ARGS 503variables hold arguments for 504.Xr mysql 1 505and 506.Xr mysqladmin 1 , 507respectively; those argument lists could be used in test scripts 508for connecting to test server, if they aren't satisfied by environment. 509.It databases/postgresql 510Adds small framework for testing ports that require running Postgres. 511Defines 512.Ev MODPOSTGRESQL_TEST_TARGET 513which consists actual commands to run in 514.Cm do-test 515target. 516If this target isn't defined, it will be added automatically. 517.Pp 518The actual test command to be run could be specified in the 519.Ev MODPOSTGRESQL_TEST_CMD . 520Default is similar to what 521.Xr bsd.port.mk 5 522runs itself. 523.Pp 524The Postgres server being started will listen on UNIX domain socket 525only, minimizing impact on running system. 526The path to directory where socket will be created is set by 527.Ev MODPOSTGRESQL_TEST_PGHOST , 528defaulting to 529.Pa ${WRKDIR} . 530Any local user will be able to connect without password. 531.Pp 532If the 533.Ev MODPOSTGRESQL_TEST_DBNAME 534variable is set, the database with such name will be set up before 535running actual test command. 536Otherwise (default), the test is responsible to call 537.Xr initdb 1 538itself. 539.Pp 540The 541.Pa databases/postgresql,-server 542will get added to 543.Ev TEST_DEPENDS , 544but not to any other 545.Ev *_DEPENDS . 546.It devel/cmake 547Adds 548.Pa devel/cmake 549to 550.Ev BUILD_DEPENDS 551and fills up 552.Ev CONFIGURE_ARGS , 553.Ev CONFIGURE_ENV 554and 555.Ev MAKE_ENV . 556Sets up 557.Cm configure 558target. 559If 560.Ev CONFIGURE_STYLE 561was not set before, sets its value to `cmake'. 562Changes default value of 563.Ev SEPARATE_BUILD 564to `Yes' because modern CMake requires out-of-source build anyway. 565Changes 566.Ev TEST_TARGET 567to `test' as this is standard for CMake projects. 568Also this module has the following knobs: 569.Bl -tag -width Ds 570.It MODCMAKE_WANTCOLOR 571If set to `Yes', CMake will colorize its output. 572Should not be used in ports Makefiles. 573Default value is `No'. 574.It MODCMAKE_VERBOSE 575If set to `Yes', CMake will print details during configure and build 576stages about exact command being run, etc. 577Should not be used in ports Makefiles. 578Default value is `Yes'. 579.It MODCMAKE_DEBUG 580If set to `Yes', CMake will produce a debug build instead of a release 581build. 582The exact effects on the build process depend on settings specified in 583the CMake config files. 584Default value is `No'. 585.El 586Also, 587.Sq nojunk 588is added to DPB_PROPERTIES because CMake's include files parser cheats 589too much. 590.It devel/cabal 591See 592.Xr cabal-module 5 593for porting Haskell applications. 594.It devel/cargo 595See 596.Xr cargo-module 5 . 597.It devel/dconf 598Sets 599.Ev CONFIGURE_ARGS , 600.Ev BUILD_DEPENDS 601and 602.Ev RUN_DEPENDS . 603This module is used by ports installing gsettings schemas under 604.Pa ${PREFIX}/share/glib-2.0/schemas/ . 605It requires the following goo in the PLIST: 606.Bd -literal -offset indent 607@exec %D/bin/glib-compile-schemas %D/share/glib-2.0/schemas >/dev/null 608@unexec-delete %D/bin/glib-compile-schemas %D/share/glib-2.0/schemas >/dev/null 609.Ed 610.It devel/gconf2 611A link from 612.Xr gconftool-2 1 613to 614.Xr true 1 615will be put at the front of the 616.Ev PATH . 617Sets 618.Ev CONFIGURE_ARGS , 619.Ev BUILD_DEPENDS 620and 621.Ev RUN_DEPENDS . 622According to the values of 623.Ev MODGCONF2_LIBDEP , 624sets 625.Ev LIB_DEPENDS . 626User settings: set 627.Ev MODGCONF2_SCHEMAS_DIR 628to the directory name under 629.Pa ${LOCALBASE}/share/schemas/ 630where schemas files will be installed. 631.It devel/meson 632Adds 633.Pa devel/meson 634and 635.Pa devel/ninja 636to 637.Ev BUILD_DEPENDS . 638Sets up 639.Cm configure 640target. 641If 642.Ev CONFIGURE_STYLE 643was not set before, sets its value to `meson'. 644Changes default value of 645.Ev SEPARATE_BUILD 646to `Yes' because meson requires out-of-source build. 647If 648.Ev CONFIGURE_STYLE 649is 'meson', 650.Ev MODMESON_CONFIGURE_ARGS 651and 652.Ev MODMESON_CONFIGURE_ENV 653will add default values to 654.Ev CONFIGURE_ARGS 655and 656.Ev CONFIGURE_ENV . 657Also this module has the following knob: 658.Bl -tag -width Ds 659.It MODMESON_WANTCOLOR 660If set to `Yes', meson will colorize its output. 661Should not be used in ports Makefiles. 662Default value is `No'. 663.El 664.It devel/qmake 665See 666.Xr qmake-module 5 . 667.It devel/scons 668Adds 669.Pa devel/scons 670to 671.Ev BUILD_DEPENDS . 672Sets 673.Ev MODSCONS_BIN 674and 675.Ev MODSCONS_ENV . 676Also defines an overridable 677.Ev MODSCONS_FLAGS . 678It provides a 679.Cm do-build 680and 681.Cm do-install 682targets that can be overridden in the port Makefile. 683.It font 684Used for ports which primarily install fonts. 685Affects 686.Ev PKG_ARCH 687and 688.Ev EXTRACT_SUFX . 689Appends to 690.Ev CATEGORIES . 691When 692.Ev MODFONT_FAMILY 693is set in combination with 694.Ev MODFONT_VERSION , 695it sets 696.Ev PKGNAME . 697.Ev MODFONT_FAMILY 698should be set to the name of the font family. 699This sets 700.Ev MODFONT_FONTDIR 701and 702.Ev MODFONT_DOCDIR 703using said family name. 704A 705.Cm do-install 706target is provided if the port itself does not provide it. 707This installs fonts from 708.Ev WRKSRC 709in the distribution. 710If one or more filenames (relative to 711.Ev WRKSRC ) 712are listed in 713.Ev MODFONT_FONTFILES , 714they will be installed to 715.Ev MODFONT_FONTDIR . 716Otherwise, otf files in 717.Ev WRKSRC 718will be installed, with a fallback to ttf. 719If filenames (relative to 720.Ev WRKSRC ) 721are listed in 722.Ev MODFONT_DOCFILES , 723they will be installed to 724.Ev MODFONT_DOCDIR . 725.It fortran 726Sets 727.Ev MODFORTRAN_LIB_DEPENDS , 728.Ev MODFORTRAN_WANTLIB , 729.Ev MODFORTRAN_BUILD_DEPENDS . 730Set 731.Ev MODFORTRAN_COMPILER 732to `gfortran', or `flang', depending on what the port requires. 733The default is `gfortran'. 734The dependencies are chosen according to 735.Ev MODFORTRAN_COMPILER . 736.It gcc4 737If 738.Ev COMPILER_VERSION 739is not gcc4 (defined by 740.Pa /usr/share/mk/bsd.own.mk ) , 741and architecture is in 742.Ev MODGCC4_ARCHS , 743then the gcc4 compilers will be put at the front of the path. 744By default, only C language support is included by this module. 745If other languages are needed, they must be listed in 746.Ev MODGCC4_LANGS 747(e.g. c++, fortran). 748The 749.Ev MODGCC4_VERSION 750variable can be used to change the version of gcc. 751By default gcc 4.9 is used. 752If 753.Ev MODGCC4_LANGS 754contains c++, this module provides 755.Ev MODGCC4_CPPLIBDEP 756and 757.Ev MODGCC4_CPPWANTLIB . 758.It gnu 759This module is documented in the main 760.Xr bsd.port.mk 5 761manpage. 762.It imake 763This module is documented in the main 764.Xr bsd.port.mk 5 765manpage. 766.It java 767Set 768.Li MODJAVA_VER=x.y 769to use exactly the JDK x.y, 770.Li MODJAVA_VER=x.y+ 771to use any x.y or higher version. 772Set 773.Li MODJAVA_JRERUN=Yes 774if the port only needs the JRE at runtime. 775The module sets 776.Ev JAVA_HOME , 777.Ev ONLY_FOR_ARCHS , 778.Ev MODJAVA_RUN_DEPENDS , 779.Ev MODJAVA_SHARE_DIR , 780.Ev MODJAVA_JAR_DIR , 781.Ev MODJAVA_EXAMPLE_DIR 782and 783.Ev MODJAVA_DOC_DIR . 784It appends to 785.Ev BUILD_DEPENDS , 786.Ev RUN_DEPENDS , 787.Ev CATEGORIES 788and 789.Ev SUBST_VARS . 790If 791.Li MODJAVA_BUILD=ant 792then this module provides 793.Ev MODJAVA_BUILD_DIR , 794.Ev MODJAVA_BUILD_FILE 795and 796.Ev MODJAVA_BUILD_TARGET_NAME , 797as well as a 798.Cm do-build 799target (if not already defined). 800It heeds 801.Ev NO_BUILD . 802.It lang/clang 803Similar to gcc4 module. 804If architecture is in MODCLANG_ARCHS, the Clang compilers will be 805put at the front of the path. 806By default, only C language support is included by this module. 807If other languages are needed, they must be listed in 808.Ev MODCLANG_LANGS 809(e.g. c++). 810Sets 811.Ev MODCLANG_VERSION 812which is also appended to 813.Ev SUBST_VARS . 814.It lang/erlang 815.It lang/go 816See 817.Xr go-module 5 . 818.It lang/lua 819Sets 820.Ev MODLUA_BIN , 821.Ev MODLUA_DATADIR , 822.Ev MODLUA_DEP , 823.Ev MODLUA_DEP_VERSION , 824.Ev MODLUA_DOCDIR , 825.Ev MODLUA_EXAMPLEDIR , 826.Ev MODLUA_INCL_DIR , 827.Ev MODLUA_LIB , 828.Ev MODLUA_LIBDIR , 829.Ev MODLUA_VERSION , 830.Ev MODLUA_WANTLIB . 831Appends to 832.Ev CATEGORIES . 833Also appends to 834.Ev BUILD_DEPENDS , 835unless 836.Ev NO_BUILD 837has been set to Yes. 838Also appends to 839.Ev RUN_DEPENDS , 840unless 841.Ev MODLUA_RUNDEP 842is set to No. 843Appends 844.Ev MODLUA_VERSION , 845.Ev MODLUA_LIB , 846.Ev MODLUA_INCL_DIR , 847.Ev MODLUA_EXAMPLEDIR , 848.Ev MODLUA_DOCDIR , 849.Ev MODLUA_LIBDIR , 850.Ev MODLUA_DATADIR , 851.Ev MODLUA_DEP , 852.Ev MODLUA_DEP_VERSION , 853.Ev MODLUA_BIN 854to 855.Ev SUBST_VARS . 856.Ev MODLUA_DEFAULT_VERSION 857is set to 5.1. 858.Ev MODLUA_VERSION is set to 859.Ev MODLUA_DEFAULT_VERSION 860by default. 861Ports can be built with several lua versions. 862If no FLAVOR is set, it defaults to MODLUA_DEFAULT_VERSION. 863Otherwise the FULLPKGNAME is adjusted, if MODLUA_SA is not set. 864In order to set a build, run or test dependency on a lua port, 865use the following, which will propagate the currently used flavor: 866.Ev MODLUA_BUILD_DEPENDS , 867.Ev MODLUA_TEST_DEPENDS , 868.Ev MODLUA_RUN_DEPENDS . 869.It lang/mono 870Sets 871.Ev MODMONO_ONLY_FOR_ARCHS , 872.Ev CONFIGURE_ENV , 873.Ev MAKE_FLAGS , 874.Ev MODMONO_BUILD_DEPENDS 875and 876.Ev MODMONO_RUN_DEPENDS . 877If 878.Ev MODMONO_DEPS 879is set to Yes, 880.Pa lang/mono 881is appended to 882.Ev BUILD_DEPENDS 883and 884.Ev RUN_DEPENDS . 885.Ev DLLMAP_FILES 886defines in which files the module will substitute hardcoded 887shared library versions using a 888.Cm post-configure 889target. 890.It lang/ocaml 891Appends to 892.Ev BUILD_DEPENDS 893and 894.Ev MAKE_ENV . 895Appends to 896.Ev RUN_DEPENDS 897unless 898.Ev MODOCAML_RUNDEP 899is set to No, or set to if-not-native and native compilation 900is supported on this architecture. 901Including this module selects a %%native%% plist fragment and 902.Ev ocaml_native 903property depending on whether the architecture supports native 904compilation. 905If dynamic linking is supported on the native architecture, 906the %%dynlink%% plist fragment and 907.Ev ocaml_native_dynlink 908property is set. 909When 910.Ev CONFIGURE_STYLE 911is set to `oasis', 912overrides for the 913.Cm do-build , 914.Cm do-install , 915and 916.Cm do-test 917targets are added. 918.It lang/php 919Used for ports using PHP in some way: 920either extensions to PHP, or software written in PHP. 921Sets 922.Ev MODPHP_RUN_DEPENDS , 923.Ev MODPHP_LIB_DEPENDS , 924.Ev MODPHP_WANTLIB , 925.Ev MODPHP_BIN , 926.Ev MODPHP_PHPIZE , 927.Ev MODPHP_PHP_CONFIG , 928.Ev MODPHP_INCDIR 929and 930.Ev MODPHP_LIBDIR . 931Adds to 932.Ev RUN_DEPENDS 933unless 934.Ev MODPHP_RUNDEP 935is set to No. 936Adds to 937.Ev BUILD_DEPENDS 938if 939.Ev MODPHP_BUILDDEP 940is set to Yes. 941If 942.Ev MODPHP_DO_PHPIZE 943is set, prepares a build environment for extensions that use phpize. 944.Pp 945Ports using PDO for database connectivity often have a choice of 946dependencies (pdo_sqlite, pdo_mysql, pdo_pgsql and others). 947The module constructs 948.Ev MODPHP_PDO_DEPENDS 949from the PDO types listed in 950.Ev MODPHP_PDO_ALLOWED 951(defaulting to "sqlite mysql pgsql"). 952This can be added to 953.Ev RUN_DEPENDS 954and allows any of these PDO packages to satisfy the dependency, with 955.Ev MODPHP_PDO_PREF 956(sqlite by default) chosen if none are installed. 957.It lang/php/pecl 958Used for ports for PHP PECL extensions. 959Sets default 960.Ev MASTER_SITES , 961.Ev HOMEPAGE , 962.Ev EXTRACT_SUFX , 963.Ev DESTDIRNAME , 964.Ev MODPHP_DO_SAMPLE , 965.Ev MODPHP_DO_PHPIZE , 966.Ev AUTOCONF_VERSION , 967.Ev AUTOMAKE_VERSION , 968.Ev LIBTOOL_FLAGS . 969Provides a default 970.Ev TEST_TARGET 971and 972.Ev TEST_FLAGS 973unless 974.Ev NO_TEST 975or a 976.Cm do-test 977target is defined. 978Adds common dependencies to 979.Ev RUN_DEPENDS 980and 981.Ev BUILD_DEPENDS . 982Sets a default 983.Ev PKGNAME 984and appends to 985.Ev CATEGORIES . 986.It lang/python 987See 988.Xr python-module 5 . 989.It lang/ruby 990See 991.Xr ruby-module 5 . 992.It lang/rust 993Ports using Rust must use this module so a rebuild can be triggered via 994.Ev SYSTEM_VERSION-rust 995on updates of the lang/rust port or changes to the Rust standard library. 996Sets 997.Ev MODRUST_WANTLIB 998as appropriate for the architecture so it can be added to 999.Ev WANTLIB . 1000It adds lang/rust to the 1001.Ev BUILD_DEPENDS 1002unless 1003.Ev MODRUST_BUILDDEP 1004is set to anything but 1005.Dq yes . 1006.It lang/tcl 1007Sets 1008.Ev MODTCL_VERSION , 1009.Ev MODTCL_BIN , 1010.Ev MODTCL_INCDIR , 1011.Ev MODTCL_LIBDIR , 1012.Ev MODTCL_BUILD_DEPENDS , 1013.Ev MODTCL_RUN_DEPENDS , 1014.Ev MODTCL_LIB , 1015.Ev MODTCL_LIB_DEPENDS , 1016and 1017.Ev MODTCL_CONFIG . 1018.Ev MODTCL_VERSION 1019is the default version used by all Tcl ports and may be overridden. 1020Provides 1021.Ev MODTCL_TCLSH_ADJ 1022and 1023.Ev MODTCL_WISH_ADJ 1024shell fragments to patch the interpreter path in executable scripts. 1025Also affects 1026.Ev CATEGORIES 1027and 1028.Ev SUBST_VARS . 1029.It perl 1030This module is documented in the main 1031.Xr bsd.port.mk 5 1032manpage. 1033.It security/heimdal 1034A link from ${LOCALBASE}/heimdal/bin/krb5-config 1035to 1036.Xr krb5-config 1 1037will be put at the front of the path. 1038Sets 1039.Ev LIB_DEPENDS 1040and 1041.Ev WANTLIB 1042according to the values of 1043.Ev MODHEIMDAL_LIB_DEPENDS , 1044and 1045.Ev MODHEIMDAL_WANTLIB . 1046.It textproc/intltool 1047Sets 1048.Ev MODINTLTOOL_OVERRIDE . 1049.Pa textproc/intltool 1050is added to 1051.Ev BUILD_DEPENDS . 1052.Ev MODINTLTOOL_OVERRIDE 1053changes the paths of 1054.Ev INTLTOOL_EXTRACT , 1055.Ev INTLTOOL_MERGE 1056and 1057.Ev INTLTOOL_UPDATE 1058to use the installed versions of intltool-extract, 1059intltool-merge and intltool-update, instead of the version's packages into the 1060distfile of the port using this module. 1061Also affects 1062.Ev CONFIGURE_ENV , 1063.Ev MAKE_ENV 1064and 1065.Ev MAKE_FLAGS 1066by appending 1067.Ev MODINTLTOOL_OVERRIDE 1068to them. 1069.It www/mozilla 1070Sets 1071.Ev PKGNAME , 1072.Ev HOMEPAGE , 1073.Ev MASTER_SITES , 1074.Ev DISTNAME , 1075.Ev USE_GMAKE , 1076and 1077.Ev ONLY_FOR_ARCHS . 1078.Ev EXTRACT_SUFX 1079defaults to .tar.bz2. 1080.Pp 1081Adds common dependencies to 1082.Ev LIB_DEPENDS , 1083.Ev WANTLIB , 1084.Ev RUN_DEPENDS 1085and 1086.Ev BUILD_DEPENDS . 1087Sets common 1088.Ev CONFIGURE_ARGS , 1089.Ev MAKE_ENV 1090and 1091.Ev CONFIGURE_ENV . 1092Sets 1093.Ev MOB 1094variable as source directory 1095and 1096.Ev MOZ 1097as target directory within 1098.Cm do-install . 1099.Pp 1100Individual port Makefile must set 1101.Ev MOZILLA_PROJECT , 1102.Ev MOZILLA_CODENAME , 1103.Ev MOZILLA_VERSION , 1104.Ev MOZILLA_BRANCH , 1105.Ev MOZILLA_LIBS 1106and 1107.Ev MOZILLA_DATADIRS 1108variables. 1109Port can also append values to 1110.Ev MOZILLA_SUBST_FILES 1111which contains the list of 1112files to run 1113.Ev SUBST_CMD 1114on during 1115.Cm pre-configure , 1116and 1117.Ev MOZILLA_AUTOCONF_DIRS 1118which 1119contains the list of dirs where 1120.Ev AUTOCONF 1121will be run during 1122.Cm pre-configure . 1123.It www/pear 1124Used for PHP PEAR ports. 1125Sets default 1126.Ev MASTER_SITES , 1127.Ev EXTRACT_SUFX , 1128.Ev PKGNAME . 1129Sets 1130.Ev PREFIX 1131to 1132.Pa /var/www . 1133Sets 1134.Ev NO_TEST 1135unless a 1136.Cm do-test 1137target is defined. 1138Adds common dependencies to 1139.Ev RUN_DEPENDS 1140and 1141.Ev BUILD_DEPENDS , 1142sets 1143.Ev MAKE_FILE 1144and 1145.Ev FAKE_FLAGS 1146appropriately. 1147Makes 1148.Ev PEAR_LIBDIR 1149and 1150.Ev PEAR_PHPBIN 1151available for use in the port. 1152Sets a default 1153.Ev PKGNAME 1154and appends to 1155.Ev CATEGORIES . 1156.It x11/gnome 1157See 1158.Xr gnome-module 5 . 1159.It x11/gnustep 1160.It x11/qt5 and x11/qt6 1161All qt* modules share a common 1162.Ev MODQT_* 1163namespace for simple ports. 1164The qt5 module also defines the same variables under 1165.Ev MODQT5_* 1166and the qt6 module also defines the same variables under 1167.Ev MODQT6_* , 1168to allow ports to use both modules, such as 1169.Pa print/poppler . 1170.Pp 1171Those modules define 1172.Ev MODQT*_LIBDIR 1173as the libraries location, 1174.Ev MODQT*_INCDIR 1175as the include files location, 1176.Ev MODQT*_QTDIR 1177as the global qt directory location, 1178.Ev MODQT*_CONFIGURE_ARGS 1179as standard GNU configure-style parameters to locate the include and libraries. 1180.Pp 1181The location of Qt-specific tools 1182.Nm lrelease , 1183.Nm moc , 1184.Nm qmake 1185and 1186.Nm uic 1187is available through 1188.Ev MODQT*_LRELEASE , 1189.Ev MODQT*_MOC , 1190.Ev MODQT*_QMAKE 1191and 1192.Ev MODQT*_UIC . 1193.Ev MODQT*_OVERRIDE_UIC 1194controls whether the default setup will force a value of 1195.Ev UIC 1196or not. 1197The value of 1198.Ev MOC 1199is always forced to ${MODQT*_MOC}. 1200.Pp 1201In most cases the 1202.Pa devel/qmake 1203module should be used instead of using 1204.Ev MODQT*_QMAKE 1205directly. 1206.Pp 1207The modules add to 1208.Ev CONFIGURE_ENV , MAKE_ENV 1209and 1210.Ev MAKE_FLAGS . 1211They define appropriate 1212.Ev MODQT*_LIB_DEPENDS 1213and 1214.Ev MODQT*_WANTLIB . 1215.Pp 1216Note that Qt5 and Qt6 have their code split over several libraries. 1217Both modules qt5 and qt6 doesn't set 1218.Ev MODQT*_WANTLIB 1219at all. 1220Qt5 and Qt6 consist of many so called Qt modules, these Qt modules should be 1221added to 1222.Ev LIB_DEPENDS , 1223.Ev BUILD_DEPENDS 1224or 1225.Ev RUN_DEPENDS 1226manually. 1227.It x11/tk 1228Sets 1229.Ev MODTK_VERSION , 1230.Ev MODTK_BIN , 1231.Ev MODTK_INCDIR , 1232.Ev MODTK_LIBDIR , 1233.Ev MODTK_BUILD_DEPENDS , 1234.Ev MODTK_RUN_DEPENDS , 1235.Ev MODTK_LIB , 1236.Ev MODTK_LIB_DEPENDS , 1237and 1238.Ev MODTK_CONFIG . 1239.Ev MODTK_VERSION 1240is the default version used by all Tk ports and 1241may be overridden. 1242Automatically adds the 1243.Pa lang/tcl 1244module, provides a default 1245.Ev MODTCL_VERSION 1246to match 1247.Ev MODTK_VERSION , 1248and affects 1249.Ev CATEGORIES 1250and 1251.Ev SUBST_VARS . 1252Note the 1253.Ev MODTCL_WISH_ADJ 1254shell fragment in the 1255.Pa lang/tcl 1256module. 1257.It x11/xfce4 1258Sets 1259.Ev DIST_SUBDIR , 1260.Ev EXTRACT_SUFX , 1261.Ev CONFIGURE_STYLE , 1262.Ev CONFIGURE_ENV 1263and 1264.Ev USE_GMAKE . 1265If 1266.Ev MODXFCE_ICON_CACHE 1267is set to yes, it adds 1268.Pa x11/gtk+4,-guic 1269to 1270.Ev RUN_DEPENDS . 1271Unless 1272.Ev XFCE_NO_SRC 1273is set, 1274.Pa textproc/intltool 1275is added to 1276.Ev MODULES . 1277Also affects 1278.Ev CATEGORIES . 1279.Pp 1280Xfce ports can be divided into five categories: core libraries and 1281applications, goodies, artwork, thunar plugins, and panel plugins. 1282.Ev HOMEPAGE , 1283.Ev MASTER_SITES 1284and 1285.Ev DISTNAME 1286are built using 1287.Ev XFCE_VERSION 1288(which defaults to 1289.Ev XFCE_DESKTOP_VERSION 1290if not set) and either 1291.Ev XFCE_PROJECT , 1292.Ev XFCE_GOODIE , 1293.Ev XFCE_ARTWORK , 1294.Ev THUNAR_PLUGIN 1295or 1296.Ev XFCE_PLUGIN . 1297One of the latter has to be provided by the port Makefile. 1298.El 1299.Sh SEE ALSO 1300.Xr make 1 , 1301.Xr bsd.port.mk 5 , 1302.Xr cabal-module 5 , 1303.Xr cargo-module 5 , 1304.Xr gnome-module 5 , 1305.Xr go-module 5 , 1306.Xr python-module 5 , 1307.Xr qmake-module 5 , 1308.Xr ruby-module 5 , 1309.Xr ports 7 1310