vscodium/stores/snapcraft/stable/snap/snapcraft.yaml

97 lines
2.9 KiB
YAML
Raw Normal View History

name: codium
adopt-info: codium
summary: Code editing. Redefined.
description: |
Binary releases of Code without branding/telemetry/licensing
base: core20
grade: stable
confinement: classic
compression: lzo
parts:
codium:
plugin: nil
override-build: |
set -eu
# Get GitHub releases
wget --quiet https://api.github.com/repos/VSCodium/vscodium/releases -O latest.json
VERSION=$(jq -r 'sort_by(.tag_name)|last.tag_name' latest.json)
2024-02-25 14:00:05 -05:00
DEB_URL=$(jq -r 'map(select(.tag_name == "'"$VERSION"'"))|first.assets[].browser_download_url|select(endswith("'"_$SNAPCRAFT_TARGET_ARCH.deb"'"))' latest.json)
DEB=$(basename "${DEB_URL}")
# Downloading .deb"
wget "${DEB_URL}" -O "${SNAPCRAFT_PART_INSTALL}/${DEB}"
# Unpacking .deb"
dpkg -x "${SNAPCRAFT_PART_INSTALL}/${DEB}" ${SNAPCRAFT_PART_INSTALL}
rm -f latest.json
rm -f "${SNAPCRAFT_PART_INSTALL}/${DEB}"
# Set version
snapcraftctl set-version "$VERSION"
# Correct path to icon.
sed -i 's|Icon=vscodium|Icon=${SNAP}/usr/share/pixmaps/vscodium.png|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium.desktop
2024-02-25 14:00:05 -05:00
#sed -i 's|Exec=/usr/share/codium/codium|Exec=codium|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium.desktop
sed -i 's|Icon=vscodium|Icon=/usr/share/pixmaps/vscodium.png|g' ${SNAPCRAFT_PART_INSTALL}/usr/share/applications/codium-url-handler.desktop
build-packages:
- wget
- jq
stage-packages:
- ca-certificates
- libasound2
- libatk-bridge2.0-0
- libatk1.0-0
- libatspi2.0-0
- libcairo2
- libcanberra-gtk3-module
- libcurl3-gnutls
- libcurl3-nss
- libcurl4
- libdrm2
- libgbm1
- libgl1
- libglib2.0-0
- libgtk-3-0
- libibus-1.0-5
- libnss3
- libpango-1.0-0
- libsecret-1-0
- libxcomposite1
- libxdamage1
- libxfixes3
- libxkbcommon0
- libxkbfile1
- libxrandr2
- libxss1
- locales-all
- packagekit-gtk3-module
- xdg-utils
prime:
- -usr/share/doc
- -usr/share/fonts
- -usr/share/icons
- -usr/share/lintian
- -usr/share/man
- -usr/share/codium/chrome-sandbox
2024-02-25 14:00:05 -05:00
build-attributes:
- enable-patchelf
override-prime: |
set -eux
craftctl default
for snap in "core20"; do
cd /snap/$snap/current/usr/lib/$SNAPCRAFT_ARCH_TRIPLET
find . -type f,l -name "*.so*" -exec bash -c "rm -f $SNAPCRAFT_PART_INSTALL/usr/lib/$SNAPCRAFT_ARCH_TRIPLET/{}*" \;
done
electron-launch:
after:
- codium
plugin: dump
2024-02-25 14:00:05 -05:00
source: snap/local/bin
apps:
codium:
command: electron-launch $SNAP/usr/share/codium/bin/codium --no-sandbox
common-id: codium.desktop
url-handler:
command: electron-launch $SNAP/usr/share/codium/bin/codium --open-url --no-sandbox