nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at devShellTools-shell 84 lines 1.7 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 6 # nativeBuildInputs 7 cmake, 8 gz-cmake, 9 doxygen, 10 graphviz, 11 12 # buildInputs 13 cli11, 14 spdlog, 15 16 # nativeCheckInputs 17 python3, 18 19 # checkInputs 20 gtest, 21}: 22stdenv.mkDerivation (finalAttrs: { 23 pname = "gz-utils"; 24 version = "3.1.1"; 25 26 src = fetchFromGitHub { 27 owner = "gazebosim"; 28 repo = "gz-utils"; 29 tag = "gz-utils${lib.versions.major finalAttrs.version}_${finalAttrs.version}"; 30 hash = "sha256-fYzysdB608jfMb/EbqiGD4hXmPxcaVTUrt9Wx0dBlto="; 31 }; 32 33 outputs = [ 34 "doc" 35 "out" 36 ]; 37 38 # Remove vendored gtest, use nixpkgs' version instead. 39 postPatch = '' 40 rm -r test/gtest_vendor 41 42 substituteInPlace test/CMakeLists.txt --replace-fail \ 43 "add_subdirectory(gtest_vendor)" "# add_subdirectory(gtest_vendor)" 44 ''; 45 46 nativeBuildInputs = [ 47 cmake 48 gz-cmake 49 doxygen 50 graphviz 51 ]; 52 53 buildInputs = [ 54 cli11 55 spdlog 56 ]; 57 58 # Indicate to CMake that we are not using the vendored CLI11 library. 59 # The integration tests make (unintentional?) unconditional usage of the vendored 60 # CLI11 library, so we can't remove that. 61 cmakeFlags = [ 62 (lib.cmakeBool "GZ_UTILS_VENDOR_CLI11" false) 63 ]; 64 65 postBuild = '' 66 make doc 67 cp -r doxygen/html $doc 68 ''; 69 70 nativeCheckInputs = [ python3 ]; 71 72 checkInputs = [ gtest ]; 73 74 doCheck = true; 75 76 meta = { 77 description = "General purpose utility classes and functions for the Gazebo libraries"; 78 homepage = "https://gazebosim.org/home"; 79 changelog = "https://github.com/gazebosim/gz-utils/blob/${finalAttrs.src.tag}/Changelog.md"; 80 license = lib.licenses.asl20; 81 platforms = lib.platforms.unix ++ lib.platforms.windows; 82 maintainers = with lib.maintainers; [ guelakais ]; 83 }; 84})