mirror of
https://github.com/VSCodium/vscodium.git
synced 2026-04-24 20:00:15 +10:00
ci(linux): wip for aur and snap [skip ci]
This commit is contained in:
88
stores/snapcraft/stable/snap/snapcraft.yaml
Normal file
88
stores/snapcraft/stable/snap/snapcraft.yaml
Normal file
@@ -0,0 +1,88 @@
|
||||
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
|
||||
ARCHITECTURE=$(dpkg --print-architecture)
|
||||
# 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)
|
||||
DEB_URL=$(jq -r 'map(select(.tag_name == "'"$VERSION"'"))|first.assets[].browser_download_url|select(endswith("'"_$ARCHITECTURE.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
|
||||
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
|
||||
|
||||
electron-launch:
|
||||
after:
|
||||
- codium
|
||||
plugin: dump
|
||||
source: snap/local
|
||||
|
||||
apps:
|
||||
codium:
|
||||
command: electron-launch $SNAP/snap/usr/share/codium/bin/codium --no-sandbox
|
||||
common-id: codium.desktop
|
||||
|
||||
url-handler:
|
||||
command: electron-launch $SNAP/snap/usr/share/codium/bin/codium --open-url --no-sandbox
|
||||
@@ -1,81 +0,0 @@
|
||||
name: @@SNAP_NAME@@
|
||||
version: '@@SNAP_VERSION@@'
|
||||
summary: Code editing. Redefined.
|
||||
description: |
|
||||
Binary releases of Visual Studio Code without branding/telemetry/licensing
|
||||
|
||||
base: core20
|
||||
grade: stable
|
||||
confinement: classic
|
||||
compression: lzo
|
||||
|
||||
parts:
|
||||
@@SNAP_NAME@@:
|
||||
plugin: dump
|
||||
source: .
|
||||
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
|
||||
build-attributes:
|
||||
- enable-patchelf
|
||||
build-packages:
|
||||
- patchelf
|
||||
override-build: |
|
||||
snapcraftctl build
|
||||
patchelf --force-rpath --set-rpath '$ORIGIN/../../lib/x86_64-linux-gnu:$ORIGIN:/snap/core20/current/lib/x86_64-linux-gnu' $SNAPCRAFT_PART_INSTALL/snap/usr/share/@@SNAP_NAME@@/chrome_crashpad_handler
|
||||
|
||||
cleanup:
|
||||
after:
|
||||
- @@SNAP_NAME@@
|
||||
plugin: nil
|
||||
build-snaps:
|
||||
- core20
|
||||
build-packages:
|
||||
- patchelf
|
||||
override-prime: |
|
||||
set -eux
|
||||
for snap in "core20"; do
|
||||
cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
|
||||
done
|
||||
patchelf --print-rpath $SNAPCRAFT_PRIME/snap/usr/share/@@SNAP_NAME@@/chrome_crashpad_handler
|
||||
|
||||
apps:
|
||||
@@SNAP_NAME@@:
|
||||
command: electron-launch $SNAP/snap/usr/share/@@SNAP_NAME@@/bin/@@SNAP_NAME@@ --no-sandbox
|
||||
common-id: @@SNAP_NAME@@.desktop
|
||||
|
||||
url-handler:
|
||||
command: electron-launch $SNAP/snap/usr/share/@@SNAP_NAME@@/bin/@@SNAP_NAME@@ --open-url --no-sandbox
|
||||
Reference in New Issue
Block a user