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.

87 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:=2020-10-26
  10. PKG_RELEASE:=1
  11. PKG_SOURCE_PROTO:=git
  12. PKG_SOURCE_URL:=https://code.videolan.org/videolan/x264.git
  13. PKG_SOURCE_VERSION:=4121277b40a667665d4eea1726aefdc55d12d110
  14. PKG_MIRROR_HASH:=4b4955e8f92d0c4afecbced2cc6414a123085f7472d198b3eeddaa9490b84f60
  15. PKG_MAINTAINER:=Adrian Panella <ianchi74@outlook.com>
  16. PKG_LICENSE:=GPL-2.0-or-later
  17. PKG_LICENSE_FILES:=COPYING
  18. PKG_BUILD_PARALLEL:=1
  19. PKG_INSTALL:=1
  20. include $(INCLUDE_DIR)/package.mk
  21. TARGET_CFLAGS:=$(filter-out -O%,$(TARGET_CFLAGS))
  22. MAKE_FLAGS:=$(filter-out LD=%,$(MAKE_FLAGS)) LD="$(TARGET_CC) -o"
  23. # Instead of blacklisting a boatload of platforms just enable
  24. # optimization where it makes sense (matters) ie ARMv7+ and x86_64
  25. ifneq ($(findstring cortex-a,$(CPU_TYPE)),)
  26. CONFIGURE_ARGS += --enable-lto
  27. else
  28. ifneq ($(CONFIG_TARGET_x86_64),)
  29. CONFIGURE_ARGS += --enable-lto
  30. ifeq ($(CONFIG_NASM),y)
  31. CONFIGURE_VARS+= AS=nasm
  32. MAKE_FLAGS+= AS=nasm
  33. endif
  34. else
  35. CONFIGURE_VARS+= AS=
  36. MAKE_FLAGS+= AS=
  37. CONFIGURE_ARGS += --disable-asm
  38. endif
  39. endif
  40. CONFIGURE_ARGS += \
  41. --disable-cli \
  42. --enable-shared \
  43. --disable-opencl \
  44. --enable-pic \
  45. --disable-avs \
  46. --disable-ffms \
  47. --disable-gpac \
  48. --disable-lsmash
  49. define Package/libx264
  50. SECTION:=libs
  51. CATEGORY:=Libraries
  52. TITLE:=H264/AVC free codec library
  53. DEPENDS:=+libpthread @BUILD_PATENTED
  54. URL:=https://www.videolan.org/developers/x264.html
  55. endef
  56. define Package/libx264/description
  57. x264 is a free software library for encoding
  58. video streams into the H.264/MPEG-4 AVC compression format.
  59. endef
  60. define Build/InstallDev
  61. $(INSTALL_DIR) $(1)/usr/include/x264/
  62. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/include/* $(1)/usr/include/
  63. $(INSTALL_DIR) $(1)/usr/lib/
  64. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  65. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig/
  66. $(INSTALL_DATA) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/* $(1)/usr/lib/pkgconfig/
  67. endef
  68. define Package/libx264/install
  69. $(INSTALL_DIR) $(1)/usr/lib/
  70. $(CP) $(PKG_INSTALL_DIR)/usr/lib/*.so* $(1)/usr/lib/
  71. endef
  72. $(eval $(call BuildPackage,libx264))