Closed Gomez closed 8 years ago
I believe the typical way to solve issues like this is by wrapping the program with PERL5LIB environment variable. See example here: https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/monitoring/munin/default.nix#L106-118.
thanks @bjornfor Unfortunaly no change: My default.nix:
{ stdenv, makeWrapper, pkgconfig, perl, perlPackages, fetchurl, DeviceSerialPort }:
stdenv.mkDerivation rec {
name = "fhem-${version}";
version = "5.7";
src = fetchurl {
url = http://fhem.de/fhem-5.7.tar.gz;
sha256 = "179fd251edb0bc7dbd775d7d6597fcfe7df88c2f7b39c5bbecf17defaa6b9539";
};
buildInputs = [ makeWrapper pkgconfig perl perlPackages.JSON DeviceSerialPort ];
patchPhase = ''
substituteInPlace Makefile --replace /opt $out
substituteInPlace fhem.cfg --replace /opt/log $out/log
'';
makeFlags = ''
PREFIX=$(out)
INSTALL=install
DESTDIR=$(out)
PERLLIB=$(out)/lib/perl5/site_perl
PERL=${perl}/bin/perl
'';
postFixup = ''
for file in "$out"/*.pm "$out"/*.pl; do
wrapProgram "$file" \
--set PERL5LIB "$out/lib/perl5/site_perl:${with perlPackages; stdenv.lib.makePerlPath [
JSON DeviceSerialPort
]}"
done
'';
meta = {
description = "File Manager and User Shell for the GNU Project";
homepage = http://www.midnight-commander.org;
license = "GPLv2+";
maintainers = [ stdenv.lib.maintainers.sander ];
};
}
Solved it:
postFixup = ''
wrapProgram "$out"/fhem/fhem.pl \
--set PERL5LIB "$out/lib/perl5/site_perl:${with perlPackages; stdenv.lib.makePerlPath [
JSON DeviceSerialPort
]}"
'';
thx @bjornfor !
@Gomez: Great!
Issue description
I try to get a fhem (http://fhem.de/fhem.html) run on my server, its a perl home automation server, here is my default.nix, it successfully builds:
DeviceSerialPort looks like this:
Steps to reproduce
If i start the server i get this errors:
and:
I am new to nix / nixos, some1 able to gimme some pointers?
Technical details