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.

99 lines
2.9 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=libjpeg-turbo
  3. PKG_VERSION:=2.1.2
  4. PKG_RELEASE:=$(AUTORELEASE)
  5. PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
  6. PKG_SOURCE_URL:=@SF/$(PKG_NAME)
  7. PKG_HASH:=09b96cb8cbff9ea556a9c2d173485fd19488844d55276ed4f42240e1e2073ce5
  8. PKG_MAINTAINER:=Rosen Penev <rosenp@gmail.com>
  9. PKG_LICENSE:=BSD-3-Clause IJG zlib
  10. PKG_LICENSE_FILES:=LICENSE.md
  11. PKG_USE_MIPS16:=0 #Allows ASM compilation for speed.
  12. include $(INCLUDE_DIR)/package.mk
  13. include $(INCLUDE_DIR)/cmake.mk
  14. define Package/libjpeg-turbo/Default
  15. TITLE:=libjpeg-turbo
  16. URL:=https://www.libjpeg-turbo.org/
  17. endef
  18. define Package/libjpeg-turbo
  19. $(call Package/libjpeg-turbo/Default)
  20. SECTION:=libs
  21. CATEGORY:=Libraries
  22. TITLE+= runtime library
  23. PROVIDES:=libjpeg
  24. endef
  25. define Package/libjpeg-turbo-utils
  26. $(call Package/libjpeg-turbo/Default)
  27. SECTION:=utils
  28. CATEGORY:=Utilities
  29. SUBMENU:=Image Manipulation
  30. DEPENDS:=+libjpeg-turbo
  31. TITLE+= manipulation tools
  32. PROVIDES:=jpeg-tools
  33. endef
  34. define Package/libjpeg-turbo/description
  35. libjpeg-turbo is a speed focused fork of libjpeg.
  36. endef
  37. define Package/libjpeg-turbo-utils/description
  38. These are the JPEG utilities that come with libjpeg-turbo.
  39. endef
  40. CMAKE_OPTIONS += \
  41. -DENABLE_SHARED=ON \
  42. -DENABLE_STATIC=OFF \
  43. -DREQUIRE_SIMD=OFF \
  44. -DWITH_12BIT=OFF \
  45. -DWITH_ARITH_DEC=OFF \
  46. -DWITH_ARITH_ENC=OFF \
  47. -DWITH_JAVA=OFF \
  48. -DWITH_JPEG7=OFF \
  49. -DWITH_JPEG8=OFF \
  50. -DWITH_MEM_SRCDST=ON \
  51. -DWITH_SIMD=O$(if $(findstring mips,$(CONFIG_ARCH)),FF,N) \
  52. -DWITH_TURBOJPEG=OFF
  53. ifneq ($(findstring arm,$(CONFIG_ARCH)),)
  54. ifeq ($(findstring neon,$(CONFIG_CPU_TYPE)),)
  55. CMAKE_OPTIONS += -DWITH_SIMD=OFF
  56. endif
  57. endif
  58. define Build/InstallDev
  59. $(INSTALL_DIR) $(1)/usr/include
  60. $(CP) $(PKG_INSTALL_DIR)/usr/include/*.h $(1)/usr/include/
  61. $(INSTALL_DIR) $(1)/usr/lib
  62. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjpeg.so* $(1)/usr/lib/
  63. $(INSTALL_DIR) $(1)/usr/lib/pkgconfig
  64. $(CP) $(PKG_INSTALL_DIR)/usr/lib/pkgconfig/*.pc $(1)/usr/lib/pkgconfig/
  65. $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libjpeg.pc
  66. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libjpeg.pc
  67. $(SED) 's,/usr/include,$$$${prefix}/include,g' $(1)/usr/lib/pkgconfig/libturbojpeg.pc
  68. $(SED) 's,/usr/lib,$$$${exec_prefix}/lib,g' $(1)/usr/lib/pkgconfig/libturbojpeg.pc
  69. endef
  70. define Package/libjpeg-turbo/install
  71. $(INSTALL_DIR) $(1)/usr/lib
  72. $(CP) $(PKG_INSTALL_DIR)/usr/lib/libjpeg.so* $(1)/usr/lib
  73. endef
  74. define Package/libjpeg-turbo-utils/install
  75. $(INSTALL_DIR) $(1)/usr/bin
  76. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/rdjpgcom $(1)/usr/bin
  77. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/wrjpgcom $(1)/usr/bin
  78. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/cjpeg $(1)/usr/bin
  79. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/djpeg $(1)/usr/bin
  80. $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/jpegtran $(1)/usr/bin
  81. endef
  82. $(eval $(call BuildPackage,libjpeg-turbo))
  83. $(eval $(call BuildPackage,libjpeg-turbo-utils))