-
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Moar Psycopg2 #1162
Moar Psycopg2 #1162
Changes from all commits
47bf903
469be30
dff56c1
93561bb
133d378
59c7ed0
88026ea
3e979f3
87d48a1
f61445f
2c88531
e0b6cf3
9fba243
674a998
a6a2ef6
cb67d78
1bb2f8e
88b4a2a
f21d8ac
75b9b00
a12ed49
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
{% set version = "9.5.3" %} | ||
|
||
package: | ||
name: libpq | ||
version: {{ version }} | ||
|
||
build: | ||
number: 0 | ||
skip: True # [win] | ||
# features: | ||
# - vc9 # [win and py27] | ||
# - vc10 # [win and py34] | ||
# - vc14 # [win and py35] | ||
always_include_files: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just curious is this a new things or old and I never saw it before b/c I am lazy and I did not read the docs? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not new, but not commonly used. This is what you do when you want to create a sort of sub-package, as I did here with libpq. The files originally come from postgresql, but then I force them to be included in the new package (they would not be, otherwise, since they exist before the build starts.) |
||
- lib/libpq.so.5.8 # [linux] | ||
- lib/libpq.so.5 # [linux] | ||
- lib/libpq.so # [linux] | ||
- lib/libpq.5.8.dylib # [osx] | ||
- lib/libpq.5.dylib # [osx] | ||
- lib/libpq.dylib # [osx] | ||
- bin/pg_config # [unix] | ||
- Library/bin/libpq.dll # [win] | ||
- Library/bin/pg_config.exe # [win] | ||
|
||
requirements: | ||
build: | ||
# - vc 9 # [win and py27] | ||
# - vc 10 # [win and py34] | ||
# - vc 14 # [win and py35] | ||
- postgresql {{ version }} | ||
# run: | ||
# - vc 9 # [win and py27] | ||
# - vc 10 # [win and py34] | ||
# - vc 14 # [win and py35] | ||
|
||
test: | ||
commands: | ||
- pg_config | ||
- test -f $PREFIX/lib/libpq.so.5.8 # [linux] | ||
- test -f $PREFIX/lib/libpq.so.5 # [linux] | ||
- test -f $PREFIX/lib/libpq.so # [linux] | ||
- test -f $PREFIX/lib/libpq.5.8.dylib # [osx] | ||
- test -f $PREFIX/lib/libpq.5.dylib # [osx] | ||
- test -f $PREFIX/lib/libpq.dylib # [osx] | ||
|
||
about: | ||
home: http://www.postgresql.org/ | ||
license: PostgreSQL license (http://www.postgresql.org/about/licence/) | ||
summary: The postgres runtime libraries and utilities (not the server itself) | ||
|
||
extra: | ||
recipe-maintainers: | ||
- msarahan | ||
- ocefpaf |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
"%PYTHON%" setup.py install | ||
if errorlevel 1 exit 1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/bin/bash | ||
|
||
export LDFLAGS="${LDFLAGS} -L$PREFIX/lib -lssl" | ||
|
||
$PYTHON setup.py install | ||
|
||
if [[ `uname` == 'Darwin' ]]; then | ||
PG_LIB=$(pg_config --libdir) | ||
for LIBRARY in `find ${SP_DIR}/${PKG_NAME} -name "*.so"`; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It is creating There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't know. I didn't write that part. @jseabold, can you comment on this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just checked the https://travis-ci.org/conda-forge/staged-recipes/jobs/149016531#L867 |
||
do | ||
install_name_tool -change libssl.1.0.0.dylib @rpath/libssl.1.0.0.dylib $LIBRARY | ||
install_name_tool -change libcrypto.1.0.0.dylib @rpath/libcrypto.1.0.0.dylib $LIBRARY | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If Continuum would build openssl with conda-build this wouldn't be needed (c.f. ContinuumIO/anaconda-issues#498). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm assuming these files are part of a different package (otherwise conda build would just do this itself after the build is complete). Assuming that is correct, shouldn't you break the hard links here? It doesn't matter for conda-forge, but if someone tries to build this recipe on their own machine, this will write into the package cache. Sorry if I'm missing something here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
👍 Absolutely correct. Should be a simple copy shuffle to break the hard links. Could you please raise the issue on the feedstock though as this is already merged or better yet propose the change? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Are they actually from a separate package? Based on the loop, it looks like they are part of this package, but if that's the case, why are these lines needed? |
||
done | ||
fi |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git setup.cfg setup.cfg | ||
index 90a47dd..1057dc1 100644 | ||
--- setup.cfg | ||
+++ setup.cfg | ||
@@ -21,7 +21,7 @@ use_pydatetime=1 | ||
# For Windows only: | ||
# Set to 1 if the PostgreSQL library was built with OpenSSL. | ||
# Required to link in OpenSSL libraries and dependencies. | ||
-have_ssl=0 | ||
+have_ssl=1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Many will be pleased 😄 |
||
|
||
# Statically link against the postgresql client library. | ||
#static_libpq=1 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{% set version = "2.6.1" %} | ||
|
||
package: | ||
name: psycopg2 | ||
version: {{ version }} | ||
|
||
source: | ||
fn: psycopg2-{{ version }}.tar.gz | ||
url: https://pypi.python.org/packages/source/p/psycopg2/psycopg2-{{ version }}.tar.gz | ||
md5: 842b44f8c95517ed5b792081a2370da1 | ||
patches: | ||
- have_openssl.patch | ||
|
||
build: | ||
number: 0 | ||
# FIXME: until we solve the postgresql package. | ||
skip: True # [win] | ||
|
||
requirements: | ||
build: | ||
- python | ||
- postgresql | ||
- openssl 1.0.* | ||
run: | ||
# libpq is a repackaging of only the library to connect to postgres | ||
- libpq | ||
- python | ||
- openssl 1.0.* | ||
|
||
test: | ||
imports: | ||
- psycopg2 | ||
- psycopg2._psycopg | ||
|
||
about: | ||
home: http://initd.org/psycopg/ | ||
license: LGPL, BSD-like, ZPL | ||
summary: Python-PostgreSQL Database Adapter | ||
|
||
extra: | ||
recipe-maintainers: | ||
- msarahan | ||
- ocefpaf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you are going to try Windows right after feedstocking we can leave these here. No need to remove them now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that was my hope. I don't know how quickly I'll get to it - still fighting postgresql build on win.