# -*- 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.1 V github.tarball_from archive revision 0 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} homepage https://www.opencascade.com/content/open-source-core-technology 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 3d47a42537bdc988b81b73301de75e9c521c2d4e \ sha256 de442298cd8860f5580b01007f67f0ecd0b8900cfa4da467fa3c823c2d1a45df \ size 48575965 # 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 # Fix ARCH configuration problem for 32-bit macs. # Was fixed upstream on 2025 Jul 19. # Remove this patch on next OCCT release after 7.9.1. # https://github.com/Open-Cascade-SAS/OCCT/issues/620 patchfiles-append patch-env-arm64.diff compiler.cxx_standard 2011 configure.args-append -DCMAKE_CXX_STANDARD=11 \ -DCMAKE_CXX_STANDARD_REQUIRED=ON depends_build-append path:lib/pkgconfig/RapidJSON.pc:rapidjson depends_lib-append port:freeimage \ port:freetype \ port:onetbb \ port:tcl \ port:tk # install it into libexec to avoid conflict with oce port cmake.install_prefix ${prefix}/libexec/${name} 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 } } } # keep this port at prefix's cmake's lib post-destroot { xinstall -d -m 0755 ${destroot}${prefix}/lib/cmake foreach cmakedir [glob -type d -nocomplain -tails -directory ${destroot}${cmake.install_prefix}/lib/cmake *] { xinstall -d -m 0755 ${destroot}${prefix}/lib/cmake/${cmakedir} foreach cmakefile [glob -tails -directory ${destroot}${cmake.install_prefix}/lib/cmake/${cmakedir} *.cmake] { ln -s ${cmake.install_prefix}/lib/cmake/${cmakedir}/${cmakefile} \ ${destroot}${prefix}/lib/cmake/${cmakedir}/ reinplace -q "s|\\\${CMAKE_CURRENT_LIST_DIR}|${cmake.install_prefix}/lib/cmake/${cmakedir}|g" \ ${destroot}${cmake.install_prefix}/lib/cmake/${cmakedir}/${cmakefile} reinplace -q "s|\\\${CMAKE_CURRENT_LIST_FILE}|${cmake.install_prefix}/lib/cmake/${cmakedir}/${cmakefile}|g" \ ${destroot}${cmake.install_prefix}/lib/cmake/${cmakedir}/${cmakefile} } } }