You are not logged in.

#1 2014-06-18 23:33:43

mike_r
Member
Registered: 2009-01-22
Posts: 114

Perl modules are being installed to the wrong root directory

This is kind of a package, kind of an AUR question. I don't think it is the usual "upgrade to perl-5.20" issue; I've done lots of searching with no obvious mention of my issue.

I have downloaded the PKGBUILDs for perl-tk (in extra) and perl-pdl (in AUR). When I run makepkg on them, the resultant package has the wrong root directory. For example, perl-pdl tries to install into

/home/<username>/perl5/bin/ 

rather than

/usr/bin

and the libraries want to go into

/home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL

rather than something like

/usr/lib/perl5/vendor_perl/PDL

I don't think I'm doing anything unusual with the build. For perl-pdl, I download the tarball from the AUR and untar it in ~/tmp. Cd to ~/tmp/perl-pdl and then run makepkg. The start of the build process says:

==> Making package: perl-pdl 2.007-1 (Wed Jun 18 16:12:19 PDT 2014)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found PDL-2.007.tar.gz
  -> Found perldl.conf
==> Validating source files with md5sums...
    PDL-2.007.tar.gz ... Passed
    perldl.conf ... Passed
==> Extracting sources...
  -> Extracting PDL-2.007.tar.gz with bsdtar
==> Removing existing pkg/ directory...
==> Starting build()...
INFORMATION: using file /home/<username>/tmp/perl-pdl/src/perldl.conf to set configuration defaults
Makefile.PL: Found required OpenGL version, setting USE_POGL => 1
Types.pm.PL: using typedef long PDL_Indx
Extracting Types.pm
making PDL_B...
making PDL_S...
making PDL_US...
making PDL_L...
making PDL_IND...
making PDL_LL...
making PDL_F...
making PDL_D...
Warning: prerequisite Astro::FITS::Header 0 not found.
Warning: prerequisite Convert::UU 0 not found.
Warning: prerequisite File::Map 0.57 not found.
Warning: prerequisite Module::Compile 0.23 not found.
Generating a Unix-style Makefile
Writing Makefile for PDL::pod
Generating a Unix-style Makefile
Writing Makefile for Inline
Writing MYMETA.yml and MYMETA.json
Generating a Unix-style Makefile
Writing Makefile for PDL::PP
Generating a Unix-style Makefile
Writing Makefile for PDL::NiceSlice
Writing MYMETA.yml and MYMETA.json
Basic/Core/Makefile.PL: got root build dir /home/<username>/tmp/perl-pdl/src/PDL-2.007
Basic/Core/Makefile.PL: adding /home/<usenname>/tmp/perl-pdl/src/PDL-2.007/inc
Trying to figure out POSIX threads support ...
        Saw pthread.h. Fine.
        Fine, your perl was linked against pthread library.
        ==> Will build PDL with POSIX thread support. Gifts to TJL :-)
...

and wraps up with

Installing /home/<username>/tmp/perl-pdl/pkg/perl-pdl/home/<username>/perl5/man/man3/PDL::Perldl2::NiceSlice.3pm
Installing /home/<username>/tmp/perl-pdl/pkg/perl-pdl/home/<username>/perl5/man/man3/PDL::Perldl2::PDLCommands.3pm
Installing /home/<username>/tmp/perl-pdl/pkg/perl-pdl/home/<username>/perl5/man/man3/PDL::Perldl2::PrintControl.3pm
Installing /home/<username>/tmp/perl-pdl/pkg/perl-pdl/home/<username>/perl5/man/man3/PDL::pdl2.3pm
Installing /home/<username>/tmp/perl-pdl/pkg/perl-pdl/home/<username>/perl5/bin/pdl2
Installing /home/<username>/tmp/perl-pdl/pkg/perl-pdl/home/<username>/perl5/bin/pptemplate
Installing /home/<username>/tmp/perl-pdl/pkg/perl-pdl/home/<username>/perl5/bin/perldl
Installing /home/<username>/tmp/perl-pdl/pkg/perl-pdl/home/<username>/perl5/bin/pdldoc
Appending installation info to /home/<username>/tmp/perl-pdl/pkg/perl-pdl/home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/perllocal.pod
==> Tidying install...
  -> Purging unwanted files...
  -> Removing libtool files...
  -> Removing static library files...
  -> Removing empty directories...
  -> Compressing man and info pages...
  -> Stripping unneeded symbols from binaries and libraries...
==> Creating package "perl-pdl"...
  -> Generating .PKGINFO file...
  -> Adding changelog file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: perl-pdl 2.007-1 (Wed Jun 18 16:21:25 PDT 2014)

Excerpts of "pacman -Qlp perl-pdl-2.007-1-x86_64.pkg.tar.xz" look like

perl-pdl /home/
perl-pdl /home/<username>/
perl-pdl /home/<username>/perl5/
perl-pdl /home/<username>/perl5/bin/
perl-pdl /home/<username>/perl5/bin/pdl
perl-pdl /home/<username>/perl5/bin/pdl2
perl-pdl /home/<username>/perl5/bin/pdldoc
perl-pdl /home/<username>/perl5/bin/perldl
perl-pdl /home/<username>/perl5/bin/pptemplate
perl-pdl /home/<username>/perl5/lib/
perl-pdl /home/<username>/perl5/lib/perl5/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/Inline/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/Inline/MakePdlppInstallable.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/Inline/Pdlpp.pmperl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/AutoLoader.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Bad.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Basic.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/CallExt.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Char.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Complex.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Compression.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Config.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Constants.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Core.pm
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Core/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Core/Dev.pmperl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Core/pdl.h
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/PDL/Core/pdlcore.h
...
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/Bad/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/Bad/Bad.so
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/CallExt/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/CallExt/CallExt.so
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/Complex/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/Complex/Complex.so
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/Compression/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/Compression/Compression.so
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/Core/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/Core/Core.so
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/FFT/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/FFT/FFT.so
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/Fit/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/Fit/Gaussian/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/Fit/Gaussian/Gaussian.so
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/GIS/
perl-pdl /home/<username>/perl5/lib/perl5/x86_64-linux-thread-multi/auto/PDL/GIS/Pr
...
perl-pdl /home/<username>/perl5/man/
perl-pdl /home/<username>/perl5/man/man1/
perl-pdl /home/<username>/perl5/man/man1/PDL::API.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::BadValues.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Bugs.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Course.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Dataflow.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Delta.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::FAQ.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Indexing.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Internals.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::MATLAB.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Modules.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Objects.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::PP-Inline.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::PP.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::ParallelCPU.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Philosophy.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::QuickStart.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Scilab.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Threading.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Tips.1p
perl-pdl /home/<username>/perl5/man/man1/PDL::Tutorials.1p
perl-pdl /home/<username>/perl5/man/man1/pdl2.1p
perl-pdl /home/<username>/perl5/man/man1/pdldoc.1p
perl-pdl /home/<username>/perl5/man/man1/perldl.1p
perl-pdl /home/<username>/perl5/man/man1/pptemplate.1p
perl-pdl /home/<username>/perl5/man/man3/
perl-pdl /home/<username>/perl5/man/man3/PDL.3pm
perl-pdl /home/<username>/perl5/man/man3/PDL::AutoLoader.3pm
perl-pdl /home/<username>/perl5/man/man3/PDL::BAD2_demo.3pm
...

It seems like the $pkgdir variable is screwed up, but non-perl AUR packages have installed just fine. Any pointers? Thanks.


Linux User #353 - SLS -> Slackware -> Red Hat -> Mandrake -> Fedora -> Arch

Offline

#2 2014-06-19 04:32:21

Joel
Member
From: Tijuana, BC, México
Registered: 2011-12-21
Posts: 122

Re: Perl modules are being installed to the wrong root directory

Well, while building it must point to $pkgdir in DESTDIR

PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'"
PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'"

* PC: Intel Core 2 DUO E6550 @ 2.33 GHz with 2 GB RAM: Archlinux-i686 with xfce4.
* Laptop: Intel Core 2 DUO T6600 @ 2.20 GHz with 4 GB RAM: Archlinux-x86-64 with xfce4.
* AUR contributor.

Offline

#3 2014-06-23 19:18:35

mike_r
Member
Registered: 2009-01-22
Posts: 114

Re: Perl modules are being installed to the wrong root directory

Thanks for that. I got perl-tk to build and install properly (the official version needed a patch so that the native texlive installer gui would work properly). I copied some of the environment variables from one of your AUR packages that you link to from your sig, inserted them into the perl-tk PKGBUILD, and that seemed to work just fine. I then tried the perl-pdl package; it seems to build, but the test step fails, though I think that is some other issue that needs to be worked out when I have more time.

I can't quite mark this solved, however, since the perl-tk PKGBUILD came from an official repository (extra). How is it that it builds and installs properly for the full system, but doesn't when I build it myself?


Linux User #353 - SLS -> Slackware -> Red Hat -> Mandrake -> Fedora -> Arch

Offline

#4 2014-06-26 19:37:39

juster
Forum Fellow
Registered: 2008-10-07
Posts: 195

Re: Perl modules are being installed to the wrong root directory

As usual I am probably too late to help. If you have local::lib installed and activated, it will override your destination directory when building packages. This is accomplished by setting environment variables. Joel hinted at this and you've seemed to fix them. Here is a decent list of them, mostly written by me I believe: https://wiki.archlinux.org/index.php/Pe … _variables

I've made tools that generate PKGBUILDs for perl modules and I always try to override these environment variables for just such an occasion. Entirely too much info on the subject is available at the wiki page above. Very few official PKGBUILDs will override these. Only the packages I used to maintain which retain my PKGBUILD will work for you. So... beware.

Offline

Board footer

Powered by FluxBB