You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

85 lines
2.2 KiB

  1. #
  2. # Copyright (C) 2016 OpenWrt.org
  3. #
  4. # This is free software, licensed under the GNU General Public License v2.
  5. # See /LICENSE for more information.
  6. #
  7. include $(TOPDIR)/rules.mk
  8. PKG_NAME:=x264
  9. PKG_VERSION:=snapshot-20190324-2245
  10. PKG_RELEASE:=2
  11. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
  12. PKG_SOURCE_URL:=https://download.videolan.org/x264/snapshots/
  13. PKG_MAINTAINER:=Adrian Panella <ianchi74@outlook.com>
  14. PKG_HASH:=68010057edaadffc7593933d13084e8d32e041c42b17c089513d88c917f2ad54
  15. PKG_LICENSE:=GPL-2.0
  16. PKG_LICENSE_FILES:=COPYING
  17. PKG_INSTALL:=1
  18. include $(INCLUDE_DIR)/package.mk
  19. TARGET_CFLAGS:=$(filter-out -O%,$(TARGET_CFLAGS))
  20. MAKE_FLAGS:=$(filter-out LD=%,$(MAKE_FLAGS)) LD="$(TARGET_CC) -o"
  21. # Instead of blacklisting a boatload of platforms just enable
  22. # optimization where it makes sense (matters) ie ARMv7+ and x86_64
  23. ifneq ($(findstring cortex-a,$(CPU_TYPE)),)
  24. CONFIGURE_ARGS += --enable-lto
  25. else
  26. ifneq ($(CONFIG_TARGET_x86_64),)
  27. CONFIGURE_ARGS += --enable-lto
  28. ifeq ($(CONFIG_NASM),y)
  29. CONFIGURE_VARS+= AS=nasm
  30. MAKE_FLAGS+= AS=nasm
  31. endif
  32. else
  33. CONFIGURE_VARS+= AS=
  34. MAKE_FLAGS+= AS=
  35. CONFIGURE_ARGS += --disable-asm
  36. endif
  37. endif
  38. CONFIGURE_ARGS += \
  39. --disable-cli \
  40. --enable-shared \
  41. --disable-opencl \
  42. --enable-pic \
  43. --disable-avs \
  44. --disable-ffms \
  45. --disable-gpac \
  46. --disable-lsmash
  47. define Package/libx264
  48. SECTION:=libs
  49. CATEGORY:=Libraries
  50. TITLE:=H264/AVC free codec library
  51. DEPENDS:=+libpthread @BUILD_PATENTED
  52. URL:=https://www.videolan.org/developers/x264.html
  53. endef
  54. define Package/libx264/description
  55. x264 is a free software library for encoding
  56. video streams into the H.264/MPEG-4 AVC compression format.
  57. endef
  58. define Build/InstallDev
  59. $(INSTALL_DIR) $(1)/usr/include/x264/
  60. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  61. $(INSTALL_DIR) $(1)/usr/lib/
  62. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  63. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
  64. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  65. endef
  66. define Package/libx264/install
  67. $(INSTALL_DIR) $(1)/usr/lib/
  68. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  69. endef
  70. $(eval $(call BuildPackage,libx264))