Commit graph

138 commits

Author SHA1 Message Date
Felix Palmen
16bde072b1 bsd.sites.mk: Support tag names with USE_GITLAB
Since quite some time, it's possible to download generated tarballs from
gitlab for a tag name without knowing the corresponding git hash. This
is preferable because you have a single source of truth about the
software version.

Support this by replacing GL_COMMIT with GL_TAGNAME which also accepts a
commit hash, similar to USE_GITHUB. Unfortunately, there's a catch, the
DISTFILE must be named exactly: ${GL_PROJECT}-${GL_TAGNAME}.tar.bz2,
otherwise it extracts in a directory that contains the commit hash. So,
we can't add the gitlab account or the revision suffix to make it work.

Therefore, detect whether GL_TAGNAME contains a commit hash, and if it
does, use the old behavior of deriving DISTNAME and DISTFILES.

Document in CHANGES, also add a DEV_WARNING similar to USE_GITHUB when
there's an URL in MASTER_SITES that looks like a gitlab URL. With
support for tags, there shouldn't be any reason left to hardcode such an
URL in MASTER_SITES.

PR:			248967
Approved by:		portmgr (tcberner, mentor)
Differential Revision:	https://reviews.freebsd.org/D37077
2023-07-12 20:55:08 +02:00
Gleb Popov
505ecf2230 Uses/cabal.mk: Rename EXECUTABLES to CABAL_EXECUTABLES.
Approved by: tcberner

Differential Revision: https://reviews.freebsd.org/D36079
2022-08-09 12:16:31 +03:00
Tobias C. Berner
aa25396790 framework: cleanup conditional-indentations in Mk/
Run Tools/scripts/indent_make_if.pl on all of Mk.

These white space changes contribute greatly to the readability of those files.
As we have a version control system, finding out the reasons for the changes
prior to these white space changes is still easily possible

Differential Revision:	https://reviews.freebsd.org/D35024
Reviewed by:		portmgr (rene, bapt)
2022-04-24 12:00:20 +02:00
Tobias Kortkamp
bdc3d57d53
Mk/bsd.options.mk: Fix typos in comment 2021-04-21 12:57:22 +02:00
Mathieu Arnold
5d33e04596
framework: Remove $FreeBSD$
Where appropriate fiddle with a few other things.
2021-04-06 16:27:10 +02:00
Rene Ladan
ee06ec39ce Clean up support for FreeBSD 11.2.
While here, modernize some comments in Mk/bsd.*.mk.

Note that graphics/drm-fbsd11.2-kmod is not renamed yet, this was somewhat
under discussion.

Submitted by:	rene
Reviewed by:	antoine, jbeich, mat, zeising
Differential Revision:	https://reviews.freebsd.org/D21974
2019-11-07 16:30:12 +00:00
Gleb Popov
6dc2e22e2d Introduce USES=cabal and use it to build Haskell applications.
PR:		230186
Reviewed by:	mat, tcberner
Approved by:	tcberner (mentor)
Differential Revision:	https://reviews.freebsd.org/D19730
2019-05-09 14:39:30 +00:00
Tobias Kortkamp
f4bb5c8fec Flag nop options helpers that appear after bsd.port.options.mk as DEV_ERRORs
Approved by:	portmgr (mat)
Differential Revision:	https://reviews.freebsd.org/D19553
2019-04-18 14:28:07 +00:00
Jan Beich
0335c38a4b Add option helper for MESON_ARGS = -Dfoo=enabled
feature options define combo like auto/yes/no in a standand way.
In other words, upstream projects of ports that use _MESON_YES are
supposed to migrate to _MESON_ENABLED.

https://mesonbuild.com/Build-options.html#features

Reviewed by:	tobik (implicit)
Approved by:	portmgr (mat)
Differential Revision:	https://reviews.freebsd.org/D19127
2019-02-25 22:07:54 +00:00
Sunpoet Po-Chuan Hsieh
8f7b1cd905 Add TEST_DEPENDS support
Differential Revision:	https://reviews.freebsd.org/D18398
Approved by:	portmgr (mat)
2018-12-06 20:33:20 +00:00
Mathieu Arnold
f4c9be1393 Do not enable options that do not exist.
Differential Revision:	https://reviews.freebsd.org/D13953
2018-09-10 14:40:57 +00:00
Mathieu Arnold
2f70fd9e54 Only set %%PORTDOCS%%/%%PORTEXAMPLES%% if a DOCS/EXAMPLES option is defined.
PR:		230864
Submitted by:	mat
exp-runs by:	antoine
Differential Revision:	https://reviews.freebsd.org/D13651
2018-09-10 13:16:27 +00:00
Mathieu Arnold
935f31b1b4 Remove automagic WITH_DEBUG activation with the DEBUG option.
- People keep adding options named DEBUG to enable verbose things in
  their ports and have no idea it also enables WITH_DEBUG.
- We already have WITH_DEBUG_PORTS that can enable WITH_DEBUG on a per
  port basis.

Differential Revision:	https://reviews.freebsd.org/D16829
2018-08-28 12:22:53 +00:00
Richard Gallamore
8035da77dd * Add USE_GITLAB for fetching from www.gitlab.com and GitLab deployed sites.
Reviewed by:	mat
Approved by:	portmgr (mat)
Relnotes:	yes
Differential Revision:	https://reviews.freebsd.org/D12162
2018-03-03 06:50:15 +00:00
Mathieu Arnold
bb5196a149 Remove support for variables that have been deprecated for a while.
variables                  deprecation       revision
WITHOUT_NLS                2013-12-13        r336337
WITH_/WITHOUT_             2014-02-24        r345870
NOPORT(DOC|EXAMPLE)S       2014-04-19        r351587
WITH_BDB_VER               2016-05-02        r414444
OVERRIDE_LINUX_BASE_PORT   2016-09-05        r421387
WITH_OPENSSL_(BASE|PORT)   2016-06-16        r416965

While there, add an ERROR variable that works like DEV_ERROR, but for
user facing errors, and move NOPORTDOCS,
NOPORTEXAMPLES and WITHOUT_NLS to it.

Cleanup bsd.sanity.mk a bit.

Fix fallout.

PR:		224613
Submitted by:	mat
Exp-run by:	antoine
Sponsored by:	Absolight
Differential Revision:	https://reviews.freebsd.org/D13490
2018-01-09 07:40:55 +00:00
Baptiste Daroussin
dee0383e5f Add an option helper for BINARY_ALIAS 2017-12-20 14:19:04 +00:00
Bryan Drewery
dc656b07fc Follow-up r454266: Sort and remove duplicates for [DE]SELECTED_OPTIONS.
Some ports like graphics/povray-meta do funky things like add the same
option into PORT_OPTIONS twice.  This also avoids a new leading blank
space in some cases.

With hat:	portmgr
2017-11-16 19:41:20 +00:00
Bryan Drewery
44ae07a5c0 Fix [DE]SELECTED_OPTIONS to lazily evaluate as late as possible.
If a port modifies OPTIONS_UNSET after including bsd.port.options.mk
then these values were wrong even though all of 'showconfig',
'pretty-print-config', and the package generated all had the expected
options.

Only Poudriere and synth use these variables for incremental build checks.

Reviewed by:	sjg, bapt
Approved by:	portmgr (bapt)
Differential Revision:	https://reviews.freebsd.org/D13092
2017-11-15 19:13:50 +00:00
Koop Mast
5ae433edd6 Meson is picky about the arguments of build options.
For example a option of the "boolean" type only accepts true/false this
 option is covered by ${opt}_MESON_TRUE/_FALSE.

Add option helpers ${opt}_MESON_YES/_NO for the "combo" type which
 accepts yes and no.

Approved by:		portmgr@ (mat@)
Differential Revision:	https://reviews.freebsd.org/D11078
2017-06-09 18:12:54 +00:00
Koop Mast
1f9f21c80b * Fix MESON_TRUE/MESON_FALSE comment, to mention the actualy meson argument.
* Rework option hanlding to be more clear and to avoid double negative.

Submitted by:	antoine@
Approved by:	antoine@
2017-04-17 20:24:46 +00:00
Koop Mast
e8ad1e183f Introduce new "meson" USES.
This uses will handling building software that uses the meson
build system. Expand the option framework to handle MESON options.

Approved by:	portmgr (swills@)

Differential Revision:	https://reviews.freebsd.org/D104091
2017-04-17 18:55:56 +00:00
Antoine Brodin
6f9a97676e Revert r398829: do not change OPTIONS when DEVELOPER=yes
Having a TEST option is usually a bad idea

With hat:	portmgr
2017-01-07 09:01:02 +00:00
Baptiste Daroussin
dd2c2cb23e Revert r429298 it has some unexpected side effects which I do not have time to
fix yet

Approved by:	portmgr (implicit)
2016-12-25 12:46:14 +00:00
Baptiste Daroussin
709b05ed2d Make the ports infrastructure accept at least 3 level ports
Approved by:	portmgr (rene
Differential Revision:	https://reviews.freebsd.org/D8889
2016-12-24 00:30:21 +00:00
Mathieu Arnold
91476b9329 Add an OPTIONS_EXCLUDE_opsys_osrel.
Sponsored by:	Absolight
2016-11-24 14:45:58 +00:00
Mathieu Arnold
07231789ec Change the way opt_USE is parsed.
This makes it possible to have:
opt_USE=  ldconfig=${PREFIX}/lib/foo/bar

Before this, it would have ended up doing USE_LDCONFIG=/lib/foo/bar,
without ${PREFIX}.

Sponsored by:	Absolight
Differential Revision:	https://reviews.freebsd.org/D8169
2016-10-12 12:19:55 +00:00
Mathieu Arnold
679f715601 Don't duplicate the list of options helpers.
People who come here can read the code, they will be able to understand
the variable definition.

Sponsored by:	Absolight
2016-08-31 13:28:05 +00:00
Mathieu Arnold
d14923d361 Add GH_SUBDIR to option helpers.
Submitted by:	lightside gmx com
Sponsored by:	Absolight
2016-08-31 12:50:36 +00:00
Mathieu Arnold
2f53697702 Move USE_BDB and PLIST_DIRSTRY to the unsupported section, all the ports
have been converted.

Sponsored by:	Absolight
2016-08-17 12:16:24 +00:00
Mathieu Arnold
6c2e13095d Add opt_CMAKE_BOOL_OFF, oposite of opt_CMAKE_BOOL.
PR:		210576
Sponsored by:	Absolight
2016-06-26 16:23:37 +00:00
Adam Weinberger
5c332ae6cb Add an opt_CMAKE_BOOL options helper.
SOMEOPT_CMAKE_BOOL=	WITH_FOO BAR

expands to:

  -DWITH_FOO:BOOL=true -DBAR:BOOL=true
or
  -DWITH_FOO:BOOL=false -DBAR:BOOL=false

PR:		210576
Approved by:	portmgr (mat)
2016-06-25 22:23:37 +00:00
Bryan Drewery
0e0764a175 Fix excluding implied options.
This fixes the devel/git-lite port to not get PERL despite being excluded.

PR:		207460
PR:		202701
With hat:	portmgr
Differential Revision:	https://reviews.freebsd.org/D5538
2016-05-03 18:36:29 +00:00
Mathieu Arnold
bd732c1ae8 Add MASTER_SITES to options helpers.
Sponsored by:	Absolight
2016-03-15 15:28:50 +00:00
Mathieu Arnold
56245d460d Add GH_TUPLE to the options flags too.
Sponsored by:	Absolight
2016-03-02 11:08:41 +00:00
Mathieu Arnold
64e435f631 Be consistent.
Noticed by:	amdmi3
Sponsored by:	Absolight
2015-12-29 17:01:42 +00:00
Mathieu Arnold
e109535adf Remove unneeded .for loops.
Sponsored by:	Absolight
Differential Revision:	https://reviews.freebsd.org/D4484
2015-12-29 16:19:55 +00:00
John Marino
cb97dd0575 Mk/bsd.options.mk: Introduce SELECTED_OPTIONS, DESELECTED_OPTIONS
Until now, the only way to obtain information on the valid port options
and the current selection states is by using the pretty-print-config
target.  It would look something like this:

  > make -C /usr/ports/lang/gcc5-aux print-print-config
  Standard[ +FORT +OBJC +NLS -TESTSUITE -ALLSTAGES -STATIC ] \
  Bootstrap[ -BOOTSTRAP ]

To process the total options and the selection state of each option
requires additional processing, e.g. with awk and/or sed.  Moreover, if
other information is needed about the port it question, it would require
a second execution of "make" to reveal variable values. There simply is
no other way to obtain the option selection information in a single pass
(this limitation came when options framework was brought in).

This enhancement allows the option selection information to revealed with
make -V so that all port information can be acquired in a single pass.
Moreover, they won't require piping through sed or awk.  Two read-only
variables are introduced:

  SELECTED_OPTIONS   (list of all "on" options)
  DESELECTED_OPTIONS (liss of all "off" options)

Here's an example of a single pass acquisition:

  > make -C /usr/dports/lang/gcc5-aux -V PKGNAME -V SELECTED_OPTIONS \
    -V DESELECTED_OPTIONS
  gcc5-aux-20150716
  NLS OBJC FORT
  BOOTSTRAP STATIC ALLSTAGES TESTSUITE

Obviously the grouping information seen in pretty-print-config is lost,
so these new variables will not help if option group information is
required.

Approved by:	portmgr (bapt)
2015-12-14 22:44:39 +00:00
Mathieu Arnold
6684338e91 Refactor the list of all excluded options so that the second place it is
needed is not forgotten any more.

PR:		204510
With hat:	portmgr
Sponsored by:	Absolight
2015-11-13 13:50:35 +00:00
Dmitry Marakasov
be25d1eef5 Enable TEST option if DEVELOPER is set
TEST option is used when a port needs extra depends or flags for
build phase to enable tests (so TEST_DEPENDS don't work). Enable
it by default for DEVELOPER builds, so interested parties and Q/A
can have all tests available.

Approved by:	portmgr (bapt)
Differential Revision:	D3844
2015-10-08 14:21:10 +00:00
Dmitry Marakasov
bdca2b917a Add support for opt_TEST_TARGET consistent with opt_{ALL,INSTALL}_TARGET
Approved by:	portmgr (mat)
Differential Revision:	D3788
2015-10-05 12:45:29 +00:00
Mathieu Arnold
3818d01826 Fix opt_VARS premature expansion.
Due to the way .for loop work, opt_VARS was being expanded too early
evaluation, which made it impossible to use vars that are set/modifies
afterwards (such as PREFIX or PKGDIR)

Fix this by changing opt_VARS handling logic so that the right side is
not prematurely expanded:

- Loop not by words (each word here is single VAR=val / VAR+=val tuple)
  but by unique left sides of assignments (VAR, VAR+ here)
- Using the left side, extract all corresponding right sides and
  append/assign them to a variable

This changes the way this opt_VARS line work, which behavior is between
invalid and undefined:

opt_VARS= FOO=bar FOO=baz

Before it would end up with "FOO=baz", now it ends up with "FOO=bar baz"

Submitted by:	amdmi3
Reviewed by:	antoine, mat
Approved by:	my portmgr hat
Sponsored by:	Absolight
Differential Revision:	https://reviews.freebsd.org/D3729
2015-10-01 07:56:36 +00:00
Dmitry Marakasov
5c57225987 Implemented complete support for test target.
You can now `make test' on any port to run test sequence, no-op by default.
If a port defines TEST_TARGET, it'll run sub-make with specified target,
usually `check' or `test', useful if upstream supports that. The port may
instead define custom do-test target, as well as usual satellite targets:

  {pre,do,post}-test, {pre,do,post}-test-OPT, {pre,do,post}-test-OPT-off

`make test' builds and stages port first, so test may use both WRKDIR and
STAGEDIR, and both BUILD and RUN depends are available for test target.
Additionally, TEST_DEPENDS is now properly supported and may be used to
define additional depends specifically for testing.

Framework may define default tests for specific cases. For instance,
perl5.mk and cran.mk already provide default test target on their own.

This commit also converts my ports which have tests to this new framework.

Approved by:	portmgr (bapt)
Differential Revision:	D3680
2015-09-28 17:20:42 +00:00
Mathieu Arnold
9f8347ee1b Add PORTEXAMPLES to the options helpers.
Sponsored by:	Absolight
2015-09-08 14:04:30 +00:00
Mathieu Arnold
46c8a181c5 Add DESKTOP_ENTRIES to the options flags.
Sponsored by:	Absolight
2015-09-04 16:35:21 +00:00
Adam Weinberger
84b58a7493 Use more precise wording, i.e. "set" and "append" instead of "run."
Approved by:	portmgr (mat)
2015-08-28 16:18:32 +00:00
Mathieu Arnold
9c517d8878 Add generic opt_VARS/opt_VARS_OFF.
OPT1_VARS=  foo=bar baz+=bam

will set FOO to bar and append bam to BAZ if OPT1 is enabled.  <opt>_VARS_OFF
works the same way, if the option is disabled.

Reviewed by:	bapt
Sponsored by:	Absolight
Differential Revision:	https://reviews.freebsd.org/D3410
2015-08-28 12:28:13 +00:00
Mathieu Arnold
741e1ac058 Add an optional error message for opt_PREVENTS, opt_PREVENTS_MSG.
Reviewed by:	bapt
Sponsored by:	Absolight
Differential Revision:	https://reviews.freebsd.org/D3469
2015-08-24 13:07:31 +00:00
Mathieu Arnold
8d82504fad Fix with fmake.
Noticed by:	marck
Sponsored by:	Absolight
2015-08-21 13:05:20 +00:00
Mathieu Arnold
08da6a6763 Optimize opt_IMPLIES.
PR:		191144
Submitted by:	hrs
Sponsored by:	Absolight
2015-08-21 12:02:50 +00:00
Mathieu Arnold
26c137c376 Add EXTRACT_ONLY to the options flags.
Sponsored by:	Absolight
2015-08-19 09:28:06 +00:00