Skip to content

Commit

Permalink
update rockcraft with changes relating to 24.04 base
Browse files Browse the repository at this point in the history
  • Loading branch information
Thanhphan1147 committed Nov 28, 2024
1 parent 4dc8a2f commit 23383db
Showing 1 changed file with 24 additions and 15 deletions.
39 changes: 24 additions & 15 deletions synapse_rock/rockcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,24 @@ parts:
- python3-dev
- python3-pip
- python3-setuptools
- python3-venv
- zlib1g-dev
stage-packages:
- bash
- coreutils
- curl
- gosu
- gpg
- gpg-agent
- libffi-dev
- libicu70
- libicu74
- libjemalloc2
- libjpeg-turbo8
- libpq5
- libssl-dev
- libwebp7
- openssl
- python3
- python3-pip
- xmlsec1
stage-snaps:
- aws-cli
Expand All @@ -123,35 +124,43 @@ parts:
mkdir -p /rust /cargo /synapse /install
curl -m 30 -sSf https://sh.rustup.rs | sh -s -- -y --no-modify-path --default-toolchain=$RUST_VERSION --profile minimal
/rust/toolchains/$RUST_VERSION-x86_64-unknown-linux-gnu/bin/rustc -V > $CRAFT_PART_INSTALL/rust-version
pip3 install -U pip setuptools
pip3 install --root-user-action=ignore "poetry==$POETRY_VERSION"
#
# install synapse requirements
pip3 install --break-system-packages --root-user-action=ignore "poetry==$POETRY_VERSION"
cp pyproject.toml poetry.lock /synapse/
/usr/local/bin/poetry export --extras all -o /synapse/requirements.txt
pip3 install --prefix="/install" --no-deps --no-warn-script-location -r /synapse/requirements.txt
$CRAFT_PART_INSTALL/usr/local/bin/poetry export --extras all -o /synapse/requirements.txt
pip3 install --break-system-packages --prefix="/install" --no-deps --no-warn-script-location -r /synapse/requirements.txt
#
# install synapse stats exporter
git clone https://github.com/canonical/synapse_stats_exporter.git
cd synapse_stats_exporter
pip3 install --prefix="/install" --no-warn-script-location -U .
pip3 --python=/usr/bin/python3 install --break-system-packages --prefix="/install" --no-warn-script-location -U .
cd ..
#
# install s3 storage provider
git clone --branch v1.4.0 --depth 1 https://github.com/matrix-org/synapse-s3-storage-provider
cd synapse-s3-storage-provider
pip3 install --prefix="/install" --no-warn-script-location -U .
pip3 install --break-system-packages --prefix="/install" --no-warn-script-location -U .
cd ..
cp -r synapse /synapse/
cp -r rust /synapse/
cp pyproject.toml README.rst build_rust.py Cargo.toml Cargo.lock /synapse/
pip3 install --prefix="/install" --no-deps --no-warn-script-location /synapse[all];
#
# install synapse invite checker
git clone https://git.buechner.me/nbuechner/synapse-invite-checker
cd synapse-invite-checker
git checkout ab6c8b78d78c4cbf31e1a30981ae45c09285b34a
pip3 install --prefix="/install" --no-warn-script-location -U .
pip3 install --break-system-packages --prefix="/install" --no-warn-script-location -U .
cd ..
#
# install synapse
cp -r synapse /synapse/
cp -r rust /synapse/
cp pyproject.toml README.rst build_rust.py Cargo.toml Cargo.lock /synapse/
pip3 install --break-system-packages --prefix="/install" --no-deps --no-warn-script-location /synapse[all];
# fix issue while creating file
# https://github.com/element-hq/synapse/issues/17882
pip3 install --prefix="/install" --force-reinstall -v "Twisted==24.7.0"
pip3 install --break-system-packages --prefix="/install" --force-reinstall -v "Twisted==24.7.0"
cp docker/start.py $CRAFT_PART_INSTALL/
chmod 755 $CRAFT_PART_INSTALL/start.py
cp -r docker/conf $CRAFT_PART_INSTALL/
cp -r /usr/local $CRAFT_PART_INSTALL/usr/
cp -r /install/local/* $CRAFT_PART_INSTALL/usr/local/
mkdir -p $CRAFT_PART_INSTALL/usr/local/attributemaps
chmod 755 $CRAFT_PART_INSTALL/usr/local/attributemaps
Expand Down

0 comments on commit 23383db

Please sign in to comment.