Ticket #37505: Portfile.diff

File Portfile.diff, 3.7 KB (added by howarth@…, 11 years ago)

Portfile.diff with pre-activate block to handle files installed outside of destrroot by previous packaging

  • Portfile

    old new  
    33
    44name                    blt
    55version                 2.4z
    6 revision                4
     6revision                5
    77categories              x11
    88license                 MIT
    99maintainers             markd
     
    2323                        port:tcl \
    2424                        port:tk
    2525
    26 configure.cflags        "-O3 -fno-common"
     26use_parallel_build      no
     27
     28configure.cflags        "-O3 -fno-common -DUSE_INTERP_RESULT"
    2729
    2830configure.args          --exec_prefix=${prefix} \
    2931                        --bindir=${prefix}/bin \
     
    4547                        patch-demos-Makefile.in \
    4648                        blt-2.4z-tcl8.5-fix.patch \
    4749                        blt2.4z-noexactversion.patch \
    48                         blt-x86_64.patch
     50                        blt-x86_64.patch \
     51                        patch-tk8.6 \
     52                        patch-man-Makefile.in
    4953
    5054post-patch {
    5155        reinplace "s|__DESTROOT__|${destroot}|g" \
    5256                ${worksrcpath}/Makefile.in \
    5357                ${worksrcpath}/src/Makefile.in \
    5458                ${worksrcpath}/src/shared/Makefile.in \
    55                 ${worksrcpath}/demos/Makefile.in
     59                ${worksrcpath}/demos/Makefile.in \
     60                ${worksrcpath}/library/Makefile.in \
     61                ${worksrcpath}/man/Makefile.in
    5662
    5763        eval reinplace "s|../src/bltwish|${prefix}/bin/bltwish|g" \
    5864                [glob ${worksrcpath}/demos/*.tcl] \
     
    6571        system "cd ${destroot}${prefix}/lib && ln -sf libBLTlite.2.4.dylib libBLTlite.2.dylib"
    6672        system "cd ${destroot}${prefix}/lib && ln -sf libBLTlite.2.4.dylib libBLTlite.dylib"
    6773}
     74
     75pre-activate {
     76        # previous packaging installed files outside of destroot.
     77        foreach file { barchart beep bgexec bitmap BLT bltdebug busy container cutbuffer dragdrop \
     78                eps graph hierbox hiertable htext spline stripchart table tabset tile tree treeview \
     79                vector watch winop } {
     80                        set filepath ${prefix}/mann/${file}.n
     81                        if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
     82                                if {[catch {delete ${filepath}}]} {
     83                                        ui_warn "Cannot delete ${filepath}; please remove it manually"
     84                                }
     85                        }
     86        }
     87        foreach file { Blt_Tree Blt_TreeCreate Blt_TreeCreateNode Blt_TreeDeleteNode Blt_TreeExists \
     88                Blt_TreeGetNode Blt_TreeGetToken Blt_TreeName Blt_TreeNodeId Blt_TreeReleaseToken } {
     89                        set filepath ${prefix}/man3/${file}.3
     90                        if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
     91                                if {[catch {delete ${filepath}}]} {
     92                                        ui_warn "Cannot delete ${filepath}; please remove it manually"
     93                                }
     94                        }
     95        }
     96        foreach file { bltCanvEps.pro bltGraph.pro dnd.tcl dragdrop.tcl graph.tcl hierbox.tcl pkgIndex.tcl \
     97                tabnotebook.tcl tabset.tcl tclIndex treeview.tcl treeview.xbm treeview_m.xbm  } {
     98                        set filepath ${prefix}/lib/blt2.4/${file}
     99                        if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
     100                                if {[catch {delete ${filepath}}]} {
     101                                        ui_warn "Cannot delete ${filepath}; please remove it manually"
     102                                }
     103                        }
     104        }
     105        foreach file { dd-color.tcl dd-file.tcl dd-number.tcl dd-text.tcl tclIndex } {
     106                        set filepath ${prefix}/lib/blt2.4/dd_protocols/${file}
     107                        if {[file exists ${filepath}] && [registry_file_registered ${filepath}] == "0"} {
     108                                if {[catch {delete ${filepath}}]} {
     109                                        ui_warn "Cannot delete ${filepath}; please remove it manually"
     110                                }
     111                        }
     112        }
     113}
     114