# -*- 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 cmake 1.1 PortGroup github 1.0 name glfw categories graphics maintainers {michaelld @michaelld} openmaintainer description GLFW is a free, open-source, portable library for OpenGL and OpenGL ES application development license zlib platforms darwin macosx # glfw does not build on Mac OS X 10.5 or prior due to CoreGraphics # references that are 10.6+. if {${os.platform} eq "darwin" && ${os.major} < 10} { known_fail yes pre-fetch { ui_error "$name does not build on Mac OS X 10.5 'Leopard' or prior." error "unsupported platform" } } # special build on Mac OS X 10.6 if {${os.platform} eq "darwin" && ${os.major} == 10} { # Mac OS X 10.6: use the latest commit supporting this OS version github.setup glfw glfw a94a84b507b0d6d11e8a3f257cb21f4bd6553516 version 3.1.2-20151024 checksums rmd160 1c07a75a88f272653ca246aa1212a208a83ecb30 \ sha256 ff4745264f92b740c50ecc90370f102c86c439f2b6108f1495bd60c87e5d6a83 \ size 366040 revision 0 # bump the epoch because I moved the version from 20151012 to 3.1.2 epoch 1 long_description ${description}. This version of GLFW is the latest to provide support for \ Mac OS X 10.6 and prior, and it will not be updated. It is provided in the \ hope that it allows ports depending on GLFW to build on these older Mac OS X installs. # patch to fix install directory for cmake files and docs patchfiles-append patch-CMakeLists.txt.legacy.diff } elseif {${os.platform} eq "darwin" && (${os.major} == 11 || ${os.major} == 12) } { # Mac OS X 10.7-8: use the latest commit supporting this OS version github.setup glfw glfw 3.2.1 checksums rmd160 5fb5988736a0a2812426907ab8d64b94eeacc010 \ sha256 34bc25f8111501eec35a52fd39fa50336a0c2e812d4a14454c7c946458ab015c \ size 472539 long_description ${description}. This version of GLFW is the latest to provide support for \ Mac OS X 10.7 and 10.8, and it will not be updated. It is provided in the \ hope that it allows ports depending on GLFW to build on these older Mac OS X installs. patchfiles patch-CMakeLists.txt.321.1.diff \ patch-CMakeLists.txt.321.2.diff } else { # Mac OS X 10.9 and newer: release and devel # requires c11 support as of 82ca58da (20190305) for # ; 3.3 was released shortly after this change, so # this requirement is now for all modern GLFW. compiler.c_standard 2011 # support was introduced in Xcode 7.0 PortGroup compiler_blacklist_versions 1.0 compiler.blacklist-append {clang < 700} compiler.cxx_standard 2011 configure.args-append -DCMAKE_C_STANDARD=11 -DCMAKE_C_EXTENSIONS=OFF subport glfw-devel {} if {${subport} eq ${name}} { # release github.setup glfw glfw 3.3.8 checksums rmd160 aac71462e51d45d1d0ce4954a8fb2b814c0edf82 \ sha256 fdee571ce0dd08c6ec5810266ff62c6792ebba7f4d518512015dee4e95a45012 \ size 803920 revision 0 # bump the epoch because I moved the version from 20151012 to 3.1.2 epoch 1 conflicts glfw-devel long_description ${description}: \ This port follows the release version of GLFW, which is typically updated every 6 months. If for some reason this port does not build or function as desired, try the ${name}-devel port. # patch to fix install directory for cmake files and docs patchfiles-append patch-CMakeLists.txt.release.diff } else { # devel github.setup glfw glfw c18851f52ec9704eb06464058a600845ec1eada1 version 20220727-[string range ${github.version} 0 7] checksums rmd160 9616cb03f7ccefc1732c5e5fc8aabf8bec4029f0 \ sha256 61a27e5426d9d9b45df3f29b30a9c0f41e2541ddd04e46743085b386c4030028 \ size 859351 revision 0 conflicts glfw long_description ${description}: \ This port follows the GIT master version of GLFW, which is typically updated every few days to weeks. # patch to fix install directory for cmake files and docs patchfiles-append patch-CMakeLists.txt.devel.diff # because I messed up a version as "202105623-52d8347d_0", which # because of the messed up date is always greater than a correctly # formatted date, which means livecheck will never show a newer version. epoch 1 } } # use the real home page, not github's homepage https://www.glfw.org # do VPATH (out of source tree) build cmake.out_of_source yes # configuration arguments for MacPorts build configure.args-append \ -DBUILD_SHARED_LIBS=on \ -DGLFW_BUILD_EXAMPLES=off \ -DGLFW_BUILD_TESTS=off \ -DGLFW_CMAKE_CONFIG_PATH=share \ -DBUILD_BUILD_DOCS=off # remove top-level library path, such that internal libraries are used # instead of any already-installed ones. configure.ldflags-delete -L${prefix}/lib variant docs description {build documentation} { # Default value is ON configure.args-delete -DBUILD_BUILD_DOCS=off } if {${build_arch} ni [list ppc ppc64]} { # Doxygen fails on PPC with Bus error due to malloc issues. # See: https://github.com/iains/darwin-toolchains-start-here/discussions/20 default_variants +docs } if {[variant_isset docs]} { depends_build-append path:bin/doxygen:doxygen configure.args-append -DDOXYGEN_EXECUTABLE=${prefix}/bin/doxygen } else { configure.args-append -DDOXYGEN_EXECUTABLE= }