nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at python-updates 101 lines 2.0 kB view raw
1{ 2 stdenv, 3 lib, 4 fetchFromGitHub, 5 bash, 6 cmake, 7 cfitsio, 8 libusb1, 9 kmod, 10 zlib, 11 boost, 12 libev, 13 libnova, 14 curl, 15 libjpeg, 16 gsl, 17 fftw, 18 gtest, 19 udevCheckHook, 20 versionCheckHook, 21 indi-full, 22}: 23 24stdenv.mkDerivation (finalAttrs: { 25 pname = "indilib"; 26 version = "2.1.6"; 27 28 src = fetchFromGitHub { 29 owner = "indilib"; 30 repo = "indi"; 31 rev = "v${finalAttrs.version}"; 32 hash = "sha256-WfVC5CLzwyO40Kpv/SZaYiPGDvWLUydQaA8FvTVhHqg="; 33 }; 34 35 nativeBuildInputs = [ 36 cmake 37 ]; 38 39 nativeInstallCheckInputs = [ 40 versionCheckHook 41 udevCheckHook 42 ]; 43 44 buildInputs = [ 45 curl 46 cfitsio 47 libev 48 libusb1 49 zlib 50 boost 51 libnova 52 libjpeg 53 gsl 54 fftw 55 ]; 56 57 cmakeFlags = [ 58 "-DCMAKE_INSTALL_LIBDIR=lib" 59 "-DUDEVRULES_INSTALL_DIR=lib/udev/rules.d" 60 ] 61 ++ lib.optional finalAttrs.finalPackage.doCheck [ 62 "-DINDI_BUILD_UNITTESTS=ON" 63 "-DINDI_BUILD_INTEGTESTS=ON" 64 ]; 65 66 checkInputs = [ gtest ]; 67 68 doCheck = true; 69 doInstallCheck = true; 70 71 # Socket address collisions between tests 72 enableParallelChecking = false; 73 74 postFixup = lib.optionalString stdenv.hostPlatform.isLinux '' 75 for f in $out/lib/udev/rules.d/*.rules 76 do 77 substituteInPlace $f --replace-quiet "/bin/sh" "${bash}/bin/sh" \ 78 --replace-quiet "/sbin/modprobe" "${kmod}/sbin/modprobe" 79 done 80 ''; 81 82 passthru.tests = { 83 # make sure 3rd party drivers compile with this indilib 84 indi-full = indi-full.override { 85 indilib = finalAttrs.finalPackage; 86 }; 87 }; 88 89 meta = { 90 homepage = "https://www.indilib.org/"; 91 description = "Implementation of the INDI protocol for POSIX operating systems"; 92 changelog = "https://github.com/indilib/indi/releases/tag/v${finalAttrs.version}"; 93 license = lib.licenses.lgpl2Plus; 94 mainProgram = "indiserver"; 95 maintainers = with lib.maintainers; [ 96 sheepforce 97 returntoreality 98 ]; 99 platforms = lib.platforms.unix; 100 }; 101})