2 # Copyright (C) 2015 OpenWrt.org
4 # This is free software, licensed under the GNU General Public License v2.
5 # See /LICENSE for more information.
8 include $(TOPDIR
)/rules.mk
10 PKG_NAME
:=perl-device-usb
14 PKG_SOURCE_URL
:=http
://www.cpan.org
/authors
/id
/G
/GW
/GWADEJ
/
15 PKG_SOURCE
:=Device-USB-
$(PKG_VERSION
).
tar.gz
16 PKG_HASH
:=fac2eb4f9e8db08b46d734ba8a2076598f974c274a91b248613fcecd7c9fc175
18 PKG_LICENSE
:=GPL-1.0
+ Artistic-1.0
-Perl
19 PKG_MAINTAINER
:=Marcel Denia
<naoir@gmx.net
>
21 PKG_BUILD_DIR
:=$(BUILD_DIR
)/perl
/Device-USB-
$(PKG_VERSION
)
22 PKG_BUILD_DEPENDS
:=perl-inline-c
/host
24 include $(INCLUDE_DIR
)/package.mk
25 include ..
/perl
/perlmod.mk
27 define Package
/perl-device-usb
31 TITLE
:=libusb library wrapper
32 URL
:=http
://search.cpan.org
/dist/Device-USB
/
33 DEPENDS
:=perl
+libusb-compat
+perl-inline
+perl-inline-c
+perlbase-essential
+perlbase-test
36 # Device::USB will generate a second Makefile.PL to build it's native code
37 # using Inline::C under _Inline/. The goal here is to prevent Inline::C from
38 # running that one automatically, as we need to supply a bunch of overrides via
40 # _INLINE_C_NO_COMPILE_ is an OpenWRT-specific environment variable to Inline::C
41 # that does just that.
42 define Build
/Configure
43 $(call perlmod
/Configure
,,)
45 # Prepare a library directory where we can link againt lusb-0.1(as
46 # opposed to -lusb) to avoid confusion at runtime
47 mkdir
$(PKG_BUILD_DIR
)/syslib
48 $(LN
) $(STAGING_DIR
)/usr
/lib
/libusb.so
$(PKG_BUILD_DIR
)/syslib
/libusb-0.1.so
51 $(call perlmod
/Compile
,config
,LIBUSB_LIBDIR
=$(PKG_BUILD_DIR
)/syslib \
52 _INLINE_C_NO_COMPILE_
=1 \
53 _INLINE_C_SYSTEM_TYPEMAP_
=$(STAGING_DIR
)/usr
/lib
/perl5
/$(PERL_VERSION
)/ExtUtils
/typemap
)
54 $(call perlmod
/Compile
,dynamic
,_INLINE_C_NO_COMPILE_
=1)
57 $(call perlmod
/Configure
,,,$(PKG_BUILD_DIR
)/_Inline
/build
/Device
/USB
)
59 # Prevent re-configuring Inline code
60 sed
's/^dynamic :: D.*$$$$//' -i
$(PKG_BUILD_DIR
)/Makefile
64 $(call perlmod
/Compile
,,,$(PKG_BUILD_DIR
)/_Inline
/build
/Device
/USB
)
65 $(call perlmod
/Compile
,,)
68 define Package
/perl-device-usb
/install
69 $(call perlmod
/Install
,$(1),Device auto
/Device
)
73 $(eval
$(call BuildPackage
,perl-device-usb
))