Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 10 Apr 2012 14:04:05 -0400
From:      "A.J. Kehoe IV (Nanoman)" <nanoman@nanoman.ca>
To:        Stephen Montgomery-Smith <stephen@missouri.edu>
Cc:        freebsd-ports@freebsd.org
Subject:   Re: autodetecting dependencies
Message-ID:  <20120410180405.GD19377@nanocomputer.nanoman.ca>
In-Reply-To: <4F839499.8050103@missouri.edu>
References:  <4F839499.8050103@missouri.edu>

next in thread | previous in thread | raw e-mail | index | archive | help

--Hf61M2y+wYpnELGG
Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Stephen Montgomery-Smith wrote:
>So suppose we are building port A.  It turns out that the configure in
>port A autodetects whether package B is present or not.  It will build
>either way.  But if built with package B, it will not operate without it.
>
>So suppose I build port A on machine X which has package B installed.
>Then I create a package from A, and copy the package to machine Y.
>Machine Y does not have package B installed, and so when package A is
>installed, it doesn't work on machine Y.
>
>What are the accepted ways of handling this?
>
>1.  Don't worry about it.  tinderbox builds will never build port A in
>the presence of package B.
>
>2.  Have the Makefile of port A detect whether package B is installed,
>and if it is then add B as a dependency of A.
>
>3.  Cripple the configure in port A so that it doesn't autodetect for
>package B.  (Sometimes this can be done using a suitable CONFIGURE_ARGS,
>but not in my particular situation.)
>
>I prefer the answer (1).  But I am interested in other people's
>opinions.  One problem with (2) or (3) is that the creator of the port
>might never find out which packages could be autodetected by port A's
>configure without performing an exhaustive search of the source code of A.
>
>Thanks, Stephen

In my opinion, it's best to use the OPTIONS framework and to avoid automati=
c detection entirely.  Consider this problem:

http://docs.freebsd.org/cgi/mid.cgi?20120304190922.GA58789

For your example, I would add this line to port A's Makefile:

OPTIONS=3D	PORT_B		"Enable Port B" off

I would then replace the automatic detection part of port A's Makefile with=
 something like this:

=2Eif defined(WITH_PORT_B) && !defined(WITHOUT_PORT_B)
RUN_DEPENDS+=3D	portb-1.0:${PORTSDIR}/category/portb
=2Eendif

So, if you don't want port A built with package B as a dependency, you'd us=
e the default on port A's OPTIONS "dialog" screen, otherwise, you'd put a c=
heck beside "PORT_B".

--=20
A.J. Kehoe IV (Nanoman)     |  /"\  ASCII Ribbon Campaign
Nanoman's Company           |  \ /   - No HTML/RTF in E-mail
E-mail: nanoman@nanoman.ca  |   X    - No proprietary attachments
WWW: http://www.nanoman.ca/ |  / \   - Respect for open standards

--Hf61M2y+wYpnELGG
Content-Type: application/x-pkcs7-signature
Content-Disposition: attachment; filename="smime.p7s"
Content-Transfer-Encoding: base64

MIIPCwYJKoZIhvcNAQcCoIIO/DCCDvgCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3DQEHAaCC
DHcwggUyMIIDGqADAgECAgMLj20wDQYJKoZIhvcNAQEFBQAweTEQMA4GA1UEChMHUm9vdCBD
QTEeMBwGA1UECxMVaHR0cDovL3d3dy5jYWNlcnQub3JnMSIwIAYDVQQDExlDQSBDZXJ0IFNp
Z25pbmcgQXV0aG9yaXR5MSEwHwYJKoZIhvcNAQkBFhJzdXBwb3J0QGNhY2VydC5vcmcwHhcN
MTIwNDAzMTkwNjMwWhcNMTIwOTMwMTkwNjMwWjA9MRgwFgYDVQQDEw9DQWNlcnQgV29UIFVz
ZXIxITAfBgkqhkiG9w0BCQEWEm5hbm9tYW5AbmFub21hbi5jYTCCASIwDQYJKoZIhvcNAQEB
BQADggEPADCCAQoCggEBAK9WRGqRDUDjWwNIfZTBp4FL5bI0kY3ZqvM6tEO+Sqp5YxATre8F
a+BYbeNp/8MKfuPrRgE2jRzlePAx7kpvZUhRTGAZpncmHC7Z3FDl8Ugid4193ReCfPypb9Gs
3ZgPfzJyNuDeCM3amz/cDXC/makJLpmLzu95D91hD+V30iActE5j1tNewMq9qJRoEdr5Tqus
bUjjDm8kiK5sz9JzQjFoufuaWIR57w2Sm1gDVZ0MH46fxZ/SwLDDzt4VC2u+1oS4KSmVUm6X
Wv1/Fmdf2sOOu9Ro2xVjJHW+j16lsFPPj+lkDv5tb0G7I2vBoKE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H8rbOOOZuW
Vdrp/UfC8GwUwPZgMZMKeJDgrrQas0MkBdE59H1UDJIhT8MlDW8KwBxQAazVBLrndQbHGWz/
J3zJuJvDfLhpv0sgsohMUl6pWywFRwE+ABUuFjfyR8PWUaRHRQ5DafVGaCf7XKqNYpPgrmdh
RKoQdBSV065UpYDomzwo580ylshL

--Hf61M2y+wYpnELGG--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120410180405.GD19377>