nixpkgs-suyu/pkgs/development/libraries/mesa/opencl.patch
2022-10-13 15:40:56 -03:00

71 lines
2.9 KiB
Diff

diff --git a/meson_options.txt b/meson_options.txt
index b8f753e2e1a..2163e3ab7ee 100644
--- a/meson_options.txt
+++ b/meson_options.txt
@@ -18,6 +18,12 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
+option(
+ 'clang-libdir',
+ type : 'string',
+ value : '',
+ description : 'Locations to search for clang libraries.'
+)
option(
'platforms',
type : 'array',
diff --git a/src/gallium/targets/opencl/meson.build b/src/gallium/targets/opencl/meson.build
index 14df6b86f7f..adcd5110342 100644
--- a/src/gallium/targets/opencl/meson.build
+++ b/src/gallium/targets/opencl/meson.build
@@ -30,6 +30,7 @@ if with_ld_version_script
endif
llvm_libdir = dep_llvm.get_variable(cmake : 'LLVM_LIBRARY_DIR', configtool: 'libdir')
+clang_libdir = get_option('clang-libdir')
opencl_libname = with_opencl_icd ? 'MesaOpenCL' : 'OpenCL'
polly_dep = null_dep
@@ -60,19 +61,19 @@ else
endif
if not (dep_clang.found() and dep_clang_usable)
dep_clang = [
- cpp.find_library('clangCodeGen', dirs : llvm_libdir),
- cpp.find_library('clangFrontendTool', dirs : llvm_libdir),
- cpp.find_library('clangFrontend', dirs : llvm_libdir),
- cpp.find_library('clangDriver', dirs : llvm_libdir),
- cpp.find_library('clangSerialization', dirs : llvm_libdir),
- cpp.find_library('clangParse', dirs : llvm_libdir),
- cpp.find_library('clangSema', dirs : llvm_libdir),
- cpp.find_library('clangAnalysis', dirs : llvm_libdir),
- cpp.find_library('clangAST', dirs : llvm_libdir),
- cpp.find_library('clangASTMatchers', dirs : llvm_libdir),
- cpp.find_library('clangEdit', dirs : llvm_libdir),
- cpp.find_library('clangLex', dirs : llvm_libdir),
- cpp.find_library('clangBasic', dirs : llvm_libdir),
+ cpp.find_library('clangCodeGen', dirs : clang_libdir),
+ cpp.find_library('clangFrontendTool', dirs : clang_libdir),
+ cpp.find_library('clangFrontend', dirs : clang_libdir),
+ cpp.find_library('clangDriver', dirs : clang_libdir),
+ cpp.find_library('clangSerialization', dirs : clang_libdir),
+ cpp.find_library('clangParse', dirs : clang_libdir),
+ cpp.find_library('clangSema', dirs : clang_libdir),
+ cpp.find_library('clangAnalysis', dirs : clang_libdir),
+ cpp.find_library('clangAST', dirs : clang_libdir),
+ cpp.find_library('clangASTMatchers', dirs : clang_libdir),
+ cpp.find_library('clangEdit', dirs : clang_libdir),
+ cpp.find_library('clangLex', dirs : clang_libdir),
+ cpp.find_library('clangBasic', dirs : clang_libdir),
polly_dep, polly_isl_dep,
]
# check clang once more
@@ -112,7 +113,7 @@ if with_opencl_icd
input : 'mesa.icd.in',
output : 'mesa.icd',
install : true,
- install_dir : join_paths(get_option('sysconfdir'), 'OpenCL', 'vendors'),
+ install_dir : join_paths(get_option('prefix'), 'etc', 'OpenCL', 'vendors'),
)
if meson.version().version_compare('>= 0.58')