Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK)) by mollari.NetBSD.org (Postfix) with ESMTPS id 6F0D07A46B for ; Sat, 23 Jul 2016 13:09:17 +0000 (UTC) Received: by mail.netbsd.org (Postfix, from userid 605) id D947085ECE; Sat, 23 Jul 2016 13:09:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by mail.netbsd.org (Postfix) with ESMTP id 6A2D085ECB for ; Sat, 23 Jul 2016 13:09:16 +0000 (UTC) X-Virus-Scanned: amavisd-new at netbsd.org Received: from mail.netbsd.org ([IPv6:::1]) by localhost (mail.netbsd.org [IPv6:::1]) (amavisd-new, port 10025) with ESMTP id gUwfbDxKHgS7 for ; Sat, 23 Jul 2016 13:09:16 +0000 (UTC) Received: from cvs.NetBSD.org (unknown [IPv6:2001:470:a085:999:28c:faff:fe03:5984]) by mail.netbsd.org (Postfix) with ESMTP id E989A85E93 for ; Sat, 23 Jul 2016 13:09:15 +0000 (UTC) Received: by cvs.NetBSD.org (Postfix, from userid 500) id DFBCDFBB5; Sat, 23 Jul 2016 13:09:15 +0000 (UTC) Content-Transfer-Encoding: 7bit Content-Type: multipart/mixed; boundary="_----------=_146927935578100" MIME-Version: 1.0 Date: Sat, 23 Jul 2016 13:09:15 +0000 From: "Kamil Rytarowski" Subject: CVS commit: pkgsrc/lang/python27 To: pkgsrc-changes@NetBSD.org Reply-To: kamil@netbsd.org X-Mailer: log_accum Message-Id: <20160723130915.DFBCDFBB5@cvs.NetBSD.org> Sender: pkgsrc-changes-owner@NetBSD.org List-Id: pkgsrc-changes.NetBSD.org Precedence: bulk This is a multi-part message in MIME format. --_----------=_146927935578100 Content-Disposition: inline Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" Module Name: pkgsrc Committed By: kamil Date: Sat Jul 23 13:09:15 UTC 2016 Modified Files: pkgsrc/lang/python27: Makefile Log Message: Fixing find_library() on POSIX-like (excluding Darwin) systems. This isn't addressing Python's wrapper for dlopen(3). This possibily addresses mostly NetBSD as other popular OSes have ldconfig. Testing commands: - before applying the patch >>> from ctypes.util import find_library >>> find_library("m") 'libm.so.0' >>> find_library("crypto") 'libcrypto.so.11' >>> find_library("GL") >>> find_library("curl") - after applying the patch >>> from ctypes.util import find_library >>> find_library("m") 'libm.so.0' >>> find_library("crypto") 'libcrypto.so.11' >>> find_library("GL") 'libGL.so.2' >>> find_library("curl") 'libcurl.so.4' This patch doesn't solve the case of custom dirs like $PREFIX/qt5/lib. However it's solving most common cases of using this call. A possible solution is to parse the output "pkg_info -La"... however it's very slow. In other words a cache with libraries might be needed to handle it efficiently. Bump PKGREVISION. To generate a diff of this commit: cvs rdiff -u -r1.62 -r1.63 pkgsrc/lang/python27/Makefile Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. --_----------=_146927935578100 Content-Disposition: inline Content-Length: 1501 Content-Transfer-Encoding: binary Content-Type: text/x-diff; charset=us-ascii Modified files: Index: pkgsrc/lang/python27/Makefile diff -u pkgsrc/lang/python27/Makefile:1.62 pkgsrc/lang/python27/Makefile:1.63 --- pkgsrc/lang/python27/Makefile:1.62 Mon Jul 11 12:17:13 2016 +++ pkgsrc/lang/python27/Makefile Sat Jul 23 13:09:15 2016 @@ -1,9 +1,9 @@ -# $NetBSD: Makefile,v 1.62 2016/07/11 12:17:13 ryoon Exp $ +# $NetBSD: Makefile,v 1.63 2016/07/23 13:09:15 kamil Exp $ .include "dist.mk" PKGNAME= python27-${PY_DISTVERSION} -PKGREVISION= 1 +PKGREVISION= 2 CATEGORIES= lang python MAINTAINER= pkgsrc-users@NetBSD.org @@ -162,6 +162,24 @@ SUBST_STAGE.findlib= pre-configure SUBST_FILES.findlib= Lib/distutils/unixccompiler.py SUBST_SED.findlib= -e 's,/usr/local,${PREFIX},' +# XXX: It might be needed to add manually more paths like ${PREFIX}/qt5/lib +# Testing: +# >>> from ctypes.util import find_library +# >>> find_library("m") +# 'libm.so.0' +# >>> find_library("crypto") +# 'libcrypto.so.11' +# >>> find_library("GL") +# 'libGL.so.2' +# >>> find_library("curl") +# 'libcurl.so.4' + +SUBST_CLASSES+= pfindlib +SUBST_MESSAGE.pfindlib= Fixing find_library() on POSIX-like (excluding Darwin) systems. +SUBST_STAGE.pfindlib= pre-configure +SUBST_FILES.pfindlib= Lib/ctypes/util.py +SUBST_SED.pfindlib= -e 's!\(-Wl,-t -o\)!${COMPILER_RPATH_FLAG}${X11BASE}/lib -L${X11BASE}/lib ${COMPILER_RPATH_FLAG}${PREFIX}/lib -L${PREFIX}/lib \1!' + SUBST_CLASSES+= sslbase SUBST_MESSAGE.sslbase= Fixing find-file for openssl with SSLBASE. SUBST_STAGE.sslbase= pre-configure --_----------=_146927935578100--