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.

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