package.nix (1056B)
1 { 2 lib, 3 stdenv, 4 fetchurl, 5 perlPackages, 6 makeWrapper, 7 }: 8 9 perlPackages.buildPerlPackage rec { 10 pname = "fhem"; 11 version = "6.4"; 12 13 src = fetchurl { 14 url = "https://fhem.de/fhem-${version}.tar.gz"; 15 hash = "sha256-AGL2GKV5ttv5s9wsJPsjV+iHYeyXtGABuERAwJwMsRc="; 16 }; 17 18 postPatch = '' 19 touch Makefile.PL 20 substituteInPlace fhem.pl \ 21 --replace-fail 'global modpath .' "global modpath $out/opt/fhem" 22 ''; 23 24 nativeBuildInputs = [ makeWrapper ]; 25 26 buildInputs = [ perlPackages.DeviceSerialPort ]; 27 28 dontBuild = true; 29 30 installFlags = [ "BINDIR=$(out)/opt/fhem" ]; 31 32 postInstall = '' 33 makeWrapper ${lib.getExe perlPackages.perl} $out/bin/fhem \ 34 --prefix PERL5LIB : "$out/opt/fhem/FHEM:$PERL5LIB" \ 35 --add-flags "$out/opt/fhem/fhem.pl" 36 ''; 37 38 outputs = [ "out" ]; 39 40 meta = { 41 homepage = "https://fhem.de"; 42 description = "FHEM (TM) is a GPL'd perl server for house automation"; 43 license = lib.licenses.gpl2; 44 maintainers = with lib.maintainers; [ sikmir ]; 45 platforms = lib.platforms.unix; 46 }; 47 }
