pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

(patch) build fail for devel/p5-File-LibMagic when p5-ExtUtils-MakeMaker-7.06 is installed


build for devel/p5-File-LibMagic fails when p5-ExtUtils-MakeMaker-7.06
is installed (Perl builtin version is at 7.04.1):

    ===> Building for p5-File-LibMagic-1.13
    cp lib/File/typemap blib/lib/File/typemap
    cp lib/File/ blib/lib/File/
    cp lib/File/LibMagic.xs blib/lib/File/LibMagic.xs
    Running Mkbootstrap for LibMagic ()
    chmod 644 ""
    "/opt/pkgsrc/bin/perl" -MExtUtils::Command::MM -e 'cp_nonempty' -- blib/arch/auto/File/LibMagic/ 644
    "/opt/pkgsrc/bin/perl" "/opt/pkgsrc/lib/perl5/5.22.0/ExtUtils/xsubpp"  -typemap '/opt/pkgsrc/lib/perl5/5.22.0/ExtUtils/typemap'  lib/File/LibMagic.xs > lib/File/LibMagic.xsc
    mv lib/File/LibMagic.xsc lib/File/LibMagic.c
    gcc -c  -I. -Ic  -D_REENTRANT -D_GNU_SOURCE -O2 -pthread -I/usr/include -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2  -I/opt/pkgsrc/include -I/usr/include    -I/opt/pkgsrc/include -I/usr/include    -DVERSION=\"1.13\"  -DXS_VERSION=\"1.13\" -fPIC "-I/opt/pkgsrc/lib/perl5/5.22.0/x86_64-linux-thread-multi/CORE"  -DHAVE_MAGIC_VERSION lib/File/LibMagic.c -o lib/File/LibMagic.o
    rm -f blib/arch/auto/File/LibMagic/
    LD_RUN_PATH="/opt/pkgsrc/lib" gcc  -shared -L/usr/local/lib -fstack-protector -o blib/arch/auto/File/LibMagic/ -L/opt/pkgsrc/lib -Wl,--enable-new-dtags,-R/opt/pkgsrc/lib LibMagic.o    -L/opt/pkgsrc/lib -Wl,--enable-new-dtags,-R/opt/pkgsrc/lib -lmagic -lz
==> gcc: error: LibMagic.o: No such file or directory
    *** Error code 1

the indicated line shows that it cannot find the .o file it just created
2 lines ago.

This is because of an incompatible change in the newer MakeMaker - it
places .o files where the source file lives (lib/File/ in this case),
whereas the older MakeMaker placed it in the current working dir
(toplevel in this case).

Solution: add BUILD_DEPENDS to the newer MakeMaker, and adapt
Makefile.PM to look for the .o in the new place (s. attached patch).

Matthias Ferdinand

--- Makefile.PL.orig	2015-09-19 08:22:40.550474000 +0000
+++ Makefile.PL
@@ -21,7 +21,7 @@ my %WriteMakefileArgs = (
   "DISTNAME" => "File-LibMagic",
   "INC" => "-I. -Ic",
-  "LDFROM" => "LibMagic\$(OBJ_EXT)",
+  "LDFROM" => "lib/File/LibMagic\$(OBJ_EXT)",
   'LIBS' => "$ENV{LDFLAGS}  -lmagic -lz", # e.g., '-lm'
   "LICENSE" => "perl",
   "MIN_PERL_VERSION" => "5.008",
Index: Makefile
RCS file: /cvsroot/pkgsrc/devel/p5-File-LibMagic/Makefile,v
retrieving revision 1.18
diff -u -p -r1.18 Makefile
--- Makefile	22 Aug 2015 23:41:00 -0000	1.18
+++ Makefile	19 Sep 2015 09:39:11 -0000
@@ -15,6 +15,10 @@ BUILDLINK_API_DEPENDS.file+=	file>=5.00
 # necessary for test
 BUILD_DEPENDS+=	p5-Test-Fatal-[0-9]*:../../devel/p5-Test-Fatal
+# incompatible change in MakeMaker 7.06 vs. 7.04.1 in object file location
+# => enforce the new behaviour
+BUILD_DEPENDS+= p5-ExtUtils-MakeMaker>=7.06:../../devel/p5-ExtUtils-MakeMaker
 # cannot open LibMagic.xs: No such file or directory

Home | Main Index | Thread Index | Old Index