RISC-V MCU中文社区

[IDE] ArchLinux 下使用 MounRiver Studio 社区版开发

发表于 2022-03-20 11:14:15
0
4702
0

MounRiver Studio 集成开发环境 (社区版)

将 MounRiver-Studio-Community-Linux 打包到 Arch Linux 的 AUR 仓库

  1. # Maintainer: taotieren
  2. pkgbase=mounriver-studio-community-bin
  3. pkgname=($pkgbase)
  4. pkgver=100
  5. pkgrel=1
  6. arch=('x86_64')
  7. url='http://www.mounriver.com/'
  8. license=('GPL2' 'GPL3' 'custom')
  9. provides=('MounRiver-Studio-Community-Linux')
  10. conflicts=()
  11. depends=()
  12. makedepends=('tar')
  13. optdepends=('ch34x-dkms-git: CH341SER driver with fixed bug'
  14. 'i2c-ch341-dkms: CH341 USB-I2C adapter driver'
  15. 'spi-ch341-usb-dkms: SPI/GPIO driver for CH341'
  16. 'ch341eepromtool: An i2c serial EEPROM programming tool for the WCH CH341A'
  17. 'ch341prog-git: A simple command line tool (programmer) interfacing with ch341a'
  18. 'ch341eeprom-git: A libusb based programming tool for 24xx I²C EEPROMs using the WCH CH341A')
  19. source=("${pkgbase}-${pkgver}.tar.xz::http://file.mounriver.com/upgrade/MounRiver_Studio_Community_Linux_x64_V${pkgver}.tar.xz"
  20. )
  21. sha256sums=('78509ace8628caa117e0680df8d71e611c8fa3a2e61030d93098d89c43dfcf6f')
  22. options=('!strip')
  23. noextract=(${pkgbase}-${pkgver}.tar.xz)
  24. prepare() {
  25. tar -xf "${srcdir}/${pkgbase}-${pkgver}.tar.xz" --strip-components=1 -C "${srcdir}/"
  26. }
  27. package_mounriver-studio-community-bin() {
  28. export LC_CTYPE="zh_CN.UTF-8"
  29. pkgdesc="为 Eclipse 平台爱好者提供的一款 RISC-V 内核芯片集成开发环境,支持 WCH 系列 MCU 的工程模板、代码编译、下载、调试等功能。 "
  30. depends=('bash'
  31. 'libftdi-compat'
  32. 'libusb'
  33. 'hidapi'
  34. 'libusb-compat'
  35. 'libudev.so')
  36. install -dm0755 "${pkgdir}/opt/wch/${pkgname%-bin}/"
  37. cp -a "${srcdir}"/MRS_Community/* "${pkgdir}/opt/wch/${pkgname%-bin}"
  38. install -Dm0644 "${srcdir}/beforeinstall/50-wch.rules" "${pkgdir}/usr/lib/udev/rules.d/50-wch-community.rules"
  39. install -Dm0644 "${srcdir}/beforeinstall/60-openocd.rules" "${pkgdir}/usr/lib/udev/rules.d/60-openocd-wch-community.rules"
  40. install -Dm0755 /dev/stdin "${pkgdir}/usr/bin/openocd-wch-community-arm" << EOF
  41. #!/bin/env bash
  42. exec /opt/wch/${pkgname%-bin}/toolchain/OpenOCD/bin/openocd -f /opt/wch/${pkgname%-bin}/toolchain/OpenOCD/bin/wch-arm.cfg "\$@"
  43. EOF
  44. install -Dm0755 /dev/stdin "${pkgdir}/usr/bin/openocd-wch-community-riscv" << EOF
  45. #!/bin/env bash
  46. exec /opt/wch/${pkgname%-bin}/toolchain/OpenOCD/bin/openocd -f /opt/wch/${pkgname%-bin}/toolchain/OpenOCD/bin//wch-riscv.cfg "\$@"
  47. EOF
  48. install -Dm0644 /dev/stdin "${pkgdir}/etc/profile.d/${pkgname%-bin}.sh" << EOF
  49. #!/bin/sh
  50. [ -d /opt/wch/${pkgname%-bin}/toolchain/arm-none-eabi-gcc/bin/ ] && append_path '/opt/wch/${pkgname%-bin}/toolchain/arm-none-eabi-gcc/bin/'
  51. [ -d /opt/wch/${pkgname%-bin}/toolchain/RISC-V\ Embedded\ GCC/bin/ ] && append_path '/opt/wch/${pkgname%-bin}/toolchain/RISC-V\ Embedded GCC/bin/'
  52. export PATH
  53. EOF
  54. install -Dm755 /dev/stdin "${pkgdir}/usr/bin/${pkgname%-bin}" << EOF
  55. #!/bin/sh
  56. /opt/wch/${pkgname%-bin}/MounRiver\ Studio_Community "\$@"
  57. EOF
  58. install -Dm0644 "${pkgdir}/opt/wch/${pkgname%-bin}/icon.xpm" "${pkgdir}/usr/share/icons/${pkgname%-bin}.xpm"
  59. install -Dm644 /dev/stdin "$pkgdir/usr/share/applications/${pkgname%-bin}.desktop" << EOF
  60. [Desktop Entry]
  61. Name=MounRiver Studio Community
  62. Comment=MounRiver Studio Community
  63. GenericName=MounRiver Studio Community
  64. Exec=env GDK_BACKEND=x11 ${pkgname%-bin} %F
  65. Icon=${pkgname%-bin}.xpm
  66. Path=/opt/wch/${pkgname%-bin}/
  67. Terminal=false
  68. StartupNotify=true
  69. Type=Application
  70. Categories=Development;RISC-V;ARM;
  71. EOF
  72. }
  73. # vim: ts=4 sw=4 et

已经上传到 AUR 仓库:https://aur.archlinux.org/packages/mounriver-studio-community-bin
提供如下的包:

  1. yay -S mounriver-studio-community-bin

使用 Arch 的包管理器,进行安装卸载更新等。用户只需要一条命令行即可解决。
其他 Linux 发行版可以参考 PKGBUILD 的内容就行移植。

喜欢0
用户评论

未通过实名认证

懒的都不写签名

积分
问答
粉丝
关注
  • RV-STAR 开发板
  • RISC-V处理器设计系列课程
  • 培养RISC-V大学土壤 共建RISC-V教育生态
RV-STAR 开发板