[vlc-commits] contrib: libplacebo: use a Makefile

Thomas Guillem git at videolan.org
Fri Nov 3 11:11:49 CET 2017


vlc | branch: master | Thomas Guillem <thomas at gllm.fr> | Mon Oct 30 14:56:10 2017 +0100| [9d2aa2f16085446216229c807d23969204147ba5] | committer: Thomas Guillem

contrib: libplacebo: use a Makefile

Since we don't want to depend on meson/ninja/python3 for VLC 3.0

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

 .../src/libplacebo/0001-build-use-a-Makefile.patch | 107 +++++++++++++++++++++
 contrib/src/libplacebo/rules.mak                   |   7 +-
 2 files changed, 112 insertions(+), 2 deletions(-)

diff --git a/contrib/src/libplacebo/0001-build-use-a-Makefile.patch b/contrib/src/libplacebo/0001-build-use-a-Makefile.patch
new file mode 100644
index 0000000000..d6d2c7e10b
--- /dev/null
+++ b/contrib/src/libplacebo/0001-build-use-a-Makefile.patch
@@ -0,0 +1,107 @@
+From 185f0ee9dc6ca6b46a43c669d98b5b63020a04e5 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] build: use a Makefile
+
+Only needed for VLC 3.0
+---
+ Makefile     | 38 ++++++++++++++++++++++++++++++++++++++
+ src/config.h | 41 +++++++++++++++++++++++++++++++++++++++++
+ 2 files changed, 79 insertions(+)
+ create mode 100644 Makefile
+ create mode 100644 src/config.h
+
+diff --git a/Makefile b/Makefile
+new file mode 100644
+index 0000000..36e7f26
+--- /dev/null
++++ b/Makefile
+@@ -0,0 +1,38 @@
++SRCS := colorspace.c common.c context.c dispatch.c filters.c ra.c shaders.c \
++	shaders/colorspace.c shaders/sampling.c spirv.c bstr/bstr.c siphash.c \
++	ta/ta.c ta/ta_utils.c ta/talloc.c osdep/printf_useloc_posix.c
++
++OBJS = $(patsubst %.c, $(OBJDIR)src/%.o, $(SRCS))
++
++CFLAGS += -D_ISOC99_SOURCE -D_GNU_SOURCE \
++	-Isrc -Isrc/osdep \
++	-fvisibility=hidden -Wall -Wundef -Wmissing-prototypes -Wshadow \
++	-Wparentheses -Wpointer-arith -Wno-pointer-sign
++
++targets = libplacebo.a
++
++all: $(targets)
++
++lpthread_libs = $(shell $(LD) -lpthread && echo "-lpthread" || echo "")
++
++install: $(targets)
++	rm -rf $(PREFIX)/include/libplacebo
++	mkdir -p $(PREFIX)/lib/pkgconfig/
++	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.1.0" >> $(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..d49992f
+--- /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 1
++
++// Increased any time a fix is made to a given API version.
++#define PL_FIX_VER 0
++
++// Friendly name (`git describe`) for the overall version of the library
++#define PL_VERSION "v0.1.0"
++
++// 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/rules.mak b/contrib/src/libplacebo/rules.mak
index 456515d8ed..43ebd087d9 100644
--- a/contrib/src/libplacebo/rules.mak
+++ b/contrib/src/libplacebo/rules.mak
@@ -15,10 +15,13 @@ $(TARBALLS)/$(PLACEBO_ARCHIVE):
 
 libplacebo: $(PLACEBO_ARCHIVE) .sum-libplacebo
 	$(UNPACK)
+	$(APPLY) $(SRC)/libplacebo/0001-build-use-a-Makefile.patch
 	$(MOVE)
 
 .libplacebo: libplacebo
 	cd $< && rm -rf ./build
-	cd $< && $(HOSTVARS) meson $(PLACEBOCONF) build
-	cd $< && cd build && ninja install
+# 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) make install
 	touch $@



More information about the vlc-commits mailing list