Bug 208874 - devel/tclxml not PREFIX-safe
Summary: devel/tclxml not PREFIX-safe
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: freebsd-tcltk (Nobody)
URL:
Keywords: easy, patch-ready
Depends on:
Blocks:
 
Reported: 2016-04-17 21:05 UTC by Mikhail Teterin
Modified: 2016-04-18 14:52 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (tcltk)
mi: maintainer-feedback?


Attachments
Replace /usr/local with ${PREFIX} and only build documentation, if needed (851 bytes, patch)
2016-04-17 21:05 UTC, Mikhail Teterin
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Teterin freebsd_committer freebsd_triage 2016-04-17 21:05:18 UTC
Created attachment 169411 [details]
Replace /usr/local with ${PREFIX} and only build documentation, if needed

The problem is obvious and the patch is trivial, but without it the newly-built code fails to find itself under ${STAGEDIR} and can not generate its own documentation:

-MAKE_ENV+=     TCLLIBPATH=${STAGEDIR}/usr/local/lib
+MAKE_ENV+=     TCLLIBPATH=${STAGEDIR}/${PREFIX}/lib

The second hunk in the patch stops generating the (useless) PORTDOCS, when docs are disabled.

The port fails numerous self-tests after building -- this patch does not address that problem.
Comment 1 commit-hook freebsd_committer freebsd_triage 2016-04-18 07:45:51 UTC
A commit references this bug:

Author: gahr
Date: Mon Apr 18 07:45:03 UTC 2016
New revision: 413558
URL: https://svnweb.freebsd.org/changeset/ports/413558

Log:
  devel/tclxml: respect PREFIX and DOCS [1], use TEST_TARGET

  PR:		208874 [1]
  Submitted by:	mi [1]

Changes:
  head/devel/tclxml/Makefile
Comment 2 Mikhail Teterin freebsd_committer freebsd_triage 2016-04-18 12:22:24 UTC
The committed patch overdoes it. The --prefix part is added to CONFIGURE_ARGS automatically, no need for the port to do it. Now it is listed twice:

% make -V CONFIGURE_ARGS
--prefix=/opt  --exec-prefix=/opt  --with-tcl=/opt/lib/tcl8.6  XML_CONFIG="/opt/bin/xml2-config" --prefix=/opt ${_LATE_CONFIGURE_ARGS}

And the --exec-prefix is, probably, simply not needed in this case. I would suggest removing the newly-introduced settings:

 USE_LDCONFIG?= ${PREFIX}/lib/Tclxml${PORTVERSION}
-CONFIGURE_ARGS=        --prefix=${PREFIX} \
-               --exec-prefix=${PREFIX} \
-               --with-tcl=${TCL_LIBDIR} \
+CONFIGURE_ARGS= --with-tcl=${TCL_LIBDIR} \
                XML_CONFIG="${XML_CONFIG}"

Thanks!
Comment 3 Pietro Cerutti freebsd_committer freebsd_triage 2016-04-18 12:30:36 UTC
You're right about --prefix Mikhail. --exec-prefix is needed, though. Try to run "port test" and you'll see.
Comment 4 commit-hook freebsd_committer freebsd_triage 2016-04-18 12:31:18 UTC
A commit references this bug:

Author: gahr
Date: Mon Apr 18 12:30:43 UTC 2016
New revision: 413571
URL: https://svnweb.freebsd.org/changeset/ports/413571

Log:
  devel/tclxml: no need to add --prefix to CONFIGURE_ARGS

  PR:		208874
  Submitted by:	mi

Changes:
  head/devel/tclxml/Makefile
Comment 5 Mikhail Teterin freebsd_committer freebsd_triage 2016-04-18 13:07:30 UTC
(In reply to Pietro Cerutti from comment #3)
> Try to run "port test" and you'll see.

I have the exact same (and numerous) test-failures with and without --exec-prefix. And none of the files generated during build contain the string "/usr/local" even if I do not specify it...
Comment 6 Pietro Cerutti freebsd_committer freebsd_triage 2016-04-18 14:03:23 UTC
(In reply to Mikhail Teterin from comment #5)

I said "port test", not "make test".
Comment 7 Mikhail Teterin freebsd_committer freebsd_triage 2016-04-18 14:05:47 UTC
(In reply to Pietro Cerutti from comment #6)
> I said "port test", not "make test".

Sorry, I don't know, what "port test" means...
Comment 8 Pietro Cerutti freebsd_committer freebsd_triage 2016-04-18 14:18:43 UTC
(In reply to Mikhail Teterin from comment #7)

https://github.com/xmj/porttools/(In reply to Mikhail Teterin from comment #7)

https://github.com/xmj/porttools/

Anyway, exec_prefix is needed as it is in other TEA based ports.

without:

$ make PREFIX=/tmp/tclxml configure && make -C `make -V WRKSRC` -V exec_prefix
/usr/local

And you can see how it's used:

$ grep exec_prefix `make -V WRKSRC`/Makefile
exec_prefix     = /usr/local
bindir          = ${exec_prefix}/bin
libdir          = ${exec_prefix}/lib
Comment 9 Mikhail Teterin freebsd_committer freebsd_triage 2016-04-18 14:23:54 UTC
> And you can see how it's used:
>  $ grep exec_prefix `make -V WRKSRC`/Makefile
>  exec_prefix     = /usr/local

No, that's my point. I do NOT see this even if I remove --exec-prefix from CONFIGURE_ARGS locally. Here:

% make -V CONFIGURE_ARGS
--with-tcl=/opt/lib/tcl8.6  XML_CONFIG="/opt/bin/xml2-config" --prefix=/opt ${_LATE_CONFIGURE_ARGS}
% rm -rf `make -V WRKDIR`
% make configure > /dev/null
% grep -c /usr/local `make -V WRKSRC`/Makefile
0
Comment 10 Pietro Cerutti freebsd_committer freebsd_triage 2016-04-18 14:49:32 UTC
(In reply to Mikhail Teterin from comment #9)

Of course the problem exists only if PREFIX != LOCALBASE. The latter is used to set TCL_LIBDIR, used in the --with-cl configure arg. In your case, both are /opt.
Comment 11 Mikhail Teterin freebsd_committer freebsd_triage 2016-04-18 14:52:17 UTC
(In reply to Pietro Cerutti from comment #10)
> Of course the problem exists only if PREFIX != LOCALBASE.

Got it. Thank you for the clarification.