summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 8506ed03d7d87cad8dce0e08996dac6fc713ecb2 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# 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=43659 # Build ID from public Xamarin DevOps
_version=11.4.99.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')
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')
source=('https://gist.githubusercontent.com/TheAirBlow/47668a5d2403baa4a06b927ebe4dc1e0/raw/index.js'
         'https://gist.githubusercontent.com/TheAirBlow/47668a5d2403baa4a06b927ebe4dc1e0/raw/package.json')
md5sums=('SKIP' 'SKIP')

# Prepare build.zip
# We check hashes here so we don't need
# to redownload everything if hashes are valid
# (filesize is very big)
prepare() {
    cd ${srcdir}
    cd ..
    local hash
    msg2 "Downloading npm modules..."
    npm i >/dev/null 2>&1
    msg2 "Getting download url..."
    cd ${srcdir}
    msg2 "Downloading build.zip..."
    curl -o build.zip $(node index.js ${_buildid})
    msg2 "Checking MD5 hashsum..."
    cd ${srcdir}
    msg2 "Extracting build.zip..."
    unzip -o build.zip | pv -l >/dev/null
    msg2 "Renaming..."
    mv "installers-unsigned - Linux" "build"
}

# Package .deb artifact
# We do not hashes here, cause it doesn't
# download or extract anything big here
package() {
    cd "${srcdir}/build"
    msg2 "Extracting .deb artifact..."
    bsdtar xf ${_deb_filename}
    msg2 "Extracting .deb data..."
    bsdtar xf data.tar.xz
    _cleanup
    msg2 "Installing..."
    chmod -R g-w usr
    mv usr "${pkgdir}"
    msg2 "Done!"
}