Skip to content
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

[LibPQ] Bump to 16 and align OpenSSL with HDF5 #7053

Merged
merged 27 commits into from
Sep 19, 2023
Merged
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
7d2423a
[LibPQ] Bump to 15.3 and align OpenSSL with HDF5
jeremiahpslewis Jul 14, 2023
9775aed
Update build_tarballs.jl
jeremiahpslewis Jul 14, 2023
6efde79
bump hash
jeremiahpslewis Jul 14, 2023
3fcab5b
try gcc v5+ to work around timezone compile issue
jeremiahpslewis Jul 14, 2023
863f0a0
Update configure flag
jeremiahpslewis Jul 15, 2023
88870f6
Add ldflag
jeremiahpslewis Jul 15, 2023
3387223
MINGW fix
jeremiahpslewis Jul 15, 2023
1903941
Try GCC v6
jeremiahpslewis Jul 15, 2023
ae620a0
Update build_tarballs.jl
jeremiahpslewis Jul 15, 2023
41a6ce6
Update build_tarballs.jl
jeremiahpslewis Jul 15, 2023
801d1ed
Update build_tarballs.jl
jeremiahpslewis Jul 15, 2023
0e83f70
Switch to meson
jeremiahpslewis Sep 15, 2023
10a0fb4
Improve build
jeremiahpslewis Sep 15, 2023
bb8415b
meson setup
jeremiahpslewis Sep 15, 2023
091a5a5
Use git checkout
jeremiahpslewis Sep 15, 2023
69c446d
Fix build
jeremiahpslewis Sep 15, 2023
185bceb
Fix windows
jeremiahpslewis Sep 15, 2023
e7d7e88
its broken
jeremiahpslewis Sep 15, 2023
146458b
Update build_tarballs.jl
jeremiahpslewis Sep 16, 2023
4a910a5
Update build_tarballs.jl
jeremiahpslewis Sep 16, 2023
1adf9eb
Why not use two build systems!
jeremiahpslewis Sep 16, 2023
fc8b39a
drop dependency
jeremiahpslewis Sep 16, 2023
41ccc90
add cflags
jeremiahpslewis Sep 16, 2023
20bbf26
Tweak params
jeremiahpslewis Sep 16, 2023
fb41a18
Bump GCC for i686 musl
jeremiahpslewis Sep 16, 2023
a5e3de7
Update L/LibPQ/build_tarballs.jl
jeremiahpslewis Sep 19, 2023
938f5c5
Update build_tarballs.jl
jeremiahpslewis Sep 19, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
96 changes: 57 additions & 39 deletions L/LibPQ/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,58 +3,73 @@
using BinaryBuilder

name = "LibPQ"
version = v"14.3"
pg_version = string(version.major, '.', version.minor)
tzcode_version = "2021e"
version = v"16.0"
tzcode_version = "2023c"

# Collection of sources required to build LibPQ
sources = [
ArchiveSource(
"https://ftp.postgresql.org/pub/source/v$pg_version/postgresql-$pg_version.tar.gz",
"18eff30438703dd7a5f2a7ca916741bce3c99eadb4025bc6268af268e8e909c5"
GitSource(
"https://github.com/postgres/postgres.git",
"c372fbbd8e911f2412b80a8c39d7079366565d67",
),
ArchiveSource(
"https://data.iana.org/time-zones/releases/tzcode$tzcode_version.tar.gz",
"584666393a5424d13d27ec01183da17703273664742e049d4f62f62dab631775",
"46d17f2bb19ad73290f03a203006152e0fa0d7b11e5b71467c4a823811b214e7",
unpack_target="zic-build",
),
]

# Bash recipe for building across all platforms
# NOTE: readline and zlib are not used by libpq
script = raw"""
cd $WORKSPACE/srcdir
cd zic-build
make CC=$BUILD_CC VERSION_DEPS= zic
mv zic ../ && cd ../ && rm -rf zic-build
export ZIC=$WORKSPACE/srcdir/zic
cd $WORKSPACE/srcdir/postgresql-*/
if [[ "${target}" == i686-linux-musl ]]; then
# Small hack: swear that we're cross-compiling. Our `i686-linux-musl` is
# bugged and it can run only a few programs, with the result that the
# configure test to check whether we're cross-compiling returns that we're
# doing a native build, but then it fails to run a bunch of programs during
# other tests.
sed -i 's/cross_compiling=no/cross_compiling=yes/' configure
fi
FLAGS=()
if [[ "${target}" == *-linux-* ]] || [[ "${target}" == *-freebsd* ]]; then
FLAGS+=(--with-gssapi)
if [[ "${target}" == *-freebsd* ]]; then
# Only for FreeBSD we need to hint that we need to libcom_err to get
# functions `add_error_table` and `remove_error_table`
export LIBS=-lcom_err
fi
export PATH=$WORKSPACE/srcdir:$PATH
export CFLAGS="-std=c99"

cd postgres

if [[ ${target} == *-apple-* ]]; then
./configure --prefix=${prefix} \
--build=${MACHTYPE} \
--host=${target} \
--with-includes=${includedir} \
--with-libraries=${libdir} \
--without-readline \
--without-zlib \
--with-ssl=openssl \
"${FLAGS[@]}"

make -C src/interfaces/libpq -j${nproc}
make -C src/interfaces/libpq install
make -C src/include install

else
meson setup meson_build --prefix=$prefix \
--cross-file="${MESON_TARGET_TOOLCHAIN}" \
--bindir=${bindir} \
--libdir=${libdir} \
--includedir=${includedir} \
-Dssl=openssl \
-Dzlib=disabled \
-Dreadline=disabled \
-Dtap_tests=disabled \
-Dplpython=disabled \
-Dplperl=disabled \
-Dnls=disabled

cd meson_build
ninja -j${nproc}
ninja install
cd ../

if [[ ${target} == *-w64-mingw32 ]]; then
mv -v meson_build/src/interfaces/libpq/* ${prefix}/lib
jeremiahpslewis marked this conversation as resolved.
Show resolved Hide resolved
fi
fi
./configure --prefix=${prefix} \
--build=${MACHTYPE} \
--host=${target} \
--with-includes=${includedir} \
--with-libraries=${libdir} \
--without-readline \
--without-zlib \
--with-openssl \
"${FLAGS[@]}"
make -C src/interfaces/libpq -j${nproc}
make -C src/interfaces/libpq install
make -C src/include install


# Delete static library
rm ${prefix}/lib/libpq.a
Expand All @@ -72,9 +87,12 @@ products = [

# Dependencies that must be installed before this package can be built
dependencies = [
Dependency("OpenSSL_jll"; compat="1.1.10"),
Dependency("OpenSSL_jll"; compat="3.0.8"),
Dependency("Kerberos_krb5_jll"; platforms=filter(p -> Sys.islinux(p) || Sys.isfreebsd(p), platforms)),
Dependency("ICU_jll"; compat="69.1"),
HostBuildDependency("Bison_jll"),
Dependency("Zstd_jll"),
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6")
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; julia_compat="1.6", preferred_gcc_version = v"7")