Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ stdenv 2, lib 3, fetchFromGitHub 4, cmake 5, cppunit 6, iconv 7}: 8 9stdenv.mkDerivation (finalAttrs: { 10 pname = "cpp-utilities"; 11 version = "5.24.1"; 12 13 src = fetchFromGitHub { 14 owner = "Martchus"; 15 repo = "cpp-utilities"; 16 rev = "v${finalAttrs.version}"; 17 sha256 = "sha256-Prb593+jXhYzwPHQnwen2qgaNfdX1Atiz1FhmXm9X7U="; 18 }; 19 20 nativeBuildInputs = [ cmake ]; 21 nativeCheckInputs = [ cppunit ]; 22 buildInputs = lib.optionals stdenv.isDarwin [ 23 iconv # needed on Darwin, see https://github.com/Martchus/cpp-utilities/issues/4 24 ]; 25 26 cmakeFlags = ["-DBUILD_SHARED_LIBS=ON"]; 27 28 # Otherwise, tests fail since the resulting shared object libc++utilities.so is only available in PWD of the make files 29 preCheck = '' 30 checkFlagsArray+=( 31 "LD_LIBRARY_PATH=$PWD" 32 ) 33 ''; 34 # tests fail on Darwin 35 doCheck = !stdenv.isDarwin; 36 37 meta = with lib; { 38 homepage = "https://github.com/Martchus/cpp-utilities"; 39 description = "Common C++ classes and routines used by @Martchus' applications featuring argument parser, IO and conversion utilities"; 40 license = licenses.gpl2Plus; 41 maintainers = with maintainers; [ doronbehar ]; 42 platforms = platforms.linux ++ platforms.darwin; 43 }; 44})