matteoscordino

python-scipy Makefile

Oct 23rd, 2020 (edited)
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Make 2.65 KB | None | 0 0
  1. include $(TOPDIR)/rules.mk
  2.  
  3. PKG_NAME:=python-scipy
  4. PKG_VERSION:=1.2.3
  5. PKG_RELEASE:=1
  6.  
  7. PKG_MAINTAINER:=Matteo Scordino <matteo@silexembedded.co.uk>
  8.  
  9. PKG_SOURCE:=scipy-$(PKG_VERSION).tar.gz
  10. PKG_SOURCE_URL:=https://github.com/scipy/scipy/releases/download/v$(PKG_VERSION)/
  11. PKG_BUILD_DIR:=$(BUILD_DIR)/scipy-$(PKG_VERSION)
  12.  
  13. PKG_BUILD_DEPENDS:=python
  14. HOST_BUILD_DEPENDS:=python
  15.  
  16. HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/scipy-$(PKG_VERSION)
  17.  
  18. include $(INCLUDE_DIR)/host-build.mk
  19. include $(INCLUDE_DIR)/package.mk
  20. $(call include_mk, python-package.mk)
  21.  
  22. define Package/$(PKG_NAME)
  23.     SUBMENU:=Python
  24.     SECTION:=lang
  25.     CATEGORY:=Languages
  26.     TITLE:=The fundamental scipy package
  27.     URL:=https://www.scipy.org/
  28.     DEPENDS:=@!SOFT_FLOAT +INSTALL_GFORTRAN:libgfortran +python +python-numpy
  29. endef
  30.  
  31. define Package/$(PKG_NAME)/description
  32.     scipy. That's all the description I'm going to give you.
  33. endef
  34.  
  35. define Build/Compile
  36.     echo "Cross-compile package, HOST=${HOST}"
  37.     # $(call Build/Compile/PyMod,,install --prefix="/usr" --root="$(PKG_INSTALL_DIR)")
  38.  
  39.     $(call HostPython, \
  40.         cd $(HOST_BUILD_DIR)/$(strip $(1)); \
  41.         CFLAGS="$(HOST_CFLAGS)" \
  42.         CPPFLAGS="$(HOST_CPPFLAGS)" \
  43.         LDFLAGS="$(HOST_LDFLAGS)" \
  44.         $(3) \
  45.         , \
  46.         ./setup.py $(2) \
  47.         )
  48. endef
  49.  
  50.  
  51. define Build/InstallDev
  52.     echo "InstallDev"
  53.     mkdir -p $(STAGING_DIR_HOST)/lib/python2.7/site-packages/
  54.     $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
  55.     $(CP) \
  56.         $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/* \
  57.         $(1)$(PYTHON_PKG_DIR)
  58.     $(CP) \
  59.         $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/* \
  60.         $(STAGING_DIR_HOST)/lib/python2.7/site-packages/
  61. endef
  62.  
  63. # TODO: this should be moved to python package
  64. # $(1) => build subdir
  65. # $(2) => additional arguments to setup.py
  66. # $(3) => additional variables
  67. define Host/Compile/PyMod
  68.     echo "Host Compile PyMod"
  69.     $(call HostPython, \
  70.         cd $(HOST_BUILD_DIR)/$(strip $(1)); \
  71.         CFLAGS="$(HOST_CFLAGS)" \
  72.         CPPFLAGS="$(HOST_CPPFLAGS)" \
  73.         LDFLAGS="$(HOST_LDFLAGS)" \
  74.         $(3) \
  75.         , \
  76.         ./setup.py $(2) \
  77.         )
  78. endef
  79.  
  80. define Host/Compile
  81.     echo host-compile
  82.     $(call Host/Compile/PyMod,,install --prefix="/usr" --root="$(STAGING_DIR_HOST)"\
  83.         CYTHON="$(STAGING_DIR_HOST)/usr/bin/cython" )
  84. endef
  85.  
  86. define Host/Install
  87. endef
  88.  
  89. define Package/$(PKG_NAME)/install
  90.     $(INSTALL_DIR) $(1)$(PYTHON_PKG_DIR)
  91.     $(CP) $(PKG_INSTALL_DIR)/usr/lib/python2.7/site-packages/* \
  92.         $(1)$(PYTHON_PKG_DIR)
  93. endef
  94.  
  95. #$(eval $(call HostBuild))
  96. $(eval $(call BuildPackage,$(PKG_NAME),+python-numpy))
Add Comment
Please, Sign In to add comment