Various compilation scripts & patches for Linux programs.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

103 lines
3.6 KiB

  1. # Maintainer: Pekka Helenius < fincer89 [at] hotmail [dot] com >
  2. pkgname=magiclantern-tools
  3. pkgver=1
  4. pkgrel=1
  5. pkgdesc="Magic Lantern Linux-compatible image processing tools for pictures taken with Canon DSLR's with Magic Lantern firmware."
  6. arch=('any')
  7. url='https://bitbucket.org/hudson/magic-lantern'
  8. license=("GPL")
  9. depends=('perl-image-exiftool' 'dcraw')
  10. optdepends=('octave')
  11. makedepends=('mercurial')
  12. #REQUIRED BY MODULES
  13. #Use these dependencies only if you try compile more modules. They rely partially on rst2html5 package.
  14. #makedepends=('rst2html5' 'python-docutils')
  15. arm_compiler=gcc-arm-none-eabi-4_8-2013q4
  16. source=(
  17. "https://launchpad.net/gcc-arm-embedded/4.8/4.8-2013-q4-major/+download/$arm_compiler-20131204-linux.tar.bz2"
  18. "Makefile.user"
  19. "01-patch_tcc_makefile-fix.patch"
  20. "02_patch_cr2hdr-source_add-dryrun.patch"
  21. "03_patch_add_baseline-exif.patch"
  22. "04_patch_cr2hdr_disable-strings.patch"
  23. "05_patch_modules-makefile_disable-strings.patch"
  24. )
  25. md5sums=('4869e6a6e1dc11ea0835e8b8213bb194'
  26. '035e3049e5f3205680566ffc6c6e9023'
  27. 'd2f975ad4896c3b82a5076bd396ceec6'
  28. '2a921d40e65004bb0f9f4d274b83ff04'
  29. '317c4ce8317182a98700b57b285ef184'
  30. 'd2e57664cbc7310521eee4b0b13a3f41'
  31. '25281350b6a5a9f40a1b40933f0de829')
  32. prepare() {
  33. cd "$srcdir"/
  34. #####
  35. #Download Magic Lantern latest source files
  36. msg2 "Downloading Magic Lantern source code"
  37. hg clone -r unified https://bitbucket.org/hudson/magic-lantern
  38. #####
  39. #This is an ugly hack, I know. Make sure you update the patch file if you change ARM compiler
  40. patch -Np1 -i "$srcdir"/01-patch_tcc_makefile-fix.patch
  41. #Implement Dry Run feature in CR2HDR
  42. patch -Np1 -i "$srcdir"/02_patch_cr2hdr-source_add-dryrun.patch
  43. #Write Baseline Exposure values to EXIF tags:
  44. patch -Np1 -i "$srcdir"/03_patch_add_baseline-exif.patch
  45. #All modules have python issues (outdated code?) so they don't compile. The problem is related to version etc. strings. Just disable them and compile the code. Only used for cr2hdr (as we need it, not other modules)
  46. patch -Np1 -i "$srcdir"/04_patch_cr2hdr_disable-strings.patch
  47. patch -Np1 -i "$srcdir"/05_patch_modules-makefile_disable-strings.patch
  48. #Custom compilation settings for Magic Lantern (Mainly ARM compiler path redefinition)
  49. ln -fs "$srcdir"/Makefile.user "$srcdir"/magic-lantern/Makefile.user
  50. #Link downloaded ARM compiler files to Magic Lantern directory
  51. ln -fs "$srcdir"/$arm_compiler "$srcdir"/magic-lantern/$arm_compiler
  52. }
  53. build() {
  54. cd ${srcdir}
  55. export PATH=$PATH:${PWD}/${arm_compiler}/bin
  56. cd "$srcdir"/magic-lantern #/modules/dual_iso
  57. #######################################
  58. # FIRMWARE - MODULES FAIL TO BUILD DUE TO PYTHON ISSUES
  59. ##make 5D3 #5D Mark 3 - Both firmwares - DOESN'T INCLUDE MODULES YET
  60. ##make 5D3.113 #5D Mark 3 - Firmware 1.1.3 - DOESN'T INCLUDE MODULES YET
  61. #make 5D3.123 #5D Mark 3 - Firmware 1.2.3 - DOESN'T INCLUDE MODULES YET
  62. #mkdir -p "$startdir"/5dmark3_firmware_123/
  63. #cp "$srcdir"/magic-lantern/platform/5D3.123/{autoexec.bin,ML-SETUP.FIR} "$startdir"/5dmark3_firmware_123/ #magiclantern.bin,version.bin
  64. #######################################
  65. # MODULES
  66. #make all_modules #All modules - FAIL TO BUILD DUE TO PYTHON ISSUES
  67. #CR2HDR application for host computer
  68. cd "$srcdir"/magic-lantern/modules/dual_iso
  69. make cr2hdr
  70. cd ..
  71. #MLV_DUMP application for host computer
  72. cd "$srcdir"/magic-lantern/modules/mlv_rec
  73. make mlv_dump
  74. cd ..
  75. }
  76. package()
  77. {
  78. mkdir -p "$pkgdir"/usr/bin
  79. cp "$srcdir"/magic-lantern/modules/dual_iso/cr2hdr "$pkgdir"/usr/bin
  80. cp "$srcdir"/magic-lantern/modules/mlv_rec/mlv_dump "$pkgdir"/usr/bin/mlvdump
  81. }