Bug 166855

Summary: [patch] Automatic Detection of Dependencies Addendum for Porter's Handbook
Product: Documentation Reporter: A.J. Kehoe IV <zxMbzY3e>
Component: Books & ArticlesAssignee: Warren Block <wblock>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description A.J. Kehoe IV 2012-04-11 19:40:11 UTC
The automatic detection of dependencies causes inconsistent indexing, and therefore makes it very difficult to automate port and package management.  A rule forbidding this method should be included in the Porter's Handbook.

Fix: I've attached an update for doc/en_US.ISO8859-1/books/porters-handbook/book.sgml.

Patch attached with submission follows:
Comment 1 Warren Block freebsd_committer freebsd_triage 2012-04-12 20:41:36 UTC
Responsible Changed
From-To: freebsd-doc->wblock

Take.
Comment 2 Max Brazhnikov freebsd_committer freebsd_triage 2012-04-12 23:26:35 UTC
On Wed, 11 Apr 2012 18:33:18 GMT, A.J. Kehoe IV (Nanoman) wrote:
> +       <example>
> +         <title>Correct Declaration of an Optional Dependency</title>
> +
> +         <programlisting>OPTIONS=              BAR     "Enable bar support" on
> +
> +.include &lt;bsd.port.pre.mk&gt;
> +
> +.if defined(WITH_BAR) && !defined(WITHOUT_BAR)
> +LIB_DEPENDS=   bar:${PORTSDIR}/foo/bar
> +.endif</programlisting>
> +       </example>

It's not enough. You also need to add something like --disable-bar to configure arguments and of course configure script should respect the switch.
Comment 3 A.J. Kehoe IV 2012-04-13 00:19:24 UTC
> On Wed, 11 Apr 2012 18:33:18 GMT, A.J. Kehoe IV (Nanoman) wrote:
>> +       <example>
>> +         <title>Correct Declaration of an Optional Dependency</title>
>> +
>> +         <programlisting>OPTIONS=              BAR     "Enable bar
>> support" on
>> +
>> +.include &lt;bsd.port.pre.mk&gt;
>> +
>> +.if defined(WITH_BAR) && !defined(WITHOUT_BAR)
>> +LIB_DEPENDS=   bar:${PORTSDIR}/foo/bar
>> +.endif</programlisting>
>> +       </example>
>
> It's not enough. You also need to add something like --disable-bar to
> configure arguments and of course configure script should respect the
> switch.

This is needed only if it's required by the configure script.  If support
for a dependency doesn't need to be compiled in, then simply including it
in the dependency list would suffice.

My examples included only the elements that were needed to illustrate my
point.  Anyone wanting to use optional dependencies should read the
"makefile-options" section that I linked to, along with any other sections
that are relevant to their port.
Comment 4 dfilter service freebsd_committer freebsd_triage 2012-04-16 03:31:47 UTC
wblock      2012-04-16 02:31:31 UTC

  FreeBSD doc repository

  Modified files:
    en_US.ISO8859-1/books/porters-handbook book.sgml 
  Log:
  Add a section describing automatic dependencies, the problems they
  cause, and the correct approach.  Patch is a modified version of the
  original in the PR.
  
  PR:             docs/166855
  Submitted by:   A.J. Kehoe IV
  
  Revision  Changes    Path
  1.1178    +50 -0     doc/en_US.ISO8859-1/books/porters-handbook/book.sgml
_______________________________________________
cvs-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/cvs-all
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Warren Block freebsd_committer freebsd_triage 2012-04-16 03:33:03 UTC
State Changed
From-To: open->closed

Revised version of original patch committed.  Thanks!