Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at python-updates 127 lines 2.4 kB view raw
1{ 2 autoPatchelfHook, 3 aeron, 4 cmake, 5 fetchFromGitHub, 6 fetchMavenArtifact, 7 jdk11, 8 lib, 9 libbsd, 10 libuuid, 11 makeWrapper, 12 patchelf, 13 stdenv, 14 zlib, 15}: 16 17let 18 version = aeron.version; 19 20 sbeAll_1_31_1 = fetchMavenArtifact { 21 groupId = "uk.co.real-logic"; 22 version = "1.31.1"; 23 artifactId = "sbe-all"; 24 hash = "sha512-Ypsk8PbShFOxm49u1L+TTuApaW6ECTSee+hHEhmY/jNi5AymHXBWwDMBMkzC25aowiHLJS5EnzLk6hu9Lea93Q=="; 25 }; 26 27 sbeAll = sbeAll_1_31_1; 28 29in 30 31stdenv.mkDerivation { 32 pname = "aeron-cpp"; 33 inherit version; 34 35 src = fetchFromGitHub { 36 owner = "real-logic"; 37 repo = "aeron"; 38 rev = version; 39 hash = "sha256-sROEZVOfScrlqMLbfrPtw3LQCQ5TfMcrLiP6j/Z9rSM="; 40 }; 41 42 patches = [ 43 ./aeron-all.patch 44 # Use pre-built aeron-all.jar from Maven repo, avoiding Gradle 45 46 ./aeron-archive-sbe.patch 47 # Use SBE tool to generate C++ codecs, avoiding Gradle 48 ]; 49 50 buildInputs = [ 51 libbsd 52 libuuid 53 zlib 54 ]; 55 56 nativeBuildInputs = [ 57 autoPatchelfHook 58 cmake 59 jdk11 60 makeWrapper 61 patchelf 62 ]; 63 64 configurePhase = '' 65 runHook preConfigure 66 67 mkdir --parents cppbuild/Release 68 ( 69 cd cppbuild/Release 70 cmake \ 71 -G "CodeBlocks - Unix Makefiles" \ 72 -DCMAKE_BUILD_TYPE=Release \ 73 -DAERON_TESTS=OFF \ 74 -DAERON_SYSTEM_TESTS=OFF \ 75 -DAERON_BUILD_SAMPLES=OFF \ 76 -DCMAKE_INSTALL_PREFIX:PATH=../../install \ 77 ../.. 78 ) 79 80 runHook postConfigure 81 ''; 82 83 buildPhase = '' 84 runHook preBuild 85 86 ln --symbolic "${aeron.jar}" ./aeron-all.jar 87 ln --symbolic "${sbeAll.jar}" ./sbe.jar 88 mkdir --parents aeron-all/build/libs 89 ( 90 cd cppbuild/Release 91 92 make -j $NIX_BUILD_CORES \ 93 aeron \ 94 aeron_archive_client \ 95 aeron_client_shared \ 96 aeron_driver \ 97 aeron_client \ 98 aeron_driver_static \ 99 aeronmd 100 101 make install 102 ) 103 104 runHook postBuild 105 ''; 106 107 installPhase = '' 108 runHook preInstall 109 110 mkdir --parents "$out" 111 cp --archive --verbose --target-directory="$out" install/* 112 113 runHook postInstall 114 ''; 115 116 meta = with lib; { 117 description = "Aeron Messaging C++ Library"; 118 homepage = "https://aeron.io/"; 119 license = licenses.asl20; 120 mainProgram = "aeronmd"; 121 maintainers = [ maintainers.vaci ]; 122 sourceProvenance = [ 123 sourceTypes.fromSource 124 sourceTypes.binaryBytecode 125 ]; 126 }; 127}