[vlc-commits] contrib: libplacebo: update to v1.7.0-rc1

Thomas Guillem git at videolan.org
Wed Nov 7 17:09:46 CET 2018


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Wed Jun 27 16:07:30 2018 +0200| [4e599bd5cbe4f28a65299b06abc0c748d335db05] | committer: Thomas Guillem

contrib: libplacebo: update to v1.7.0-rc1

And use meson.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=4e599bd5cbe4f28a65299b06abc0c748d335db05
---

 .../src/libplacebo/0001-build-use-a-Makefile.patch | 107 ---------------------
 .../0001-meson-fix-glslang-search-path.patch       |  64 ++++++++++++
 contrib/src/libplacebo/SHA512SUMS                  |   2 +-
 contrib/src/libplacebo/rules.mak                   |  30 +++---
 4 files changed, 80 insertions(+), 123 deletions(-)

diff --git a/contrib/src/libplacebo/0001-build-use-a-Makefile.patch b/contrib/src/libplacebo/0001-build-use-a-Makefile.patch
deleted file mode 100644
index 86ab90dbef..0000000000
--- a/contrib/src/libplacebo/0001-build-use-a-Makefile.patch
+++ /dev/null
@@ -1,107 +0,0 @@
-From 3899884d6c15251255b8217ae19f78a8f5d0a08c Mon Sep 17 00:00:00 2001
-From: Thomas Guillem <thomas at gllm.fr>
-Date: Mon, 30 Oct 2017 14:32:03 +0100
-Subject: [PATCH 1/3] build: use a Makefile
-
-Only needed for VLC 3.0
----
- Makefile     | 45 +++++++++++++++++++++++++++++++++++++++++++++
- src/config.h | 41 +++++++++++++++++++++++++++++++++++++++++
- 2 files changed, 86 insertions(+)
- create mode 100644 Makefile
- create mode 100644 src/config.h
-
-diff --git a/Makefile b/Makefile
-new file mode 100644
-index 0000000..4c431cf
---- /dev/null
-+++ b/Makefile
-@@ -0,0 +1,38 @@
-+SRCS := colorspace.c common.c context.c dither.c dispatch.c filters.c ra.c renderer.c shaders.c \
-+	shaders/colorspace.c shaders/sampling.c spirv.c bstr/bstr.c bstr/format.c 3rdparty/siphash.c \
-+	ta/ta.c ta/ta_utils.c ta/talloc.c
-+
-+lpthread_libs = $(shell $(LD) -lpthread && echo "-lpthread" || echo "")
-+
-+OBJS = $(patsubst %.c, $(OBJDIR)src/%.o, $(SRCS))
-+
-+CFLAGS += -D_ISOC99_SOURCE -D_GNU_SOURCE \
-+	-Isrc -Isrc/osdep -Isrc/include \
-+	-fvisibility=hidden -Wall -Wundef -Wmissing-prototypes -Wshadow \
-+	-Wparentheses -Wpointer-arith -Wno-pointer-sign
-+
-+targets = libplacebo.a
-+
-+all: $(targets)
-+
-+install: $(targets)
-+	rm -rf $(PREFIX)/include/libplacebo
-+	mkdir -p $(PREFIX)/lib/pkgconfig/ $(PREFIX)/include/libplacebo
-+	cp -r src/include/libplacebo $(PREFIX)/include
-+	cp src/config.h $(PREFIX)/include/libplacebo
-+	cp libplacebo.a $(PREFIX)/lib/
-+	@echo "Name: libplacebo" > $(PREFIX)/lib/pkgconfig/libplacebo.pc
-+	@echo "Description: Reusable library for GPU-accelerated video/image rendering" >> $(PREFIX)/lib/pkgconfig/libplacebo.pc
-+	@echo "Version: 0.2.1" >> $(PREFIX)/lib/pkgconfig/libplacebo.pc
-+	@echo "Libs: -L$(PREFIX)/lib -lplacebo $(lpthread_libs)" >> $(PREFIX)/lib/pkgconfig/libplacebo.pc
-+	@echo "Cflags: -I$(PREFIX)/include" >> $(PREFIX)/lib/pkgconfig/libplacebo.pc
-+
-+$(OBJDIR)/%.o: src/%.c
-+	$(CC) -c $(CFLAGS) $< -o $@
-+
-+libplacebo.a: $(OBJS)
-+	$(AR) csr $@ $^
-+
-+clean:
-+	rm -f *.o
-+	rm -f $(targets)
-diff --git a/src/config.h b/src/config.h
-new file mode 100644
-index 0000000..85aac82
---- /dev/null
-+++ b/src/config.h
-@@ -0,0 +1,41 @@
-+/*
-+ * This file is part of libplacebo.
-+ *
-+ * libplacebo is free software; you can redistribute it and/or
-+ * modify it under the terms of the GNU Lesser General Public
-+ * License as published by the Free Software Foundation; either
-+ * version 2.1 of the License, or (at your option) any later version.
-+ *
-+ * libplacebo is distributed in the hope that it will be useful,
-+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
-+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-+ * GNU Lesser General Public License for more details.
-+ *
-+ * You should have received a copy of the GNU Lesser General Public
-+ * License along with libplacebo.  If not, see <http://www.gnu.org/licenses/>.
-+ */
-+
-+#ifndef LIBPLACEBO_CONFIG_H_
-+#define LIBPLACEBO_CONFIG_H_
-+
-+// Increased any time the library changes in a fundamental/major way.
-+#define PL_MAJOR_VER 0
-+
-+// Increased any time the API changes. (Note: Does not reset when PL_MAJOR_VER
-+// is increased)
-+#define PL_API_VER 2
-+
-+// Increased any time a fix is made to a given API version.
-+#define PL_FIX_VER 1
-+
-+// Friendly name (`git describe`) for the overall version of the library
-+#define PL_VERSION "v0.2.1"
-+
-+// Feature tests. These aren't described in further detail, but may be useful
-+// for programmers wanting to programmatically check for feature support
-+// in their compiled libshaderc versions.
-+#define PL_HAVE_SHADERC 0
-+#define PL_HAVE_VULKAN 0
-+
-+
-+#endif // LIBPLACEBO_CONTEXT_H_
--- 
-2.11.0
-
diff --git a/contrib/src/libplacebo/0001-meson-fix-glslang-search-path.patch b/contrib/src/libplacebo/0001-meson-fix-glslang-search-path.patch
new file mode 100644
index 0000000000..920402b690
--- /dev/null
+++ b/contrib/src/libplacebo/0001-meson-fix-glslang-search-path.patch
@@ -0,0 +1,64 @@
+From 9b3c97d83d92b2f56120c08cd796e81410da45f2 Mon Sep 17 00:00:00 2001
+From: Thomas Guillem <thomas at gllm.fr>
+Date: Wed, 24 Oct 2018 10:28:55 +0200
+Subject: [PATCH] meson: fix glslang search path
+
+---
+ src/meson.build | 24 ++++++++++++++++--------
+ 1 file changed, 16 insertions(+), 8 deletions(-)
+
+diff --git a/src/meson.build b/src/meson.build
+index 6b2b07d56b..ff58b60f5f 100644
+--- a/src/meson.build
++++ b/src/meson.build
+@@ -25,6 +25,12 @@ build_opts = [
+ ]
+ 
+ link_args = []
++# Meson doesn't seem to add ${prefix/}lib and ${prefix}/include directories
++# into link/includes search directories. This is needed by glslang (that
++# doesn't have a .pc file).
++prefix_option = get_option('prefix')
++prefix_lib = prefix_option + '/lib'
++prefix_include = include_directories(prefix_option + '/include')
+ 
+ cc = meson.get_compiler('c')
+ cxx = meson.get_compiler('cpp')
+@@ -91,12 +97,12 @@ glslang_combined = disabler()
+ glslang_min_ver = 2763
+ glslang_req = get_option('glslang')
+ glslang_deps = [
+-  cxx.find_library('glslang',     required: glslang_req),
+-  cxx.find_library('HLSL',        required: glslang_req),
+-  cxx.find_library('OGLCompiler', required: glslang_req),
+-  cxx.find_library('OSDependent', required: glslang_req),
+-  cxx.find_library('SPIRV',       required: glslang_req),
+-  cxx.find_library('SPVRemapper', required: glslang_req),
++  cxx.find_library('glslang',     dirs: prefix_lib, required: glslang_req),
++  cxx.find_library('HLSL',        dirs: prefix_lib, required: glslang_req),
++  cxx.find_library('OGLCompiler', dirs: prefix_lib, required: glslang_req),
++  cxx.find_library('OSDependent', dirs: prefix_lib, required: glslang_req),
++  cxx.find_library('SPIRV',       dirs: prefix_lib, required: glslang_req),
++  cxx.find_library('SPVRemapper', dirs: prefix_lib, required: glslang_req),
+ ]
+ 
+ glslang_found = true
+@@ -106,11 +112,13 @@ endforeach
+ 
+ if glslang_found
+   glslang_ver = cxx.get_define('GLSLANG_PATCH_LEVEL',
+-      prefix: '#include <glslang/Include/revision.h>'
++      prefix: '#include <glslang/Include/revision.h>',
++      include_directories : prefix_include
+   ).to_int()
+ 
+   if glslang_ver >= glslang_min_ver
+-    glslang_combined = declare_dependency(dependencies: glslang_deps)
++    glslang_combined = declare_dependency(dependencies: glslang_deps,
++        include_directories : prefix_include)
+   else
+     error('glslang revision @0@ too old! Must be at least @1@'
+           .format(glslang_ver, glslang_min_ver))
+-- 
+2.19.1
+
diff --git a/contrib/src/libplacebo/SHA512SUMS b/contrib/src/libplacebo/SHA512SUMS
index a8e6eb7d09..b49b48014a 100644
--- a/contrib/src/libplacebo/SHA512SUMS
+++ b/contrib/src/libplacebo/SHA512SUMS
@@ -1 +1 @@
-d662c1972ee36f45d1e75b1c38edb7d2a47a1df8dedd811c37662ae88514403c978088bc4a42c3bf850b22e9cc882cb5de730bf2463f36caf284f6172e177dbb  libplacebo-0.2.1.tar.gz
+b15144f40bc0604e2e37449b96f9cb31a7da9970392d3746f18092e99d28891cdeb61458c2d5868fd7c6c3ecc5b37509a1dc2e3604345021cca2fbad513f760f  libplacebo-1.7.0-rc1.tar.gz
diff --git a/contrib/src/libplacebo/rules.mak b/contrib/src/libplacebo/rules.mak
index 216b79591c..f0c83f696c 100644
--- a/contrib/src/libplacebo/rules.mak
+++ b/contrib/src/libplacebo/rules.mak
@@ -1,23 +1,23 @@
 # libplacebo
 
-PLACEBO_VERSION := 0.2.1
+PLACEBO_VERSION := 1.7.0-rc1
 PLACEBO_URL := https://github.com/haasn/libplacebo/archive/v$(PLACEBO_VERSION).tar.gz
 PLACEBO_ARCHIVE = libplacebo-$(PLACEBO_VERSION).tar.gz
 
-LIBPLACEBO_CFLAGS   := $(CFLAGS) $(PIC)
-LIBPLACEBO_CXXFLAGS := $(CXXFLAGS) $(PIC)
-ifdef HAVE_WIN32
-LIBPLACEBO_WIN32 = HAVE_WIN32=1
-endif
+DEPS_libplacebo = glslang
 
 PKGS += libplacebo
 ifeq ($(call need_pkg,"libplacebo"),)
 PKGS_FOUND += libplacebo
 endif
 
-PLACEBOCONF := --prefix="$(PREFIX)" \
-	--libdir lib \
-	--default-library static
+ifdef HAVE_WIN32
+PLACEBOCONF :=
+else
+PLACEBOCONF := -Dvulkan=enabled \
+	-Dglslang=enabled \
+	-Dshaderc=disabled
+endif
 
 $(TARBALLS)/$(PLACEBO_ARCHIVE):
 	$(call download_pkg,$(PLACEBO_URL),libplacebo)
@@ -26,13 +26,13 @@ $(TARBALLS)/$(PLACEBO_ARCHIVE):
 
 libplacebo: $(PLACEBO_ARCHIVE) .sum-libplacebo
 	$(UNPACK)
-	$(APPLY) $(SRC)/libplacebo/0001-build-use-a-Makefile.patch
+	$(APPLY) $(SRC)/libplacebo/0001-meson-fix-glslang-search-path.patch
 	$(MOVE)
 
-.libplacebo: libplacebo
+.libplacebo: libplacebo crossfile.meson
 	cd $< && rm -rf ./build
-# we don't want to depend on meson/ninja for VLC 3.0
-#cd $< && $(HOSTVARS) meson $(PLACEBOCONF) build
-#cd $< && cd build && ninja install
-	cd $< && $(HOSTVARS_PIC) PREFIX=$(PREFIX) $(LIBPLACEBO_WIN32) CFLAGS="$(LIBPLACEBO_CFLAGS)" CXXFLAGS="$(LIBPLACEBO_CXXFLAGS)" make install
+	cd $< && $(HOSTVARS_MESON) $(MESON) $(PLACEBOCONF) build
+	cd $< && cd build && ninja install
+# Work-around messon issue https://github.com/mesonbuild/meson/issues/4091
+	sed -i $(PREFIX)/lib/pkgconfig/libplacebo.pc -e 's/Libs: \(.*\) -L$${libdir} -lplacebo/Libs: -L$${libdir} -lplacebo \1/g'
 	touch $@



More information about the vlc-commits mailing list