How do I make Alien use an existing tarball instead of downloading?

daxim

My distro does not offer any gsl <2.6 any more.

Given:

  • Alien::GSL 1.01
  • /tmp/gsl-2.5.tar.gz

How do I force it to compile that gsl instead of downloading from GNU FTP version 2.6, which I already have on the system anyway but is not delectable to Math::GSL 0.40?

I unsuccessfully tried:

  • copying the tarball into the unpacked Alien::GSL base directory
  • messing with alien_repository

This is for a throw-away project. I'm okay with manual installation instructions and patching toolchain code.

daxim

ikegami found the decisive hint:

It looks like you can set protocol of local to use a local file


Tested step-by-step instructions, plus some additional work-arounds; to me it looks like the build systems of the two modules are buggy/insufficiently tested:

cpanm --look Alien::GSL

patch Build.PL

diff --git a/Build.PL b/Build.PL
index 32f3057..6537138 100644
--- a/Build.PL
+++ b/Build.PL
@@ -20,10 +20,9 @@ my $builder = Alien::Base::ModuleBuild->new(
   alien_name => 'gsl',
   alien_repository => [
     {
-      protocol => 'ftp',
-      host     => 'ftp.gnu.org',
-      location => '/gnu/gsl',
-      pattern  => qr/^gsl-([\d\.]+)\.tar\.gz$/,
+      protocol => 'local',
+      location => '/tmp',
+      pattern  => 'gsl-2.5.tar.gz',
     },
   ],
   meta_merge => {
-- 
2.23.0
perl Build.PL
./Build

Pay attention to the generated configure/libtool commands here, they match the Perl configuration. A manual installation without those various options is not guaranteed to be compatible or usable. (This is not superstition: a similar problem historically shows up when installing mod_perl2 and libapreq2 from source on a system httpd; perl needs to be compiled first, then httpd to match, then the other packages, otherwise it won't work.) This shows the value of installing through Alien, since it delegates to M::B, the correct options will be figured out. It's above my level of knowledge to accurately create them from scratch.

./Build test

gsl-config in blib now erroneously contains build paths, not install paths, fix:

perl -MConfig -i -lpe'
    s|/.*(/auto/share/dist/Alien-GSL)|$Config{installsitelib}$1|
' blib/lib/auto/share/dist/Alien-GSL/bin/gsl-config
./Build install
exit # cpanm

cpanm --look Math::GSL
# let it pick up gsl-config on PATH
export PATH=$PATH:$(perl -mAlien::GSL -e'print Alien::GSL->bin_dir')
perl Build.PL
./Build
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$(gsl-config --libs | perl -lne'/-L(\S+) / && print $1')
./Build test
./Build install
exit # cpanm

Finally rëexport the variables whenever you want to use Math::GSL.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

How do I make Ansible ignore failed tarball extraction?

How do I make Vue wait for Firestore to finish downloading collection?

How do I make progress bar while downloading file in python

How do I add use the make installed using homebrew instead of the macOS included make?

How do I uncompress a tarball that uses .xz?

How do I get my shell functions to make use of existing autocompletion in zsh?

Can i make a server open html instead of downloading it? if i can how?

How do I update the content of body instead of adding to existing content?

How do I make Heroku use node 14.x instead of 12.x?

How do I make an app use a module outside of its own folder, by linking to it (instead of copying)?

How do I make Openshift to use Express 4, instead of its installed Express 3?

Sometimes it's convenient to use ` read -t 3 ` instead of ` sleep 3 `. How do I make it work with `nohup`?

Git in Terminal is using my real name for commits, how do I make it use my username instead?

How do I make my Dockerfile use base images from ECR registry instead of Dockerhub?

how do I use current node instead of this?

How can I use npm package selenium-standalone with Nightmare.js instead of downloading the selenium jar?

How do I get the browser to open the pdf in a new tab instead of just downloading it?

How do I get my embed tag to display videos instead of downloading them?

How do I make existing tabs appear as 4 spaces in vim?

How do I make an existing .chm file searchable?

How do I make a keyboard shortcut open an existing window?

How do I make a lagged value variable from an existing column?

How do I make an include for an existing list in C #?

How do I make an existing animated GIF loop repeatedly?

How do I make an existing project on my machine into a GitHub project?

How do I add a tuple to an existing one, and make it nested?

How do I extract a tarball, skipping some of the leading directories?

How do I download a tarball from GitHub using cURL?

How do I make XTerm not use bold?