Test building PG 10 using the solution provided by Jason Erickson

https://github.com/psycopg/psycopg2-wheels/pull/3/
This commit is contained in:
Daniele Varrazzo 2017-10-18 22:37:14 +01:00
parent 0d90c173fb
commit 552e49a11d

View File

@ -73,6 +73,9 @@ matrix:
fast_finish: false fast_finish: false
services: services:
# Note: if you change this service also change the path to match in:
# - the postgresql.conf customisation in 'init'
# - the path in 'build_script'
- postgresql96 - postgresql96
cache: cache:
@ -187,30 +190,33 @@ install:
- IF NOT EXIST %PGTOP%\lib MKDIR %PGTOP%\lib - IF NOT EXIST %PGTOP%\lib MKDIR %PGTOP%\lib
# Download PostgreSQL source # Download PostgreSQL source
- CD C:\Others - CD C:\Others
- IF NOT EXIST postgres-REL9_6_3.zip ( - IF NOT EXIST postgres-REL_10_0.zip (
curl -fsSL -o postgres-REL9_6_3.zip https://github.com/postgres/postgres/archive/REL9_6_3.zip curl -fsSL -o postgres-REL_10_0.zip https://github.com/postgres/postgres/archive/REL_10_0.zip
) )
# Setup build config file (config.pl) # Setup build config file (config.pl)
# Build libpgport first # Hack the Mkvcbuild.pm file so we build the lib version of libpq
# Build libpq # Build libpgport, libpgcommon, libpq
# Copy over includes
# Copy over built libraries
# NOTE: Cannot set and use the same variable inside an IF # NOTE: Cannot set and use the same variable inside an IF
- SET PGBUILD=%BUILD_DIR%\postgres-REL9_6_3 - SET PGBUILD=%BUILD_DIR%\postgres-REL_10_0
- IF NOT EXIST %PGTOP%\lib\libpq.lib ( - IF NOT EXIST %PGTOP%\lib\libpq.lib (
CD %BUILD_DIR% && CD %BUILD_DIR% &&
7z x C:\Others\postgres-REL9_6_3.zip && 7z x C:\Others\postgres-REL_10_0.zip &&
CD postgres-REL9_6_3\src\tools\msvc && CD postgres-REL_10_0\src\tools\msvc &&
ECHO $config-^>{ldap} = 0; > config.pl && ECHO $config-^>{ldap} = 0; > config.pl &&
ECHO $config-^>{openssl} = "%OPENSSLTOP:\=\\%"; >> config.pl && ECHO $config-^>{openssl} = "%OPENSSLTOP:\=\\%"; >> config.pl &&
ECHO.>> config.pl && ECHO.>> config.pl &&
ECHO 1;>> config.pl && ECHO 1;>> config.pl &&
perl -pi.bak -e "s/'libpq', 'dll'/'libpq', 'lib'/g" Mkvcbuild.pm &&
build libpgport && build libpgport &&
build libpgcommon &&
build libpq &&
XCOPY /E ..\..\include %PGTOP%\include && XCOPY /E ..\..\include %PGTOP%\include &&
COPY %PGBUILD%\Release\libpgport\libpgport.lib %PGTOP%\lib && COPY %PGBUILD%\Release\libpgport\libpgport.lib %PGTOP%\lib &&
CD ..\..\interfaces\libpq && COPY %PGBUILD%\Release\libpgcommon\libpgcommon.lib %PGTOP%\lib &&
nmake -f win32.mak USE_OPENSSL=1 ENABLE_THREAD_SAFETY=1 SSL_INC=%OPENSSLTOP%\include SSL_LIB_PATH=%OPENSSLTOP%\lib config .\Release\libpq.lib && COPY %PGBUILD%\Release\libpq\libpq.lib %PGTOP%\lib &&
COPY *.h %PGTOP%\include &&
COPY Release\libpq.lib %PGTOP%\lib &&
CD %BASE_DIR% && CD %BASE_DIR% &&
RMDIR /S /Q %PGBUILD% RMDIR /S /Q %PGBUILD%
) )
@ -223,7 +229,7 @@ build_script:
# Add PostgreSQL binaries to the path # Add PostgreSQL binaries to the path
- PATH=C:\Program Files\PostgreSQL\9.6\bin\;%PATH% - PATH=C:\Program Files\PostgreSQL\9.6\bin\;%PATH%
- CD C:\Project - CD C:\Project
- "%PYTHON%\\python.exe setup.py build_ext --have-ssl -l libpgcommon -L %OPENSSLTOP%\\lib;%PGTOP%\\lib -I %OPENSSLTOP%\\include;%PGTOP%\\include" - "%PYTHON%\\python.exe setup.py build_ext --have-ssl -l libpgcommon -l libpgport -L %OPENSSLTOP%\\lib;%PGTOP%\\lib -I %OPENSSLTOP%\\include;%PGTOP%\\include"
- "%PYTHON%\\python.exe setup.py build" - "%PYTHON%\\python.exe setup.py build"
- "%PYTHON%\\python.exe setup.py install" - "%PYTHON%\\python.exe setup.py install"