summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 71e505e8ee845cfaad4b14c6f973bef8e734045f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# Maintainer: TheAirBlow <pilexet.danila at gmail dot com>
# Maintainer: C_Schmidpeter <christoph.schmidpeter at gmx dot de>
# Contributor: indjera <indjera at gmail dot com>

# Uses latest public Xamarin DevOps successfull run:
# https://dev.azure.com/xamarin/public/_build?definitionId=48&view=runs&statusFilter=succeeded
_buildid=55118 # Build ID from public Xamarin DevOps
_version=12.0.0.0 # Version supplied from any artifact filename
_deb_filename=xamarin.android-oss_${_version}_amd64.deb # .deb artifact filename
# Why use the .deb one? It already has everything we need and already
# has the mono symlinks.

pkgname=xamarin-android
pkgver=${_version}.${_buildid}
pkgrel=1
pkgdesc="Provides open-source bindings of the Android SDK for use with .NET managed languages"
arch=('x86_64')
depends=('mono>=5.0.0' 'libzip')
makedepends=('tar' 'findutils' 'jq' 'git' 'unzip' 'curl')
optdepends=('jdk8-openjdk: For building Xamarin.Android Apps'
            'rider: .NET IDE supporting Android app development via Xamarin.Forms / Xamarin.Native.'
            'rider-eap: .NET IDE supporting Android app development via Xamarin.Forms / Xamarin.Native.')
options=(!strip)
provides=('xamarin-android')
conflicts=('xamarin-android' 'xamarin-android-git')
url="https://github.com/xamarin/xamarin-android"
license=('MIT')

# Prepare build.zip
prepare() {
    cd ${srcdir}
    msg2 "Getting download url..."
    local downloadUrl=$(curl https://dev.azure.com/xamarin/public/_apis/build/builds/$_buildid/artifacts | jq -r '.value[] | select(.name=="installers-unsigned - Linux").resource.downloadUrl')
    msg2 "Downloading build.zip..."
    curl -o build.zip $downloadUrl
    msg2 "Extracting build.zip..."
    unzip -o build.zip
    msg2 "Renaming..."
    mv "installers-unsigned - Linux" "build"
}

# Package .deb artifact
package() {
    cd "${srcdir}/build"
    msg2 "Extracting .deb artifact..."
    bsdtar xf ${_deb_filename}
    msg2 "Extracting .deb data..."
    bsdtar xf data.tar.xz
    msg2 "Installing..."
    chmod -R g-w usr
    mv usr "${pkgdir}"
    msg2 "Done!"
}