packages/lang/perl-xml-parser/Makefile
Matthias Schiffer 4a984a8d60
treewide: replace $(STAGING_DIR)/host and $(HOST_BUILD_PREFIX) with $(STAGING_DIR_HOSTPKG)
As both LEDE and OpenWrt have STAGING_DIR_HOSTPKG now, we can start to rely
on it. See 73b7f55424 for more information on
STAGING_DIR_HOSTPKG.

STAGING_DIR_HOSTPKG won't actually be changed before the first LEDE release
(it is equivalent to $(STAGING_DIR)/host), so this simple search/replace
cleanup is safe to apply. Doing this cleanup now will be useful for the
Gluon project (an OpenWrt/LEDE based firmware framework) for experimenting
with modifying STAGING_DIR_HOSTPKG before doing this in the LEDE upstream.

Also fixes a typo in the dbus Makefile ("STAGIND_DIR").

Signed-off-by: Matthias Schiffer <mschiffer@universe-factory.net>
2017-01-10 18:25:54 +01:00

86 lines
2.3 KiB
Makefile

#
# 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 <naoir@gmx.net>
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_HOSTPKG)/lib
HOST_EXPAT_INCPATH=$(STAGING_DIR_HOSTPKG)/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))