Skip to content

Commit

Permalink
Build from upstream Debian package
Browse files Browse the repository at this point in the history
Closes #9, #11
  • Loading branch information
ghisvail committed Apr 17, 2019
1 parent 16ecfae commit f3e64e8
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 9,088 deletions.
3 changes: 3 additions & 0 deletions .flathub.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"only-arches": ["x86_64"]
}
8 changes: 0 additions & 8 deletions com.bitwarden.desktop.desktop

This file was deleted.

80 changes: 19 additions & 61 deletions com.bitwarden.desktop.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,27 +12,14 @@ finish-args:
- --share=network
- --talk-name=org.freedesktop.Notifications
- --talk-name=org.freedesktop.secrets
build-options:
cflags: -O2 -g
cxxflags: -O2 -g
env:
NPM_CONFIG_LOGLEVEL: info
rename-desktop-file: bitwarden.desktop
rename-icon: bitwarden
modules:
- name: nodejs
cleanup:
- /include
- /share
- /app/lib/node_modules/npm/changelogs
- /app/lib/node_modules/npm/doc
- /app/lib/node_modules/npm/html
- /app/lib/node_modules/npm/man
- /app/lib/node_modules/npm/scripts
- name: libsecret
sources:
- type: archive
url: https://nodejs.org/dist/v8.12.0/node-v8.12.0.tar.xz
sha256: 5a9dff58016c18fb4bf902d963b124ff058a550ebcd9840c677757387bce419a

- name: libsecret
url: https://gitlab.gnome.org/GNOME/libsecret/-/archive/0.18.6/libsecret-0.18.6.tar.gz
sha256: f4fa198d4e131f94d9ec84cfeaf6c124245e7ff3c0af11c76cc35332bfae5585
config-opts:
- --disable-manpages
- --disable-gtk-doc
Expand All @@ -43,51 +30,22 @@ modules:
- /include
- /lib/*.la
- /lib/pkgconfig
sources:
- type: archive
url: https://gitlab.gnome.org/GNOME/libsecret/-/archive/0.18.6/libsecret-0.18.6.tar.gz
sha256: f4fa198d4e131f94d9ec84cfeaf6c124245e7ff3c0af11c76cc35332bfae5585

- name: bitwarden
buildsystem: simple
build-options:
env:
electron_config_cache: /run/build/bitwarden/npm-cache
build-commands:
- npm install --prefix=main --offline --cache=/run/build/bitwarden/npm-cache --nodedir=/app
- npm run build --prefix=main --nodedir=/app
- mkdir -p /app/main /app/bin
- cp -ra main/* /app/main
- install -Dm644 main/resources/icons/16x16.png /app/share/icons/hicolor/16x16/apps/com.bitwarden.desktop.png
- install -Dm644 main/resources/icons/32x32.png /app/share/icons/hicolor/32x32/apps/com.bitwarden.desktop.png
- install -Dm644 main/resources/icons/48x48.png /app/share/icons/hicolor/48x48/apps/com.bitwarden.desktop.png
- install -Dm644 main/resources/icons/64x64.png /app/share/icons/hicolor/64x64/apps/com.bitwarden.desktop.png
- install -Dm644 main/resources/icons/128x128.png /app/share/icons/hicolor/128x128/apps/com.bitwarden.desktop.png
- install -Dm644 main/resources/icons/256x256.png /app/share/icons/hicolor/256x256/apps/com.bitwarden.desktop.png
- install -Dm644 main/resources/icons/512x512.png /app/share/icons/hicolor/512x512/apps/com.bitwarden.desktop.png
- install -Dm755 run.sh /app/bin/bitwarden
- install -Dm644 -t /app/share/applications com.bitwarden.desktop.desktop
- install -Dm644 -t /app/share/metainfo com.bitwarden.desktop.appdata.xml
sources:
- generated-sources.json
- type: git
url: https://github.com/bitwarden/desktop
commit: 8efa46683a3753c92af1a9cee41ced92873cefc5
dest: main
- type: patch
path: webfonts.patch
dest: main
- type: file
path: webfonts.css
dest: main/src/css
- type: archive
path: webfonts.zip
dest: main/src/css/webfonts
- type: script
commands:
- npm start --prefix=/app/main
dest-filename: run.sh
- type: file
path: com.bitwarden.desktop.desktop
only-arches:
- x86_64
url: https://github.com/bitwarden/desktop/releases/download/v1.14.0/Bitwarden-1.14.0-amd64.deb
sha256: ea645842053d9d05fb3c12cca6dfec2864b1eb5836f8d4d197220e0be16f7464
- type: file
path: com.bitwarden.desktop.appdata.xml
path: com.bitwarden.desktop.appdata.xml
buildsystem: simple
build-commands:
- ar -x Bitwarden-*.deb
- tar -xf data.tar.xz
- cp -r usr/* ${FLATPAK_DEST}
- mkdir -p ${FLATPAK_DEST}/bin
- cp -r opt/Bitwarden/* ${FLATPAK_DEST}/bin
- desktop-file-edit --set-key=Exec --set-value=${FLATPAK_DEST}/bin/bitwarden ${FLATPAK_DEST}/share/applications/bitwarden.desktop
- install -Dm644 -t /app/share/metainfo ${FLATPAK_ID}.appdata.xml
Loading

0 comments on commit f3e64e8

Please sign in to comment.