Ticket #47808: jpeg.diff

File jpeg.diff, 3.8 KB (added by RJVB (René Bertin), 9 years ago)
  • graphics/jpeg/Portfile

    old new  
    44PortSystem          1.0
    55
    66name                jpeg
    7 conflicts           libjpeg-turbo mozjpeg
    87version             9a
    9 revision            1
     8revision            2
    109categories          graphics
    1110platforms           darwin freebsd sunos
    1211maintainers         ryandesign openmaintainer
     
    3231
    3332configure.ldflags-delete    -L${prefix}/lib
    3433configure.cppflags-delete   -I${prefix}/include
    35 configure.args      --disable-silent-rules
     34configure.args              --disable-silent-rules --disable-dependency-tracking
     35
     36# install libjpeg into its own prefix, to allow it to co-exist with libjpeg-turbo or mozjpeg
     37# which provide an earlier ABI version (jpeg8):
     38set jpeg_dir                libexec/jpeg
     39configure.pre_args-delete   --prefix=${prefix}
     40configure.pre_args-append   --prefix=${prefix}/${jpeg_dir}
     41
     42# libjpeg as provided port:jpeg is slated for replacement by either libjpeg-turbo or mozjpeg;
     43# to prepare for that change, port:jpeg installs into its own prefix, ${prefix}/libexec/jpeg .
     44# During a grace period, provide a means to make the change in install location fully transparent
     45# so that no ports need to be rebuilt because of it
     46variant transitional description {make the change in install location fully transparent} {
     47    # using this variant reintroduces the conflict with the libjpeg alternatives
     48    conflicts           libjpeg-turbo mozjpeg
     49}
     50# this variant is the default for the time being
     51default_variants    +transitional
     52
     53if {![variant_exists transitional]} {
     54    # after the grace period, the transitional variant will disappear and port:jpeg
     55    # *could* be marked as having been replaced by libjpeg-turbo ... if there's a
     56    # guarantee that it will never be required anymore.
     57#     replaced_by     libjpeg-turbo
     58#     PortGroup       obsolete 1.0
     59}
    3660
    3761test.run            yes
    3862
     
    4266    xinstall -m 644 -W ${worksrcpath} \
    4367        README change.log libjpeg.txt structure.txt usage.txt wizard.txt \
    4468        ${destroot}${docdir}
     69
     70    if {[variant_exists transitional]} {
     71        if {[variant_isset transitional]} {
     72            # symlink the port's payload to the usual locations in ${prefix}
     73            foreach f [glob ${destroot}/${prefix}/${jpeg_dir}/bin/*] {
     74                set fn [lindex [split ${f} /] end]
     75                ln -s ../${jpeg_dir}/bin/${fn} ${destroot}${prefix}/bin
     76            }
     77            foreach f [glob ${destroot}/${prefix}/${jpeg_dir}/include/*] {
     78                set fn [lindex [split ${f} /] end]
     79                ln -s ../${jpeg_dir}/include/${fn} ${destroot}${prefix}/include
     80            }
     81            foreach f [glob ${destroot}/${prefix}/${jpeg_dir}/lib/*] {
     82                set fn [lindex [split ${f} /] end]
     83                ln -s ../${jpeg_dir}/lib/${fn} ${destroot}${prefix}/lib
     84            }
     85            foreach f [glob ${destroot}/${prefix}/${jpeg_dir}/share/man/man1/*] {
     86                set fn [lindex [split ${f} /] end]
     87                ln -s ../${jpeg_dir}/share/man/man1/${fn} ${destroot}${prefix}/share/man/man1
     88            }
     89        } else {
     90            # even during the grace period, a user could decide to install, say, libjpeg-turbo
     91            # in addition to port:jpeg . The minimal requirement for not having to rebuild all
     92            # ports in that case is to provide libjpeg.9.dylib where it is expected.
     93            ln -s ../${jpeg_dir}/lib/libjpeg.9.dylib ${destroot}${prefix}/lib
     94        }
     95    }
    4596}
    4697
    4798livecheck.type      regex
    4899livecheck.url       [lindex ${master_sites} 0]
    49 livecheck.regex     ${name}src.v(.*?)${extract.suffix}
     100livecheck.regex     ${name}src.v(.*?)${extract.suffix}
     101 No newline at end of file