From c7666b8e3ee8dc5c9bc80b7533bb1979b6170ce7 Mon Sep 17 00:00:00 2001 From: newbluemoon Date: Fri, 14 Sep 2018 10:30:11 +0200 Subject: [PATCH] perl-Tk: enable cross build --- srcpkgs/perl-Tk/patches/cross.patch | 27 +++++++++++++++++++++++++++ srcpkgs/perl-Tk/template | 10 +++++----- 2 files changed, 32 insertions(+), 5 deletions(-) create mode 100644 srcpkgs/perl-Tk/patches/cross.patch diff --git a/srcpkgs/perl-Tk/patches/cross.patch b/srcpkgs/perl-Tk/patches/cross.patch new file mode 100644 index 00000000000..256b7950805 --- /dev/null +++ b/srcpkgs/perl-Tk/patches/cross.patch @@ -0,0 +1,27 @@ +For libpng and libjpeg Makefile.PL tries to run a short test program to see if +the system libraries can be used. From native builds we know they can so remove +the test. + +--- PNG/Makefile.PL.orig 2013-11-18 10:04:04.000000000 +0100 ++++ PNG/Makefile.PL 2018-09-14 09:31:08.785202470 +0200 +@@ -53,8 +53,7 @@ + $all_libs = "$libpng_libs $zlib_libs"; + } + +-if ($Tk::MMtry::VERSION ge '4.007' && +- try_run("config/has_png.c",[$all_cflags],[$all_libs])) ++if ($Tk::MMtry::VERSION ge '4.007') + { + warn "Using system's -lpng\n"; + Tk::MMutil::TkExtMakefile( +--- JPEG/Makefile.PL.orig 2013-11-18 10:04:04.000000000 +0100 ++++ JPEG/Makefile.PL 2018-09-14 09:35:28.041623709 +0200 +@@ -6,7 +6,7 @@ + + use Tk::MMtry; + +-if ($Tk::MMtry::VERSION ge '4.007' && try_run("config/has_jpeg.c",['-I/usr/local/include'],['-ljpeg'])) ++if ($Tk::MMtry::VERSION ge '4.007') + { + push(@args, LIBS => ['-ljpeg'], + INC => '-I/usr/local/include', diff --git a/srcpkgs/perl-Tk/template b/srcpkgs/perl-Tk/template index f10b99aac62..ab62b1646f7 100644 --- a/srcpkgs/perl-Tk/template +++ b/srcpkgs/perl-Tk/template @@ -4,16 +4,16 @@ version=804.034 revision=3 wrksrc="${pkgname#*-}-${version}" build_style=perl-module -configure_args="X11INC=/usr/include" -hostmakedepends="perl libX11-devel libpng-devel libjpeg-turbo-devel" -makedepends="${hostmakedepends}" +configure_args="X11INC=${XBPS_CROSS_BASE}/usr/include + X11LIB=${XBPS_CROSS_BASE}/usr/lib" +hostmakedepends="perl pkg-config" +makedepends="perl libX11-devel libpng-devel libjpeg-turbo-devel" short_desc='Tk graphical interface for Perl' maintainer="Enguerrand de Rochefort " homepage="https://metacpan.org/release/Tk" -license="GPL-1, Artistic" +license="Artistic-1.0-Perl, GPL-1.0-or-later" distfiles="${CPAN_SITE}/Tk/Tk-${version}.tar.gz" checksum=fea6b144c723528a2206c8cd9175844032ee9c14ee37791f0f151e5e5b293fe2 -nocross="http://build.voidlinux.eu/builders/armv7l_builder/builds/21051/steps/shell_3/logs/stdio" post_configure() { sed -i 's,X11/Xproto.h,,; s,X11/Xutil.h,,' pTk/Makefile