Radix cross Linux

Radix Linux distribution for embedded systems.

637 Commits   4 Branches   3 Tags
author: Andrey V.Kosteltsev <kx@radix.pro> 2016-10-17 09:22:37 +0000 committer: Andrey V.Kosteltsev <kx@radix.pro> 2016-10-17 09:22:37 +0000 commit: 4be8884d42e533c72eb658d3bc0e82f7ebca9b4a parent: c0448fad70ae6b11643e096a0db5dd6810e7017b
Commit Summary:
libx264 - H.264 (MPEG-4 AVC) encoder library
Diffstat:
12 files changed, 679 insertions, 3 deletions
diff --git a/libs/libx264/0.148.20160920-x86_32/Makefile b/libs/libx264/0.148.20160920-x86_32/Makefile
new file mode 100644
index 000000000..a89a1dff5
--- /dev/null
+++ b/libs/libx264/0.148.20160920-x86_32/Makefile
@@ -0,0 +1,168 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC64)
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+CREATE_X86_32_PACKAGE = true
+
+
+include ../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/m/VideoLAN/x264
+
+REQUIRES           = libs/libx264/0.148.20160920
+REQUIRES          += libs/glibc/2.23-x86_32
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 0.148.20160920
+short_version      = $(shell echo $(version) | cut -f 1,2 -d '.').x
+tar_xz_archive     = $(SRC_PACKAGE_PATH)/packages/m/VideoLAN/x264/x264-$(version).tar.xz
+SRC_ARCHIVE        = $(tar_xz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/x264-$(version)
+src_dir_name       = x264-$(version)
+doc_dir_name       = libx264-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = libs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+LIBX264_32_PKG_NAME                = libx264-x32
+LIBX264_32_PKG_VERSION             = 0.148.20160920
+LIBX264_32_PKG_ARCH                = $(TOOLCHAIN)
+LIBX264_32_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+LIBX264_32_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+LIBX264_32_PKG_GROUP               = $(PKG_GROUP)
+###                                 |---handy-ruler-------------------------------|
+LIBX264_32_PKG_SHORT_DESCRIPTION   = H.264/MPEG-4 AVC encoder library
+LIBX264_32_PKG_URL                 = $(BUG_URL)
+LIBX264_32_PKG_LICENSE             = GPLv2
+LIBX264_32_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(LIBX264_32_PKG_NAME)-pkg-description
+LIBX264_32_PKG_DESCRIPTION_FILE_IN = $(LIBX264_32_PKG_NAME)-pkg-description.in
+LIBX264_32_PKG_INSTALL_SCRIPT      = $(LIBX264_32_PKG_NAME)-pkg-install.sh
+
+LIBX264_32_PKG    = $(CURDIR)/$(TARGET_BUILD_DIR)/$(LIBX264_32_PKG_NAME)-package
+
+pkg_basename      = $(LIBX264_32_PKG_NAME)-$(LIBX264_32_PKG_VERSION)-$(LIBX264_32_PKG_ARCH)-$(LIBX264_32_PKG_DISTRO_NAME)-$(LIBX264_32_PKG_DISTRO_VERSION)
+
+pkg_archive       = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature     = $(call sign-name,$(pkg_archive))
+pkg_description   = $(call desc-name,$(pkg_archive))
+products          = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS     = $(build_target)
+BUILD_TARGETS    += $(install_target)
+
+PRODUCT_TARGETS   = $(products)
+
+ROOTFS_TARGETS    = $(pkg_archive)
+
+
+include ../../../build-system/core.mk
+
+
+env_sysroot = DESTDIR=$(LIBX264_32_PKG)
+
+
+ENABLE_X86_YASM = yes
+
+
+extra_configure_switches  = --libdir=/usr/lib$(MULTILIB_X86_32_SUFFIX)
+extra_configure_switches += --bindir=/usr/bin/32
+
+extra_configure_switches += --disable-cli
+extra_configure_switches += --disable-opencl
+
+extra_configure_switches += --bit-depth='8'
+extra_configure_switches += --chroma-format=all
+
+extra_configure_switches += --enable-pic
+
+extra_configure_switches += --disable-avs
+extra_configure_switches += --disable-swscale
+extra_configure_switches += --disable-lavf
+extra_configure_switches += --disable-ffms
+extra_configure_switches += --disable-gpac
+extra_configure_switches += --disable-lsmash
+
+extra_configure_switches += --enable-shared
+
+
+ifeq ($(ENABLE_X86_YASM),yes)
+extra_x86_environment  = AS=/usr/bin/yasm
+else
+extra_configure_switches += --disable-asm
+endif
+
+
+TARGET_LIB_RPATH = /lib$(MULTILIB_X86_32_SUFFIX):/usr/lib$(MULTILIB_X86_32_SUFFIX):/usr/lib/../lib$(MULTILIB_X86_32_SUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@cd $(SRC_DIR) && \
+	  $(BUILD_ENVIRONMENT) $(extra_x86_environment) ./configure \
+	  --prefix=/usr               \
+	  --host=$(TARGET32)          \
+	  $(extra_configure_switches)
+	@cd $(SRC_DIR) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(LIBX264_32_PKG)
+	@cd $(SRC_DIR) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	@rm -rf $(LIBX264_32_PKG)/usr/include
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(LIBX264_32_PKG))
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(MULTILIB_X86_32_SUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" x264.pc ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(LIBX264_32_PKG) ; \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	 )
+	@touch $@
+
+$(LIBX264_32_PKG_DESCRIPTION_FILE): $(LIBX264_32_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(short_version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(LIBX264_32_PKG_DESCRIPTION_FILE) $(LIBX264_32_PKG_INSTALL_SCRIPT)
+	@cp $(LIBX264_32_PKG_DESCRIPTION_FILE) $(LIBX264_32_PKG)/.DESCRIPTION
+	@cp $(LIBX264_32_PKG_INSTALL_SCRIPT) $(LIBX264_32_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(LIBX264_32_PKG)/.REQUIRES
+	@echo "pkgname=$(LIBX264_32_PKG_NAME)"                            >  $(LIBX264_32_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(LIBX264_32_PKG_VERSION)"                          >> $(LIBX264_32_PKG)/.PKGINFO ; \
+	 echo "arch=$(LIBX264_32_PKG_ARCH)"                               >> $(LIBX264_32_PKG)/.PKGINFO ; \
+	 echo "distroname=$(LIBX264_32_PKG_DISTRO_NAME)"                  >> $(LIBX264_32_PKG)/.PKGINFO ; \
+	 echo "distrover=$(LIBX264_32_PKG_DISTRO_VERSION)"                >> $(LIBX264_32_PKG)/.PKGINFO ; \
+	 echo "group=$(LIBX264_32_PKG_GROUP)"                             >> $(LIBX264_32_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(LIBX264_32_PKG_SHORT_DESCRIPTION)\"" >> $(LIBX264_32_PKG)/.PKGINFO ; \
+	 echo "url=$(LIBX264_32_PKG_URL)"                                 >> $(LIBX264_32_PKG)/.PKGINFO ; \
+	 echo "license=$(LIBX264_32_PKG_LICENSE)"                         >> $(LIBX264_32_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(LIBX264_32_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/libs/libx264/0.148.20160920-x86_32/PATCHES b/libs/libx264/0.148.20160920-x86_32/PATCHES
new file mode 100644
index 000000000..7cc05a665
--- /dev/null
+++ b/libs/libx264/0.148.20160920-x86_32/PATCHES
@@ -0,0 +1,2 @@
+
+../../../sources/packages/m/VideoLAN/x264/patches/x264-0.148.20160920-gnu-as.patch -p0
diff --git a/libs/libx264/0.148.20160920-x86_32/libx264-x32-pkg-description.in b/libs/libx264/0.148.20160920-x86_32/libx264-x32-pkg-description.in
new file mode 100644
index 000000000..f8bd1c291
--- /dev/null
+++ b/libs/libx264/0.148.20160920-x86_32/libx264-x32-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+           |-----handy-ruler------------------------------------------------------|
+libx264-x32: libx264-x32 @VERSION@ (x86_32 H.264/MPEG-4 AVC encoder library)
+libx264-x32:
+libx264-x32: x264 is a free software library for encoding video streams into the
+libx264-x32: H.264/MPEG-4 AVC compression format, and is released under the terms
+libx264-x32: of the GNU GPL.
+libx264-x32:
+libx264-x32:
+libx264-x32: Homepage: http://www.videolan.org/developers/x264.html
+libx264-x32:
+libx264-x32:
+libx264-x32:
diff --git a/libs/libx264/0.148.20160920-x86_32/libx264-x32-pkg-install.sh b/libs/libx264/0.148.20160920-x86_32/libx264-x32-pkg-install.sh
new file mode 100755
index 000000000..8e8683cd6
--- /dev/null
+++ b/libs/libx264/0.148.20160920-x86_32/libx264-x32-pkg-install.sh
@@ -0,0 +1,39 @@
+#!/bin/sh
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/libs/libx264/0.148.20160920/Makefile b/libs/libx264/0.148.20160920/Makefile
new file mode 100644
index 000000000..7ec3dcbee
--- /dev/null
+++ b/libs/libx264/0.148.20160920/Makefile
@@ -0,0 +1,216 @@
+
+COMPONENT_TARGETS  = $(HARDWARE_PC32)
+COMPONENT_TARGETS += $(HARDWARE_PC64)
+COMPONENT_TARGETS += $(HARDWARE_CB1X)
+COMPONENT_TARGETS += $(HARDWARE_CB2X)
+COMPONENT_TARGETS += $(HARDWARE_CB3X)
+COMPONENT_TARGETS += $(HARDWARE_FFRK3288)
+COMPONENT_TARGETS += $(HARDWARE_M201)
+COMPONENT_TARGETS += $(HARDWARE_MXQ)
+COMPONENT_TARGETS += $(HARDWARE_NIT6Q)
+COMPONENT_TARGETS += $(HARDWARE_OMAP5UEVM)
+COMPONENT_TARGETS += $(HARDWARE_DRA7XXEVM)
+COMPONENT_TARGETS += $(HARDWARE_CI20)
+COMPONENT_TARGETS += $(HARDWARE_BT1)
+
+
+NEED_ABS_PATH      = true
+COMPONENT_IS_3PP   = true
+
+
+include ../../../build-system/constants.mk
+
+
+SOURCE_REQUIRES    = sources/packages/m/VideoLAN/x264
+
+ifeq ($(__USE_BUILT_GCC_LIBS__),yes)
+REQUIRES           = dev/gcc/5.3.0
+else
+REQUIRES          += libs/glibc/2.23
+endif
+
+# ======= __END_OF_REQUIRES__ =======
+
+
+version            = 0.148.20160920
+short_version      = $(shell echo $(version) | cut -f 1,2 -d '.').x
+tar_xz_archive     = $(SRC_PACKAGE_PATH)/packages/m/VideoLAN/x264/x264-$(version).tar.xz
+SRC_ARCHIVE        = $(tar_xz_archive)
+SRC_DIR            = $(TARGET_BUILD_DIR)/x264-$(version)
+src_dir_name       = x264-$(version)
+doc_dir_name       = libx264-$(version)
+src_done           = $(TARGET_BUILD_DIR)/.source_done
+
+PATCHES = PATCHES
+
+build_target       = $(TARGET_BUILD_DIR)/.build_done
+install_target     = $(TARGET_BUILD_DIR)/.install_done
+
+
+####### Targets
+
+PKG_GROUP = libs
+
+#
+# *PKG_NAME & *PKG_VERSION shouldn't be a reference to value.
+#
+LIBX264_PKG_NAME                = libx264
+LIBX264_PKG_VERSION             = 0.148.20160920
+LIBX264_PKG_ARCH                = $(TOOLCHAIN)
+LIBX264_PKG_DISTRO_NAME         = $(DISTRO_NAME)
+LIBX264_PKG_DISTRO_VERSION      = $(DISTRO_VERSION)
+LIBX264_PKG_GROUP               = $(PKG_GROUP)
+###                              |---handy-ruler-------------------------------|
+LIBX264_PKG_SHORT_DESCRIPTION   = H.264/MPEG-4 AVC encoder library
+LIBX264_PKG_URL                 = $(BUG_URL)
+LIBX264_PKG_LICENSE             = GPLv2
+LIBX264_PKG_DESCRIPTION_FILE    = $(TARGET_BUILD_DIR)/$(LIBX264_PKG_NAME)-pkg-description
+LIBX264_PKG_DESCRIPTION_FILE_IN = $(LIBX264_PKG_NAME)-pkg-description.in
+LIBX264_PKG_INSTALL_SCRIPT      = $(LIBX264_PKG_NAME)-pkg-install.sh
+
+LIBX264_PKG      = $(CURDIR)/$(TARGET_BUILD_DIR)/$(LIBX264_PKG_NAME)-package
+
+pkg_basename     = $(LIBX264_PKG_NAME)-$(LIBX264_PKG_VERSION)-$(LIBX264_PKG_ARCH)-$(LIBX264_PKG_DISTRO_NAME)-$(LIBX264_PKG_DISTRO_VERSION)
+
+pkg_archive      = $(TARGET_BUILD_DIR)/$(PKG_GROUP)/$(pkg_basename).$(pkg_arch_suffix)
+pkg_signature    = $(call sign-name,$(pkg_archive))
+pkg_description  = $(call desc-name,$(pkg_archive))
+products         = $(call pkg-files,$(pkg_archive))
+
+BUILD_TARGETS    = $(build_target)
+BUILD_TARGETS   += $(install_target)
+
+PRODUCT_TARGETS  = $(products)
+
+ROOTFS_TARGETS   = $(pkg_archive)
+
+
+include ../../../build-system/core.mk
+
+
+env_sysroot = DESTDIR=$(LIBX264_PKG)
+
+
+ENABLE_X86_YASM = yes
+
+
+extra_configure_switches  = --libdir=/usr/lib$(LIBSUFFIX)
+extra_configure_switches += --bindir=/usr/bin
+
+extra_configure_switches += --disable-cli
+extra_configure_switches += --disable-opencl
+
+extra_configure_switches += --bit-depth='8'
+extra_configure_switches += --chroma-format=all
+
+extra_configure_switches += --enable-pic
+
+extra_configure_switches += --disable-avs
+extra_configure_switches += --disable-swscale
+extra_configure_switches += --disable-lavf
+extra_configure_switches += --disable-ffms
+extra_configure_switches += --disable-gpac
+extra_configure_switches += --disable-lsmash
+
+extra_configure_switches += --enable-shared
+
+
+ifneq ($(filter $(HARDWARE),$(HARDWARE_CI20) $(HARDWARE_BT1)),)
+extra_configure_switches += --disable-asm
+endif
+
+ifneq ($(filter $(HARDWARE),$(HARDWARE_PC32) $(HARDWARE_PC64)),)
+ifeq ($(ENABLE_X86_YASM),yes)
+extra_x86_environment  = AS=/usr/bin/yasm
+else
+extra_configure_switches += --disable-asm
+endif
+endif
+
+
+TARGET_LIB_RPATH = /lib$(LIBSUFFIX):/usr/lib$(LIBSUFFIX):/usr/lib/../lib$(LIBSUFFIX)
+
+LDFLAGS += -Wl,-rpath,$(TARGET_LIB_RPATH)
+
+
+####### Dependencies
+
+$(src_done): $(SRC_ARCHIVE) $(PATCHES_DEP)
+	$(UNPACK_SRC_ARCHIVE)
+	$(APPLY_PATCHES)
+	@touch $@
+
+$(build_target): $(src_done)
+	@cd $(SRC_DIR) && \
+	  $(BUILD_ENVIRONMENT) $(extra_x86_environment) ./configure \
+	  --prefix=/usr               \
+	  --host=$(TARGET)            \
+	  $(extra_configure_switches)
+	@cd $(SRC_DIR) && $(BUILD_ENVIRONMENT) $(MAKE)
+	@touch $@
+
+$(install_target): $(build_target)
+	@mkdir -p $(LIBX264_PKG)
+	@cd $(SRC_DIR) && $(BUILD_ENVIRONMENT) $(MAKE) -j1 install $(env_sysroot)
+	# ======= Install Documentation =======
+	@if [ -d $(LIBX264_PKG)/usr/share/man ]; then \
+	  ( cd $(LIBX264_PKG)/usr/share/man ; \
+	    for manpagedir in `find . -type d -name "man*"` ; do \
+	      ( cd $$manpagedir ; \
+	        for eachpage in `find . -type l -maxdepth 1` ; do \
+	          ln -s `readlink $$eachpage`.gz $$eachpage.gz ; \
+	          rm $$eachpage ; \
+	        done ; \
+	        gzip -9 *.?  ; \
+	      ) \
+	    done \
+	  ) \
+	 fi
+	@mkdir -p $(LIBX264_PKG)/usr/doc/$(src_dir_name)
+	@cp -a $(SRC_DIR)/AUTHORS $(SRC_DIR)/COPYING \
+	       $(LIBX264_PKG)/usr/doc/$(src_dir_name)
+	@mkdir -p $(LIBX264_PKG)/usr/share/doc/$(src_dir_name)
+	@( cd $(SRC_DIR) ; \
+	   cp -a AUTHORS COPYING doc/*.txt \
+	         $(LIBX264_PKG)/usr/share/doc/$(src_dir_name) ; \
+	 )
+	@( cd $(SRC_DIR) ; \
+	   if [ -r ChangeLog ]; then \
+	     DOCSDIR=`echo $(LIBX264_PKG)/usr/share/doc/$(src_dir_name)` ; \
+	     cat ChangeLog | head -n 1000 > $$DOCSDIR/ChangeLog ; \
+	     touch -r ChangeLog $$DOCSDIR/ChangeLog ; \
+	   fi \
+	 )
+	# ======= Install the same to $(TARGET_DEST_DIR) =======
+	$(call install-into-devenv, $(LIBX264_PKG))
+	# ======= tune pkg-config *.pc search path to the target destination for development =======
+	@( cd $(TARGET_DEST_DIR)/usr/lib$(LIBSUFFIX)/pkgconfig ; \
+	   sed -i "s,/usr,$(TARGET_DEST_DIR)/usr,g" x264.pc ; \
+	 )
+	# ======= Strip binaries =======
+	@( cd $(LIBX264_PKG) ; \
+	   find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	   find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs $(STRIP) --strip-unneeded 2> /dev/null ; \
+	 )
+	@touch $@
+
+$(LIBX264_PKG_DESCRIPTION_FILE): $(LIBX264_PKG_DESCRIPTION_FILE_IN)
+	@cat $< | $(SED) -e "s/@VERSION@/$(short_version)/g" > $@
+
+$(pkg_signature)   : $(pkg_archive) ;
+$(pkg_description) : $(pkg_archive) ;
+
+$(pkg_archive): $(install_target) $(LIBX264_PKG_DESCRIPTION_FILE) $(LIBX264_PKG_INSTALL_SCRIPT)
+	@cp $(LIBX264_PKG_DESCRIPTION_FILE) $(LIBX264_PKG)/.DESCRIPTION
+	@cp $(LIBX264_PKG_INSTALL_SCRIPT) $(LIBX264_PKG)/.INSTALL
+	@$(BUILD_PKG_REQUIRES) $(LIBX264_PKG)/.REQUIRES
+	@echo "pkgname=$(LIBX264_PKG_NAME)"                            >  $(LIBX264_PKG)/.PKGINFO ; \
+	 echo "pkgver=$(LIBX264_PKG_VERSION)"                          >> $(LIBX264_PKG)/.PKGINFO ; \
+	 echo "arch=$(LIBX264_PKG_ARCH)"                               >> $(LIBX264_PKG)/.PKGINFO ; \
+	 echo "distroname=$(LIBX264_PKG_DISTRO_NAME)"                  >> $(LIBX264_PKG)/.PKGINFO ; \
+	 echo "distrover=$(LIBX264_PKG_DISTRO_VERSION)"                >> $(LIBX264_PKG)/.PKGINFO ; \
+	 echo "group=$(LIBX264_PKG_GROUP)"                             >> $(LIBX264_PKG)/.PKGINFO ; \
+	 echo "short_description=\"$(LIBX264_PKG_SHORT_DESCRIPTION)\"" >> $(LIBX264_PKG)/.PKGINFO ; \
+	 echo "url=$(LIBX264_PKG_URL)"                                 >> $(LIBX264_PKG)/.PKGINFO ; \
+	 echo "license=$(LIBX264_PKG_LICENSE)"                         >> $(LIBX264_PKG)/.PKGINFO
+	@$(FAKEROOT) sh -c "cd $(LIBX264_PKG) && chown -R root:root . && $(MAKE_PACKAGE) --linkadd yes .."
diff --git a/libs/libx264/0.148.20160920/PATCHES b/libs/libx264/0.148.20160920/PATCHES
new file mode 100644
index 000000000..7cc05a665
--- /dev/null
+++ b/libs/libx264/0.148.20160920/PATCHES
@@ -0,0 +1,2 @@
+
+../../../sources/packages/m/VideoLAN/x264/patches/x264-0.148.20160920-gnu-as.patch -p0
diff --git a/libs/libx264/0.148.20160920/libx264-pkg-description.in b/libs/libx264/0.148.20160920/libx264-pkg-description.in
new file mode 100644
index 000000000..68839a902
--- /dev/null
+++ b/libs/libx264/0.148.20160920/libx264-pkg-description.in
@@ -0,0 +1,19 @@
+# HOW TO EDIT THIS FILE:
+# The "handy ruler" below makes it easier to edit a package description.  Line
+# up the first '|' above the ':' following the base package name, and the '|'
+# on the right side marks the last column you can put a character in.  You must
+# make exactly 11 lines for the formatting to be correct.  It's also
+# customary to leave one space after the ':'.
+
+       |-----handy-ruler------------------------------------------------------|
+libx264: libx264 @VERSION@ (H.264/MPEG-4 AVC encoder library)
+libx264:
+libx264: x264 is a free software library for encoding video streams into the
+libx264: H.264/MPEG-4 AVC compression format, and is released under the terms
+libx264: of the GNU GPL.
+libx264:
+libx264:
+libx264: Homepage: http://www.videolan.org/developers/x264.html
+libx264:
+libx264:
+libx264:
diff --git a/libs/libx264/0.148.20160920/libx264-pkg-install.sh b/libs/libx264/0.148.20160920/libx264-pkg-install.sh
new file mode 100755
index 000000000..b44c4e648
--- /dev/null
+++ b/libs/libx264/0.148.20160920/libx264-pkg-install.sh
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+# Preserve new files
+install_file() {
+  NEW="$1"
+  OLD="`dirname $NEW`/`basename $NEW .new`"
+  # If there's no file by that name, mv it over:
+  if [ ! -r $OLD ]; then
+    mv $NEW $OLD
+  elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
+    rm $NEW
+  fi
+  # Otherwise, we leave the .new copy for the admin to consider...
+}
+
+
+# arg 1:  the new package version
+pre_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+post_install() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+pre_update() {
+  /bin/true
+}
+
+# arg 1:  the new package version
+# arg 2:  the old package version
+post_update() {
+  post_install
+}
+
+# arg 1:  the old package version
+pre_remove() {
+  /bin/true
+}
+
+# arg 1:  the old package version
+post_remove() {
+  /bin/true
+}
+
+
+operation=$1
+shift
+
+$operation $*
diff --git a/sources/packages/m/VideoLAN/x264/Makefile b/sources/packages/m/VideoLAN/x264/Makefile
index 2f0a1e505..8c9435e69 100644
--- a/sources/packages/m/VideoLAN/x264/Makefile
+++ b/sources/packages/m/VideoLAN/x264/Makefile
@@ -7,15 +7,19 @@ include ../../../../../build-system/constants.mk
 
 url         = $(DOWNLOAD_SERVER)/sources/packages/m/VideoLAN/x264
 
-versions    = 0.148.20160917
+versions    = 0.148.20160920
 pkgname     = x264
 suffix      = tar.xz
 
 tarballs    = $(addsuffix .$(suffix), $(addprefix $(pkgname)-, $(versions)))
 sha1s       = $(addsuffix .sha1sum, $(tarballs))
 
+patches     = $(CURDIR)/patches/x264-0.148.20160920-gnu-as.patch
 
-BUILD_TARGETS = $(tarballs) $(sha1s)
+.NOTPARALLEL: $(patches)
+
+
+BUILD_TARGETS = $(tarballs) $(sha1s) $(patches)
 
 
 include ../../../../../build-system/core.mk
@@ -43,5 +47,10 @@ $(sha1s): $(tarballs)
 	   fi ; \
 	 done
 
+$(patches): $(sha1s)
+	@echo -e "\n======= Create Patches =======\n" ; \
+	 ( cd create-0.148.20160920-gnu-as-patch ; ./create.patch.sh ) ; \
+	 echo -e "\n"
+
 download_clean:
-	@rm -f $(tarballs) $(sha1s)
+	@rm -f $(tarballs) $(sha1s) $(patches)
diff --git a/sources/packages/m/VideoLAN/x264/create-0.148.20160920-gnu-as-patch/create.patch.sh b/sources/packages/m/VideoLAN/x264/create-0.148.20160920-gnu-as-patch/create.patch.sh
new file mode 100755
index 000000000..e5a74d8ce
--- /dev/null
+++ b/sources/packages/m/VideoLAN/x264/create-0.148.20160920-gnu-as-patch/create.patch.sh
@@ -0,0 +1,15 @@
+#!/bin/sh
+
+VERSION=0.148.20160920
+
+tar --files-from=file.list -xJvf ../x264-$VERSION.tar.xz
+mv x264-$VERSION x264-$VERSION-orig
+
+cp -rf ./x264-$VERSION-new ./x264-$VERSION
+
+diff -b --unified -Nr  x264-$VERSION-orig  x264-$VERSION > x264-$VERSION-gnu-as.patch
+
+mv x264-$VERSION-gnu-as.patch ../patches
+
+rm -rf ./x264-$VERSION
+rm -rf ./x264-$VERSION-orig
diff --git a/sources/packages/m/VideoLAN/x264/create-0.148.20160920-gnu-as-patch/file.list b/sources/packages/m/VideoLAN/x264/create-0.148.20160920-gnu-as-patch/file.list
new file mode 100644
index 000000000..15427c231
--- /dev/null
+++ b/sources/packages/m/VideoLAN/x264/create-0.148.20160920-gnu-as-patch/file.list
@@ -0,0 +1 @@
+x264-0.148.20160920/Makefile
diff --git a/sources/packages/m/VideoLAN/x264/create-0.148.20160920-gnu-as-patch/x264-0.148.20160920-new/Makefile b/sources/packages/m/VideoLAN/x264/create-0.148.20160920-gnu-as-patch/x264-0.148.20160920-new/Makefile
new file mode 100644
index 000000000..5e5cea7a7
--- /dev/null
+++ b/sources/packages/m/VideoLAN/x264/create-0.148.20160920-gnu-as-patch/x264-0.148.20160920-new/Makefile
@@ -0,0 +1,321 @@
+# Makefile
+
+include config.mak
+
+vpath %.c $(SRCPATH)
+vpath %.h $(SRCPATH)
+vpath %.S $(SRCPATH)
+vpath %.asm $(SRCPATH)
+vpath %.rc $(SRCPATH)
+
+GENERATED =
+
+all: default
+default:
+
+SRCS = common/mc.c common/predict.c common/pixel.c common/macroblock.c \
+       common/frame.c common/dct.c common/cpu.c common/cabac.c \
+       common/common.c common/osdep.c common/rectangle.c \
+       common/set.c common/quant.c common/deblock.c common/vlc.c \
+       common/mvpred.c common/bitstream.c \
+       encoder/analyse.c encoder/me.c encoder/ratecontrol.c \
+       encoder/set.c encoder/macroblock.c encoder/cabac.c \
+       encoder/cavlc.c encoder/encoder.c encoder/lookahead.c
+
+SRCCLI = x264.c input/input.c input/timecode.c input/raw.c input/y4m.c \
+         output/raw.c output/matroska.c output/matroska_ebml.c \
+         output/flv.c output/flv_bytestream.c filters/filters.c \
+         filters/video/video.c filters/video/source.c filters/video/internal.c \
+         filters/video/resize.c filters/video/cache.c filters/video/fix_vfr_pts.c \
+         filters/video/select_every.c filters/video/crop.c filters/video/depth.c
+
+SRCSO =
+OBJS =
+OBJSO =
+OBJCLI =
+
+OBJCHK = tools/checkasm.o
+
+OBJEXAMPLE = example.o
+
+CONFIG := $(shell cat config.h)
+
+# GPL-only files
+ifneq ($(findstring HAVE_GPL 1, $(CONFIG)),)
+SRCCLI +=
+endif
+
+# Optional module sources
+ifneq ($(findstring HAVE_AVS 1, $(CONFIG)),)
+SRCCLI += input/avs.c
+endif
+
+ifneq ($(findstring HAVE_THREAD 1, $(CONFIG)),)
+SRCCLI += input/thread.c
+SRCS   += common/threadpool.c
+endif
+
+ifneq ($(findstring HAVE_WIN32THREAD 1, $(CONFIG)),)
+SRCS += common/win32thread.c
+endif
+
+ifneq ($(findstring HAVE_LAVF 1, $(CONFIG)),)
+SRCCLI += input/lavf.c
+endif
+
+ifneq ($(findstring HAVE_FFMS 1, $(CONFIG)),)
+SRCCLI += input/ffms.c
+endif
+
+ifneq ($(findstring HAVE_GPAC 1, $(CONFIG)),)
+SRCCLI += output/mp4.c
+endif
+
+ifneq ($(findstring HAVE_LSMASH 1, $(CONFIG)),)
+SRCCLI += output/mp4_lsmash.c
+endif
+
+# MMX/SSE optims
+ifneq ($(AS),)
+X86SRC0 = const-a.asm cabac-a.asm dct-a.asm deblock-a.asm mc-a.asm \
+          mc-a2.asm pixel-a.asm predict-a.asm quant-a.asm \
+          cpu-a.asm dct-32.asm bitstream-a.asm
+ifneq ($(findstring HIGH_BIT_DEPTH, $(CONFIG)),)
+X86SRC0 += sad16-a.asm
+else
+X86SRC0 += sad-a.asm
+endif
+X86SRC = $(X86SRC0:%=common/x86/%)
+
+ifeq ($(SYS_ARCH),X86)
+ARCH_X86 = yes
+ASMSRC   = $(X86SRC) common/x86/pixel-32.asm
+endif
+
+ifeq ($(SYS_ARCH),X86_64)
+ARCH_X86 = yes
+ASMSRC   = $(X86SRC:-32.asm=-64.asm) common/x86/trellis-64.asm
+endif
+
+ifdef ARCH_X86
+SRCS   += common/x86/mc-c.c common/x86/predict-c.c
+OBJASM  = $(ASMSRC:%.asm=%.o)
+$(OBJASM): common/x86/x86inc.asm common/x86/x86util.asm
+OBJCHK += tools/checkasm-a.o
+endif
+endif
+
+# AltiVec optims
+ifeq ($(SYS_ARCH),PPC)
+ifneq ($(AS),)
+SRCS += common/ppc/mc.c common/ppc/pixel.c common/ppc/dct.c \
+        common/ppc/quant.c common/ppc/deblock.c \
+        common/ppc/predict.c
+endif
+endif
+
+# NEON optims
+ifeq ($(SYS_ARCH),ARM)
+ifneq ($(AS),)
+ASMSRC += common/arm/cpu-a.S common/arm/pixel-a.S common/arm/mc-a.S \
+          common/arm/dct-a.S common/arm/quant-a.S common/arm/deblock-a.S \
+          common/arm/predict-a.S common/arm/bitstream-a.S
+SRCS   += common/arm/mc-c.c common/arm/predict-c.c
+OBJASM  = $(ASMSRC:%.S=%.o)
+OBJCHK += tools/checkasm-arm.o
+endif
+endif
+
+# AArch64 NEON optims
+ifeq ($(SYS_ARCH),AARCH64)
+ifneq ($(AS),)
+ASMSRC += common/aarch64/bitstream-a.S \
+          common/aarch64/cabac-a.S     \
+          common/aarch64/dct-a.S     \
+          common/aarch64/deblock-a.S \
+          common/aarch64/mc-a.S      \
+          common/aarch64/pixel-a.S   \
+          common/aarch64/predict-a.S \
+          common/aarch64/quant-a.S
+SRCS   += common/aarch64/asm-offsets.c \
+          common/aarch64/mc-c.c        \
+          common/aarch64/predict-c.c
+OBJASM  = $(ASMSRC:%.S=%.o)
+OBJCHK += tools/checkasm-aarch64.o
+endif
+endif
+
+# MSA optims
+ifeq ($(SYS_ARCH),MIPS)
+ifneq ($(findstring HAVE_MSA 1, $(CONFIG)),)
+SRCS += common/mips/mc-c.c common/mips/dct-c.c \
+        common/mips/deblock-c.c common/mips/pixel-c.c \
+        common/mips/predict-c.c common/mips/quant-c.c
+endif
+endif
+
+ifneq ($(HAVE_GETOPT_LONG),1)
+SRCCLI += extras/getopt.c
+endif
+
+ifeq ($(SYS),WINDOWS)
+OBJCLI += $(if $(RC), x264res.o)
+ifneq ($(SONAME),)
+SRCSO  += x264dll.c
+OBJSO  += $(if $(RC), x264res.dll.o)
+endif
+endif
+
+ifeq ($(HAVE_OPENCL),yes)
+common/oclobj.h: common/opencl/x264-cl.h $(wildcard $(SRCPATH)/common/opencl/*.cl)
+	cat $^ | $(SRCPATH)/tools/cltostr.sh $@
+GENERATED += common/oclobj.h
+SRCS += common/opencl.c encoder/slicetype-cl.c
+endif
+
+OBJS   += $(SRCS:%.c=%.o)
+OBJCLI += $(SRCCLI:%.c=%.o)
+OBJSO  += $(SRCSO:%.c=%.o)
+
+.PHONY: all default fprofiled clean distclean install install-* uninstall cli lib-* etags
+
+cli: x264$(EXE)
+lib-static: $(LIBX264)
+lib-shared: $(SONAME)
+
+$(LIBX264): $(GENERATED) .depend $(OBJS) $(OBJASM)
+	rm -f $(LIBX264)
+	$(AR)$@ $(OBJS) $(OBJASM)
+	$(if $(RANLIB), $(RANLIB) $@)
+
+$(SONAME): $(GENERATED) .depend $(OBJS) $(OBJASM) $(OBJSO)
+	$(LD)$@ $(OBJS) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS)
+
+ifneq ($(EXE),)
+.PHONY: x264 checkasm example
+x264: x264$(EXE)
+checkasm: checkasm$(EXE)
+example: example$(EXE)
+endif
+
+x264$(EXE): $(GENERATED) .depend $(OBJCLI) $(CLI_LIBX264)
+	$(LD)$@ $(OBJCLI) $(CLI_LIBX264) $(LDFLAGSCLI) $(LDFLAGS)
+
+checkasm$(EXE): $(GENERATED) .depend $(OBJCHK) $(LIBX264)
+	$(LD)$@ $(OBJCHK) $(LIBX264) $(LDFLAGS)
+
+example$(EXE): $(GENERATED) .depend $(OBJEXAMPLE) $(LIBX264)
+	$(LD)$@ $(OBJEXAMPLE) $(LIBX264) $(LDFLAGS)
+
+$(OBJS) $(OBJASM) $(OBJSO) $(OBJCLI) $(OBJCHK) $(OBJEXAMPLE): .depend
+
+%.o: %.asm common/x86/x86inc.asm common/x86/x86util.asm
+	$(AS) $(ASFLAGS) -o $@ $<
+	-@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
+
+%.o: %.S
+	$(CC) $(ASFLAGS) -o $@ $<
+	-@ $(if $(STRIP), $(STRIP) -x $@) # delete local/anonymous symbols, so they don't show up in oprofile
+
+%.dll.o: %.rc x264.h
+	$(RC) $(RCFLAGS)$@ -DDLL $<
+
+%.o: %.rc x264.h
+	$(RC) $(RCFLAGS)$@ $<
+
+.depend: config.mak
+	@rm -f .depend
+	@echo 'dependency file generation...'
+ifeq ($(COMPILER),CL)
+	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS) $(SRCCLI) $(SRCSO)), $(SRCPATH)/tools/msvsdepend.sh "$(CC)" "$(CFLAGS)" "$(SRC)" "$(SRC:$(SRCPATH)/%.c=%.o)" 1>> .depend;)
+else
+	@$(foreach SRC, $(addprefix $(SRCPATH)/, $(SRCS) $(SRCCLI) $(SRCSO)), $(CC) $(CFLAGS) $(SRC) $(DEPMT) $(SRC:$(SRCPATH)/%.c=%.o) $(DEPMM) 1>> .depend;)
+endif
+
+config.mak:
+	./configure
+
+depend: .depend
+ifneq ($(wildcard .depend),)
+include .depend
+endif
+
+SRC2 = $(SRCS) $(SRCCLI)
+# These should cover most of the important codepaths
+OPT0 = --crf 30 -b1 -m1 -r1 --me dia --no-cabac --direct temporal --ssim --no-weightb
+OPT1 = --crf 16 -b2 -m3 -r3 --me hex --no-8x8dct --direct spatial --no-dct-decimate -t0  --slice-max-mbs 50
+OPT2 = --crf 26 -b4 -m5 -r2 --me hex --cqm jvt --nr 100 --psnr --no-mixed-refs --b-adapt 2 --slice-max-size 1500
+OPT3 = --crf 18 -b3 -m9 -r5 --me umh -t1 -A all --b-pyramid normal --direct auto --no-fast-pskip --no-mbtree
+OPT4 = --crf 22 -b3 -m7 -r4 --me esa -t2 -A all --psy-rd 1.0:1.0 --slices 4
+OPT5 = --frames 50 --crf 24 -b3 -m10 -r3 --me tesa -t2
+OPT6 = --frames 50 -q0 -m9 -r2 --me hex -Aall
+OPT7 = --frames 50 -q0 -m2 -r1 --me hex --no-cabac
+
+ifeq (,$(VIDS))
+fprofiled:
+	@echo 'usage: make fprofiled VIDS="infile1 infile2 ..."'
+	@echo 'where infiles are anything that x264 understands,'
+	@echo 'i.e. YUV with resolution in the filename, y4m, or avisynth.'
+else
+fprofiled:
+	$(MAKE) clean
+	$(MAKE) x264$(EXE) CFLAGS="$(CFLAGS) $(PROF_GEN_CC)" LDFLAGS="$(LDFLAGS) $(PROF_GEN_LD)"
+	$(foreach V, $(VIDS), $(foreach I, 0 1 2 3 4 5 6 7, ./x264$(EXE) $(OPT$I) --threads 1 $(V) -o $(DEVNULL) ;))
+ifeq ($(COMPILER),CL)
+# Because Visual Studio timestamps the object files within the PGD, it fails to build if they change - only the executable should be deleted
+	rm -f x264$(EXE)
+else
+	rm -f $(SRC2:%.c=%.o)
+endif
+	$(MAKE) CFLAGS="$(CFLAGS) $(PROF_USE_CC)" LDFLAGS="$(LDFLAGS) $(PROF_USE_LD)"
+	rm -f $(SRC2:%.c=%.gcda) $(SRC2:%.c=%.gcno) *.dyn pgopti.dpi pgopti.dpi.lock *.pgd *.pgc
+endif
+
+clean:
+	rm -f $(OBJS) $(OBJASM) $(OBJCLI) $(OBJSO) $(SONAME) *.a *.lib *.exp *.pdb x264 x264.exe .depend TAGS
+	rm -f checkasm checkasm.exe $(OBJCHK) $(GENERATED) x264_lookahead.clbin
+	rm -f example example.exe $(OBJEXAMPLE)
+	rm -f $(SRC2:%.c=%.gcda) $(SRC2:%.c=%.gcno) *.dyn pgopti.dpi pgopti.dpi.lock *.pgd *.pgc
+
+distclean: clean
+	rm -f config.mak x264_config.h config.h config.log x264.pc x264.def conftest*
+
+install-cli: cli
+	$(INSTALL) -d $(DESTDIR)$(bindir)
+	$(INSTALL) x264$(EXE) $(DESTDIR)$(bindir)
+
+install-lib-dev:
+	$(INSTALL) -d $(DESTDIR)$(includedir)
+	$(INSTALL) -d $(DESTDIR)$(libdir)
+	$(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig
+	$(INSTALL) -m 644 $(SRCPATH)/x264.h $(DESTDIR)$(includedir)
+	$(INSTALL) -m 644 x264_config.h $(DESTDIR)$(includedir)
+	$(INSTALL) -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
+
+install-lib-static: lib-static install-lib-dev
+	$(INSTALL) -m 644 $(LIBX264) $(DESTDIR)$(libdir)
+	$(if $(RANLIB), $(RANLIB) $(DESTDIR)$(libdir)/$(LIBX264))
+
+install-lib-shared: lib-shared install-lib-dev
+ifneq ($(IMPLIBNAME),)
+	$(INSTALL) -d $(DESTDIR)$(bindir)
+	$(INSTALL) -m 755 $(SONAME) $(DESTDIR)$(bindir)
+	$(INSTALL) -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir)
+else ifneq ($(SONAME),)
+	ln -f -s $(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX)
+	$(INSTALL) -m 755 $(SONAME) $(DESTDIR)$(libdir)
+endif
+
+uninstall:
+	rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(includedir)/x264_config.h $(DESTDIR)$(libdir)/libx264.a
+	rm -f $(DESTDIR)$(bindir)/x264$(EXE) $(DESTDIR)$(libdir)/pkgconfig/x264.pc
+ifneq ($(IMPLIBNAME),)
+	rm -f $(DESTDIR)$(bindir)/$(SONAME) $(DESTDIR)$(libdir)/$(IMPLIBNAME)
+else ifneq ($(SONAME),)
+	rm -f $(DESTDIR)$(libdir)/$(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX)
+endif
+
+etags: TAGS
+
+TAGS:
+	etags $(SRCS)