Skip to content

Instantly share code, notes, and snippets.

@rwp0
Last active November 17, 2023 21:19
Show Gist options
  • Save rwp0/d3738e07e8f4617d5c0def113df6d4a2 to your computer and use it in GitHub Desktop.
Save rwp0/d3738e07e8f4617d5c0def113df6d4a2 to your computer and use it in GitHub Desktop.
Perl under WSL from Scratch
******************************************************************************
* COULD NOT FIND LIBSSL HEADERS                                              *
*                                                                            *
* The libssl header files are required to build Net-SSLeay, but they are     *
* missing from /usr. They would typically reside in /usr/include/openssl.    *
*                                                                            *
* If you are using the version of OpenSSL/LibreSSL packaged by your Linux    *
* distribution, you may need to install the corresponding "development"      *
* package via your package manager (e.g. libssl-dev for OpenSSL on Debian    *
* and Ubuntu, or openssl-devel for OpenSSL on Red Hat Enterprise Linux and   *
* Fedora).                                                                   *
******************************************************************************
/home/regular/perl5/perlbrew/perls/perl-blead/lib/5.39.5/x86_64-linux-thread-multi/CORE/proto.h:1015:1: note: declared here
 1015 | Perl_dowantarray(pTHX)
      | ^~~~~~~~~~~~~~~~
rm -f blib/arch/auto/Net/SSLeay/SSLeay.so
LD_RUN_PATH="/usr/lib/x86_64-linux-gnu" cc  -shared -O2 -g -L/usr -L/usr/lib64 -L/usr/lib -L/usr/local/lib -fstack-protector-strong  SSLeay.o  -o blib/arch/auto/Net/SSLeay/SSLeay.so  \
   -L/usr -L/usr/lib64 -L/usr/lib -lssl -lcrypto -lz   \

/usr/bin/ld: cannot find -lz: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:495: blib/arch/auto/Net/SSLeay/SSLeay.so] Error 1
FAIL
! Installing Net::SSLeay failed. See /home/regular/.cpanm/work/1700253142.103396/build.log for details. Retry with --force to force install it.

Install Perlbrew

curl -kL https://install.perlbrew.pl | bash
echo "source ~/perl5/perlbrew/etc/bashrc" >> ~/.profile

Install Perl

 perlbrew install blead -j 8 --thread --debug

Switch to Blead Perl from System

perlbrew use perl-blead

perl --version

Install CPANM

perlbrew install-cpanm

cpm (install-cpm) has certificate issues since it doesn't support curl -k underneath

Install Linux Development Libraries

libssl-dev and zlib1g-dev needed for Net-SSLeay, a dependency of Dist-Zilla

libexpat needed by XML-Parser, a dependency of Rex

apt install -y \
  libssl-dev zlib1g-dev \
  libexpat-dev

Install my Perl Modules Bundle

cpanm -q Task::BeLike::RWP
Expat must be installed prior to building XML::Parser and I can't find
it in the standard library directories. Install 'expat-devel' (or
'libexpat1-dev') package with your OS package manager. See 'README'.

Or you can download expat from:

http://sourceforge.net/projects/expat/

If expat is installed, but in a non-standard directory, then use the
following options to Makefile.PL:

    EXPATLIBPATH=...  To set the directory in which to find libexpat

    EXPATINCPATH=...  To set the directory in which to find expat.h

For example:

    perl Makefile.PL EXPATLIBPATH=/home/me/lib EXPATINCPATH=/home/me/include

Note that if you build against a shareable library in a non-standard location
you may (on some platforms) also have to set your LD_LIBRARY_PATH environment
variable at run time for perl to find the library.

N/A
@rwp0
Copy link
Author

rwp0 commented Nov 17, 2023

apt install -y gh
gh auth login (paste Token)
gh auth setup-git

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment