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.

66 lines
1.9 KiB

  1. include $(TOPDIR)/rules.mk
  2. PKG_NAME:=fbthrift
  3. PKG_SOURCE_DATE:=2019-09-22
  4. PKG_SOURCE_VERSION:=2f9839604e2569120cc4876c667388da6d7342f2
  5. PKG_RELEASE:=1
  6. PKG_SOURCE:=$(PKG_NAME)-$(PKG_SOURCE_DATE).tar.gz
  7. PKG_SOURCE_URL:=https://codeload.github.com/facebook/fbthrift/tar.gz/$(PKG_SOURCE_VERSION)?
  8. PKG_HASH:=339a73610ad19070d33151127966aaf56e5df3640c238292fc74658c3075da3a
  9. PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  10. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/$(PKG_NAME)-$(PKG_SOURCE_VERSION)
  11. PKG_MAINTAINER:=Amol Bhave <ambhave@fb.com>
  12. PKG_LICENSE:=Apache-2.0
  13. PKG_LICENSE_FILES:=LICENSE
  14. HOST_BUILD_DEPENDS:=libmstch/host
  15. PKG_BUILD_DEPENDS:=fbthrift/host libwangle librsocket-cpp
  16. HOST_BUILD_PARALLEL:=1
  17. PKG_BUILD_PARALLEL:=1
  18. CMAKE_INSTALL:=1
  19. include $(INCLUDE_DIR)/package.mk
  20. include $(INCLUDE_DIR)/host-build.mk
  21. include $(INCLUDE_DIR)/cmake.mk
  22. define Package/fbthrift
  23. SECTION:=libs
  24. CATEGORY:=Libraries
  25. TITLE:=Facebook's branch of Apache Thrift, including a new C++ server.
  26. URL:=https://github.com/facebook/fbthrift
  27. DEPENDS:=+libfmt +libfolly
  28. endef
  29. define Package/fbthrift/description
  30. Facebook's branch of Apache Thrift, including a new C++ server.
  31. endef
  32. CMAKE_HOST_OPTIONS += \
  33. -DBUILD_SHARED_LIBS=ON \
  34. -DCMAKE_SKIP_RPATH=OFF \
  35. -DCMAKE_INSTALL_RPATH="${STAGING_DIR_HOSTPKG}/lib" \
  36. -Dcompiler_only=ON
  37. CMAKE_OPTIONS += \
  38. -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
  39. -DCXX_STD=c++14 \
  40. -Dlib_only=ON \
  41. -DTHRIFT1="$(STAGING_DIR_HOSTPKG)/bin/thrift1" \
  42. -DTHRIFT_COMPILER_INCLUDE="$(STAGING_DIR_HOSTPKG)/include/" \
  43. -Dpython-six_DIR=OFF
  44. # This should not be necessary as it is supposed to be done above.
  45. # Someone broke something.
  46. HOST_LDFLAGS += -Wl,-rpath="$(STAGING_DIR_HOSTPKG)/lib"
  47. # GCC9 bug
  48. TARGET_LDFLAGS += -fno-lto
  49. TARGET_CFLAGS += -ffunction-sections -fdata-sections
  50. TARGET_LDFLAGS += -Wl,--gc-sections,--as-needed
  51. $(eval $(call BuildPackage,fbthrift))
  52. $(eval $(call HostBuild))