Bug 218058

Summary: archivers/lzo2: packaging failed
Product: Ports & Packages Reporter: Konstantin Belousov <kib>
Component: Individual Port(s)Assignee: Matthias Andree <mandree>
Status: Closed FIXED    
Severity: Affects Only Me CC: chris, mandree, martin.dieringer, rozhuk.im, tremere
Priority: --- Flags: mandree: maintainer-feedback+
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
log of failed build
none
Patch
mandree: maintainer-approval-
Simplify previous fix for lzo2.pc mandree: maintainer-approval+

Description Konstantin Belousov freebsd_committer freebsd_triage 2017-03-24 09:16:07 UTC
Created attachment 181125 [details]
log of failed build

archivers/lzo2 r436784 fails to package with docs/examples turned off.  Attached is the poudriere log.

===>  Building package for lzo2-2.10
pkg-static: Unable to access file /wrkdirs/usr/ports/archivers/lzo2/work/stage/u
sr/local/lib/pkgconfig/lzo2.pc:No such file or directory
*** Error code 1
Comment 1 Christian Ullrich 2017-03-24 11:11:52 UTC
Created attachment 181133 [details]
Patch

lzo2.pc is only installed if the target directory exists. An explicit dependency on pkgconf is required to ensure it does, at least in poudriere.
Comment 2 Konstantin Belousov freebsd_committer freebsd_triage 2017-03-24 11:31:29 UTC
(In reply to Christian Ullrich from comment #1)
This did not worked for me, the packaging error is the same.
Comment 3 Christian Ullrich 2017-03-24 11:36:56 UTC
Uh ... oops? Sorry, I must literally have dreamed having tested that change. Same result here.
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-03-24 11:56:23 UTC
A commit references this bug:

Author: mandree
Date: Fri Mar 24 11:55:49 UTC 2017
New revision: 436809
URL: https://svnweb.freebsd.org/changeset/ports/436809

Log:
  Install .pc into libdata, fix build without docs.

  PR:		218058
  Reported by:	sunpoet@, danfe@, gaspar, kib@

Changes:
  head/archivers/lzo2/Makefile
  head/archivers/lzo2/pkg-plist
Comment 5 Matthias Andree freebsd_committer freebsd_triage 2017-03-24 11:57:04 UTC
I think the patch is bogus. The reason it was failing is that the NODOCS is changing INSTALL_TARGET. Since the .pc file was put into the wrong directory anyhow, I'm installing it manually into the right place. Now tested with all four combinations of examples on/off portdocs on/off.
Comment 6 Ralf van der Enden 2017-03-24 12:31:41 UTC
Created attachment 181134 [details]
Simplify previous fix for lzo2.pc

The previous patch seems a little complex to me when it can be fixed much easier by adding an extra configure switch and install target.

Didn't bump the PORTREVISION since it doesn't change anything in the package, but simplifies the Makefile.
Comment 7 Matthias Andree freebsd_committer freebsd_triage 2017-03-24 12:36:17 UTC
will review and possibly clean up with Ralf's patch later
Comment 8 martin.dieringer 2017-03-24 13:11:32 UTC
None of these patches works ;(
Comment 9 martin.dieringer 2017-03-24 13:21:59 UTC
(In reply to martin.dieringer from comment #8)
... sorry my ports were too old (1 hour?) :(
Comment 10 Matthias Andree freebsd_committer freebsd_triage 2017-03-24 13:26:31 UTC
For the record, 2.10_1 fixes this. Update your ports tree before retrying.
Comment 11 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-03-24 17:38:16 UTC
(In reply to commit-hook from comment #4)

lzo2.pc was installed via "make install-pkgconfigDATA".
I think the better fix would be as follows:

Index: Makefile
===================================================================
--- Makefile    (revision 436821)
+++ Makefile    (working copy)
@@ -16,12 +16,12 @@

 USES=          libtool
 GNU_CONFIGURE= yes
-CONFIGURE_ARGS=        --enable-shared --docdir=${DOCSDIR}
+CONFIGURE_ARGS=        --enable-shared --docdir=${DOCSDIR} --with-pkgconfigdir=${PREFIX}/libdata/pkgconfig
 USE_LDCONFIG=  yes

 OPTIONS_DEFINE=        DOCS EXAMPLES

-DOCS_INSTALL_TARGET_OFF=       install-exec install-pkgincludeHEADERS
+DOCS_INSTALL_TARGET_OFF=       install-exec install-pkgincludeHEADERS install-pkgconfigDATA

 post-build:
 .if !defined(WITHOUT_CHECKS)
@@ -40,9 +40,5 @@
        ${INSTALL_DATA} ${WRKSRC}/doc/* ${STAGEDIR}${DOCSDIR}/
        ${MKDIR} ${STAGEDIR}${EXAMPLESDIR}
        ${INSTALL_DATA} ${WRKSRC}/examples/[a-z]*.[ch] ${STAGEDIR}${EXAMPLESDIR}/
-       ${MKDIR} ${STAGEDIR}${PREFIX}/libdata/pkgconfig
-       ${INSTALL_DATA} ${WRKSRC}/lzo2.pc ${STAGEDIR}${PREFIX}/libdata/pkgconfig
-       ${RM} ${STAGEDIR}${PREFIX}/lib/pkgconfig/lzo2.pc
-       d="${STAGEDIR}${PREFIX}/lib/pkgconfig" ; if test -d "$$d" ; then ${RMDIR} "$$d" ; fi

 .include <bsd.port.mk>
Comment 12 Ralf van der Enden 2017-03-24 18:08:24 UTC
(In reply to Po-Chuan Hsieh from comment #11)

Heh... that's an exact copy of the patch I uploaded earlier today to simplify the Makefile :)
Comment 13 commit-hook freebsd_committer freebsd_triage 2017-03-24 23:58:45 UTC
A commit references this bug:

Author: mandree
Date: Fri Mar 24 23:58:19 UTC 2017
New revision: 436863
URL: https://svnweb.freebsd.org/changeset/ports/436863

Log:
  Simplify lzo2.pc packaging fix.

  PR:		218058
  Submitted by:	Ralf van der Enden

Changes:
  head/archivers/lzo2/Makefile
Comment 14 Matthias Andree freebsd_committer freebsd_triage 2017-03-25 00:00:04 UTC
Ralf and Po-Chuan, thanks to both of your for your proposals to simplify the fix, which has been applied.