blob: 38e3e1794cc8f0fa6d8dc9237c7816c4a748970b (
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
|
# Maintainer: Will Price <willprice94+arch@gmail.com>
# Contributor: Andrew67 (.desktop file, icon, 64bit compatibility)
pkgname=energia
pkgver=0017
pkgrel=1
pkgdesc="Energia is a Arduino IDE clone for use with the MSP430 launchpad"
arch=('i686' 'x86_64')
url="http://energia.nu/"
license=('GPL')
depends=(java-environment java-rxtx)
provides=('energia')
# staticlibs keeps all *.a files which are necessary since we bundle a toolchain
# !strip disable stripping of debug symbols which are useful
options=(!strip staticlibs)
install='energia.install'
source=('energia.desktop'
'10-msp430-launchpad.rules')
md5sums=('a7ce061d9fc0f9530e058204e532b40b'
'dcdf66ac4ae446dcfadbcd6a2dbb6f31')
if [[ $CARCH == "x86_64" ]]; then
source+=("$pkgname-$pkgver-$CARCH.tgz::http://energia.nu/downloads/downloadv3.php?file=energia-0101E$pkgver-linux64.tgz")
md5sums+=('cbb348ff40c2f9d42c025eb9a6484ae2')
elif [[ $CARCH == "i686" ]]; then
source+=("$pkgname-$pkgver-$CARCH.tgz::http://energia.nu/downloads/downloadv3.php?file=energia-0101E$pkgver-linux.tgz")
md5sums+=('a4c11b8478f6b142de31b28a8847e7c1')
fi
# Don't compress, takes too long
PKGEXT='.pkg.tar'
package() {
_copy_src
_link_binary_to_bin
_patch_package_for_lock_issues
_add_menu_entry_and_icon
(_support_fhs)
}
_copy_src() {
mkdir -p "$pkgdir"{/etc/{tmpfiles.d,udev/rules.d},/opt/energia,/usr/{bin,share/{applications,pixmaps,doc}}}
# --archive copies recursively, preserves permissions and links
cp --archive "$srcdir/$pkgname-0101E$pkgver/." "$pkgdir/opt/energia"
}
_patch_package_for_lock_issues() {
ln -sf /usr/lib/librxtxSerial.so "$pkgdir/opt/energia/lib/librxtxSerial64.so"
ln -sf /usr/lib/librxtxSerial.so "$pkgdir/opt/energia/lib/librxtxSerial32.so"
ln -sf /usr/share/java/rxtx/RXTXcomm.jar "$pkgdir/opt/energia/lib/RXTXcomm.jar"
install -m755 "$srcdir/10-msp430-launchpad.rules" "$pkgdir/etc/udev/rules.d/"
}
_link_binary_to_bin() {
ln -s /opt/energia/energia "$pkgdir/usr/bin/"
}
_add_menu_entry_and_icon() {
install -m755 "$srcdir/energia.desktop" "$pkgdir/usr/share/applications/"
for size in 16 24 32 48; do
install -m755 "$pkgdir/opt/energia/lib/energia_$size.png" "$pkgdir/usr/share/pixmaps/"
done
}
_support_fhs() {
# To some extent ;)
cd "$pkgdir/usr/share/doc"
ln -s /opt/energia/reference energia
}
|