Bug 207230 - textproc/hs-pandoc: Make TEX an option to avoid installing TeX from ports when not necessary
Summary: textproc/hs-pandoc: Make TEX an option to avoid installing TeX from ports whe...
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Gabor Pali
Depends on:
Reported: 2016-02-15 21:56 UTC by janm
Modified: 2016-02-19 20:56 UTC (History)
1 user (show)

See Also:
pgj: maintainer-feedback+

Add "TEX" option to textproc/hs-pandoc port (503 bytes, text/plain)
2016-02-15 21:56 UTC, janm
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description janm 2016-02-15 21:56:12 UTC
Created attachment 167054 [details]
Add "TEX" option to textproc/hs-pandoc port

Many uses of textproc/hs-pandoc don't require PDF generation, or are on systems where TeX is managed separately to the ports system.

This patch adds a "TEX" option to the textproc/hs-pandoc port, defaulting to enabled. This keeps the current default behaviour and allows turning off the TeX dependency.
Comment 1 Gabor Pali freebsd_committer 2016-02-16 21:43:03 UTC
Comment on attachment 167054 [details]
Add "TEX" option to textproc/hs-pandoc port

As I can see in the proposed patch, it also replaces the USE_TEX line with TEX_USE.  I have not found this make(1) variable anywhere in the ports tree, could you please tell me where it came from?

Anyhow, bsd.tex.mk says that "Ports which depend on TeX should use USE_TEX".  Am I missing something here?
Comment 2 janm 2016-02-16 22:20:52 UTC
(In reply to Gabor Pali from comment #1)

It is from bsd.options.mk:

# ${opt}_USE=   FOO=bar         When option is enabled, it will  enable
#                               USE_FOO+= bar
#                               If you need more than one option, you can do
#                               FOO=bar,baz and you'll get USE_FOO=bar baz

See section of the porters handbook:


So a port with:

TEX_DESC=	Include TeX for PDF generation
TEX_USE=	TEX=texmf:run

when built with WITH=TEX (or where TEX is a default option as in this case) gives:


When the port is build with WITHOUT=TEX there is no USE_TEX variable set.

The point here is that the port only depends on TeX when the port is use to build PDFs and TeX has not been installed by non-port means. There are uses of the port where one or both of those are not true, and installing ports TeX gets in the way of the rest of the system.

There is probably a good argument for not calling option TEX but calling it PDFGEN or similar. I don't mind what the option is called; I just want to be able to turn it off.

For example:

PDFGEN_DESC=	Include TeX for PDF generation
PDFGEN_USE=	TEX=texmf:run
Comment 3 Gabor Pali freebsd_committer 2016-02-18 13:43:29 UTC
(In reply to janm from comment #2)

Aw, indeed.  Thanks for the detailed explanation, now it completely makes sense.  I already understood the reasoning behind and I also agree with the purpose.  I just did not see how this works, because apparently I misparsed the name of the variable.
Comment 4 commit-hook freebsd_committer 2016-02-19 20:45:16 UTC
A commit references this bug:

Author: pgj
Date: Fri Feb 19 20:44:46 UTC 2016
New revision: 409203
URL: https://svnweb.freebsd.org/changeset/ports/409203

  - Make dependency on TeX optional

  PR:		207230
  Submitted by:	janm@transactionware.com
  Obtained from:	FreeBSD Haskell

Comment 5 Gabor Pali freebsd_committer 2016-02-19 20:56:06 UTC
The version with the PDFGEN options has been added to the port.  Thank you for your submission!