| 1 | # -*- 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 |
|---|
| 2 | # $Id$ |
|---|
| 3 | |
|---|
| 4 | PortSystem 1.0 |
|---|
| 5 | |
|---|
| 6 | name mesa |
|---|
| 7 | |
|---|
| 8 | # Yes, it's a dated version. Newer versions of mesa don't work on darwin, so |
|---|
| 9 | # we're stuck here for a while If you need a newer version, join the |
|---|
| 10 | # xquartz-dev mailing list, and let us know why. |
|---|
| 11 | |
|---|
| 12 | version 7.10.3 |
|---|
| 13 | categories x11 graphics |
|---|
| 14 | maintainers jeremyhu openmaintainer |
|---|
| 15 | description Mesa 3D Graphics Library |
|---|
| 16 | long_description Mesa is an open-source implementation of the OpenGL specification, a system for rendering interactive 3D graphics. |
|---|
| 17 | |
|---|
| 18 | homepage http://mesa3d.sourceforge.net/ |
|---|
| 19 | distfiles MesaLib-${version}.tar.bz2 \ |
|---|
| 20 | MesaGLUT-${version}.tar.bz2 |
|---|
| 21 | |
|---|
| 22 | worksrcdir Mesa-${version} |
|---|
| 23 | platforms macosx darwin |
|---|
| 24 | use_bzip2 yes |
|---|
| 25 | master_sites http://www.buraphalinux.org/download/bls2.0/dvd_source/source/xorg/xserver/mesa/ \ |
|---|
| 26 | ftp://ftp.freedesktop.org/pub/mesa/${version}/ |
|---|
| 27 | checksums MesaLib-7.10.3.tar.bz2 \ |
|---|
| 28 | rmd160 bd9800a0cf98560a4424742cac635b4c07a39647 \ |
|---|
| 29 | sha256 1e701fc839b872677ddca9ed8784d754c9da1fbeda98173980e06aa7df0e85c0 \ |
|---|
| 30 | MesaGLUT-7.10.3.tar.bz2 \ |
|---|
| 31 | rmd160 b3f166343210abbeabfc70ac3dba289ec5e34e96 \ |
|---|
| 32 | sha256 a18edbdda2d722103417c54008e78e5de84fbbcadd7a218f25d4bc59da8962f5 |
|---|
| 33 | |
|---|
| 34 | depends_build \ |
|---|
| 35 | bin:makedepend:makedepend \ |
|---|
| 36 | bin:tclsh8.5:tcl |
|---|
| 37 | |
|---|
| 38 | depends_lib \ |
|---|
| 39 | port:xorg-glproto \ |
|---|
| 40 | port:xorg-dri2proto \ |
|---|
| 41 | port:xorg-libXfixes \ |
|---|
| 42 | port:xorg-libXi \ |
|---|
| 43 | port:xorg-libXmu |
|---|
| 44 | |
|---|
| 45 | use_configure no |
|---|
| 46 | use_parallel_build yes |
|---|
| 47 | |
|---|
| 48 | patch.pre_args -p1 |
|---|
| 49 | patchfiles \ |
|---|
| 50 | 0001-apple-applegl_destroy_context-Pass-along-the-correct.patch |
|---|
| 51 | |
|---|
| 52 | build.target default |
|---|
| 53 | build.args-append INSTALL_DIR=${prefix} |
|---|
| 54 | destroot.args-append INSTALL_DIR=${prefix} |
|---|
| 55 | |
|---|
| 56 | # Ensure correct compilers are used in Makefiles. |
|---|
| 57 | if {${os.platform} == "darwin" && ${os.major} == 9} { |
|---|
| 58 | # http://trac.macports.org/ticket/24345 |
|---|
| 59 | configure.cc /usr/bin/gcc-4.2 |
|---|
| 60 | configure.cxx /usr/bin/g++-4.2 |
|---|
| 61 | } |
|---|
| 62 | |
|---|
| 63 | variant universal {} |
|---|
| 64 | if {[variant_isset universal]} { |
|---|
| 65 | set extra_cflags ${configure.universal_cflags} |
|---|
| 66 | set extra_ldflags ${configure.universal_ldflags} |
|---|
| 67 | } else { |
|---|
| 68 | set extra_cflags ${configure.cc_archflags} |
|---|
| 69 | set extra_ldflags ${configure.ld_archflags} |
|---|
| 70 | } |
|---|
| 71 | |
|---|
| 72 | if {$extra_cflags != ""} { |
|---|
| 73 | append build.args " " RC_CFLAGS="${extra_cflags}" |
|---|
| 74 | } |
|---|
| 75 | |
|---|
| 76 | if { ![file exists /usr/include/Xplugin.h] } { |
|---|
| 77 | # Xplugin.h is missing on Tiger |
|---|
| 78 | configure.cppflags-append -I${filespath}/include |
|---|
| 79 | } |
|---|
| 80 | |
|---|
| 81 | configure.cppflags-delete -I${prefix}/include |
|---|
| 82 | build.args-append \ |
|---|
| 83 | CC="${configure.cc} ${configure.cppflags}" \ |
|---|
| 84 | CXX="${configure.cxx} ${configure.cppflags}" |
|---|
| 85 | |
|---|
| 86 | post-extract { |
|---|
| 87 | if {! [file exists "${worksrcpath}/configs/current"]} { |
|---|
| 88 | ln -s darwin ${worksrcpath}/configs/current |
|---|
| 89 | } |
|---|
| 90 | } |
|---|
| 91 | |
|---|
| 92 | post-patch { |
|---|
| 93 | # Ensure correct compilers are used in mklib. |
|---|
| 94 | reinplace "s:LINK=\"g++\":LINK=\"${configure.cxx}\":" ${worksrcpath}/bin/mklib |
|---|
| 95 | reinplace "s:LINK=\"cc\":LINK=\"${configure.cc}\":" ${worksrcpath}/bin/mklib |
|---|
| 96 | } |
|---|
| 97 | |
|---|
| 98 | pre-configure { |
|---|
| 99 | if { ![file exists /usr/lib/libXplugin.dylib] } { |
|---|
| 100 | ui_error "Detected a problem with your development environment. Please work around it by executing:" |
|---|
| 101 | ui_error "sudo ln -s libXplugin.1.dylib /usr/lib/libXplugin.dylib" |
|---|
| 102 | return -code error "missing libXplugin.dylib" |
|---|
| 103 | } |
|---|
| 104 | } |
|---|
| 105 | |
|---|
| 106 | variant iglx description {Install a libGL that uses your X11 server's indirect GLX path for rendering (the default is off which allows libGL to accelerate rendering using OpenGL.framework)} { |
|---|
| 107 | patchfiles-append mesa-7.10.2-iglx.patch |
|---|
| 108 | } |
|---|
| 109 | |
|---|
| 110 | variant python26 conflicts python27 description {Use python 2.6} { |
|---|
| 111 | depends_build-append \ |
|---|
| 112 | port:py26-libxml2 |
|---|
| 113 | build.args-append \ |
|---|
| 114 | PYTHON2="${prefix}/bin/python2.6" |
|---|
| 115 | } |
|---|
| 116 | |
|---|
| 117 | variant python27 conflicts python26 description {Use python 2.7} { |
|---|
| 118 | depends_build-append \ |
|---|
| 119 | port:py27-libxml2 |
|---|
| 120 | build.args-append \ |
|---|
| 121 | PYTHON2="${prefix}/bin/python2.7" |
|---|
| 122 | } |
|---|
| 123 | |
|---|
| 124 | if {![variant_isset python26] && ![variant_isset python27]} { |
|---|
| 125 | default_variants +python27 |
|---|
| 126 | } |
|---|
| 127 | |
|---|
| 128 | platform darwin 8 { |
|---|
| 129 | patchfiles-append tiger-exports.patch |
|---|
| 130 | |
|---|
| 131 | post-patch { |
|---|
| 132 | # These are being comented out to find out if they're still broken |
|---|
| 133 | # 6/6/2011 |
|---|
| 134 | # http://trac.macports.org/ticket/24345 |
|---|
| 135 | # http://trac.macports.org/ticket/24393 |
|---|
| 136 | #reinplace "/SRC_DIRS/ s/gallium//" ${worksrcpath}/configs/darwin |
|---|
| 137 | #reinplace "/SRC_DIRS/ s/mesa//" ${worksrcpath}/configs/darwin |
|---|
| 138 | |
|---|
| 139 | # libOSMesa fails on Tiger, too... |
|---|
| 140 | #reinplace "/DRIVER_DIRS/ s/osmesa//" ${worksrcpath}/configs/darwin |
|---|
| 141 | |
|---|
| 142 | # http://trac.macports.org/ticket/24366 |
|---|
| 143 | reinplace "s:-fno-strict-aliasing:-fno-strict-aliasing -fno-common:g" ${worksrcpath}/configs/darwin |
|---|
| 144 | } |
|---|
| 145 | |
|---|
| 146 | post-activate { |
|---|
| 147 | if {[variant_isset hw_render]} { |
|---|
| 148 | ui_msg "In order to use OpenGL on Tiger, you need to use MacPorts' X11 server (xorg-server) rather than Apple's." |
|---|
| 149 | } |
|---|
| 150 | } |
|---|
| 151 | } |
|---|
| 152 | |
|---|
| 153 | livecheck.type regex |
|---|
| 154 | livecheck.url http://www.buraphalinux.org/download/bls1.4/dvd_source/source/x11/xserver/mesa/ |
|---|
| 155 | livecheck.regex "MesaLib-(\\d+\\.\[02468\](?:\\.\\d+)*)${extract.suffix}" |
|---|