Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions .github/workflows/ci-build-binary-artifacts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -93,16 +93,16 @@ jobs:
matrix:
include:
- name: 'Windows x64'
os: windows-2019
os: windows-2022
triplet: x64-windows-static
suffix: 'windows-win64'
generator: 'Visual Studio 16 2019'
generator: 'Visual Studio 17 2022'
arch: '-A x64'
- name: 'Windows x86'
os: windows-2019
os: windows-2022
triplet: x86-windows-static
suffix: 'windows-win32'
generator: 'Visual Studio 16 2019'
generator: 'Visual Studio 17 2022'
arch: '-A Win32'

steps:
Expand Down
30 changes: 17 additions & 13 deletions pkg/apk/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.
#

# Maintainer: "Apache Pulsar <dev@pulsar.apache.org>"
# Maintainer: Apache Pulsar <dev@pulsar.apache.org>

pkgname="apache-pulsar-client"
pkgver="$VERSION"
Expand All @@ -38,19 +38,23 @@ build() {
if [ "$CBUILD" != "$CHOST" ]; then
CMAKE_CROSSOPTS="-DCMAKE_SYSTEM_NAME=Linux -DCMAKE_HOST_SYSTEM_NAME=Linux"
fi
cmake \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_INSTALL_LIBDIR=lib \
-DBUILD_SHARED_LIBS=True \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_CXX_FLAGS="$CXXFLAGS" \
-DCMAKE_C_FLAGS="$CFLAGS" \
-DBUILD_TESTS=OFF \
-DLINK_STATIC=ON \
${CMAKE_CROSSOPTS} ${ROOT_DIR}
make -j6
git clone https://github.com/microsoft/vcpkg.git
mv vcpkg $ROOT_DIR/
export VCPKG_FORCE_SYSTEM_BINARIES=1
set +e
cmake -B build -DINTEGRATE_VCPKG=ON -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_MAKE_PROGRAM=make \
-DCMAKE_INSTALL_PREFIX="$pkgdir" \
-DBUILD_TESTS=OFF -DBUILD_DYNAMIC_LIB=ON -DBUILD_STATIC_LIB=ON \
$ROOT_DIR
if [[ $? -ne 0 ]]; then
cat $ROOT_DIR/vcpkg/buildtrees/detect_compiler/*.log
exit 1
fi
set -e
cmake --build build -j8
}

package() {
make DESTDIR="$pkgdir" install
cmake --build build --target install
}
91 changes: 5 additions & 86 deletions pkg/apk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
# under the License.
#

FROM alpine:3.12
FROM alpine:3.19

ARG PLATFORM

Expand All @@ -31,91 +31,10 @@ RUN apk add \
g++ \
make \
cmake \
python3 \
py3-pip \
perl \
git \
ninja \
zip \
unzip \
openssl-dev \
sudo

RUN pip3 install pyyaml

ADD .build/dependencies.yaml /
ADD .build/dep-version.py /usr/local/bin

# Download and compile boost
RUN BOOST_VERSION=$(dep-version.py boost) && \
curl -O -L https://github.com/boostorg/boost/releases/download/boost-${BOOST_VERSION}/boost-${BOOST_VERSION}.tar.gz && \
tar zxf boost-${BOOST_VERSION}.tar.gz && \
cd boost-${BOOST_VERSION} && \
./bootstrap.sh --with-libraries=regex && \
./b2 -d0 address-model=64 cxxflags=-fPIC link=static threading=multi variant=release install && \
rm -rf /boost-${BOOST_VERSION}.tar.gz /boost-${BOOST_VERSION}

# Download and compile protobuf
RUN PROTOBUF_VERSION=$(dep-version.py protobuf) && \
curl -O -L https://github.com/google/protobuf/releases/download/v${PROTOBUF_VERSION}/protobuf-cpp-${PROTOBUF_VERSION}.tar.gz && \
tar xfz protobuf-cpp-${PROTOBUF_VERSION}.tar.gz && \
cd protobuf-${PROTOBUF_VERSION}/ && \
CXXFLAGS=-fPIC ./configure && \
make -j8 && make install && \
rm -rf /protobuf-cpp-${PROTOBUF_VERSION}.tar.gz /protobuf-${PROTOBUF_VERSION}

# ZLib
RUN ZLIB_VERSION=$(dep-version.py zlib) && \
curl -O -L https://github.com/madler/zlib/archive/v${ZLIB_VERSION}.tar.gz && \
tar xfz v${ZLIB_VERSION}.tar.gz && \
cd zlib-${ZLIB_VERSION} && \
CFLAGS="-fPIC -O3" ./configure && \
make -j8 && make install && \
rm -rf /v${ZLIB_VERSION}.tar.gz /zlib-${ZLIB_VERSION}

# Zstandard
RUN ZSTD_VERSION=$(dep-version.py zstd) && \
curl -O -L https://github.com/facebook/zstd/releases/download/v${ZSTD_VERSION}/zstd-${ZSTD_VERSION}.tar.gz && \
tar xfz zstd-${ZSTD_VERSION}.tar.gz && \
cd zstd-${ZSTD_VERSION} && \
CFLAGS="-fPIC -O3" make -j8 && \
make install && \
rm -rf /zstd-${ZSTD_VERSION} /zstd-${ZSTD_VERSION}.tar.gz

# Snappy
RUN SNAPPY_VERSION=$(dep-version.py snappy) && \
curl -O -L https://github.com/google/snappy/archive/refs/tags/${SNAPPY_VERSION}.tar.gz && \
tar xfz ${SNAPPY_VERSION}.tar.gz && \
cd snappy-${SNAPPY_VERSION} && \
CXXFLAGS="-fPIC -O3" cmake . -DSNAPPY_BUILD_TESTS=OFF -DSNAPPY_BUILD_BENCHMARKS=OFF && \
make -j8 && make install && \
rm -rf /snappy-${SNAPPY_VERSION} /${SNAPPY_VERSION}.tar.gz

# Roaring
RUN ROARING_VERSION=$(dep-version.py roaring) && \
curl -O -L https://github.com/RoaringBitmap/CRoaring/archive/refs/tags/v${ROARING_VERSION}.tar.gz && \
tar xfz v${ROARING_VERSION}.tar.gz && \
cd CRoaring-${ROARING_VERSION} && \
mkdir build && cd build && CXXFLAGS="-fPIC -O3" cmake .. && \
make -j8 && make install && \
rm -rf /v${ROARING_VERSION}.tar.gz /CRoaring-${ROARING_VERSION}

RUN OPENSSL_VERSION=$(dep-version.py openssl) && \
OPENSSL_VERSION_UNDERSCORE=$(echo $OPENSSL_VERSION | sed 's/\./_/g') && \
curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.tar.gz && \
tar xfz OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.tar.gz && \
cd openssl-OpenSSL_${OPENSSL_VERSION_UNDERSCORE}/ && \
./Configure -fPIC --prefix=/usr/local/ssl/ linux-${PLATFORM} && \
make -j8 && make install && \
rm -rf /OpenSSL_${OPENSSL_VERSION_UNDERSCORE}.tar.gz /openssl-OpenSSL_${OPENSSL_VERSION_UNDERSCORE}

ENV LD_LIBRARY_PATH /usr/local/ssl/lib/:
ENV OPENSSL_ROOT_DIR /usr/local/ssl/

# LibCurl
RUN CURL_VERSION=$(dep-version.py curl) && \
CURL_VERSION_UNDERSCORE=$(echo $CURL_VERSION | sed 's/\./_/g') && \
curl -O -L https://github.com/curl/curl/releases/download/curl-${CURL_VERSION_UNDERSCORE}/curl-${CURL_VERSION}.tar.gz && \
tar xfz curl-${CURL_VERSION}.tar.gz && \
cd curl-${CURL_VERSION} && \
CFLAGS=-fPIC ./configure --with-ssl=/usr/local/ssl/ --without-zstd --without-libpsl && \
make -j8 && make install && \
rm -rf /curl-${CURL_VERSION}.tar.gz /curl-${CURL_VERSION}


2 changes: 1 addition & 1 deletion pkg/apk/build-apk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export VERSION=`echo $POM_VERSION | sed -E 's/\-[a-zA-Z]+//'`

echo "VERSION: $VERSION"

abuild-keygen -a -i -n
sudo abuild-keygen -a -i -n
abuild -F -c -r

cp -r /root/packages/pkg ./build
2 changes: 1 addition & 1 deletion pkg/apk/docker-build-apk-arm64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ ROOT_DIR=$(git rev-parse --show-toplevel)
IMAGE_NAME=${1:-apachepulsar/pulsar-build:alpine-3.16-arm64}

docker run -v $ROOT_DIR:/pulsar-client-cpp \
--env PLATFORM=arm64 \
--env PLATFORM=aarch64 \
$IMAGE_NAME \
/pulsar-client-cpp/pkg/apk/build-apk.sh