Advertisement
Guest User

Untitled

a guest
Apr 22nd, 2020
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.47 KB | None | 0 0
  1. # Maintainer: Grey Christoforo <first name at last name dot net>
  2. # Contributor: mickael9 <mickael9 at gmail dot com>
  3. # Contributor: thodnev <thodnev at github>
  4.  
  5. _number_of_bits=32
  6. pkgname=microchip-mplabxc${_number_of_bits}-bin
  7. pkgver=2.40
  8. pkgrel=1
  9. pkgdesc="Microchip's MPLAB XC${_number_of_bits} C compiler toolchain for all of their 32bit microcontrollers"
  10. arch=(i686 x86_64)
  11. url=https://www.microchip.com/development-tools/downloads-archive
  12. license=(custom)
  13. depends_i688=(gcc-libs)
  14. depends_x86_64=(lib32-gcc-libs)
  15. makedepends=(sdx)
  16. makedepends_x86_64=(tclkit)
  17. makedepends_i686=(tclkit)
  18.  
  19. options=(!strip docs libtool emptydirs !zipman staticlibs)
  20. source=("http://ww1.microchip.com/downloads/en/DeviceDoc/xc${_number_of_bits}-v$pkgver-full-install-linux-installer.run"
  21. "bitrock-unpacker.tcl")
  22.  
  23. md5sums=('db700eadf606da4207a1239015f3fcc3'
  24. '70dedba4c417f8c0bb07c32d19e9d197')
  25.  
  26. install=$pkgname.install
  27.  
  28. instdir="/opt/microchip/xc${_number_of_bits}/v${pkgver}"
  29.  
  30. build() {
  31. msg2 "Unpacking files from installer"
  32. ./bitrock-unpacker.tcl ./xc${_number_of_bits}-v$pkgver-full-install-linux-installer.run ./unpacked.vfs
  33. }
  34.  
  35. package() {
  36. mkdir -p "${pkgdir}${instdir}"
  37. mv unpacked.vfs/compiler/programfiles*/* "${pkgdir}${instdir}"
  38. mv unpacked.vfs/licensecomponent/xclmBinlinux32/bin/{roam.lic,xclm} "${pkgdir}${instdir}/bin"
  39. chmod +s "${pkgdir}${instdir}/bin/xclm"
  40. sed -i "s/<xclm>/<xclm>\n\t<xclm:LicenseDirectory xclm:path=\"\/opt\/microchip\/xclm\/license\/\" \/>/" \
  41. unpacked.vfs/licensecomponent/xclmBinlinux32/etc/xclm.conf
  42. rsync -av unpacked.vfs/licensecomponent/xclmBinlinux32/etc "${pkgdir}${instdir}"
  43. rsync -av unpacked.vfs/licensecomponent/xclmallDocs "${pkgdir}${instdir}/docs/xclm"
  44. cp "${pkgdir}${instdir}"/*License.txt "${pkgdir}${instdir}/docs" 2>/dev/null || true
  45. mv "${pkgdir}${instdir}"/*License.txt "${pkgdir}${instdir}" 2>/dev/null || true
  46.  
  47. mkdir -p "$pkgdir/etc/profile.d"
  48. echo "export PATH=\"\$PATH\":'${instdir}/bin'" > "${pkgdir}/etc/profile.d/${pkgname}.sh"
  49. echo "export XC${_number_of_bits}_TOOLCHAIN_ROOT='${instdir}'" >> "$pkgdir/etc/profile.d/${pkgname}.sh"
  50.  
  51. mkdir -p "$pkgdir/usr/share/licenses/$pkgname"
  52. ln -s "${instdir}/docs/$(basename "${pkgdir}${instdir}/docs"/*[Ll]icense.txt)" "${pkgdir}/usr/share/licenses/$pkgname/LICENSE"
  53.  
  54. # Workaround to skip license checks
  55. # https://github.com/cv007/XC3216
  56. echo -en "*cc1:+ -mafrlcsj\n\n*cc1plus:+ -mafrlcsj" > "${pkgdir}${instdir}/lib/gcc/specs"
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement