Ticket #38728: Portfile-org-mode-v2.diff

File Portfile-org-mode-v2.diff, 2.9 KB (added by jrhope, 11 years ago)
  • Portfile

    old new  
    2323checksums           rmd160  a3c65d8d83de882b41d77c499a9ecf0b80bf3cc3 \
    2424                    sha256  2a1b2b9cf5a9c3606aede007d05d5ee978b42d88cfeaaf28f45ae11c21f81848
    2525
    26 depends_lib         port:emacs
     26depends_lib         path:${prefix}/share/emacs/site-lisp:emacs
    2727depends_build       port:texinfo
    2828
    2929use_configure       no
     
    3434livecheck.type      regex
    3535livecheck.url       ${homepage}
    3636livecheck.regex     {Stable version <b>([\w.]+)</b>}
     37
     38variant contrib description "Include org-mode contributed packages" {
     39}
     40
     41set org_mode_emacs_binary "${applications_dir}/Emacs.app/Contents/MacOS/Emacs"
     42if {![file exists $org_mode_emacs_binary] ||
     43    [registry_file_registered $org_mode_emacs_binary] == 0} {
     44    set org_mode_emacs_binary "${prefix}/bin/emacs"
     45}
     46
     47configure {
     48    system "cd ${worksrcpath} && make local.mk"
     49    reinplace "s|EMACS  = emacs|EMACS   = ${org_mode_emacs_binary}|g" ${worksrcpath}/local.mk
     50
     51    if { [ variant_isset contrib ] } {
     52        # Add definition of ORG_ADD_CONTRIB.  This definition includes
     53        # almost all of the contrib modules (a simple '*' would do
     54        # all); we do not include org-jira, because it has a
     55        # build-time dependency on jira.el, which is not currently
     56        # available via MacPorts.
     57        system "echo \"ORG_ADD_CONTRIB =\" >> ${worksrcpath}/local.mk"
     58        system "echo \"ORG_ADD_CONTRIB += htmlize\" >> ${worksrcpath}/local.mk"
     59        system "echo \"ORG_ADD_CONTRIB += org2rem\" >> ${worksrcpath}/local.mk"
     60        system "echo \"ORG_ADD_CONTRIB += org-a*\" >> ${worksrcpath}/local.mk"
     61        system "echo \"ORG_ADD_CONTRIB += org-b*\" >> ${worksrcpath}/local.mk"
     62        system "echo \"ORG_ADD_CONTRIB += org-c*\" >> ${worksrcpath}/local.mk"
     63        system "echo \"ORG_ADD_CONTRIB += org-d*\" >> ${worksrcpath}/local.mk"
     64        system "echo \"ORG_ADD_CONTRIB += org-e*\" >> ${worksrcpath}/local.mk"
     65        system "echo \"ORG_ADD_CONTRIB += org-g*\" >> ${worksrcpath}/local.mk"
     66        system "echo \"ORG_ADD_CONTRIB += org-i*\" >> ${worksrcpath}/local.mk"
     67        system "echo \"ORG_ADD_CONTRIB += org-l*\" >> ${worksrcpath}/local.mk"
     68        system "echo \"ORG_ADD_CONTRIB += org-m*\" >> ${worksrcpath}/local.mk"
     69        system "echo \"ORG_ADD_CONTRIB += org-n*\" >> ${worksrcpath}/local.mk"
     70        system "echo \"ORG_ADD_CONTRIB += org-p*\" >> ${worksrcpath}/local.mk"
     71        system "echo \"ORG_ADD_CONTRIB += org-r*\" >> ${worksrcpath}/local.mk"
     72        system "echo \"ORG_ADD_CONTRIB += org-s*\" >> ${worksrcpath}/local.mk"
     73        system "echo \"ORG_ADD_CONTRIB += org-t*\" >> ${worksrcpath}/local.mk"
     74        system "echo \"ORG_ADD_CONTRIB += org-v*\" >> ${worksrcpath}/local.mk"
     75        system "echo \"ORG_ADD_CONTRIB += org-w*\" >> ${worksrcpath}/local.mk"
     76        system "echo \"ORG_ADD_CONTRIB += orgtbl-sqlinsert\" >> ${worksrcpath}/local.mk"
     77    }
     78}