From 5c234cbdcbd7289539b2df4281ee20fbd12dbea0 Mon Sep 17 00:00:00 2001 From: TheCharlatan Date: Sat, 22 Sep 2018 20:07:33 +0200 Subject: [PATCH] Add hidapi to depends Clang needs to get its cctools path passed directly for the hid build to succeed. Make gperf a permanent external dependency. Remove pcsc from depends. --- .travis.yml | 8 +++--- contrib/depends/packages/eudev.mk | 25 ++++++++++++++++++ contrib/depends/packages/hidapi-darwin.mk | 23 +++++++++++++++++ contrib/depends/packages/hidapi-linux.mk | 28 ++++++++++++++++++++ contrib/depends/packages/hidapi.mk | 23 +++++++++++++++++ contrib/depends/packages/libusb.mk | 31 +++++++++++++++++++++++ contrib/depends/packages/packages.mk | 6 +++-- contrib/depends/packages/pcsc-lite.mk | 26 ------------------- 8 files changed, 138 insertions(+), 32 deletions(-) create mode 100644 contrib/depends/packages/eudev.mk create mode 100644 contrib/depends/packages/hidapi-darwin.mk create mode 100644 contrib/depends/packages/hidapi-linux.mk create mode 100644 contrib/depends/packages/hidapi.mk create mode 100644 contrib/depends/packages/libusb.mk delete mode 100644 contrib/depends/packages/pcsc-lite.mk diff --git a/.travis.yml b/.travis.yml index c87dceac9..9368c3ff2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,15 +23,15 @@ env: - DOCKER_PACKAGES="build-essential libtool cmake autotools-dev automake pkg-config bsdmainutils curl git ca-certificates ccache" matrix: # ARM v7 - - HOST=arm-linux-gnueabihf PACKAGES="g++-arm-linux-gnueabihf" + - HOST=arm-linux-gnueabihf PACKAGES="gperf g++-arm-linux-gnueabihf" # ARM v8 - - HOST=aarch64-linux-gnu PACKAGES="g++-aarch64-linux-gnu" + - HOST=aarch64-linux-gnu PACKAGES="gperf g++-aarch64-linux-gnu" # i686 Linux - - HOST=i686-pc-linux-gnu PACKAGES="cmake g++-multilib bc python3-zmq" RUN_TESTS=true + - HOST=i686-pc-linux-gnu PACKAGES="gperf cmake g++-multilib bc python3-zmq" RUN_TESTS=true # Win64 - HOST=x86_64-w64-mingw32 PACKAGES="cmake python3 nsis g++-mingw-w64-x86-64 wine-binfmt wine64 bc" RUN_TESTS=true # x86_64 Linux - - HOST=x86_64-unknown-linux-gnu PACKAGES="cmake python3-zmq protobuf-compiler libdbus-1-dev libharfbuzz-dev libprotobuf-dev" RUN_TESTS=true + - HOST=x86_64-unknown-linux-gnu PACKAGES="gperf cmake python3-zmq protobuf-compiler libdbus-1-dev libharfbuzz-dev libprotobuf-dev" RUN_TESTS=true # Cross-Mac - HOST=x86_64-apple-darwin11 PACKAGES="cmake imagemagick libcap-dev librsvg2-bin libz-dev libbz2-dev libtiff-tools python-dev python3-setuptools-git" OSX_SDK=10.11 diff --git a/contrib/depends/packages/eudev.mk b/contrib/depends/packages/eudev.mk new file mode 100644 index 000000000..08752909f --- /dev/null +++ b/contrib/depends/packages/eudev.mk @@ -0,0 +1,25 @@ +package=eudev +$(package)_version=v3.2.6 +$(package)_download_path=https://github.com/gentoo/eudev/archive/ +$(package)_file_name=$($(package)_version).tar.gz +$(package)_sha256_hash=a96ecb8637667897b8bd4dee4c22c7c5f08b327be45186e912ce6bc768385852 + +define $(package)_set_vars + $(package)_config_opts=--disable-gudev --disable-introspection --disable-hwdb --disable-manpages +endef + +define $(package)_config_cmds + $($(package)_autoconf) +endef + +define $(package)_build_cmd + $(MAKE) +endef + +define $(package)_preprocess_cmds + cd $($(package)_build_subdir); autoreconf -f -i +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/contrib/depends/packages/hidapi-darwin.mk b/contrib/depends/packages/hidapi-darwin.mk new file mode 100644 index 000000000..1fbbb59e0 --- /dev/null +++ b/contrib/depends/packages/hidapi-darwin.mk @@ -0,0 +1,23 @@ +package=hidapi-darwin +$(package)_version=0.8.0-rc1 +$(package)_download_path=https://github.com/signal11/hidapi/archive +$(package)_file_name=hidapi-$($(package)_version).tar.gz +$(package)_sha256_hash=3c147200bf48a04c1e927cd81589c5ddceff61e6dac137a605f6ac9793f4af61 + +define $(package)_set_vars +$(package)_config_opts=--enable-static +$(package)_config_opts+=--prefix=$(host_prefix) +endef + +define $(package)_config_cmds + ./bootstrap &&\ + $($(package)_autoconf) $($(package)_config_opts) RANLIB="$(host_prefix)/native/bin/x86_64-apple-darwin11-ranlib" AR="$(host_prefix)/native/bin/x86_64-apple-darwin11-ar" +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/contrib/depends/packages/hidapi-linux.mk b/contrib/depends/packages/hidapi-linux.mk new file mode 100644 index 000000000..b2a499915 --- /dev/null +++ b/contrib/depends/packages/hidapi-linux.mk @@ -0,0 +1,28 @@ +package=hidapi-linux +$(package)_version=0.8.0-rc1 +$(package)_download_path=https://github.com/signal11/hidapi/archive +$(package)_file_name=hidapi-$($(package)_version).tar.gz +$(package)_sha256_hash=3c147200bf48a04c1e927cd81589c5ddceff61e6dac137a605f6ac9793f4af61 +$(package)_dependencies=libusb eudev + +define $(package)_set_vars +$(package)_config_opts=--enable-static +$(package)_config_opts+=--prefix=$(host_prefix) +$(package)_config_opts+=libudev_LIBS="-L$(host_prefix)/lib -ludev" +$(package)_config_opts+=libudev_CFLAGS=-I$(host_prefix)/include +$(package)_config_opts+=libusb_LIBS="-L$(host_prefix)/lib -lusb-1.0" +$(package)_config_opts+=libusb_CFLAGS=-I$(host_prefix)/include/libusb-1.0 +endef + +define $(package)_config_cmds + ./bootstrap &&\ + $($(package)_autoconf) $($(package)_config_opts) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/contrib/depends/packages/hidapi.mk b/contrib/depends/packages/hidapi.mk new file mode 100644 index 000000000..b6b228643 --- /dev/null +++ b/contrib/depends/packages/hidapi.mk @@ -0,0 +1,23 @@ +package=hidapi +$(package)_version=0.8.0-rc1 +$(package)_download_path=https://github.com/signal11/hidapi/archive +$(package)_file_name=$(package)-$($(package)_version).tar.gz +$(package)_sha256_hash=3c147200bf48a04c1e927cd81589c5ddceff61e6dac137a605f6ac9793f4af61 + +define $(package)_set_vars +$(package)_config_opts=--enable-static +$(package)_config_opts+=--prefix=$(host_prefix) +endef + +define $(package)_config_cmds + ./bootstrap &&\ + $($(package)_autoconf) $($(package)_config_opts) +endef + +define $(package)_build_cmds + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef diff --git a/contrib/depends/packages/libusb.mk b/contrib/depends/packages/libusb.mk new file mode 100644 index 000000000..47f8b3cbc --- /dev/null +++ b/contrib/depends/packages/libusb.mk @@ -0,0 +1,31 @@ +package=libusb +$(package)_version=1.0.9 +$(package)_download_path=http://sourceforge.net/projects/libusb/files/libusb-1.0/libusb-1.0.9/ +$(package)_file_name=$(package)-$($(package)_version).tar.bz2 +$(package)_sha256_hash=e920eedc2d06b09606611c99ec7304413c6784cba6e33928e78243d323195f9b + +define $(package)_preprocess_cmds + autoreconf -i +endef + +define $(package)_set_vars + $(package)_config_opts=--disable-shared + $(package)_config_opts_linux=--with-pic +endef + +define $(package)_config_cmds + cp -f $(BASEDIR)/config.guess config.guess &&\ + cp -f $(BASEDIR)/config.sub config.sub &&\ + $($(package)_autoconf) +endef + +define $(package)_build_cmd + $(MAKE) +endef + +define $(package)_stage_cmds + $(MAKE) DESTDIR=$($(package)_staging_dir) install +endef + +define $(package)_postprocess_cmds cp -f lib/libusb-1.0.a lib/libusb.a +endef diff --git a/contrib/depends/packages/packages.mk b/contrib/depends/packages/packages.mk index 114f8e9c0..13ba37628 100644 --- a/contrib/depends/packages/packages.mk +++ b/contrib/depends/packages/packages.mk @@ -4,16 +4,18 @@ native_packages := native_ccache wallet_packages=bdb darwin_native_packages = native_biplist native_ds_store native_mac_alias -darwin_packages += sodium-darwin +darwin_packages += sodium-darwin hidapi-darwin + +linux_packages = eudev libusb hidapi-linux ifeq ($(host_os),linux) -packages += pcsc-lite packages += unwind packages += sodium endif ifeq ($(host_os),mingw32) packages += icu4c packages += sodium +packages += hidapi endif ifneq ($(build_os),darwin) diff --git a/contrib/depends/packages/pcsc-lite.mk b/contrib/depends/packages/pcsc-lite.mk deleted file mode 100644 index 06be0e585..000000000 --- a/contrib/depends/packages/pcsc-lite.mk +++ /dev/null @@ -1,26 +0,0 @@ -package=pcsc-lite -$(package)_version=1.8.23 -$(package)_download_path=https://pcsclite.apdu.fr/files -$(package)_file_name=$(package)-$($(package)_version).tar.bz2 -$(package)_sha256_hash=5a27262586eff39cfd5c19aadc8891dd71c0818d3d629539bd631b958be689c9 - -define $(package)_set_vars - $(package)_build_opts=CC="$($(package)_cc)" - $(package)_config_env=AR="$($(package)_ar)" RANLIB="$($(package)_ranlib)" CC="$($(package)_cc)" - $(package)_config_opts=--prefix=$(host_prefix) - $(package)_config_opts_release=--disable-debug-mode --disable-libsystemd --disable-libudev --enable-static --disable-shared --disable-libusb - $(package)_build_opts=CFLAGS="$($(package)_cflags) $($(package)_cppflags) -fPIC" -endef - -define $(package)_config_cmds - ./bootstrap &&\ - $($(package)_autoconf) $($(package)_config_opts) -endef - -define $(package)_build_cmds - $(MAKE) $($(package)_build_opts) -endef - -define $(package)_stage_cmds - $(MAKE) DESTDIR=$($(package)_staging_dir) install -endef