owfs.mk 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. ################################################################################
  2. #
  3. # owfs
  4. #
  5. ################################################################################
  6. OWFS_VERSION = 3.2p3
  7. OWFS_SITE = https://github.com/owfs/owfs/releases/download/v$(OWFS_VERSION)
  8. OWFS_DEPENDENCIES = host-pkgconf
  9. OWFS_CONF_OPTS = --disable-owperl --without-perl5 --disable-owtcl --without-tcl
  10. # owtcl license is declared in module/ownet/c/src/include/ow_functions.h
  11. OWFS_LICENSE = GPL-2.0+, LGPL-2.0 (owtcl)
  12. OWFS_LICENSE_FILES = COPYING COPYING.LIB
  13. OWFS_INSTALL_STAGING = YES
  14. # owfs PHP support is not PHP 7 compliant
  15. # https://sourceforge.net/p/owfs/support-requests/32/
  16. OWFS_CONF_OPTS += --disable-owphp --without-php
  17. # Skip man pages processing
  18. OWFS_CONF_ENV += ac_cv_path_SOELIM=true
  19. ifeq ($(BR2_PACKAGE_LIBFUSE),y)
  20. OWFS_DEPENDENCIES += libfuse
  21. OWFS_CONF_OPTS += \
  22. --enable-owfs \
  23. --with-fuseinclude=$(STAGING_DIR)/usr/include \
  24. --with-fuselib=$(STAGING_DIR)/usr/lib
  25. define OWFS_INSTALL_FUSE_INIT_SYSV
  26. $(INSTALL) -D -m 0755 $(OWFS_PKGDIR)S60owfs \
  27. $(TARGET_DIR)/etc/init.d/S60owfs
  28. endef
  29. define OWFS_CREATE_MOUNTPOINT
  30. mkdir -p $(TARGET_DIR)/dev/1wire
  31. endef
  32. OWFS_POST_INSTALL_TARGET_HOOKS += OWFS_CREATE_MOUNTPOINT
  33. else
  34. OWFS_CONF_OPTS += --disable-owfs
  35. endif
  36. ifeq ($(BR2_PACKAGE_LIBFTDI1),y)
  37. OWFS_CONF_OPTS += \
  38. --enable-ftdi \
  39. --with-libftdi-config=$(STAGING_DIR)/usr/bin/libftdi1-config
  40. OWFS_DEPENDENCIES += libftdi1
  41. else ifeq ($(BR2_PACKAGE_LIBFTDI),y)
  42. OWFS_CONF_OPTS += \
  43. --enable-ftdi \
  44. --with-libftdi-config=$(STAGING_DIR)/usr/bin/libftdi-config
  45. OWFS_DEPENDENCIES += libftdi
  46. else
  47. OWFS_CONF_OPTS += --disable-ftdi
  48. endif
  49. ifeq ($(BR2_PACKAGE_LIBUSB),y)
  50. OWFS_CONF_OPTS += --enable-usb
  51. OWFS_DEPENDENCIES += libusb
  52. else
  53. OWFS_CONF_OPTS += --disable-usb
  54. endif
  55. ifeq ($(BR2_PACKAGE_AVAHI),y)
  56. OWFS_CONF_OPTS += --enable-avahi
  57. OWFS_DEPENDENCIES += avahi
  58. else
  59. OWFS_CONF_OPTS += --disable-avahi
  60. endif
  61. # setup.py isn't python3 compliant
  62. ifeq ($(BR2_PACKAGE_PYTHON),y)
  63. OWFS_CONF_OPTS += \
  64. --enable-owpython \
  65. --with-python \
  66. --with-pythonconfig=$(STAGING_DIR)/usr/bin/python-config
  67. OWFS_MAKE_ENV += \
  68. CC="$(TARGET_CC)" \
  69. PYTHONPATH="$(PYTHON_PATH)" \
  70. _python_sysroot=$(STAGING_DIR) \
  71. _python_prefix=/usr \
  72. _python_exec_prefix=/usr
  73. OWFS_DEPENDENCIES += python host-swig
  74. # The configure scripts finds PYSITEDIR as the python_lib directory of
  75. # host-python, and then prepends DESTDIR in front of it. So we end up
  76. # installing things in $(TARGET_DIR)/$(HOST_DIR)/lib/python which is
  77. # clearly wrong.
  78. # Patching owfs to do the right thing is not trivial, it's much easier to
  79. # override the PYSITEDIR variable in make.
  80. OWFS_EXTRA_MAKE_OPTS += PYSITEDIR=/usr/lib/python$(PYTHON_VERSION_MAJOR)/site-packages
  81. ifeq ($(BR2_PER_PACKAGE_DIRECTORIES),y)
  82. define OWFS_FIXUP_PYTHON_SYSCONFIGDATA
  83. find $(HOST_DIR)/lib/python* $(STAGING_DIR)/usr/lib/python* \
  84. -name "_sysconfigdata*.py" | xargs --no-run-if-empty \
  85. $(SED) "s:$(PER_PACKAGE_DIR)/[^/]\+/:$(PER_PACKAGE_DIR)/owfs/:g"
  86. endef
  87. OWFS_PRE_CONFIGURE_HOOKS += OWFS_FIXUP_PYTHON_SYSCONFIGDATA
  88. endif
  89. else
  90. OWFS_CONF_OPTS += --disable-owpython --without-python
  91. endif
  92. ifeq ($(BR2_STATIC_LIBS),y)
  93. # zeroconf support uses dlopen()
  94. OWFS_CONF_OPTS += --disable-zero
  95. endif
  96. OWFS_MAKE = $(MAKE) $(OWFS_EXTRA_MAKE_OPTS)
  97. define OWFS_INSTALL_INIT_SYSV
  98. $(INSTALL) -D -m 0755 $(OWFS_PKGDIR)S55owserver \
  99. $(TARGET_DIR)/etc/init.d/S55owserver
  100. $(OWFS_INSTALL_FUSE_INIT_SYSV)
  101. endef
  102. $(eval $(autotools-package))