Create Canon DSLR CR2 image statistics (exiftool & GNU Plot) and convert ML dual ISO CR2 files painlessly for post-processing
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.

102 lines
3.6 KiB

6 years ago
  1. # Maintainer: Pekka Helenius <fincer89 at hotmail DOT com>
  2. pkgname=magiclantern-tools
  3. pkgver=1
  4. pkgrel=1
  5. pkgdesc="Magic Lantern image processing tools for 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. gcc-arm-none-eabi-4_8-2013q4-20131204-linux.tar.bz2 #local source
  19. magic-lantern_source_30092017.tar.bz2 #local source
  20. Makefile.user
  21. 01-patch_tcc_makefile-fix.patch
  22. 02_patch_cr2hdr-source_add-dryrun.patch
  23. 03_patch_add_baseline-exif.patch
  24. 04_patch_cr2hdr_disable-strings.patch
  25. 05_patch_modules-makefile_disable-strings.patch
  26. )
  27. md5sums=('4869e6a6e1dc11ea0835e8b8213bb194'
  28. '5f32b3c128cccebdac1520d442b95c95'
  29. '035e3049e5f3205680566ffc6c6e9023'
  30. '2adcdf6ed3a6cec7b7594ef310d5737a'
  31. '2a921d40e65004bb0f9f4d274b83ff04'
  32. '317c4ce8317182a98700b57b285ef184'
  33. 'd2e57664cbc7310521eee4b0b13a3f41'
  34. '25281350b6a5a9f40a1b40933f0de829')
  35. prepare() {
  36. cd "$srcdir"/
  37. #####
  38. #Download Magic Lantern latest source files
  39. #hg clone -r unified https://bitbucket.org/hudson/magic-lantern
  40. #####
  41. #This is an ugly hack, I know. Make sure you update the patch file if you change ARM compiler
  42. patch -Np1 -i "$srcdir"/01-patch_tcc_makefile-fix.patch
  43. #Implement Dry Run feature in CR2HDR
  44. patch -Np1 -i "$srcdir"/02_patch_cr2hdr-source_add-dryrun.patch
  45. #Write Baseline Exposure values to EXIF tags:
  46. patch -Np1 -i "$srcdir"/03_patch_add_baseline-exif.patch
  47. #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)
  48. patch -Np1 -i "$srcdir"/04_patch_cr2hdr_disable-strings.patch
  49. patch -Np1 -i "$srcdir"/05_patch_modules-makefile_disable-strings.patch
  50. #Custom compilation settings for Magic Lantern (Mainly ARM compiler path redefinition)
  51. ln -s "$srcdir"/Makefile.user "$srcdir"/magic-lantern/Makefile.user
  52. #Link downloaded ARM compiler files to Magic Lantern directory
  53. ln -s "$srcdir"/$arm_compiler "$srcdir"/magic-lantern/$arm_compiler
  54. }
  55. build() {
  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. }