vsTerminus / Discord-NP

Last.FM Now Playing info in your Discord status message
MIT License
43 stars 6 forks source link

For those who are struggling to run this on Linux #16

Closed ghost closed 3 years ago

ghost commented 4 years ago

It took me an insurmountable amount of time with quite a few reinstallations with different magic variables to configure this on Linux (Manjaro). Apparently Perl doesn't "just work" and the author doesn't explain the meaning of $PERL5LIB and doesn't suggest what to set it to. Anyway, based on default paths created by Perl, this works for me (assuming you store this software in .local/soft) and the application can find all libraries:

cd .local/soft
git clone https://github.com/vsTerminus/Discord-NP.git
git clone https://github.com/vsTerminus/Mojo-Discord.git
git clone https://github.com/vsTerminus/Mojo-WebService-LastFM.git
export PERL5LIB="/home/ave/perl5/lib/perl5"
export PERL_LOCAL_LIB_ROOT="/home/ave/perl5"
export PERL_MB_OPT="--install_base "/home/ave/perl5""
export PERL_MM_OPT="INSTALL_BASE=/home/ave/perl5"
mkdir -p $PERL5LIB/Mojo/WebService
ln -s $PWD/Mojo-Discord/lib/Mojo/Discord.pm $PERL5LIB/Mojo/
ln -s $PWD/Mojo-Discord/lib/Mojo/Discord $PERL5LIB/Mojo/
ln -s $PWD/Mojo-WebService-LastFM/lib/Mojo/WebService/LastFM.pm $PERL5LIB/Mojo/WebService/LastFM.pm
cd Mojo-Discord && cpanm --notest --installdeps .
cd ../Mojo-WebService-LastFM && cpanm --notest --installdeps .
cd ../Discord-NP && cpanm --notest --installdeps .
cpanm --local-lib=~/perl5 local::lib && eval $(perl -I ~/perl5/lib/perl5/ -Mlocal::lib)

Afterwards you can run it from clear shell context like that:

PERL5LIB="/home/ave/perl5/lib/perl5" ./.local/soft/Discord-NP/discordnp.pl
Sonico98 commented 3 years ago

Thanks A LOT for this. I also was having a hard time trying to get this to install correctly.

vsTerminus commented 3 years ago

Thanks for the feedback and the good info. I need to do another pass at this app's documentation soon, I will make sure to be more clear about the perl stuff.

Thanks again