NetBSD Problem Report #23830

Received: (qmail 25683 invoked by uid 605); 21 Dec 2003 19:09:36 -0000
Message-Id: <20031221190935.60E1E1115D@narn.netbsd.org>
Date: Sun, 21 Dec 2003 19:09:35 +0000 (UTC)
From: dotz@irc.pl
Sender: gnats-bugs-owner@NetBSD.org
Reply-To: dotz@irc.pl
To: gnats-bugs@gnats.NetBSD.org
Subject: databases/py-PgSQL uses a pkgsrc-incompatible library and include paths detection system
X-Send-Pr-Version: www-1.0

>Number:         23830
>Category:       pkg
>Synopsis:       databases/py-PgSQL uses a pkgsrc-incompatible library and include paths detection system
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          closed
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Sun Dec 21 19:10:00 +0000 2003
>Closed-Date:    Sat Jan 17 13:17:52 +0000 2004
>Last-Modified:  Sun Jan 18 13:03:00 +0000 2004
>Originator:     Michal Pasternak
>Release:        N/A
>Organization:
Good people with bad reputation
>Environment:
FreeBSD mainframe.w.lub.pl 4.9-RELEASE FreeBSD 4.9-RELEASE #0: Mon Oct 27 17:51:09 GMT 2003     root@freebsd-stable.sentex.ca:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
py-PgSQL's setup.py gets paths to PostgreSQL includes basing on sys.platform so it is quite not compatible with pkgsrc. See the file for details.

As pkgsrc should handle libs, paths and such, I therefore suggest we drop autodetection of path from py-PgSQL's setup.py and make it dependent on Pkgsrc.
>How-To-Repeat:
Try to install py-PgSQL on any non-NetBSD system using pkgsrc (FreeBSD, Linux, anything else)
>Fix:
apply the following files as patches/patch-ab; make mdi and recompile:


$NetBSD$

--- setup.py~   Mon Jul 14 23:02:02 2003
+++ setup.py    Sun Dec 21 19:05:12 2003
@@ -97,66 +97,10 @@
        "port/strtoll.c", "port/strtoull.c",
        "port/strtok.c"]

-    if USE_CUSTOM:
-       include_dirs = YOUR_LIST_HERE
-       library_dirs = YOUR_LIST_HERE
-    elif sys.platform == "linux2":
-       include_dirs = ["/usr/include", "/usr/include/postgresql",
-           "/usr/include/pgsql"]
-       library_dirs = ["/usr/lib"]
-
-       # XXX: This is an ugly hack to make bdist_rpm find the include files.
-       include_dirs.append("../" * 5)
-    elif sys.platform[:8] == "unixware":
-       LOCALBASE = os.environ.get('LOCALBASE', '/usr/local/pgsql')
-       include_dirs = ['%s/include' % LOCALBASE]
-       library_dirs = ['%s/lib' % LOCALBASE]
-       pypgsql_rt_dirs = library_dirs
-    elif sys.platform[:8] == "openunix":
-       LOCALBASE = os.environ.get('LOCALBASE', '/usr/local/pgsql')
-       include_dirs = ['%s/include' % LOCALBASE]
-       library_dirs = ['%s/lib' % LOCALBASE]
-       pypgsql_rt_dirs = library_dirs
-    elif sys.platform == "freebsd4":
-       LOCALBASE = os.environ.get('LOCALBASE', '/usr/local')
-       include_dirs = ['%s/include' % LOCALBASE]
-       library_dirs = ['%s/lib' % LOCALBASE]
-    elif sys.platform == "openbsd3":
-       LOCALBASE = os.environ.get('LOCALBASE', '/usr/local')
-       include_dirs = ['%s/include/postgresql' % LOCALBASE]
-       library_dirs = ['%s/lib' % LOCALBASE]
-    elif sys.platform == "netbsd1":
-       LOCALBASE = os.environ.get('LOCALBASE', '/usr/pkg')
-       include_dirs = ['%s/include/pgsql' % LOCALBASE]
-       library_dirs = ['%s/lib' % LOCALBASE]
-    elif sys.platform == "cygwin":
-       include_dirs  = ["/usr/include/postgresql"]
-       library_dirs  = ["/usr/lib"]
-    elif sys.platform == "darwin": # Mac OS X
-       include_dirs = ["/usr/local/pgsql/include"]
-       library_dirs = ["/usr/local/pgsql/lib"]
-       optional_libs += ["ssl", "crypto"]
-    elif sys.platform == "win32":
-       # This works with the PostgreSQL source tree, so it's a bit ugly ...
-       # Lines commented out are for using MSVC instead of mingw
-       win_pg_build_root = os.getenv("PG_SRC", "../postgresql")
-
-       include_dirs = [os.path.join(win_pg_build_root, p) for p in
-                       ["src/include",
-                        "src/include/libpq",
-                        "src",
-                        "src/interfaces/libpq"]]
-
-       library_dirs = [win_pg_build_root + "/src/interfaces/libpq"]
-       #library_dirs = [win_pg_build_root + "/src/interfaces/libpq/Release"]
-       optional_libs += ["wsock32", "advapi32"]
-       #optional_libs = ["libpq", "wsock32", "advapi32"]
-       modname="pyPgSQL.libpq.libpq"
-    else:
-       # Assume a Unixish system
-       include_dirs = ["/usr/local/include"]
-       library_dirs = ["/usr/local/lib"]
-
+    LOCALBASE = os.environ.get('LOCALBASE', '/usr/pkg')
+    include_dirs = ['%s/include/pgsql' % LOCALBASE]
+    library_dirs = ['%s/lib' % LOCALBASE]
+    
     # patch distutils if it can't cope with the "classifiers" keyword
     if sys.version < '2.2.3':
        from distutils.dist import DistributionMetadata

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: recht 
State-Changed-When: Sat Jan 17 13:16:37 UTC 2004 
State-Changed-Why:  
Simplied version of this patch commited. 
Thanks for the PR. 

From: Marc Recht <recht@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc:  
Subject: pr/23830 CVS commit: pkgsrc/databases/py-PgSQL
Date: Sat, 17 Jan 2004 13:16:06 +0000 (UTC)

 Module Name:	pkgsrc
 Committed By:	recht
 Date:		Sat Jan 17 13:16:06 UTC 2004

 Modified Files:
 	pkgsrc/databases/py-PgSQL: distinfo
 Added Files:
 	pkgsrc/databases/py-PgSQL/patches: patch-ab

 Log Message:
 Make this pkgsrc-aware: don't let setup.py search for includes and libs.
 Based on a patch provided by Michal Pasternak in PR 23830.


 To generate a diff of this commit:
 cvs rdiff -r1.1.1.1 -r1.2 pkgsrc/databases/py-PgSQL/distinfo
 cvs rdiff -r0 -r1.1 pkgsrc/databases/py-PgSQL/patches/patch-ab

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.


From: Michal Pasternak <michal@pasternak.w.lub.pl>
To: gnats-bugs@gnats.netbsd.org
Cc: dotz@irc.pl, recht@netbsd.org, pkg-manager@netbsd.org
Subject: Re: pkg/23830
Date: Sun, 18 Jan 2004 12:59:25 +0100

 recht@netbsd.org [Sat, Jan 17, 2004 at 01:17:51PM -0000]:
 > Synopsis: databases/py-PgSQL uses a pkgsrc-incompatible library and include paths detection system
 > 
 > State-Changed-From-To: open->closed
 > State-Changed-By: recht
 > State-Changed-When: Sat Jan 17 13:16:37 UTC 2004
 > State-Changed-Why: 
 > Simplied version of this patch commited.

 Where? anoncvs.netbsd.org doesn't seem to have it.

From: Marc Recht <recht@netbsd.org>
To: Michal Pasternak <michal@pasternak.w.lub.pl>, gnats-bugs@gnats.netbsd.org
Cc: dotz@irc.pl
Subject: Re: pkg/23830
Date: Sun, 18 Jan 2004 14:02:03 +0100

 > Where? anoncvs.netbsd.org doesn't seem to have it.

 The CVS -> AnonCVS gateway is currently broken. I send you this diff in 
 private mail.

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.