Bug 203417 - math/py-matplotlib fails to build if optional components are disabled
Summary: math/py-matplotlib fails to build if optional components are disabled
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-ports-bugs (Nobody)
URL:
Keywords: needs-qa, patch
Depends on:
Blocks:
 
Reported: 2015-09-28 15:48 UTC by Tomi Kause
Modified: 2015-10-07 12:56 UTC (History)
4 users (show)

See Also:
koobs: maintainer-feedback+


Attachments
Tentative fix (1.32 KB, patch)
2015-09-29 08:27 UTC, Tomi Kause
no flags Details | Diff
Misc. fixes (2.74 KB, patch)
2015-10-07 11:45 UTC, Jimmy Olgeni
koobs: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tomi Kause 2015-09-28 15:48:10 UTC

    
Comment 1 Tomi Kause 2015-09-28 15:49:03 UTC
I tried to build the FreeBSD port math/py-matplotlib (svn r397069) with all the optional components turned off and observed a failure.

Currently the post-install rule in Makefile unconditionally tries to strip .so's which are generated by optional components, making them effectively rather non-optional. If I understood correctly.
Comment 2 Tomi Kause 2015-09-28 15:50:09 UTC
This hasty patch seems to fix the problem:
--- Makefile.sshbak     2015-09-28 15:54:16.906945572 +0300
+++ Makefile    2015-09-28 15:54:16.910010137 +0300
@@ -78,9 +78,6 @@
 post-install:
        ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/_image.so
        ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/backends/_backend_agg.so
-       ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/backends/_gtkagg.so
-       ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/backends/_tkagg.so
-       ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/backends/_backend_gdk.so
        ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/_qhull.so
        ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/ttconv.so
        ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/_delaunay.so
@@ -90,6 +87,15 @@
        ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/_cntr.so
        ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/ft2font.so
 
+post-install-GTKAGGBACKEND-on:
+       ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/backends/_gtkagg.so
+
+post-install-TKAGGBACKEND-on:
+       ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/backends/_tkagg.so
+
+post-install-GTKBACKEND-on:
+        ${STRIP_CMD} ${STAGEDIR}${PYTHON_SITELIBDIR}/matplotlib/backends/_backend_gdk.so
+
 post-install-EXAMPLES-on:
        @${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
        ${CP} -R ${WRKSRC}/examples/ ${STAGEDIR}${EXAMPLESDIR}
Comment 3 Geoffrey Mainland 2015-09-28 15:53:17 UTC
I approve the patch.
Comment 4 Kubilay Kocak freebsd_committer freebsd_triage 2015-09-29 03:46:59 UTC
Tomi, can you please include your patch as an attachment, and also attach QA results for:

 * portlint -AC
 * poudriere testport (or bulk -t) with OPTIONS disabled
Comment 5 Tomi Kause 2015-09-29 08:05:34 UTC
1004:my-dev-freebsd-10.2:/usr/ports/math/py-matplotlib> portlint -AC
WARN: Makefile: [61]: possible use of "${CHMOD}" found. Use @(owner,group,mode) syntax or @owner/@group operators in pkg-plist instead.
WARN: Makefile: for new port, make $FreeBSD$ tag in comment section empty, to make SVN happy.
WARN: Consider to set DEVELOPER=yes in /etc/make.conf
0 fatal errors and 3 warnings found.
1004:my-dev-freebsd-10.2:/usr/ports/math/py-matplotlib>
Comment 6 Tomi Kause 2015-09-29 08:27:42 UTC
Created attachment 161518 [details]
Tentative fix

N.B. the filenames in the patch are questionable. Apologies.
Comment 7 Tomi Kause 2015-09-29 08:28:32 UTC
Poudrie: I failed to set up the thing in 15 minutes and gave up. Sloppy me.
Comment 8 Jimmy Olgeni freebsd_committer freebsd_triage 2015-10-07 09:57:38 UTC
I got hit by this - let me check on my poudriere.
Comment 9 Jimmy Olgeni freebsd_committer freebsd_triage 2015-10-07 11:44:16 UTC
I made a few fixes.

- Helpers were ok from the patch
- WXAGGBACKEND_VARS was broken and the WX option caused a build failure
- Fixed some permissions in .py files
- Sorted entries in post-install
- Some whitespace :)

Attaching patch...
Comment 10 Jimmy Olgeni freebsd_committer freebsd_triage 2015-10-07 11:45:13 UTC
Created attachment 161796 [details]
Misc. fixes
Comment 11 Geoffrey Mainland 2015-10-07 12:06:09 UTC
Thanks!

I approve the patch.
Comment 12 Kubilay Kocak freebsd_committer freebsd_triage 2015-10-07 12:28:21 UTC
Comment on attachment 161796 [details]
Misc. fixes

Over to you after for commit after QA Jimmy
Comment 13 Jimmy Olgeni freebsd_committer freebsd_triage 2015-10-07 12:42:15 UTC
Poudriere good for all options - commit on the way...
Comment 14 commit-hook freebsd_committer freebsd_triage 2015-10-07 12:51:41 UTC
A commit references this bug:

Author: olgeni
Date: Wed Oct  7 12:50:43 UTC 2015
New revision: 398761
URL: https://svnweb.freebsd.org/changeset/ports/398761

Log:
  Unbreak math/py-matplotlib when some options are disabled (original PR).

  The previous version tried to ${STRIP} non-existing files.

  Some additional fixes:

  - Fix WXAGGBACKEND_VARS, which was overwritten and broke the WX build
  - Fix permissions in .py files
  - Sort entries in post-install
  - Whitespace fixes

  PR:		203417
  Submitted by:	Tomi Kause
  Reviewed by:	olgeni
  Approved by:	maintainer

Changes:
  head/math/py-matplotlib/Makefile
Comment 15 Jimmy Olgeni freebsd_committer freebsd_triage 2015-10-07 12:56:00 UTC
Looks fixed :)