Files
Gregorio LitensteinandRenee Otten 0b828b9b4b boost: fix error and edge case in symlink creation
1) We were checking essentially if boost was already activated for deciding which symlinks to create in the destroot.

2) In the particular case of the Boost-${version}, using an actual folder instead of symlinking it very rarely resulted in my boost libraries not being found by third-party programs.

Signed-off-by: Gregorio Litenstein <g.litenstein@gmail.com>
2026-02-26 07:10:09 -05:00

83 lines
2.5 KiB
Tcl

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:filetype=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup boost 1.0
version ${boost.version}
revision 1
name boost
license Boost-1
categories devel
maintainers {michaelld @michaelld} \
{mascguy @mascguy} \
openmaintainer
description Collection of portable C++ source libraries
long_description \
Boost provides free portable peer-reviewed C++ \
libraries. The emphasis is on portable libraries \
which work well with the C++ Standard Library.
homepage https://www.boost.org
distfiles
use_configure no
build {}
universal_variant yes
platform powerpc {
# See https://trac.macports.org/ticket/66006
universal_variant no
}
if {[vercmp ${boost.version} 1.87] >= 0} {
subport ${name}-numpy {
description Boost.Numpy library
long_description {*}${description}
depends_lib port:${name}
boost.require_numpy yes
}
}
long_description {*}${long_description} \
This port is just a shim port, installing symbolic \
links to the include area and libraries provided \
by the [boost::depends_portname] port.
destroot {
# Sym link to boost include dir.
# Only need to do this for primary boost port
if { ${subport} eq ${name} } {
xinstall -d ${destroot}${prefix}/include
ln -s [boost::include_dir]/boost ${destroot}${prefix}/include
}
# Sym link libraries
xinstall -d ${destroot}${prefix}/lib
if [file exists [boost::lib_dir]/cmake] {
xinstall -d ${destroot}${prefix}/lib/cmake
}
fs-traverse -tails lib [list [boost::lib_dir]] {
# Skip numpy lib if present for main boost port
if { ${subport} ne ${name} || ![string match *numpy* $lib] } {
set plib ${prefix}/lib/${lib}
if {![file exists ${destroot}${plib}]} {
if {![file isdirectory [boost::lib_dir]/${lib}] ||
[string match cmake/Boost-${version}.* ${lib}]} {
ln -s [boost::lib_dir]/${lib} ${destroot}${plib}
} else {
xinstall -d ${destroot}${plib}
}
}
}
}
# Readme explaining this port
set readme ${destroot}${prefix}/share/doc/${subport}/README
xinstall -d [file dirname ${readme}]
set f [open ${readme} "w"]
puts ${f} ${long_description}
close ${f}
}
livecheck.type none