This commit is contained in:
Evan Simkowitz 2024-03-15 12:07:24 -04:00
parent 0649dbb15c
commit d9f38f3cbc
No known key found for this signature in database

View File

@ -1,69 +1,116 @@
app-id: dev.commandline.waveterm app-id: com.visualstudio.code
runtime: org.freedesktop.Platform default-branch: stable
runtime: org.freedesktop.Sdk
runtime-version: '23.08' runtime-version: '23.08'
sdk: org.freedesktop.Sdk sdk: org.freedesktop.Sdk
base: org.electronjs.Electron2.BaseApp base: org.electronjs.Electron2.BaseApp
base-version: '23.08' base-version: '23.08'
command: wave command: code
tags: [proprietary]
separate-locales: false
finish-args: finish-args:
- --share=ipc - --require-version=0.10.3
- --share=network - --share=network
- --socket=wayland - --share=ipc
- --socket=x11 - --socket=x11
- --socket=system-bus - --socket=pulseaudio
- --socket=session-bus - --socket=ssh-auth
- --device=dri
- --device=all - --device=all
- --env=XDG_CURRENT_DESKTOP=Unity - --allow=devel
- --filesystem=host
- --env=NPM_CONFIG_GLOBALCONFIG=/app/etc/npmrc
- --env=LD_LIBRARY_PATH=/app/lib
# required to fix cursor scaling on wayland
- --env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons - --env=XCURSOR_PATH=/run/host/user-share/icons:/run/host/share/icons
- --talk-name=org.kde.StatusNotifierWatcher - --system-talk-name=org.freedesktop.login1
- --talk-name=org.freedesktop.Notifications - --talk-name=org.freedesktop.Notifications
- --talk-name=org.freedesktop.secrets - --talk-name=org.freedesktop.secrets
- --talk-name=org.freedesktop.Flatpak
- --talk-name=com.canonical.AppMenu.Registrar - --talk-name=com.canonical.AppMenu.Registrar
- --system-talk-name=org.freedesktop.login1 - --talk-name=com.canonical.AppMenu.Registrar.*
- --filesystem=host add-extensions:
- --filesystem=home com.visualstudio.code.tool:
- --persist= directory: tools
rename-desktop-file: Wave.desktop subdirectories: true
rename-icon: Wave version: '23.08'
add-ld-path: lib
no-autodownload: true
cleanup:
- /include
- /lib/pkgconfig
- /share/gtk-doc
- '*.la'
modules: modules:
- name: waveterm-desktop - shared-modules/libusb/libusb.json
- name: vscode
buildsystem: simple buildsystem: simple
build-commands: build-commands:
- ar -x Wave*.deb - install -D code.sh /app/bin/code
- rm -f Wave*.deb - install -Dm644 vscode_64.png /app/share/icons/hicolor/64x64/apps/com.visualstudio.code.png
- tar -xf data.tar.xz - install -Dm644 vscode_128.png /app/share/icons/hicolor/128x128/apps/com.visualstudio.code.png
- rm -f control.tar.gz data.tar.xz debian-binary - install -Dm644 vscode_256.png /app/share/icons/hicolor/256x256/apps/com.visualstudio.code.png
- cp -r opt/* usr/* $FLATPAK_DEST - install -Dm644 vscode_512.png /app/share/icons/hicolor/512x512/apps/com.visualstudio.code.png
- rm -rf opt usr - install -Dm644 com.visualstudio.code.metainfo.xml -t /app/share/metainfo
- install wave.sh $FLATPAK_DEST/bin/wave - install -Dm644 com.visualstudio.code.desktop -t /app/share/applications
- install -D -m 644 -t $FLATPAK_DEST/share/metainfo $FLATPAK_ID.metainfo.xml - install -Dm644 com.visualstudio.code-url-handler.desktop -t /app/share/applications
- desktop-file-edit --set-key=Exec --set-value="Wave %U" $FLATPAK_DEST/share/applications/Wave.desktop - install -Dm644 com.visualstudio.code-workspace.xml -t /app/share/mime/packages
- rm -rf "${FLATPAK_DEST}/share/icons/hicolor/1024x1024/" - install -Dm644 npmrc -t /app/etc
- install -Dm644 flatpak-warning.txt -t /app/share/vscode
# To allow separate locales - install -D apply_extra -t /app/bin
# https://searchfox.org/mozilla-central/rev/8a4f55bc09ffc5c25dcb4586c51ae4a9fee77b4c/taskcluster/docker/firefox-flatpak/runme.sh#131-133 - cp /usr/bin/ar /app/bin
- | - ARCH_TRIPLE=$(gcc --print-multiarch) && cp /usr/lib/${ARCH_TRIPLE}/libbfd-*.so
for lang in ${FLATPAK_DEST}/Wave/locales/*.pak /app/lib
do - ARCH_TRIPLE=$(gcc --print-multiarch) && ln -s /usr/lib/${ARCH_TRIPLE}/libtinfo.so/app/lib/libtinfo.so.5
locale="$(basename -s .pak $lang)" - mkdir /app/tools
install -Dm644 -t "${FLATPAK_DEST}/share/runtime/locale/${locale%%-*}/" "$lang"
ln -sf "${FLATPAK_DEST}/share/runtime/locale/${locale%%-*}/$(basename $lang)" "${FLATPAK_DEST}/Wave/locales/$(basename $lang)"
done
sources: sources:
- type: script
dest-filename: apply_extra
commands:
- ar x code.deb
- tar xf data.tar.xz
- mv usr/share/code vscode
- rm -r code.deb control.tar.* data.tar.xz debian-binary usr
- type: file - type: file
only-arches: path: code.sh
- x86_64 - type: file
path: flatpak-warning.txt
- type: file
path: npmrc
- type: file
path: com.visualstudio.code.metainfo.xml
- type: file
path: com.visualstudio.code.desktop
- type: file
path: com.visualstudio.code-url-handler.desktop
- type: file
path: com.visualstudio.code-workspace.xml
- type: file
path: icons/vscode_64.png
- type: file
path: icons/vscode_128.png
- type: file
path: icons/vscode_256.png
- type: file
path: icons/vscode_512.png
- type: extra-data
filename: code.deb
only-arches: [x86_64]
url: <to-replace> url: <to-replace>
sha256: <to-replace> sha256: <to-replace>
size: <to-replace>
x-checker-data: x-checker-data:
type: electron-updater type: electron-updater
url: https://dl.waveterm.dev/releases/latest-linux.yml url: https://dl.waveterm.dev/releases/latest-linux.yml
- type: script is-main-source: true
dest-filename: wave.sh
commands: - name: host-spawn
- export TMPDIR="$XDG_RUNTIME_DIR/app/$FLATPAK_ID" buildsystem: simple
- exec zypak-wrapper /app/Wave/Wave --ozone-platform-hint=auto build-commands:
--enable-features=WaylandWindowDecorations "$@" - install -Dm755 host-spawn /app/bin/host-spawn
sources:
- type: file - type: file
path: dev.commandline.waveterm.metainfo.xml url: https://github.com/1player/host-spawn/releases/download/1.5.0/host-spawn-x86_64
sha256: dbf67e7e111c4fe1edb0c642cbb4193064ca5b384aeb1054fc2befba6ed88b83
dest-filename: host-spawn
only-arches: [x86_64]