Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm on Linux, with no root access, and have installed an rpm locally (in /home/me/local, rather than /usr). This is fine, except that the rpm (rxvt-unicode) requires some Perl modules, and the default library search path doesn't include my local directories.

There are two issues, but I can only fix one of them. First off, /home/me/local/lib64/urxvt contains urxvt.pm. I can fix this by setting PERL5LIB to /home/me/local/lib64/urxvt, so no problem.

Second, /home/me/local/lib64/urxvt/perl contains various extensions (including /home/me/local/lib64/urxvt/perl/option-popup). When I run the program (urxvt) I now get various messages along the lines of

urxvt: perl extension 'option-popup' not found in perl library search path

I can't fix this by adding the extra directory to PERL5LIB. for instance, this:

setenv PERL5LIB /home/me/local/lib64/urxvt/perl:/home/me/local/lib64/urxvt

makes no difference. I've checked the search path with perl -V and it correctly shows both directories. Is there something different about extensions? Don't they check @INC?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

rxvt-unicode looks for its extensions either in a compiled-in directory (which might be something like /usr/lib64/urxvt/perl in case of an RPM package, and does not change according to the location of executable files), or in directories specified by the perl-lib resource or the --perl-lib command line option.

See the relevant part from the urxvt(1) man page:

   perl-lib: path
       Colon-separated list of additional directories that hold extension
       scripts. When looking for extensions specified by the "perl"
       resource, urxvt will first look in these directories and then in
       /usr/lib64/urxvt/perl/.

       See the urxvtperl(3) manpage.

So you need to add something like this to your ~/.Xresources or ~/.Xdefaults file:

URxvt.perl-lib: /home/me/local/lib64/urxvt/perl

Update: Since rxvt-unicode 9.14 the default extension path includes $HOME/.urxvt/ext before the compiled-in system extension directory, therefore you can just place your extension files into ~/.urxvt/ext instead of setting the perl-lib X resource.

In addition to that, rxvt-unicode >= 9.16 looks for Perl extensions in directories listed in the URXVT_PERL_LIB environment variable. Now the search order is as follows:

  1. Directories listed in the perl-lib X resource (multiple directories separated by colons).
  2. Directories listed in the URXVT_PERL_LIB environment variable (multiple directories separated by colons).
  3. $HOME/.urxvt/ext
  4. $LIBDIR/perl, where $LIBDIR is the package library directory name compiled into the executable (e.g., /usr/lib64/urxvt).
share|improve this answer
    
That works - thanks. –  EML May 1 '13 at 11:47
    
Can we use an environment variable or ~ in .Xresources? –  Chris Sep 1 '13 at 19:36
    
No, environment variables are not expanded in the perl-lib resource neither by rxvt-unicode nor by xrdb. However, see the updated answer — if you have a recent enough version of rxvt-unicode, you may just place your extensions into ~/.urxvt/ext, or set URXVT_PERL_LIB in a script where you can use values of other environment variables. –  Sergey Vlasov Sep 2 '13 at 15:17

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.