1 | SUMMARY="Multi-platform GL implementation"
|
---|
2 | DESCRIPTION="Mesa is an open-source implementation of the OpenGL \
|
---|
3 | specification. The OpenGL specification documents a system for rendering \
|
---|
4 | interactive 3D graphics. Mesa fills the role of the Haiku OpenGL kit \
|
---|
5 | providing 3D rendering to Haiku applications."
|
---|
6 | HOMEPAGE="http://www.mesa3d.org/"
|
---|
7 | COPYRIGHT="1999-2018 Brian Paul"
|
---|
8 | LICENSE="MIT"
|
---|
9 | SOURCE_URI="https://mesa.freedesktop.org/archive/mesa-${portVersion}.tar.xz"
|
---|
10 | CHECKSUM_SHA256="cbc0d681cc4df47d8deb5a36f45b420978128522fd665b2cd4c7096316f11bdb"
|
---|
11 | PATCHES="mesa-$portVersion.patchset"
|
---|
12 |
|
---|
13 |
|
---|
14 | ARCHITECTURES="!x86_gcc2 x86 x86_64 ?arm ?ppc"
|
---|
15 | SECONDARY_ARCHITECTURES="x86"
|
---|
16 |
|
---|
17 | PROVIDES="
|
---|
18 | mesa$secondaryArchSuffix = $portVersion
|
---|
19 | lib:libGL$secondaryArchSuffix = 1.0.0 compat >= 1
|
---|
20 | lib:libEGL$secondaryArchSuffix = 1.0.0 compat >= 1
|
---|
21 | lib:libOSMesa$secondaryArchSuffix = 8.0.0 compat >= 8
|
---|
22 | "
|
---|
23 | REQUIRES="
|
---|
24 | haiku$secondaryArchSuffix
|
---|
25 | lib:libz$secondaryArchSuffix
|
---|
26 | "
|
---|
27 |
|
---|
28 | PROVIDES_devel="
|
---|
29 | mesa${secondaryArchSuffix}_devel = $portVersion
|
---|
30 | devel:libGL$secondaryArchSuffix = 1.0.0 compat >= 1
|
---|
31 | devel:libEGL$secondaryArchSuffix = 1.0.0 compat >= 1
|
---|
32 | devel:libOSMesa$secondaryArchSuffix = 8.0.0 compat >= 8
|
---|
33 | "
|
---|
34 | REQUIRES_devel="
|
---|
35 | mesa$secondaryArchSuffix == $portVersion base
|
---|
36 | "
|
---|
37 |
|
---|
38 | SUMMARY_swpipe="The Mesa LLVM enhanced Gallium software pipe renderer"
|
---|
39 | DESCRIPTION_swpipe="This 3D BGLRenderer add-on provides Gallium LLVM \
|
---|
40 | enhanced software rendering. Software pipe rendering performs all \
|
---|
41 | 3D rendering on the systems CPU and doesn't require any specialized \
|
---|
42 | hardware. The usage of LLVM over traditional rasterization gives this \
|
---|
43 | renderer a boost in performance.
|
---|
44 |
|
---|
45 | Gallium software pipe rendering is in an extremely early state as of \
|
---|
46 | this version of Mesa, and may not function as expected."
|
---|
47 |
|
---|
48 | PROVIDES_swpipe="
|
---|
49 | mesa${secondaryArchSuffix}_swpipe = $portVersion
|
---|
50 | "
|
---|
51 | REQUIRES_swpipe="
|
---|
52 | mesa$secondaryArchSuffix == $portVersion base
|
---|
53 | lib:libLLVM_5.0$secondaryArchSuffix
|
---|
54 | "
|
---|
55 |
|
---|
56 | BUILD_REQUIRES="
|
---|
57 | haiku${secondaryArchSuffix}_devel
|
---|
58 | devel:libz$secondaryArchSuffix
|
---|
59 | devel:libLLVM_5.0$secondaryArchSuffix
|
---|
60 | "
|
---|
61 | BUILD_PREREQUIRES="
|
---|
62 | cmd:aclocal
|
---|
63 | cmd:autoconf
|
---|
64 | cmd:automake
|
---|
65 | cmd:llvm_config
|
---|
66 | cmd:egrep
|
---|
67 | cmd:gcc$secondaryArchSuffix
|
---|
68 | cmd:ld$secondaryArchSuffix
|
---|
69 | cmd:libtoolize$secondaryArchSuffix
|
---|
70 | cmd:make
|
---|
71 | cmd:pkg_config$secondaryArchSuffix
|
---|
72 | cmd:which
|
---|
73 | "
|
---|
74 |
|
---|
75 | BUILD()
|
---|
76 | {
|
---|
77 | if [ -n "$secondaryArchSuffix" ]; then
|
---|
78 | export HAIKU_SECONDARY_ARCH="$effectiveTargetArchitecture"
|
---|
79 | fi
|
---|
80 |
|
---|
81 | autoreconf -fi
|
---|
82 | # for whatever reason, the llvm_require_version function is busted, so we
|
---|
83 | # manually patch it here
|
---|
84 | sed -i 's@"\$LLVM_VERSION_MAJOR" -gt "\$llvm_target_version_major"@true@' configure
|
---|
85 | sed -i 's@-DHAVE_LLVM=0x0\$LLVM_VERSION_INT@-DHAVE_LLVM=0x0500@' configure
|
---|
86 | runConfigure ./configure \
|
---|
87 | --enable-llvm \
|
---|
88 | --disable-dri \
|
---|
89 | --disable-glx \
|
---|
90 | --disable-glx-tls \
|
---|
91 | --disable-gbm \
|
---|
92 | --disable-gles1 \
|
---|
93 | --disable-gles2 \
|
---|
94 | --disable-shared-glapi \
|
---|
95 | --with-gallium-drivers=swrast \
|
---|
96 | --enable-osmesa \
|
---|
97 | --with-platforms=haiku
|
---|
98 |
|
---|
99 | make $jobArgs
|
---|
100 | }
|
---|
101 |
|
---|
102 | INSTALL()
|
---|
103 | {
|
---|
104 | make install
|
---|
105 |
|
---|
106 | rm $libDir/lib*.la
|
---|
107 |
|
---|
108 | # Our rendering add-ons
|
---|
109 | mkdir -p $addOnsDir/opengl
|
---|
110 | mv $(find $libDir -name 'libswpipe.so') \
|
---|
111 | "$addOnsDir/opengl/Software Pipe"
|
---|
112 | strip -s "$addOnsDir/opengl/Software Pipe"
|
---|
113 | rm -rf $libDir/haiku
|
---|
114 |
|
---|
115 | # Set some nice version info
|
---|
116 | appVersion=${portVersion//\./ }
|
---|
117 | setversion "$libDir/libGL.so" -app $appVersion -long "Haiku OpenGL kit"
|
---|
118 | setversion "$libDir/libEGL.so.1" -app $appVersion -long "Mesa EGL"
|
---|
119 | setversion "$addOnsDir/opengl/Software Pipe" -app $appVersion -long "Gallium LLVM software pipe renderer"
|
---|
120 |
|
---|
121 | prepareInstalledDevelLibs \
|
---|
122 | libGL libEGL libOSMesa
|
---|
123 | fixPkgconfig
|
---|
124 |
|
---|
125 | # for compatibility
|
---|
126 | symlinkRelative -s $libDir/libGL.so.1 $libDir/libGL.so
|
---|
127 |
|
---|
128 | # OpenGL Kit
|
---|
129 | mkdir -p $includeDir/os/opengl
|
---|
130 | cp ./include/HaikuGL/OpenGLKit.h $includeDir/os/
|
---|
131 | cp ./include/HaikuGL/GLView.h $includeDir/os/opengl/
|
---|
132 | cp ./include/HaikuGL/GLRenderer.h $includeDir/os/opengl/
|
---|
133 |
|
---|
134 | # Create GL symlink in opengl kit
|
---|
135 | symlinkRelative -s $includeDir/GL $includeDir/os/opengl/GL
|
---|
136 | # Create EGL symlink in opengl kit
|
---|
137 | symlinkRelative -s $includeDir/EGL $includeDir/os/opengl/EGL
|
---|
138 | # Create KHR symlink in opengl kit
|
---|
139 | symlinkRelative -s $includeDir/KHR $includeDir/os/opengl/KHR
|
---|
140 |
|
---|
141 | # devel package
|
---|
142 | packageEntries devel \
|
---|
143 | $developDir
|
---|
144 |
|
---|
145 | # swpipe renderer package
|
---|
146 | packageEntries swpipe \
|
---|
147 | "$addOnsDir/opengl/Software Pipe"
|
---|
148 | }
|
---|