Files

116 lines
4.7 KiB
Tcl

# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4
PortSystem 1.0
PortGroup cmake 1.1
PortGroup github 1.0
PortGroup muniversal 1.0
name opencascade
github.setup Open-Cascade-SAS OCCT 7.9.3 V
github.tarball_from archive
revision 2
categories science
license LGPL-2
maintainers {mcalhoun @MarcusCalhoun-Lopez} openmaintainer
description Development platform for CAD/CAE, \
3D surface/solid modeling and data exchange
long_description ${description}
set git_version [join [split ${version} .] _]
# Workarounds for URL bug in github portgroup.
# https://trac.macports.org/ticket/70652
# https://trac.macports.org/ticket/71377
github.master_sites ${github.homepage}/archive/refs/tags
distname [join ${github.tag_prefix}]${git_version}
checksums rmd160 b4c29464eb5c7fea264dfca34869a8d5869870b3 \
sha256 5ecf094ec6b12d5413dfb851d8c3590c354058aee556e32e408bdfbf8c357d57 \
size 48586815
# Add support for custom CMAKE_BUILD_TYPE = MacPorts, set by cmake portgroup.
# Note, build_type = "None" DOES NOT WORK CORRECTLY for this port.
# https://trac.macports.org/ticket/49108
patchfiles-append patch-CMakeLists.txt.diff
# Stop using DYLD_LIBRARY_PATH.
# https://trac.macports.org/ticket/70235
# https://github.com/macports/macports-ports/pull/30589
if {${configure.cxx_stdlib} eq "libc++"} {
patchfiles-append patch-env.sh.diff
}
compiler.cxx_standard 2017
configure.args-append -DCMAKE_CXX_STANDARD=17 \
-DCMAKE_CXX_STANDARD_REQUIRED=ON
platform darwin {
# In file included from ... /V7_9_3/src/OSD/OSD_Parallel_TBB.cxx:25:
# ... /tbb/detail/_task.h:262:13: error: aligned deallocation function
# of type 'void (void *, std::align_val_t) noexcept'
# is only available on macOS 10.13 or newer
if {${os.major} <= 16} {
# gcc does not recognize -fno-aligned-allocation
if {[string match *clang* ${configure.compiler}]} {
configure.cxxflags-append \
-fno-aligned-allocation
}
}
}
depends_build-append path:lib/pkgconfig/RapidJSON.pc:rapidjson
depends_lib-append port:freeimage \
port:freetype \
port:onetbb \
port:tcl \
port:tk
configure.args-append -DUSE_FREEIMAGE=ON \
-DUSE_RAPIDJSON=ON \
-DUSE_TBB=ON \
-DBUILD_DOC_Overview=OFF \
-D3RDPARTY_DIR=${prefix}
# see https://trac.macports.org/ticket/59917
if {${os.major} < 12} {
configure.cxxflags-append \
-F/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks
}
if {[string match *gcc* ${configure.compiler}]} {
# OpenGl_GlFunctions.cxx: error: invalid conversion from 'void (*)(GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*)'
# {aka 'void (*)(unsigned int, int, unsigned int, int, int, int, unsigned int, unsigned int, const void*)'} to 'OpenGl_GlFunctions::glTexImage2D_t'
# {aka 'void (*)(unsigned int, int, int, int, int, int, unsigned int, unsigned int, const void*)'} [-fpermissive]
configure.cxxflags-append \
-fpermissive
if {${configure.build_arch} in [list arm i386 ppc]} {
# Undefined symbols: "___atomic_fetch_add_8"
configure.ldflags-append \
-latomic
}
}
variant docs description {Build and install documentation} {
depends_build-append path:bin/doxygen:doxygen
configure.args-delete -DBUILD_DOC_Overview=OFF
}
if {${universal_possible} && [variant_isset universal]} {
set merger_dont_diff ${prefix}/bin/custom.sh
post-destroot {
file delete ${destroot}${prefix}/bin/custom.sh
system -W ${destroot}${prefix}/bin/ "echo \"#!/bin/bash\" > custom.sh"
foreach arch ${configure.universal_archs} {
reinplace "s|^#!/bin/bash||" ${destroot}${prefix}/bin/${arch}-custom.sh
system -W ${destroot}${prefix}/bin/ "cat ${arch}-custom.sh >> custom.sh"
file delete ${destroot}${prefix}/bin/${arch}-custom.sh
}
}
}
# Avoid release candidates
github.livecheck.regex {([0-9._]+)}
livecheck.version ${git_version}