Ticket #34808: highlight.diff

File highlight.diff, 3.9 KB (added by mww@…, 12 years ago)
  • Portfile

     
    33PortSystem 1.0
    44
    55name                    highlight
    6 version                 2.4.8
     6version                 3.9
    77categories              textproc devel
    88platforms               darwin
     9license             GPL-3
    910maintainers             groovie.org:pjenvey
    1011description             converts source code to formatted text with syntax highlighting
    1112long_description        ${description}
    1213
    1314homepage                http://www.andre-simon.de
    1415master_sites            ${homepage}/zip/
    15 checksums               sha1 091689fde96c9f4e3de75ea1b7c1838e8d25708c
     16checksums           rmd160  bd48eff6f6bbaff54fec61001e44a9cd2e124437 \
     17                    sha256  4ae69795e3ca4ffef47355a7b6dc371e2d781735efd44fa12ff3a1ffc990daef
    1618use_bzip2               yes
    1719
     20depends_build       port:boost
     21depends_lib         port:lua
     22
     23patchfiles          patch-makefile.diff
     24
    1825configure {
    19         reinplace "s|/usr/share/highlight/|${prefix}/share/${name}/|g" \
    20                 ${worksrcpath}/highlight/datadir.cpp
    21         reinplace "s|/etc/highlight/|${prefix}/etc/highlight/|g" \
    22                 ${worksrcpath}/highlight/datadir.cpp
     26    reinplace "s|@prefix@|${prefix}|g" ${worksrcpath}/Makefile
     27    reinplace "s|@destroot@|${destroot}|g" ${worksrcpath}/Makefile
    2328}
    2429
    25 # Avoid stripping the binary (-s flag) during linking as this corrupts the executable.
    26 # Strip after building
    27 platform darwin 8 { build.args LDFLAGS="" }
     30build.args           CXX=${configure.cxx} LDFLAGS=${configure.ldflags} CXXFLAGS=${configure.cxxflags}
     31build.target         cli lib
    2832
    29 set conf_file "filetypes.conf"
    30 set old_conf_files { "scriptre.conf" "extensions.conf" }
    31 destroot {
    32         xinstall -m 755 ${worksrcpath}/highlight/highlight ${destroot}${prefix}/bin
    33 
    34         xinstall -m 755 -d ${destroot}${prefix}/etc/${name}
    35         xinstall -m 644 ${worksrcpath}/${conf_file} \
    36                 ${destroot}${prefix}/etc/${name}/${conf_file}.sample
    37 
    38         xinstall -m 755 -d ${destroot}${prefix}/share/${name}
    39         foreach dir { "langDefs" "themes" "indentSchemes" "helpmsg" } {
    40                 file copy ${worksrcpath}/${dir} ${destroot}${prefix}/share/${name}
    41                         system "chmod 644 ${destroot}${prefix}/share/${name}/${dir}/*"
    42         }
    43 
    44         xinstall -m 755 -d ${destroot}${prefix}/share/man/man1
    45         xinstall -m 644 ${worksrcpath}/man/highlight.1.gz \
    46                 ${destroot}${prefix}/share/man/man1
    47 
    48         xinstall -m 755 -d ${destroot}${prefix}/share/doc/${name}
    49         foreach file { "AUTHORS" "README" "README_DE" "README_INDENT" "ChangeLog" \
    50                 "COPYING" "INSTALL" } {
    51                 xinstall -m 644 ${worksrcpath}/${file} \
    52                         ${destroot}${prefix}/share/doc/${name}
    53         }
    54 
    55         file copy ${worksrcpath}/examples ${destroot}${prefix}/share/doc/${name}
     33post-destroot {
     34    file rename ${destroot}${prefix}/etc/highlight/filetypes.conf \
     35        ${destroot}${prefix}/etc/highlight/filetypes.conf.sample
    5636}
    5737
    5838post-activate {
    59         # copy over the sample conf file if necessary
    60         if { ![file exists ${prefix}/etc/${name}/${conf_file}] } {
    61                 file copy ${prefix}/etc/${name}/${conf_file}.sample \
    62                         ${prefix}/etc/${name}/${conf_file}
    63         }
    64        
    65         # warn the user of deprecated conf files
    66         set deprecated_conf_files {}
    67         foreach file $old_conf_files {
    68                 if { [file exists ${prefix}/etc/${name}/${file}] } {
    69                         file rename ${prefix}/etc/${name}/${file} \
    70                                 ${prefix}/etc/${name}/${file}.dport_bak
    71                         lappend deprecated_conf_files ${file}
    72                 }
    73         }
    74         if { [llength $deprecated_conf_files] } {
    75                 ui_msg "\nWarning: Old highlight conf files: ${deprecated_conf_files}"
    76                 ui_msg "have been replaced by: ${conf_file}"
    77                 ui_msg "as of highlight-2.4.5."
    78                 ui_msg "\nThe following old conf files have been renamed (and should be"
    79                 ui_msg "removed):\n"
    80                 foreach file $deprecated_conf_files {
    81                         ui_msg "${prefix}/etc/${name}/${file} ->"
    82                         ui_msg "${prefix}/etc/${name}/${file}.dport_bak"
    83                         ui_msg ""
    84                 }
    85         }
     39    # copy over the sample conf file if necessary
     40    if { ![file exists ${prefix}/etc/filetypes.conf] } {
     41        file copy ${prefix}/etc/filetypes.conf.sample \
     42             ${prefix}/etc/filetypes.conf.sample
     43    }
    8644}
    8745