Bug 222912 - security/py-m2crypto 0.27.0 fails to build with LibreSSL
Summary: security/py-m2crypto 0.27.0 fails to build with LibreSSL
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-10-10 20:01 UTC by Peter Putzer
Modified: 2017-10-15 00:41 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (sunpoet)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Putzer 2017-10-10 20:01:43 UTC
The update to py-m2crypot 0.27.0 fails to build with the following error message. The only reason I can think of is that SSL is set to LibreSSL from ports.

[...]
building 'M2Crypto._m2crypto' extension
swigging SWIG/_m2crypto.i to SWIG/_m2crypto_wrap.c
/usr/local/bin/swig3.0 -python -I/usr/local/include/python2.7 -includeall -modern -builtin -outdir /usr/ports/security/py-m2crypto/work/M2Crypto-0.27.0/M2Crypto -o SWIG/_m2crypto_wrap.c SWIG/_m2crypto.i
creating build/temp.freebsd-11.1-RELEASE-p1-amd64-2.7
creating build/temp.freebsd-11.1-RELEASE-p1-amd64-2.7/SWIG
/usr/local/libexec/ccache/world/cc -DNDEBUG -O3 -pipe -funroll-loops -march=native -fstack-protector -fno-strict-aliasing -fPIC -I/usr/local/include/python2.7 -I/usr/ports/security/py-m2crypto/work/M2Crypto-0.27.0/SWIG -c SWIG/_m2crypto_wrap.c -o build/temp.freebsd-11.1-RELEASE-p1-amd64-2.7/SWIG/_m2crypto_wrap.o -DTHREADING
SWIG/_m2crypto_wrap.c:11545:3: warning: implicit declaration of function 'pyfd_init' is invalid in C99 [-Wimplicit-function-declaration]
  pyfd_init();
  ^
SWIG/_m2crypto_wrap.c:11545:3: warning: this function declaration is not a prototype [-Wstrict-prototypes]
SWIG/_m2crypto_wrap.c:12350:19: error: incomplete definition of type 'struct pyfd_struct'
  if (arg1) (arg1)->fd = arg2;
            ~~~~~~^
[...]
Comment 1 Peter Putzer 2017-10-13 06:07:29 UTC
Using this patch made the port build for me:

--- Makefile.old	2017-10-09 21:02:18.545682000 +0200
+++ Makefile	2017-10-13 08:06:34.217182000 +0200
@@ -17,7 +17,7 @@
 BUILD_DEPENDS=	swig3.0:devel/swig30
 
 MAKE_ENV=	SWIG_FEATURES=-I${OPENSSLINC}
-PYDISTUTILS_BUILDARGS=	build_ext --openssl=${OPENSSLBASE} --swig=${LOCALBASE}/bin/swig3.0
+PYDISTUTILS_BUILDARGS=	build_ext --openssl=${OPENSSLBASE} --swig=${LOCALBASE}/bin/swig3.0 --include=${LOCALBASE}/include
 USE_PYTHON=	autoplist concurrent distutils
 USES=		python ssl
Comment 2 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-10-13 08:03:51 UTC
The port builds fine with base OpenSSL.

Please try the following patch (which uses OPENSSLINC rather than LOCALBASE/include):

Index: Makefile
===================================================================
--- Makefile    (revision 451941)
+++ Makefile    (working copy)
@@ -16,8 +16,7 @@

 BUILD_DEPENDS= swig3.0:devel/swig30

-MAKE_ENV=      SWIG_FEATURES=-I${OPENSSLINC}
-PYDISTUTILS_BUILDARGS= build_ext --openssl=${OPENSSLBASE} --swig=${LOCALBASE}/bin/swig3.0
+PYDISTUTILS_BUILDARGS= build_ext --include=${OPENSSLINC} --openssl=${OPENSSLBASE} --swig=${LOCALBASE}/bin/swig3.0
 USE_PYTHON=    autoplist concurrent distutils
 USES=          python ssl
Comment 3 Peter Putzer 2017-10-13 08:58:03 UTC
(In reply to Po-Chuan Hsieh from comment #2)

Yes, your patch works as well.
Comment 4 commit-hook freebsd_committer freebsd_triage 2017-10-15 00:40:51 UTC
A commit references this bug:

Author: sunpoet
Date: Sun Oct 15 00:38:44 UTC 2017
New revision: 452122
URL: https://svnweb.freebsd.org/changeset/ports/452122

Log:
  Fix build with LibreSSL

  PR:		222912
  Submitted by:	Peter Putzer <freebsd@mnd.sc>

Changes:
  head/security/py-m2crypto/Makefile
Comment 5 Po-Chuan Hsieh freebsd_committer freebsd_triage 2017-10-15 00:41:05 UTC
Committed. Thanks!