forked from openwrt/packages
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
86 lines (67 loc) · 2.32 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# Copyright (C) 2015 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=perl-xml-parser
PKG_VERSION:=2.44
PKG_RELEASE:=1
PKG_SOURCE_URL:=http://www.cpan.org/authors/id/T/TO/TODDR/
PKG_SOURCE:=XML-Parser-$(PKG_VERSION).tar.gz
PKG_MD5SUM:=af4813fe3952362451201ced6fbce379
PKG_LICENSE:=GPL-1.0+ Artistic-1.0-Perl
PKG_MAINTAINER:=Marcel Denia <[email protected]>
PKG_BUILD_DIR:=$(BUILD_DIR)/perl/XML-Parser-$(PKG_VERSION)
HOST_BUILD_DIR:=$(BUILD_DIR_HOST)/perl/XML-Parser-$(PKG_VERSION)
HOST_BUILD_DEPENDS:=perl/host expat/host
EXPAT_LIBPATH:=$(STAGING_DIR)/usr/lib
EXPAT_INCPATH=$(STAGING_DIR)/usr/include
HOST_EXPAT_LIBPATH:=$(STAGING_DIR)/host/lib
HOST_EXPAT_INCPATH=$(STAGING_DIR)/host/include
include $(INCLUDE_DIR)/package.mk
include $(INCLUDE_DIR)/host-build.mk
include ../perl/perlmod.mk
define Package/perl-xml-parser
SUBMENU:=Perl
SECTION:=lang
CATEGORY:=Languages
TITLE:=Perl XML Parser
URL:=http://search.cpan.org/dist/XML-Parser/
DEPENDS:=perl +libexpat +perlbase-dynaloader +perlbase-essential
endef
define FixupExpat
# Manually reconfigure XML::Parser::Expat, as some overrides we provide will not have any effect otherwise
# Force usage of OpenWRT's expat
sed \
-e 's!%%EXPAT_LIBPATH%%!$(2)!g' \
-e 's!%%EXPAT_INCPATH%%!$(3)!g' \
-i $(1)/Expat/Makefile.PL
endef
define Build/Configure
$(call perlmod/Configure,EXPATLIBPATH=$(EXPAT_LIBPATH) EXPATINCPATH=$(EXPAT_INCPATH),,)
$(call FixupExpat,$(PKG_BUILD_DIR),$(EXPAT_LIBPATH),$(EXPAT_INCPATH))
$(call perlmod/Configure,,,$(PKG_BUILD_DIR)/Expat)
endef
define Build/Compile
$(call perlmod/Compile,,)
$(call perlmod/Compile,,,$(PKG_BUILD_DIR)/Expat)
endef
define Host/Configure
$(call perlmod/host/Configure,EXPATLIBPATH=$(HOST_EXPAT_LIBPATH) EXPATINCPATH=$(HOST_EXPAT_INCPATH),,)
$(call FixupExpat,$(HOST_BUILD_DIR),$(HOST_EXPAT_LIBPATH),$(HOST_EXPAT_INCPATH))
$(call perlmod/host/Configure,,,$(HOST_BUILD_DIR)/Expat)
endef
define Host/Compile
$(call perlmod/host/Compile,,)
$(call perlmod/host/Compile,,,$(HOST_BUILD_DIR)/Expat)
endef
define Host/Install
$(call perlmod/host/Install,$(1),)
endef
define Package/perl-xml-parser/install
$(call perlmod/Install,$(1),auto/XML XML)
endef
$(eval $(call BuildPackage,perl-xml-parser))
$(eval $(call HostBuild))