Skip to content

Commit

Permalink
Use source: syntax for libgrpc/ssl building for controller rocks.
Browse files Browse the repository at this point in the history
Signed-off-by: Nashwan Azhari <[email protected]>
  • Loading branch information
aznashwan committed Aug 13, 2024
1 parent 22e51e7 commit cafc8e4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 38 deletions.
38 changes: 19 additions & 19 deletions controller/v1.10.1/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,23 @@ parts:
build-libgrpcpp:
plugin: nil
after: ['prepare-base-image']

source-type: git
# HACK(aznashwan): the `libgrpc++` package on 22.04 is version 1.30,
# while the `grpc-dev` package in the Alpine repos used in the original
# image is currently 1.62.1, so we must build it ourselves:
source: https://github.com/grpc/grpc
source-tag: v1.62.1
source-depth: 1

build-packages:
- cmake

override-build: |
set -eux -o pipefail
# HACK(aznashwan): the `libgrpc++` package on 22.04 is version 1.30,
# while the `grpc-dev` package in the Alpine repos used in the original
# image is currently 1.62.1, so we must build it ourselves:
LIBGRPC_VERSION=v1.62.1
cd /tmp
git clone --recurse-submodules --depth 1 --shallow-submodules \
-b $LIBGRPC_VERSION https://github.com/grpc/grpc
cd $CRAFT_PART_SRC
cd /tmp/grpc
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF \
Expand All @@ -100,27 +102,25 @@ parts:
make -j 4
make install
build-libssl:
plugin: nil
after: ['prepare-base-image']

source-type: tar
# HACK(aznashwan): the version of OpenSSL used in the upstream Nginx
# image is 3.3.1, which is not otherwise available on 22.04:
source: https://github.com/openssl/openssl/releases/download/openssl-3.3.1/openssl-3.3.1.tar.gz

build-packages:
- build-essential
- checkinstall
- zlib1g-dev

override-build: |
set -eux -o pipefail
# HACK(aznashwan): the version of OpenSSL used in the upstream Nginx
# image is 3.3.1, which is not otherwise available on 22.04:
SSL_VERSION=3.3.1
cd /tmp
mkdir openssl
wget https://github.com/openssl/openssl/releases/download/openssl-${SSL_VERSION}/openssl-${SSL_VERSION}.tar.gz
tar -xzvf openssl-${SSL_VERSION}.tar.gz
cd $CRAFT_PART_SRC
cd openssl-${SSL_VERSION}
./config shared zlib
make
make install
Expand Down
38 changes: 19 additions & 19 deletions controller/v1.11.0/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,23 @@ parts:
build-libgrpcpp:
plugin: nil
after: ['prepare-base-image']

source-type: git
# HACK(aznashwan): the `libgrpc++` package on 22.04 is version 1.30,
# while the `grpc-dev` package in the Alpine repos used in the original
# image is currently 1.62.1, so we must build it ourselves:
source: https://github.com/grpc/grpc
source-tag: v1.62.1
source-depth: 1

build-packages:
- cmake

override-build: |
set -eux -o pipefail
# HACK(aznashwan): the `libgrpc++` package on 22.04 is version 1.30,
# while the `grpc-dev` package in the Alpine repos used in the original
# image is currently 1.62.1, so we must build it ourselves:
LIBGRPC_VERSION=v1.62.1
cd /tmp
git clone --recurse-submodules --depth 1 --shallow-submodules \
-b $LIBGRPC_VERSION https://github.com/grpc/grpc
cd $CRAFT_PART_SRC
cd /tmp/grpc
mkdir -p cmake/build
pushd cmake/build
cmake -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF \
Expand All @@ -100,27 +102,25 @@ parts:
make -j 4
make install
build-libssl:
plugin: nil
after: ['prepare-base-image']

source-type: tar
# HACK(aznashwan): the version of OpenSSL used in the upstream Nginx
# image is 3.3.1, which is not otherwise available on 22.04:
source: https://github.com/openssl/openssl/releases/download/openssl-3.3.1/openssl-3.3.1.tar.gz

build-packages:
- build-essential
- checkinstall
- zlib1g-dev

override-build: |
set -eux -o pipefail
# HACK(aznashwan): the version of OpenSSL used in the upstream Nginx
# image is 3.3.1, which is not otherwise available on 22.04:
SSL_VERSION=3.3.1
cd /tmp
mkdir openssl
wget https://github.com/openssl/openssl/releases/download/openssl-${SSL_VERSION}/openssl-${SSL_VERSION}.tar.gz
tar -xzvf openssl-${SSL_VERSION}.tar.gz
cd $CRAFT_PART_SRC
cd openssl-${SSL_VERSION}
./config shared zlib
make
make install
Expand Down

0 comments on commit cafc8e4

Please sign in to comment.