| 1 | package=hidapi |
| 2 | $(package)_version=0.13.1 |
| 3 | $(package)_download_path=https://github.com/libusb/hidapi/archive/refs/tags |
| 4 | $(package)_file_name=$(package)-$($(package)_version).tar.gz |
| 5 | $(package)_sha256_hash=476a2c9a4dc7d1fc97dd223b84338dbea3809a84caea2dcd887d9778725490e3 |
| 6 | $(package)_linux_dependencies=libusb eudev |
| 7 | $(package)_patches=missing_win_include.patch |
| 8 | |
| 9 | define $(package)_set_vars |
| 10 | $(package)_config_opts=--enable-static --disable-shared |
| 11 | $(package)_config_opts+=--prefix=$(host_prefix) |
| 12 | $(package)_config_opts_linux+=libudev_LIBS="-L$(host_prefix)/lib -ludev" |
| 13 | $(package)_config_opts_linux+=libudev_CFLAGS=-I$(host_prefix)/include |
| 14 | $(package)_config_opts_linux+=libusb_LIBS="-L$(host_prefix)/lib -lusb-1.0" |
| 15 | $(package)_config_opts_linux+=libusb_CFLAGS=-I$(host_prefix)/include/libusb-1.0 |
| 16 | $(package)_config_opts_linux+=--with-pic |
| 17 | endef |
| 18 | |
| 19 | define $(package)_preprocess_cmds |
| 20 | patch -p1 < $($(package)_patch_dir)/missing_win_include.patch && ./bootstrap |
| 21 | endef |
| 22 | |
| 23 | define $(package)_config_cmds |
| 24 | $($(package)_autoconf) AR_FLAGS=$($(package)_arflags) |
| 25 | endef |
| 26 | |
| 27 | define $(package)_build_cmds |
| 28 | $(MAKE) |
| 29 | endef |
| 30 | |
| 31 | define $(package)_stage_cmds |
| 32 | $(MAKE) DESTDIR=$($(package)_staging_dir) install |
| 33 | endef |
| 34 | |
| 35 | define $(package)_postprocess_cmds |
| 36 | rm lib/*.la |
| 37 | endef |
| 38 |