diff --git a/.gitmodules b/.gitmodules index c52265e3..43cc76d0 100644 --- a/.gitmodules +++ b/.gitmodules @@ -43,3 +43,9 @@ [submodule "Vulkan-Loader"] path = Vulkan-Loader url = https://github.com/KhronosGroup/Vulkan-Loader +[submodule "gst-libav"] + path = gst-libav + url = https://github.com/GStreamer/gst-libav +[submodule "ffmpeg"] + path = ffmpeg + url = https://github.com/FFmpeg/FFmpeg diff --git a/Makefile.in b/Makefile.in index 33061cf2..b9158ff0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -53,6 +53,7 @@ include $(SRC)/make/rules-common.mk include $(SRC)/make/rules-meson.mk include $(SRC)/make/rules-cmake.mk include $(SRC)/make/rules-autoconf.mk +include $(SRC)/make/rules-configure.mk include $(SRC)/make/rules-winemaker.mk include $(SRC)/make/rules-cargo.mk @@ -351,7 +352,7 @@ $(DIST_FONTS): fonts ALL_TARGETS += dist GOAL_TARGETS += dist -dist_prefix: wine gst_good +dist_prefix: wine gst_good gst_libav find $(DST_LIBDIR32)/wine -type f -execdir chmod a-w '{}' '+' find $(DST_LIBDIR64)/wine -type f -execdir chmod a-w '{}' '+' rm -rf $(abspath $(DIST_PREFIX)) @@ -491,6 +492,37 @@ $(eval $(call rules-source,gst_good,$(SRCDIR)/gst-plugins-good)) $(eval $(call rules-meson,gst_good,32)) $(eval $(call rules-meson,gst_good,64)) +## +## FFmpeg +## + +FFMPEG_CONFIGURE_ARGS := \ + --enable-shared \ + --disable-static \ + --disable-everything \ + --disable-programs \ + --disable-doc \ + +$(eval $(call rules-source,ffmpeg,$(SRCDIR)/ffmpeg)) +$(eval $(call rules-configure,ffmpeg,32)) +$(eval $(call rules-configure,ffmpeg,64)) + +## Only use ffmpeg to build gst-libav; we don't ship it. +$(OBJ)/.ffmpeg-dist32: + touch $@ +$(OBJ)/.ffmpeg-dist64: + touch $@ + +## +## gst-libav +## + +GST_LIBAV_DEPENDS = gst_orc gstreamer gst_base ffmpeg + +$(eval $(call rules-source,gst_libav,$(SRCDIR)/gst-libav)) +$(eval $(call rules-meson,gst_libav,32)) +$(eval $(call rules-meson,gst_libav,64)) + ## ## Vulkan-Headers diff --git a/ffmpeg b/ffmpeg new file mode 160000 index 00000000..a77521cd --- /dev/null +++ b/ffmpeg @@ -0,0 +1 @@ +Subproject commit a77521cd5d27e955b16e8097eecefc779ffdcb6d diff --git a/gst-libav b/gst-libav new file mode 160000 index 00000000..e896aabe --- /dev/null +++ b/gst-libav @@ -0,0 +1 @@ +Subproject commit e896aabe3c3d278510fb567712c4a55ed0eae075 diff --git a/make/rules-configure.mk b/make/rules-configure.mk new file mode 100644 index 00000000..d04a3c53 --- /dev/null +++ b/make/rules-configure.mk @@ -0,0 +1,39 @@ +# parameters: +# $(1): lowercase package name +# $(2): uppercase package name +# $(3): 32/64, build type +# $(4): CROSS/, cross compile +# +define create-rules-configure +$(call create-rules-common,$(1),$(2),$(3),$(4)) + +ifeq ($(CONTAINER),1) +$$(OBJ)/.$(1)-configure$(3): + @echo ":: configuring $(3)bit $(1)..." >&2 + + cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ + $$($(2)_SRC)/configure $(--quiet?) \ + --cross-prefix=$$(TARGET_$(3))- \ + --arch=$(CONFIGURE_ARCH$(3)) \ + --target-os=linux \ + --prefix="$$($(2)_DST$(3))" \ + --libdir="$$($(2)_DST$(3))/lib$(subst 32,,$(3))" \ + $$($(2)_CONFIGURE_ARGS) \ + $$($(2)_CONFIGURE_ARGS$(3)) + + touch $$@ + +$$(OBJ)/.$(1)-build$(3): + @echo ":: building $(3)bit $(1)..." >&2 + cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ + $$(MAKE) + cd "$$($(2)_OBJ$(3))" && env $$($(2)_ENV$(3)) \ + $$(MAKE) install + touch $$@ +endif +endef + +CONFIGURE_ARCH32 = x86 +CONFIGURE_ARCH64 = x86_64 + +rules-configure = $(call create-rules-configure,$(1),$(call toupper,$(1)),$(2),$(3))