| 37 | |
| 38 | variant app description "Build org-mode against editors/emacs-app" { |
| 39 | depends_lib-append port:emacs-app |
| 40 | depends_lib-delete port:emacs |
| 41 | } |
| 42 | |
| 43 | variant contrib description "Include org-mode contributed packages" { |
| 44 | } |
| 45 | |
| 46 | set org_mode_emacs_binary "" |
| 47 | |
| 48 | configure { |
| 49 | set org_mode_emacs_binary [ |
| 50 | if { [ variant_isset app ] |
| 51 | && [file exist ${applications_dir}/Emacs.app/Contents/MacOS/Emacs] } { |
| 52 | list "${applications_dir}/Emacs.app/Contents/MacOS/Emacs" |
| 53 | } else { |
| 54 | list "${prefix}/bin/emacs" |
| 55 | } |
| 56 | ] |
| 57 | |
| 58 | system "cd ${worksrcpath} && make local.mk" |
| 59 | reinplace "s|EMACS = emacs|EMACS = ${org_mode_emacs_binary}|g" ${worksrcpath}/local.mk |
| 60 | |
| 61 | if { [ variant_isset contrib ] } { |
| 62 | # Add definition of ORG_ADD_CONTRIB. This definition includes |
| 63 | # almost all of the contrib modules (a simple '*' would do |
| 64 | # all); we do not include org-jira, because it has a |
| 65 | # build-time dependency on jira.el, which is not currently |
| 66 | # available via MacPorts. |
| 67 | system "echo \"ORG_ADD_CONTRIB =\" >> ${worksrcpath}/local.mk" |
| 68 | system "echo \"ORG_ADD_CONTRIB += htmlize\" >> ${worksrcpath}/local.mk" |
| 69 | system "echo \"ORG_ADD_CONTRIB += org2rem\" >> ${worksrcpath}/local.mk" |
| 70 | system "echo \"ORG_ADD_CONTRIB += org-a*\" >> ${worksrcpath}/local.mk" |
| 71 | system "echo \"ORG_ADD_CONTRIB += org-b*\" >> ${worksrcpath}/local.mk" |
| 72 | system "echo \"ORG_ADD_CONTRIB += org-c*\" >> ${worksrcpath}/local.mk" |
| 73 | system "echo \"ORG_ADD_CONTRIB += org-d*\" >> ${worksrcpath}/local.mk" |
| 74 | system "echo \"ORG_ADD_CONTRIB += org-e*\" >> ${worksrcpath}/local.mk" |
| 75 | system "echo \"ORG_ADD_CONTRIB += org-g*\" >> ${worksrcpath}/local.mk" |
| 76 | system "echo \"ORG_ADD_CONTRIB += org-i*\" >> ${worksrcpath}/local.mk" |
| 77 | system "echo \"ORG_ADD_CONTRIB += org-l*\" >> ${worksrcpath}/local.mk" |
| 78 | system "echo \"ORG_ADD_CONTRIB += org-m*\" >> ${worksrcpath}/local.mk" |
| 79 | system "echo \"ORG_ADD_CONTRIB += org-n*\" >> ${worksrcpath}/local.mk" |
| 80 | system "echo \"ORG_ADD_CONTRIB += org-p*\" >> ${worksrcpath}/local.mk" |
| 81 | system "echo \"ORG_ADD_CONTRIB += org-r*\" >> ${worksrcpath}/local.mk" |
| 82 | system "echo \"ORG_ADD_CONTRIB += org-s*\" >> ${worksrcpath}/local.mk" |
| 83 | system "echo \"ORG_ADD_CONTRIB += org-t*\" >> ${worksrcpath}/local.mk" |
| 84 | system "echo \"ORG_ADD_CONTRIB += org-v*\" >> ${worksrcpath}/local.mk" |
| 85 | system "echo \"ORG_ADD_CONTRIB += org-w*\" >> ${worksrcpath}/local.mk" |
| 86 | system "echo \"ORG_ADD_CONTRIB += orgtbl-sqlinsert\" >> ${worksrcpath}/local.mk" |
| 87 | } |
| 88 | } |