nur-packages

My NUR packages
git clone git://git.sikmir.ru/nur-packages
Log | Files | Refs | README | LICENSE

default.nix (1663B)


      1 { lib, stdenv, fetchFromGitHub, fftwFloat, libsamplerate, libsndfile, libusb1
      2 , portaudio, rtl-sdr, qmake, qwt, wrapQtAppsHook
      3 }:
      4 
      5 stdenv.mkDerivation rec {
      6   pname = "fmreceiver";
      7   version = "2.1";
      8 
      9   src = fetchFromGitHub {
     10     owner = "JvanKatwijk";
     11     repo = "sdr-j-fm";
     12     rev = version;
     13     hash = "sha256-U0m9PIB+X+TBoz5FfXMvR/tZjkNIy7B613I7eLT5UIs=";
     14   };
     15 
     16   postPatch = ''
     17     substituteInPlace fmreceiver.pro \
     18       --replace "-lqwt-qt5" "-lqwt" \
     19       --replace "CONFIG" "#CONFIG"
     20   '' + lib.optionalString stdenv.isDarwin ''
     21     substituteInPlace fmreceiver.pro --replace "-lrt " ""
     22     substituteInPlace includes/fm-constants.h --replace "<malloc.h>" "<stdlib.h>"
     23     substituteInPlace devices/rtlsdr-handler/rtlsdr-handler.cpp --replace ".so" ".dylib"
     24   '';
     25 
     26   nativeBuildInputs = [ qmake wrapQtAppsHook ];
     27 
     28   buildInputs = [ fftwFloat libsamplerate libsndfile libusb1 portaudio qwt ];
     29 
     30   qmakeFlags = [ "CONFIG+=dabstick" ];
     31 
     32   qtWrapperArgs = [
     33     "--prefix ${lib.optionalString stdenv.isDarwin "DY"}LD_LIBRARY_PATH : ${lib.makeLibraryPath [ rtl-sdr ]}"
     34   ];
     35 
     36   installPhase = if stdenv.isDarwin then ''
     37     mkdir -p $out/Applications
     38     mv linux-bin/fmreceiver-2.0.app $out/Applications/fmreceiver.app
     39     install_name_tool -change {,${qwt}/lib/}libqwt.6.dylib "$out/Applications/fmreceiver.app/Contents/MacOS/fmreceiver-2.0"
     40   '' else ''
     41     install -Dm755 linux-bin/fmreceiver-2.0 $out/bin/fmreceiver
     42   '';
     43 
     44   meta = with lib; {
     45     description = "A simple FM receiver";
     46     inherit (src.meta) homepage;
     47     license = licenses.gpl2Plus;
     48     maintainers = [ maintainers.sikmir ];
     49     platforms = platforms.unix;
     50     broken = true;
     51   };
     52 }