Subject: pkg/28605: some (all?) pthon modules fail to build on OSX due to missing -lpython
To: None <pkg-manager@netbsd.org, gnats-admin@netbsd.org,>
From: None <adrianp@netbsd.org>
List: pkgsrc-bugs
Date: 12/11/2004 12:57:00
>Number:         28605
>Category:       pkg
>Synopsis:       some (all?) pthon modules fail to build on OSX due to missing -lpython
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Dec 11 12:57:00 +0000 2004
>Originator:     Adrian Portelli
>Release:        n/a
>Organization:
>Environment:
Darwin monty.local 7.6.0 Darwin Kernel Version 7.6.0: Sun Oct 10 12:05:27 PDT 2004; root:xnu/xnu-517.9.4.obj~1/RELEASE_PPC  Power Macintosh powerpc
>Description:
Trying to build bittorrent, which pulls in two py-* modules, fails because gcc is missing -lpython when building the Python modules.  Adding LDFLAGS+= -lpython fixed the build for me in both cases. 

A user reported a smiliar issue to this on teck-pkg on 19/10/04
(20041018215440.3705D14401@tiamat.goathill.org) but AFAIK did not receive a response. 
>How-To-Repeat:
try building bittorrent on OSX with pkgsrc -current.
>Fix:
This is a really bad, slightly tested hack, no more.  Someone who knows more about python and how the modules infrastructure works should see if this is the correct way to address the issue.

Index: extension.mk
===================================================================
RCS file: /cvsroot/pkgsrc/lang/python/extension.mk,v
retrieving revision 1.11
diff -u -r1.11 extension.mk
--- extension.mk        12 Jun 2004 21:18:31 -0000      1.11
+++ extension.mk        11 Dec 2004 12:53:42 -0000
@@ -35,3 +35,8 @@
 .if defined(PY_PATCHPLIST)
 PLIST_SUBST+=  PYINC=${PYINC} PYSITELIB=${PYSITELIB}
 .endif
+
+.include "../../mk/bsd.prefs.mk"
+.if ${OPSYS} == "Darwin"
+LDFLAGS+=      -lpython
+.endif