summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 65e3e9065fa8311d99c649940c0d9b7761f3ee5b (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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# Maintainer: acxz <akashpatel2008 at yahoo dot com>
pkgname=ardupilot-copter-sitl
pkgver=4.2.2
pkgdesc="Advanced, Fully-Featured, and Reliable Autopilot Software (Copter,
SITL)"
url='https://ardupilot.org'
arch=('i686' 'x86_64')
pkgrel=1
license=('GPLv3')
provides=('ardupilot-sitl')
makedepends=('waf' 'python-setuptools' 'git')

# Deps taken from:
# https://github.com/ArduPilot/ardupilot/blob/master/Tools/environment_install/install-prereqs-ubuntu.sh
sitl_depends=(
    libtool
    libxml2
    libxslt
    python
    python-pip
    python-setuptools
    python-numpy
    python-pyparsing
    python-psutil
    xterm
    python-matplotlib
    python-pyserial
    python-scipy
    python-opencv
    csfml
    sfml
    python-yaml
    python-argparse
    python-wxpython
)
px4_depends=()
arm_linux_depends=(
    #arm-linux-gnueabihf-gcc
    #arm-linux-gnueabihf-pkg-config
)
coverage_depends=(
    lcov
    gcovr
)
python_depends=(
    python-future
    python-lxml
    python-pymavlink
    mavproxy
    python-pexpect
    flake8
    python-geocoder
    python-empy
    python-click
    python-decorator
    python-pygame
    python-intelhex
)
depends=(
    ${sitl_depends[@]}
    ${px4_depends[@]}
    ${arm_linux_depends[@]}
    ${coverage_depends[@]}
    ${python_depends[@]}
    ${submodule_depends[@]}
    lsb-release
)
source=("${pkgname}-${pkgver}::git+https://github.com/ArduPilot/ardupilot.git#tag=Copter-${pkgver}"
        "${pkgname}-libuavcan::git+https://github.com/DroneCAN/libuavcan.git"
        "${pkgname}-waf::git+https://github.com/ArduPilot/waf.git"
        "${pkgname}-benchmark::git+https://github.com/google/benchmark.git"
        "${pkgname}-mavlink::git+https://github.com/ArduPilot/mavlink.git"
        "${pkgname}-googletest::git+https://github.com/ArduPilot/googletest.git"
        "${pkgname}-ChibiOS::git+https://github.com/ArduPilot/ChibiOS.git"
        "${pkgname}-gsoap::git+https://github.com/ArduPilot/gsoap.git"
        "${pkgname}-DSDL::git+https://github.com/DroneCAN/DSDL.git"
        "${pkgname}-CrashDebug::git+https://github.com/ardupilot/CrashDebug.git"
        "${pkgname}-pydronecan::git+https://github.com/DroneCAN/pydronecan.git"
        "${pkgname}-dronecan_dsdlc::git+https://github.com/DroneCAN/dronecan_dsdlc.git"
        "${pkgname}-libcanard::git+https://github.com/DroneCAN/libcanard.git"
        "uninitialized.patch::https://patch-diff.githubusercontent.com/raw/ArduPilot/ardupilot/pull/21183.patch"
)
sha256sums=('SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
            'SKIP'
)

prepare() {
    cd "$srcdir/${pkgname}-${pkgver}"

    git submodule init

    git config submodule."modules/uavcan".url "${srcdir}/${pkgname}"-libuavcan
    git config submodule."modules/waf".url "${srcdir}/${pkgname}"-waf
    git config submodule."modules/gbenchmark".url "${srcdir}/${pkgname}"-benchmark
    git config submodule."modules/mavlink".url "${srcdir}/${pkgname}"-mavlink
    git config submodule."gtest".url "${srcdir}/${pkgname}"-googletest
    git config submodule."modules/ChibiOS".url "${srcdir}/${pkgname}"-ChibiOS
    git config submodule."modules/gsoap".url "${srcdir}/${pkgname}"-gsoap
    git config submodule."modules/DroneCAN/DSDL".url "${srcdir}/${pkgname}"-DSDL
    # git config submodule."modules/CrashDebug".url "${srcdir}/${pkgname}"-CrashDebug
    git config submodule."modules/DroneCAN/pydronecan".url "${srcdir}/${pkgname}"-pydronecan
    git config submodule."modules/DroneCAN/dronecan_dsdlc".url "${srcdir}/${pkgname}"-dronecan_dsdlc
    git config submodule."modules/DroneCAN/libcanard".url "${srcdir}/${pkgname}"-libcanard

    git submodule update --init --recursive

    patch -Np1 -i "${srcdir}"/uninitialized.patch
}

build() {
    cd "$srcdir/${pkgname}-${pkgver}"
    waf configure --board sitl
    waf copter
}

package() {
    cd "$srcdir/${pkgname}-${pkgver}"
    DESTDIR="${pkgdir}/" waf install
}