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