PKGBUILD 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. # Maintainer: Márcio Silva <coadde@hyperbola.info>
  2. _pkgbase=u-boot
  3. pkgbase=uboot-grub
  4. pkgname=('uboot-grub-am335x_evm')
  5. pkgver=2015.07
  6. pkgrel=1
  7. arch=(armv7h)
  8. url='http://www.denx.de/wiki/U-Boot/'
  9. license=('GPL2')
  10. makedepends=('bc')
  11. source=("ftp://ftp.denx.de/pub/${_pkgbase}/${_pkgbase}-${pkgver}.tar.bz2"
  12. '0001-Revert-arch-Make-board-selection-choices-optional.patch'
  13. 'uboot-am335x_evm_boot-on-grub.patch'
  14. 'config.am335x_evm'
  15. 'uEnv-am335x_evm.txt'
  16. "${pkgbase}-install-am335x_evm.sh")
  17. sha512sums=('40878f28c19f077bc83b82687c9f656c64ef2bdbbc3b4caf3f7ec657a7200ce212713cd5adbc0cb23379950fe804767d1efb9108cc8c33b66faa7c7d3a831ffe'
  18. '8da39a3c8aa05a1897c4b0b2279c6e819523a46f6bce4b4a9027e58cc9d5c6ccf7787dfcf03453ece6f114e5638d06dcad055d276d4dfbcca3d65366afe46fe7'
  19. 'c292fa1c90c33d4291e5d24d3ff4834949fc14f9835fe71b6a3de29005438910b3ed6ade081e8c78617302b3912edcaf9b7806596506fa1fdc3154d929d9a055'
  20. '6f9ca967209add2e61ef4f099d77e64c0eeee2a63ce53c1795e06209557f7f14e554479c56a91a1cc4a08781b444b97f4875f5fd38af668ee25f1c6b98ca44b1'
  21. 'd8287e898bdcb1a542693c2bf94eead62a640d845145527005ce37e1bbba1e73552ef2728271b7486c7fb059239de7f18fe254af30b03b4293a5993ce1e8b351'
  22. '3ed1c1f4e8ad2ffc3ba74b139900ed113e4e6b574fbeb8e7d39ad18393bb941561042df3d778cc7497385ce18df645da4768542db2343a9c6b2d2765a3b815f3')
  23. _prepare_uboot-grub-am335x_evm() {
  24. msg 'Copy the U-Boot building source for am335x_evm to run GRUB'
  25. cp -r "${srcdir}/${_pkgbase}-${pkgver}/" "${srcdir}/${pkgbase}-am335x_evm-${pkgver}/"
  26. cd "${srcdir}/${pkgbase}-am335x_evm-${pkgver}/"
  27. msg 'Add am335x_evm configuration'
  28. cat "${srcdir}/config.am335x_evm" > '.config'
  29. unset CFLAGS CXXFLAGS LDFLAGS
  30. msg 'get U-Boot version'
  31. make prepare
  32. msg 'Rewrite configuration'
  33. yes '' | make config >/dev/null
  34. }
  35. prepare() {
  36. cd "${srcdir}/${_pkgbase}-${pkgver}/"
  37. msg '[Das U-Boot ver.2015.07]: Fix removing board selection choices optional'
  38. patch -p1 -i "${srcdir}/0001-Revert-arch-Make-board-selection-choices-optional.patch"
  39. msg 'Patch to boot on GRUB'
  40. patch -p1 -i "${srcdir}/uboot-am335x_evm_boot-on-grub.patch"
  41. if [[ "${CARCH}" == "armv7h" ]]; then
  42. msg "Prepare U-Boot for am335x_evm to run GRUB"
  43. _prepare_uboot-grub-am335x_evm
  44. fi
  45. }
  46. _build_uboot-grub-am335x_evm() {
  47. cd "${srcdir}/${pkgbase}-am335x_evm-${pkgver}/"
  48. unset CFLAGS CXXFLAGS LDFLAGS
  49. make LOCALVERSION=
  50. }
  51. build() {
  52. if [ "${CARCH}" = 'armv7h' ]; then
  53. msg 'Build U-Boot for am335x_evm to run GRUB'
  54. _build_uboot-grub-am335x_evm
  55. fi
  56. }
  57. package_uboot-grub-am335x_evm() {
  58. install="${pkgname}.install"
  59. cd "${srcdir}/${pkgname}-${pkgver}/"
  60. msg 'Package U-Boot for am335x_evm to run GRUB'
  61. install -vDm 0644 'MLO' "${pkgdir}/boot/${pkgname}"
  62. install -vDm 0644 'u-boot.img' "${pkgdir}/boot/${pkgname}"
  63. install -vDm 0644 "${srcdir}/uEnv-am335x_evm.txt" "${pkgdir}/boot/${pkgname}/uEnv.txt"
  64. install -vDm 0644 "${srcdir}/${pkgbase}-install-am335x_evm.sh" "${pkgdir}/boot/${pkgname}/uboot-install.sh"
  65. install -vDm 0644 'Licenses/README' "${pkgdir}/usr/share/licenses/${pkgname}"
  66. }