summaryrefslogtreecommitdiffstats
path: root/pkgs/development/perl-modules
diff options
context:
space:
mode:
authorSamuel Dionne-Riel <samuel@dionne-riel.com>2019-12-06 23:05:01 -0500
committerSamuel Dionne-Riel <samuel@dionne-riel.com>2019-12-06 23:17:02 -0500
commit706247fd107dc7048d38aeabec83f7ffe0df5879 (patch)
treebb7c566ffd819ba951a8f32deb64deaa9ba50aa5 /pkgs/development/perl-modules
parent3140fa89c51233397f496f49014f6b23216667c2 (diff)
perlPackages.XMLParser: Work around cross-compilation regression
Since 2.44_01, the behaviour for `check_lib` in their `Makefile.PL` has been "fixed" to fail when the `assert_lib` function fails to build the test. * https://github.com/toddr/XML-Parser/commit/2bc1e90c04220a04a0b40d1047d464bc55f56210 Now, this wouldn't be so bad, since it's good to actually test what stuff is being compiled against. Except that *something* is wonky with the cross-compilation build-time Perl. ``` Undefined subroutine &File::Temp::mktemp called at inc/Devel/CheckLib.pm line 236. ``` As far as I know, this is a built-in function from Perl. * https://perldoc.perl.org/File/Temp.html Though, something *else* is wrong with `Checklib.pm`. Side-stepping the issue by (eww) shelling out to `mktemp`, we get these errors: ``` /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-armv7l-unknown-linux-gnueabihf-binutils-2.31.1/bin/armv7l-unknown-linux-gnueabihf-ld: assertlib_src1_0.553056903257133: file not recognized: file truncated collect2: error: ld returned 1 exit status -I/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-expat-2.2.8-armv7l-unknown-linux-gnueabihf-dev/include -L/nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-expat-2.2.8-armv7l-unknown-linux-gnueabihf/lib -lexpat /nix/store/eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee-armv7l-unknown-linux-gnueabihf-binutils-2.31.1/bin/armv7l-unknown-linux-gnueabihf-ld: assertlib_src2_0.262169388446154: file not recognized: file truncated collect2: error: ld returned 1 exit status Can't link/include C library 'expat.h', 'expat', aborting. ``` Meanwhile, the actual build, while building the library, seemingly has no issues building using those paths. `¯\_(ツ)_/¯`
Diffstat (limited to 'pkgs/development/perl-modules')
-rw-r--r--pkgs/development/perl-modules/xml-parser-0001-HACK-Assumes-Expat-paths-are-good.patch45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkgs/development/perl-modules/xml-parser-0001-HACK-Assumes-Expat-paths-are-good.patch b/pkgs/development/perl-modules/xml-parser-0001-HACK-Assumes-Expat-paths-are-good.patch
new file mode 100644
index 000000000000..add6d9df3b7f
--- /dev/null
+++ b/pkgs/development/perl-modules/xml-parser-0001-HACK-Assumes-Expat-paths-are-good.patch
@@ -0,0 +1,45 @@
+From e996904128653c67b04ddbdb1e10cef158098957 Mon Sep 17 00:00:00 2001
+From: Samuel Dionne-Riel <samuel@dionne-riel.com>
+Date: Fri, 6 Dec 2019 23:00:51 -0500
+Subject: [PATCH] [HACK]: Assumes Expat paths are good.
+
+The `check_lib` check fails with the cross-compilation build platform's
+Perl, since apparently `mktemp` is missing...
+
+Even then, side-stepping the issue, it seems it is not actually enough
+to work, as the compilation fails.
+---
+ Makefile.PL | 17 +++++++++++------
+ 1 file changed, 11 insertions(+), 6 deletions(-)
+
+diff --git a/Makefile.PL b/Makefile.PL
+index 505d1df..fc38b76 100644
+--- a/Makefile.PL
++++ b/Makefile.PL
+@@ -29,12 +29,17 @@ foreach (@ARGV) {
+ @ARGV = @replacement_args;
+
+ unless (
+- check_lib( # fill in what you prompted the user for here
+- lib => [qw(expat)],
+- header => ['expat.h'],
+- incpath => $expat_incpath,
+- ( $expat_libpath ? ( libpath => $expat_libpath ) : () ),
+- )
++ #check_lib( # fill in what you prompted the user for here
++ # lib => [qw(expat)],
++ # header => ['expat.h'],
++ # incpath => $expat_incpath,
++ # ( $expat_libpath ? ( libpath => $expat_libpath ) : () ),
++ #)
++ # The check_lib implementation fails horribly with cross-compilation.
++ # We are giving known good paths to expat.
++ # And in all cases, the previous behaviour of not actually failing
++ # seemed to work just fine :/.
++ false
+ ) {
+ warn <<'Expat_Not_Installed;';
+
+--
+2.23.0
+