Skip to content

Commit

Permalink
fix(snap): build all packages from source
Browse files Browse the repository at this point in the history
  • Loading branch information
lengau committed Dec 20, 2024
1 parent c952210 commit 148853a
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions snap/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ parts:
build-environment:
# CFLAGS for Python 3.10 and libyaml. Allows cryptography and pyyaml to find
# the appropriate system libraries.
- CFLAGS: "$(pkg-config python-3.10 yaml-0.1 --cflags)"
# - CFLAGS: "$(pkg-config python-3.10 yaml-0.1 --cflags)"
# Build all packages from source. Prevents issues like #1369.
# https://github.com/canonical/charmcraft/issues/1369
- PIP_NO_BINARY: ":all:"
Expand All @@ -149,15 +149,17 @@ parts:
rustup default 1.79
override-build: |
uv venv --relocatable $CRAFT_PART_INSTALL
uv sync --no-dev --no-editable --extra apt-jammy
uv sync --no-dev --no-editable --no-binary
. $CRAFT_PART_INSTALL/bin/activate
uv pip install 'python-apt @ https://launchpad.net/ubuntu/+archive/primary/+sourcefiles/python-apt/2.4.0ubuntu4/python-apt_2.4.0ubuntu4.tar.xz'
rm $CRAFT_PART_INSTALL/lib64
cp -v completion.bash $CRAFT_PART_INSTALL
mkdir -p $CRAFT_PART_INSTALL/libexec/charmcraft
sed -i 's|#!/bin/sh|#!/snap/charmcraft/current/bin/python3|' $CRAFT_PART_INSTALL/bin/craftctl
version="$($CRAFT_PART_INSTALL/bin/charmcraft --version | cut -d' ' -f2)"
version="$(uv pip show charmcraft|grep "Version:" | cut -d' ' -f2)"
/snap/snapcraft/current/libexec/snapcraft/craftctl set version="${version}"
[ -n "$(echo $version | grep "post")" ] && grade=devel || grade=stable
/snap/snapcraft/current/libexec/snapcraft/craftctl set grade="${grade}"
Expand Down

0 comments on commit 148853a

Please sign in to comment.