Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 23.11-beta 111 lines 2.2 kB view raw
1{ stdenv 2, lib 3, fetchFromGitHub 4, arpack 5, bison 6, blas 7, cmake 8, flex 9, fop 10, glpk 11, gmp 12, lapack 13, libxml2 14, libxslt 15, llvmPackages 16, pkg-config 17, plfit 18, python3 19, sourceHighlight 20, xmlto 21}: 22 23assert (blas.isILP64 == lapack.isILP64 && 24 blas.isILP64 == arpack.isILP64 && 25 !blas.isILP64); 26 27stdenv.mkDerivation (finalAttrs: { 28 pname = "igraph"; 29 version = "0.10.7"; 30 31 src = fetchFromGitHub { 32 owner = "igraph"; 33 repo = finalAttrs.pname; 34 rev = finalAttrs.version; 35 hash = "sha256-1ge5V9G2jmIWQE5TW7+6cXCV9viFkhcnjpYrLQVLrgg="; 36 }; 37 38 postPatch = '' 39 echo "${finalAttrs.version}" > IGRAPH_VERSION 40 '' 41 # https://github.com/igraph/igraph/issues/2340 42 + lib.optionalString stdenv.isDarwin '' 43 sed -i "/safelocale/d" tests/CMakeLists.txt 44 ''; 45 46 outputs = [ "out" "dev" "doc" ]; 47 48 nativeBuildInputs = [ 49 bison 50 cmake 51 flex 52 fop 53 libxml2 54 libxslt 55 pkg-config 56 python3 57 sourceHighlight 58 xmlto 59 ]; 60 61 buildInputs = [ 62 arpack 63 blas 64 glpk 65 gmp 66 lapack 67 libxml2 68 plfit 69 ] ++ lib.optionals stdenv.cc.isClang [ 70 llvmPackages.openmp 71 ]; 72 73 cmakeFlags = [ 74 "-DIGRAPH_USE_INTERNAL_BLAS=OFF" 75 "-DIGRAPH_USE_INTERNAL_LAPACK=OFF" 76 "-DIGRAPH_USE_INTERNAL_ARPACK=OFF" 77 "-DIGRAPH_USE_INTERNAL_GLPK=OFF" 78 "-DIGRAPH_USE_INTERNAL_GMP=OFF" 79 "-DIGRAPH_USE_INTERNAL_PLFIT=OFF" 80 "-DIGRAPH_GLPK_SUPPORT=ON" 81 "-DIGRAPH_GRAPHML_SUPPORT=ON" 82 "-DIGRAPH_OPENMP_SUPPORT=ON" 83 "-DIGRAPH_ENABLE_LTO=AUTO" 84 "-DIGRAPH_ENABLE_TLS=ON" 85 "-DBUILD_SHARED_LIBS=ON" 86 ]; 87 88 doCheck = true; 89 90 postInstall = '' 91 mkdir -p "$out/share" 92 cp -r doc "$out/share" 93 ''; 94 95 postFixup = lib.optionalString stdenv.isDarwin '' 96 install_name_tool -change libblas.dylib ${blas}/lib/libblas.dylib $out/lib/libigraph.dylib 97 ''; 98 99 passthru.tests = { 100 python = python3.pkgs.igraph; 101 }; 102 103 meta = with lib; { 104 description = "C library for complex network analysis and graph theory"; 105 homepage = "https://igraph.org/"; 106 changelog = "https://github.com/igraph/igraph/blob/${finalAttrs.src.rev}/CHANGELOG.md"; 107 license = licenses.gpl2Plus; 108 platforms = platforms.all; 109 maintainers = with maintainers; [ MostAwesomeDude dotlambda ]; 110 }; 111})