2 # This file and its contents are supplied under the terms of the
3 # Common Development and Distribution License ("CDDL"), version 1.0.
4 # You may only use this file in accordance with the terms of version
7 # A full copy of the text of the CDDL should have accompanied this
8 # source. A copy of the CDDL is also available via the Internet at
9 # http://www.illumos.org/license/CDDL.
13 # Copyright 2015 Alexander Pyhalov
14 # Copyright 2015 Ken Mays
19 include ..
/..
/..
/make-rules
/shared-macros.mk
22 COMPONENT_VERSION
= 21.3.9
24 COMPONENT_SUMMARY
= The Mesa
3-D Graphics Library
25 COMPONENT_SRC
= mesa-
$(COMPONENT_VERSION
)
26 COMPONENT_ARCHIVE
= mesa-
$(COMPONENT_VERSION
).
tar.xz
27 COMPONENT_ARCHIVE_HASH
= sha256
:91fe6f20339884e37a7c47bfba42fb1cd397512c9ed5ad423de369f047cd8b5c
28 COMPONENT_ARCHIVE_URL
= https
://archive.mesa3d.org
/$(COMPONENT_ARCHIVE
)
29 COMPONENT_PROJECT_URL
= http
://www.mesa3d.org
/
31 TEST_TARGET
= $(NO_TESTS
)
32 include $(WS_MAKE_RULES
)/common.mk
36 ARCHLIBSUBDIR
.64= /$(MACH64
)
37 ARCHLIBSUBDIR
= $(ARCHLIBSUBDIR.
$(BITS
))
39 SERVERMOD_SUBDIR
.64= /$(MACH64
)
40 SERVERMOD_SUBDIR
= $(SERVERMOD_SUBDIR.
$(BITS
))
41 X11_SERVERMODS_DIR
= /usr
/lib
/xorg
/modules
42 X11_SERVERLIBS_DIR
= /usr
/lib
/xorg
44 # Identify source_file files in hard links for manifest generator.
45 #PKG_HARDLINKS += usr/lib/xorg/modules/dri/radeon_dri.so
47 CONFIGURE_OPTIONS
+= --libdir='lib/mesa/amd64'
49 PKG_HARDLINKS
+= usr
/lib
/xorg
/modules
/dri
/$(MACH64
)/kms_swrast_dri.so
51 # Command line options to GNU autoconf configure script
52 CONFIGURE_OPTIONS
+= -Dgallium-drivers
='swrast, i915, r600'
53 CONFIGURE_OPTIONS
+= -Dvulkan-drivers
=''
54 CONFIGURE_OPTIONS
+= -Dgbm
=enabled
55 CONFIGURE_OPTIONS
+= -Dglvnd
=false
56 # Wayland currently requires linux specific socket options and epoll for events.
57 CONFIGURE_OPTIONS
+= -Dplatforms
='x11'
58 # llvm is disabled due to requiring llvm 16 we do not have 16
59 CONFIGURE_OPTIONS
+= -Dllvm
=false
60 CONFIGURE_OPTIONS
+= -Dglx
='auto'
61 CONFIGURE_OPTIONS
+= -Degl
=enabled
62 CONFIGURE_OPTIONS
+= -Dgles1
=enabled
63 CONFIGURE_OPTIONS
+= -Dgles2
=enabled
64 CONFIGURE_OPTIONS
+= -Dosmesa
=true
65 CONFIGURE_OPTIONS
+= -Dshared-glapi
=enabled
66 CONFIGURE_OPTIONS
+= -Dgallium-xvmc
=enabled
67 CONFIGURE_OPTIONS
+= -Dgallium-xa
=enabled
68 CONFIGURE_OPTIONS
+= -Ddri-drivers
=''
69 CONFIGURE_OPTIONS
+= -Ddri-drivers-path
='$(X11_SERVERMODS_DIR)/dri$(SERVERMOD_SUBDIR)'
70 CONFIGURE_OPTIONS
+= -Delf-tls
=false
73 CFLAGS
+= -Wno-incompatible-pointer-types
-D_POSIX_PTHREAD_SEMANTICS
74 CPPFLAGS
+= -D__STDC_CONSTANT_MACROS
-D__STDC_LIMIT_MACROS
-Drestrict
=__restrict__
-DHAVE_NOATEXIT
75 #LDFLAGS += -Wl,-zgnu-version-script-compat
76 # This code has init cycles and multiple C++ libraries, and misbehaves
77 # when lazy loading is used. Since we're unable to restructure third
78 # party code at that level, we must instead disable lazy loading.
79 LDFLAGS
+= -Wl
,-znolazyload
80 LDFLAGS
+= -Wl
,-z
,rescan-now
81 CFLAGS
+= -Wstack-protector
-fdata-sections
-fstack-protector-all
82 LD_OPTIONS
+= -z ignore
-lssp
-lsocket
-lnsl
83 #LD_OPTIONS += -z discard-unused=dependencies
84 #LD_OPTIONS += -M $(COMPONENT_DIR)/mapfile.externs
85 CONFIGURE_ENV
+= PYTHON
=$(PYTHON
)
86 CONFIGURE_ENV
+= CPPFLAGS
="$(CPPFLAGS)"
88 # Add RPATH to xorg lib directory where is libdrm.
90 COMPONENT_POST_INSTALL_ACTION
.64 += \
91 for f in libgbm.so
.1.0.0 libEGL.so
.1.0.0 libGL.so
.1.2.0 libxatracker.so
.2.5.0 libXvMCr600.so
.1.0.0 vdpau
/libvdpau_r600.so
.1.0.0; do \
92 elfedit
-e
"dyn:runpath /usr/lib/mesa/$(MACH64):/usr/lib/xorg/$(MACH64):$(GCC_LIBDIR)" \
93 $(PROTOUSRLIBDIR
)/mesa
/$(MACH64
)/$$f ; \
95 elfedit
-e
"dyn:runpath /usr/lib/mesa/$(MACH64):/usr/lib/xorg/$(MACH64):$(GCC_LIBDIR)" \
96 $(PROTOUSRLIBDIR
)/xorg
/modules
/dri
/$(MACH64
)/i915_dri.so
; \
97 mv
$(PROTOUSRDIR
)/include/GL
$(PROTOUSRDIR
)/include/mesa
99 # Manually added build dependencies
100 REQUIRED_PACKAGES
+= x11
/header
/x11-protocols
101 REQUIRED_PACKAGES
+= x11
/library
/libpthread-stubs
102 REQUIRED_PACKAGES
+= system
/header
/header-drm
103 REQUIRED_PACKAGES
+= library
/graphics
/libvdpau
105 # Auto-generated dependencies
106 REQUIRED_PACKAGES
+= $(GCC_RUNTIME_PKG
)
107 REQUIRED_PACKAGES
+= $(GXX_RUNTIME_PKG
)
108 REQUIRED_PACKAGES
+= compress
/zstd
109 REQUIRED_PACKAGES
+= library
/expat
110 REQUIRED_PACKAGES
+= library
/zlib
111 REQUIRED_PACKAGES
+= service
/opengl
/ogl-select
112 REQUIRED_PACKAGES
+= system
/library
113 REQUIRED_PACKAGES
+= system
/library
/math
114 REQUIRED_PACKAGES
+= x11
/header
/x11-protocols
115 REQUIRED_PACKAGES
+= x11
/library
/glu
116 REQUIRED_PACKAGES
+= x11
/library
/libdrm
117 REQUIRED_PACKAGES
+= x11
/library
/libx11
118 REQUIRED_PACKAGES
+= x11
/library
/libxcb
119 REQUIRED_PACKAGES
+= x11
/library
/libxext
120 REQUIRED_PACKAGES
+= x11
/library
/libxfixes
121 REQUIRED_PACKAGES
+= x11
/library
/libxshmfence
122 REQUIRED_PACKAGES
+= x11
/library
/libxv
123 REQUIRED_PACKAGES
+= x11
/library
/libxvmc
124 REQUIRED_PACKAGES
+= x11
/library
/libxxf86vm