blob: c3b4cacc44123c9f12c7f9c17d113c50d202df09 (
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
|
# Maintainer: Chance Chen <ufbycd@163.com>
pkgname=mounriver-studio-community
pkgver=1.80
pkgrel=1
arch=('x86_64')
pkgdesc="为 Eclipse 平台爱好者提供的一款 RISC-V 内核芯片集成开发环境,支持 WCH 系列 MCU 的工程模板、代码编译、下载、调试等功能。 "
url="http://www.mounriver.com"
license=('GPL2' 'GPL3' 'custom')
provides=()
conflicts=()
depends=('libftdi-compat' 'libusb' 'hidapi' 'libusb-compat' 'udev')
makedepends=()
optdepends=('ch34x-dkms-git: CH341SER driver with fixed bug'
'i2c-ch341-dkms: CH341 USB-I2C adapter driver'
'spi-ch341-usb-dkms: SPI/GPIO driver for CH341'
'ch341eepromtool: An i2c serial EEPROM programming tool for the WCH CH341A'
'ch341prog-git: A simple command line tool (programmer) interfacing with ch341a'
'ch341eeprom-git: A libusb based programming tool for 24xx I²C EEPROMs using the WCH CH341A')
options=('!strip')
source=("${pkgname}-${pkgver}.tar.xz::http://file.mounriver.com/upgrade/MounRiver_Studio_Community_Linux_x64_V${pkgver//./}.tar.xz"
"udev-rules.patch")
sha256sums=('bc7cdf4d8e704c33accc1f4afb6d35f1595c073535ae65e6f5adb4a8ac299222'
'7ed97c1a494ddbd5b6d594223bc35aa31949c416c0b23a3adabfda239b9f3c73')
prepare() {
cd "$srcdir/MounRiver_Studio_Community_Linux_x64_V${pkgver//./}"
patch --forward --strip=1 --input="${srcdir}/udev-rules.patch"
find MRS_Community -perm 600 -exec chmod 644 {} \;
}
package() {
cd "$srcdir/MounRiver_Studio_Community_Linux_x64_V${pkgver//./}"
install -dm0755 "$pkgdir/usr/share/$pkgname"
cp -afr MRS_Community/* "$pkgdir/usr/share/$pkgname"
install -Dm0644 "beforeinstall/50-wch.rules" "${pkgdir}/usr/lib/udev/rules.d/50-wch-community.rules"
install -Dm0644 "beforeinstall/60-openocd.rules" "${pkgdir}/usr/lib/udev/rules.d/60-openocd-wch-community.rules"
install -Dm0755 /dev/stdin "${pkgdir}/usr/bin/openocd-wch-community-arm" << EOF
#!/bin/env bash
exec /usr/share/$pkgname/toolchain/OpenOCD/bin/openocd -f /usr/share/$pkgname/toolchain/OpenOCD/bin/wch-arm.cfg "\$@"
EOF
install -Dm0755 /dev/stdin "${pkgdir}/usr/bin/openocd-wch-community-riscv" << EOF
#!/bin/env bash
exec /usr/share/$pkgname/toolchain/OpenOCD/bin/openocd -f /usr/share/$pkgname/toolchain/OpenOCD/bin//wch-riscv.cfg "\$@"
EOF
install -Dm0644 /dev/stdin "${pkgdir}/etc/profile.d/${pkgname}.sh" << EOF
[ -d /usr/share/$pkgname/toolchain/arm-none-eabi-gcc/bin/ ] && append_path '/usr/share/$pkgname/toolchain/arm-none-eabi-gcc/bin/'
[ -d /usr/share/$pkgname/toolchain/RISC-V\ Embedded\ GCC/bin/ ] && append_path '/usr/share/$pkgname/toolchain/RISC-V\ Embedded GCC/bin/'
EOF
install -Dm755 /dev/stdin "${pkgdir}/usr/bin/${pkgname}" <<EOF
#!/bin/sh
/usr/share/$pkgname/MounRiver\ Studio_Community "\$@"
EOF
install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/${pkgname}.desktop" <<EOF
[Desktop Entry]
Name=MounRiver Studio Community
GenericName=MounRiver Studio Community
Comment=Eclipse Based Embedded C/C++ IDE for WCH Microcontroller
Exec=/usr/bin/$pkgname
Icon=/usr/share/$pkgname/icon.xpm
Path=/usr/share/$pkgname/
Terminal=false
StartupNotify=true
Type=Application
Categories=Development;RISC-V;ARM;
EOF
}
# vim: ts=4 sw=4 et
|