Commit 3604d94d authored by Johan Lorenzo's avatar Johan Lorenzo
Browse files

Bug 1623631 - Drop bundled mimeapps.list, mime cache and set TMPDIR to better...

Bug 1623631 - Drop bundled mimeapps.list, mime cache and set TMPDIR to better take advantage of portals. r=rail, a=pascalc

Differential Revision: https://phabricator.services.mozilla.com/D67478
parent 30b6e628
Loading
Loading
Loading
Loading
+2 −37
Original line number Diff line number Diff line
@@ -9,6 +9,7 @@ base: core18
apps:
  firefox:
    command: firefox
    command-chain: [tmpdir]
    desktop: distribution/firefox.desktop
    extensions: [gnome-3-34]
    environment:
@@ -60,46 +61,10 @@ parts:
      - -usr/lib/*/libharfbuzz*
      - -usr/lib/*/*pango*

  xdg-open:
    after: [firefox]
    plugin: nil
    source: .
    override-build: |
      snapcraftctl build
      set -eux
      mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/applications
      install -m 644 mimeapps.list $SNAPCRAFT_PART_INSTALL/usr/share/applications
      update-desktop-database -v $SNAPCRAFT_PART_INSTALL/usr/share/applications
    build-packages:
      - desktop-file-utils

  shared-mime-info:
    after: [xdg-open]
    plugin: nil
    stage-packages:
      - shared-mime-info
    override-build: |
      snapcraftctl build
      set -eux
      mkdir -p $SNAPCRAFT_PART_INSTALL/usr/share/mime
      update-mime-database $SNAPCRAFT_PART_INSTALL/usr/share/mime

  # Find files provided by the base and platform snap and ensure they aren't
  # duplicated in this snap
  cleanup:
    after: [shared-mime-info]
    plugin: nil
    build-snaps: [core18, gnome-3-28-1804]
    override-prime: |
      set -eux
      for snap in "core18" "gnome-3-28-1804"; do
        cd "/snap/$snap/current" && find . -type f,l -exec rm -f "$SNAPCRAFT_PRIME/{}" \;
      done

  # Find files provided by the base and platform snap and ensure they aren't
  # duplicated in this snap
  cleanup:
    after: [shared-mime-info]
    after: [firefox]
    plugin: nil
    build-snaps: [core18, gnome-3-34-1804]
    override-prime: |
+0 −264
Original line number Diff line number Diff line
[Default Applications]
application/csv=xdg-open.desktop
application/excel=xdg-open.desktop
application/msexcel=xdg-open.desktop
application/msword=xdg-open.desktop
application/ogg=xdg-open.desktop
application/oxps=xdg-open.desktop
application/pdf=xdg-open.desktop
application/postscript=xdg-open.desktop
application/rtf=xdg-open.desktop
application/tab-separated-values=xdg-open.desktop
application/vnd.debian.binary-package=xdg-open.desktop
application/vnd.ms-cab-compressed=xdg-open.desktop
application/vnd.lotus-1-2-3=xdg-open.desktop
application/vnd.ms-excel=xdg-open.desktop
application/vnd.ms-word=xdg-open.desktop
application/vnd.ms-xpsdocument=xdg-open.desktop
application/vnd.rn-realmedia=xdg-open.desktop
application/vnd.sun.xml.base=xdg-open.desktop
application/vnd.sun.xml.calc=xdg-open.desktop
application/vnd.sun.xml.calc.template=xdg-open.desktop
application/vnd.sun.xml.draw=xdg-open.desktop
application/vnd.sun.xml.draw.template=xdg-open.desktop
application/vnd.sun.xml.math=xdg-open.desktop
application/vnd.sun.xml.writer=xdg-open.desktop
application/vnd.sun.xml.writer.template=xdg-open.desktop
application/vnd.sun.xml.writer.global=xdg-open.desktop
application/vnd.oasis.opendocument.database=xdg-open.desktop
application/vnd.oasis.opendocument.formula=xdg-open.desktop
application/vnd.oasis.opendocument.graphics=xdg-open.desktop
application/vnd.oasis.opendocument.graphics-template=xdg-open.desktop
application/vnd.oasis.opendocument.presentation=xdg-open.desktop
application/vnd.oasis.opendocument.presentation-template=xdg-open.desktop
application/vnd.oasis.opendocument.spreadsheet=xdg-open.desktop
application/vnd.oasis.opendocument.spreadsheet-template=xdg-open.desktop
application/vnd.oasis.opendocument.text=xdg-open.desktop
application/vnd.oasis.opendocument.text-template=xdg-open.desktop
application/vnd.oasis.opendocument.text-web=xdg-open.desktop
application/vnd.oasis.opendocument.text-master=xdg-open.desktop
application/vnd.sun.xml.impress=xdg-open.desktop
application/vnd.sun.xml.impress.template=xdg-open.desktop
application/vnd.stardivision.calc=xdg-open.desktop
application/vnd.stardivision.draw=xdg-open.desktop
application/vnd.stardivision.impress=xdg-open.desktop
application/vnd.stardivision.math=xdg-open.desktop
application/vnd.stardivision.writer=xdg-open.desktop
application/mspowerpoint=xdg-open.desktop
application/vnd.ms-powerpoint=xdg-open.desktop
application/vnd.wordperfect=xdg-open.desktop
application/wordperfect=xdg-open.desktop
application/vnd.openxmlformats-officedocument.wordprocessingml.document=xdg-open.desktop
application/vnd.openxmlformats-officedocument.wordprocessingml.template=xdg-open.desktop
application/vnd.openxmlformats-officedocument.spreadsheetml.sheet=xdg-open.desktop
application/vnd.openxmlformats-officedocument.spreadsheetml.template=xdg-open.desktop
application/vnd.openxmlformats-officedocument.presentationml.slide=xdg-open.desktop
application/vnd.openxmlformats-officedocument.presentationml.slideshow=xdg-open.desktop
application/vnd.openxmlformats-officedocument.presentationml.presentation=xdg-open.desktop
application/vnd.openxmlformats-officedocument.presentationml.template=xdg-open.desktop
application/x-123=xdg-open.desktop
application/x-abiword=xdg-open.desktop
application/x-applix-spreadsheet=xdg-open.desktop
application/x-ar=xdg-open.desktop
application/x-arj=xdg-open.desktop
application/x-audacity-project=xdg-open.desktop
application/x-bzdvi=xdg-open.desktop
application/x-bzip-compressed-tar=xdg-open.desktop
application/x-bzip=xdg-open.desktop
application/x-bzpdf=xdg-open.desktop
application/x-bzpostscript=xdg-open.desktop
application/x-cbr=xdg-open.desktop
application/x-cbt=xdg-open.desktop
application/x-cbz=xdg-open.desktop
application/x-compressed-tar=xdg-open.desktop
application/x-compress=xdg-open.desktop
application/x-cab=xdg-open.desktop
application/x-ms-cab-compressed=xdg-open.desktop
application/x-deb=xdg-open.desktop
application/x-debian-package=xdg-open.desktop
application/x-dos_ms_excel=xdg-open.desktop
application/x-dvi=xdg-open.desktop
application/x-ear=xdg-open.desktop
application/x-excel=xdg-open.desktop
application/x-extension-m4a=xdg-open.desktop
application/x-extension-mp4=xdg-open.desktop
application/x-flac=xdg-open.desktop
application/x-glade=xdg-open.desktop
application/x-gnumeric=xdg-open.desktop
application/x-gtar=xdg-open.desktop
application/x-gzdvi=xdg-open.desktop
application/x-gzip=xdg-open.desktop
application/x-gzpdf=xdg-open.desktop
application/x-gzpostscript=xdg-open.desktop
application/xhtml+xml=xdg-open.desktop
application/x-jar=xdg-open.desktop
application/x-java-archive=xdg-open.desktop
application/x-java-jnlp-file=xdg-open.desktop
application/x-lha=xdg-open.desktop
application/x-lhz=xdg-open.desktop
application/xls=xdg-open.desktop
application/x-lzop=xdg-open.desktop
application/x-matroska=xdg-open.desktop
application/x-mps=xdg-open.desktop
application/x-ms-excel=xdg-open.desktop
application/x-msexcel=xdg-open.desktop
application/x-ogg=xdg-open.desktop
application/x-oleo=xdg-open.desktop
application/x-perl=xdg-open.desktop
application/x-planperfect=xdg-open.desktop
application/x-quattropro=xdg-open.desktop
application/x-rar-compressed=xdg-open.desktop
application/x-rar=xdg-open.desktop
application/x-rpm=xdg-open.desktop
application/x-sc=xdg-open.desktop
application/x-shockwave-flash=xdg-open.desktop
application/x-sylk=xdg-open.desktop
application/x-tar=xdg-open.desktop
application/x-war=xdg-open.desktop
application/x-xbase=xdg-open.desktop
application/x-xls=xdg-open.desktop
application/x-xzpdf=xdg-open.desktop
application/x-zip-compressed=xdg-open.desktop
application/x-zip=xdg-open.desktop
application/x-zoo=xdg-open.desktop
application/zip=xdg-open.desktop
audio/3gpp=xdg-open.desktop
audio/ac3=xdg-open.desktop
audio/AMR=xdg-open.desktop
audio/AMR-WB=xdg-open.desktop
audio/basic=xdg-open.desktop
audio/flac=xdg-open.desktop
audio/midi=xdg-open.desktop
audio/mp4=xdg-open.desktop
audio/mpeg=xdg-open.desktop
audio/mpegurl=xdg-open.desktop
audio/ogg=xdg-open.desktop
audio/prs.sid=xdg-open.desktop
audio/vnd.rn-realaudio=xdg-open.desktop
audio/x-ape=xdg-open.desktop
audio/x-flac=xdg-open.desktop
audio/x-gsm=xdg-open.desktop
audio/x-it=xdg-open.desktop
audio/x-m4a=xdg-open.desktop
audio/x-matroska=xdg-open.desktop
audio/x-mod=xdg-open.desktop
audio/x-mp3=xdg-open.desktop
audio/x-mpeg=xdg-open.desktop
audio/x-mpegurl=xdg-open.desktop
audio/x-ms-asf=xdg-open.desktop
audio/x-ms-asx=xdg-open.desktop
audio/x-ms-wax=xdg-open.desktop
audio/x-ms-wma=xdg-open.desktop
audio/x-musepack=xdg-open.desktop
audio/x-pn-aiff=xdg-open.desktop
audio/x-pn-au=xdg-open.desktop
audio/x-pn-realaudio=xdg-open.desktop
audio/x-pn-realaudio-plugin=xdg-open.desktop
audio/x-pn-wav=xdg-open.desktop
audio/x-pn-windows-acm=xdg-open.desktop
audio/x-realaudio=xdg-open.desktop
audio/x-real-audio=xdg-open.desktop
audio/x-sbc=xdg-open.desktop
audio/x-scpls=xdg-open.desktop
audio/x-speex=xdg-open.desktop
audio/x-tta=xdg-open.desktop
audio/x-wav=xdg-open.desktop
audio/x-wavpack=xdg-open.desktop
audio/x-vorbis=xdg-open.desktop
audio/x-vorbis+ogg=xdg-open.desktop
audio/x-xm=xdg-open.desktop
image/bmp=xdg-open.desktop
image/gif=xdg-open.desktop
image/jpeg=xdg-open.desktop
image/jpg=xdg-open.desktop
image/pjpeg=xdg-open.desktop
image/png=xdg-open.desktop
image/svg+xml=xdg-open.desktop
image/tiff=xdg-open.desktop
image/vnd.djvu=xdg-open.desktop
image/vnd.rn-realpix=xdg-open.desktop
image/x-bmp=xdg-open.desktop
image/x-bzeps=xdg-open.desktop
image/x-eps=xdg-open.desktop
image/x-gray=xdg-open.desktop
image/x-gzeps=xdg-open.desktop
image/x-icb=xdg-open.desktop
image/x-ico=xdg-open.desktop
image/x-png=xdg-open.desktop
image/x-portable-anymap=xdg-open.desktop
image/x-portable-bitmap=xdg-open.desktop
image/x-portable-graymap=xdg-open.desktop
image/x-portable-pixmap=xdg-open.desktop
image/x-psd=xdg-open.desktop
image/x-xbitmap=xdg-open.desktop
image/x-xpixmap=xdg-open.desktop
inode/directory=xdg-open.desktop
misc/ultravox=xdg-open.desktop
multipart/x-zip=xdg-open.desktop
text/abiword=xdg-open.desktop
text/calendar=xdg-open.desktop
text/comma-separated-values=xdg-open.desktop
text/csv=xdg-open.desktop
text/html=xdg-open.desktop
text/plain=xdg-open.desktop
text/richtext=xdg-open.desktop
text/rtf=xdg-open.desktop
text/spreadsheet=xdg-open.desktop
text/tab-separated-values=xdg-open.desktop
text/x-comma-separated-values=xdg-open.desktop
text/x-c++hdr=xdg-open.desktop
text/x-c++src=xdg-open.desktop
text/x-xsrc=xdg-open.desktop
text/x-chdr=xdg-open.desktop
text/x-csrc=xdg-open.desktop
text/x-dtd=xdg-open.desktop
text/x-java=xdg-open.desktop
text/mathml=xdg-open.desktop
text/x-python=xdg-open.desktop
text/x-sql=xdg-open.desktop
text/xml=xdg-open.desktop
video/3gpp=xdg-open.desktop
video/dv=xdg-open.desktop
video/fli=xdg-open.desktop
video/flv=xdg-open.desktop
video/mp2t=xdg-open.desktop
video/mp4=xdg-open.desktop
video/mp4v-es=xdg-open.desktop
video/mpeg=xdg-open.desktop
video/msvideo=xdg-open.desktop
video/ogg=xdg-open.desktop
video/quicktime=xdg-open.desktop
video/vivo=xdg-open.desktop
video/vnd.divx=xdg-open.desktop
video/vnd.rn-realvideo=xdg-open.desktop
video/vnd.vivo=xdg-open.desktop
video/webm=xdg-open.desktop
video/x-anim=xdg-open.desktop
video/x-avi=xdg-open.desktop
video/x-flc=xdg-open.desktop
video/x-fli=xdg-open.desktop
video/x-flic=xdg-open.desktop
video/x-flv=xdg-open.desktop
video/x-m4v=xdg-open.desktop
video/x-matroska=xdg-open.desktop
video/x-mpeg=xdg-open.desktop
video/x-ms-asf=xdg-open.desktop
video/x-ms-asx=xdg-open.desktop
video/x-msvideo=xdg-open.desktop
video/x-ms-wm=xdg-open.desktop
video/x-ms-wmv=xdg-open.desktop
video/x-ms-wmx=xdg-open.desktop
video/x-ms-wvx=xdg-open.desktop
video/x-nsv=xdg-open.desktop
video/x-ogm+ogg=xdg-open.desktop
video/x-theora+ogg=xdg-open.desktop
video/x-totem-stream=xdg-open.desktop
x-content/video-dvd=xdg-open.desktop
x-content/video-vcd=xdg-open.desktop
x-content/video-svcd=xdg-open.desktop
x-content/audio-cdda=xdg-open.desktop
x-content/audio-dvd=xdg-open.desktop
x-content/audio-player=xdg-open.desktop
x-content/image-dcf=xdg-open.desktop
x-content/image-picturecd=xdg-open.desktop
zz-application/zz-winassoc-xls=xdg-open.desktop
+3 −1
Original line number Diff line number Diff line
@@ -64,9 +64,11 @@ for i in *.deb; do
    dpkg-deb --fsys-tarfile $i | tar xv -C "$SOURCE_DEST" --wildcards "./usr/share/locale-langpack/*/LC_MESSAGES/gtk30.mo" || true
done

# Add wrapper script to set TMPDIR appropriate for the snap
cp -v "$SCRIPT_DIRECTORY/tmpdir" "$SOURCE_DEST"

# Generate snapcraft manifest
sed -e "s/@VERSION@/${VERSION}/g" -e "s/@BUILD_NUMBER@/${BUILD_NUMBER}/g" ${PRODUCT}.snapcraft.yaml.in > "${WORKSPACE}/snapcraft.yaml"
cp -v "$SCRIPT_DIRECTORY/mimeapps.list" "$WORKSPACE"
cd "${WORKSPACE}"

# Make sure snapcraft knows we're building amd64, even though we may not be on this arch.
+6 −0
Original line number Diff line number Diff line
#!/bin/bash

# Set TMPDIR to be under the user's default Downloads dir
export TMPDIR=$(xdg-user-dir DOWNLOAD)/firefox.tmp

exec "$@"