blob: c0b417762b904118696d948aa62554df7ed4724c (
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
|
# Maintainer: pzl <alsoelp@gmail.com>
pkgname=jlink
_pkgver="502j"
pkgver="5.02j"
pkgrel=1
pkgdesc="ARM Embedded debugger and flashing software from Segger"
arch=('i686' 'x86_64')
url="https://www.segger.com/jlink-software.html"
license=('custom') #https://www.segger.com/cms/admin/uploads/userfiles/file/J-Link/license_agreement.txt
depends=('glibc')
source=('udev_fix.patch') #fetching the pkg source requires a POST request, so we must do this in prepare()
md5sums=('8134047402c9ac6dc7c3bc24dfcf51b5')
_md5sums_64=("b80ce35e7d7aa7b537ab4c93bb7b6fc1") #underscored because real md5sums must match source array length, ours is missing package URL
_md5sums_32=("59e5651da9767bb8d7ee52ef399475a8")
prepare() {
cd "$srcdir"
if [ "$CARCH" = "x86_64" ]; then
_ARCH="64"
_MD5="${_md5sums_64}"
else
_ARCH="32"
_MD5="${_md5sums_32}"
fi
#fetch source
wget -O "${pkgname}.tgz" --post-data="agree=1&confirm=yes" "https://www.segger.com/jlink-software.html?step=1&file=JLinkLinuxTGZ${_ARCH}_${_pkgver}"
#verify
if [ "$(md5sum "${pkgname}.tgz" | cut -d' ' -f1)" != "${_MD5}" ]; then
echo "md5 source verification failed" >&2
exit 1
fi
#extract
tar -xzvf "${pkgname}.tgz"
}
build() {
#remove `BUS!="usb"` from udev rules. BUS isn't valid anymore
cd "${srcdir}"/JLink_Linux_V*
patch -uN 99-jlink.rules ../udev_fix.patch
}
package() {
cd "${srcdir}"/JLink_Linux_V*
#documentation and licenses
install -d "${pkgdir}/usr/share/doc/${pkgname}" "${pkgdir}/usr/lib" "${pkgdir}/usr/bin" "${pkgdir}/etc/udev/rules.d"
install -Dm644 Doc/License.txt "${pkgdir}/usr/share/licenses/${pkgname}/LICENSE"
install -Dm644 Doc/*_JLink.pdf "${pkgdir}/usr/share/doc/${pkgname}/"
cp -r Samples/JLink/* "${pkgdir}/usr/share/doc/${pkgname}/"
#binaries
install -Dm755 JLink* "${pkgdir}/usr/bin/"
#libraries and udev rules
install -Dm644 99-jlink.rules "${pkgdir}/etc/udev/rules.d/99-jlink.rules"
install -Dm755 libjlinkarm.so.*.* "${pkgdir}/usr/lib/"
cd "${pkgdir}/usr/lib" && ln -s libjlinkarm.so.*.* libjlinkarm.so.5
}
|