Guest User

Untitled

a guest
Sep 30th, 2020
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 2.84 KB | None | 0 0
  1. name: wine-platform-5-devel
  2. adopt-info: wine
  3. summary: wine platform snap it provides devel WINE 5 for snaps
  4. description: |
  5.  This snap creates a WINE devel 5 via content sharing to be used by other snaps that are using WINE.
  6.  
  7. grade: stable
  8. confinement: strict
  9. architectures:
  10.   - build-on: amd64
  11.   - build-on: i386
  12. base: core18
  13.  
  14. slots:
  15.   wine-5-devel:
  16.     interface: content
  17.     source:
  18.       read:
  19.       - $SNAP/opt/wine-devel
  20.  
  21. parts:
  22.   faudio-amd64:
  23.     source: https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/amd64/libfaudio0_19.07-0~bionic_amd64.deb
  24.     plugin: dump
  25.     source-type: deb
  26.     override-build: |
  27.       snapcraftctl build
  28.   faudio-i386:
  29.     source: https://download.opensuse.org/repositories/Emulators:/Wine:/Debian/xUbuntu_18.04/i386/libfaudio0_19.07-0~bionic_i386.deb
  30.     plugin: dump
  31.     source-type: deb
  32.     override-build: |
  33.       snapcraftctl build
  34.   wine:
  35.     plugin: nil
  36.     build-packages:
  37.       - dpkg
  38.       - wget
  39.     override-build: |
  40.       snapcraftctl build
  41.  
  42.       ARCH="$(dpkg --print-architecture)"
  43.       WINE_VER="$(wget -qO- https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/binary-amd64/ | grep wine-dev | sed 's|_| |g;s|~| |g' | awk '{print $5}' | tail -n1)"
  44.  
  45.       # set snap version
  46.       snapcraftctl set-version "$WINE_VER"
  47.  
  48.       # wget and dpkg extract the wine debs
  49.       ## supporting binaries which are arch-specific but the same filenames in both architectures so we only install the native architecture
  50.       DEB_URLS="$DEB_URLS https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/binary-${ARCH}/wine-devel_${WINE_VER}~bionic_${ARCH}.deb"
  51.  
  52.       ## wine loaders - this one is the native system architecture
  53.       DEB_URLS="$DEB_URLS https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/binary-${ARCH}/wine-devel-${ARCH}_${WINE_VER}~bionic_${ARCH}.deb"
  54.  
  55.       if [ "$ARCH" = "amd64" ]; then
  56.         ## on amd64 builds we need to also bundle the i386 wine loaders
  57.         DEB_URLS="$DEB_URLS https://dl.winehq.org/wine-builds/ubuntu/dists/bionic/main/binary-i386/wine-devel-i386_${WINE_VER}~bionic_i386.deb"
  58.       fi
  59.  
  60.       for DEB_URL in ${DEB_URLS}; do
  61.         DEB=$(basename "${DEB_URL}")
  62.         echo "Downloading ${DEB_URL}..."
  63.         wget --quiet "${DEB_URL}" -O "${SNAPCRAFT_PART_INSTALL}/${DEB}"
  64.         echo "Unpacking ${DEB}..."
  65.         dpkg -x "${SNAPCRAFT_PART_INSTALL}/${DEB}" ${SNAPCRAFT_PART_INSTALL}
  66.         rm -f "${SNAPCRAFT_PART_INSTALL}/${DEB}"
  67.       done
  68.  
  69.       # Cleanup
  70.       rm -rf ${SNAPCRAFT_PART_INSTALL}/opt/wine-devel/share/applications
  71.       rm -rf ${SNAPCRAFT_PART_INSTALL}/opt/wine-devel/share/man
  72.       rm -rf ${SNAPCRAFT_PART_INSTALL}/usr
  73.  
  74.       # Disable winemenubuilder
  75.       sed -i 's/winemenubuilder.exe -a -r/winemenubuilder.exe -r/g' "${SNAPCRAFT_PART_INSTALL}"/opt/wine-devel/share/wine/wine.inf
  76.  
Add Comment
Please, Sign In to add comment