Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 stdenv, 3 lib, 4 fetchFromGitLab, 5 testers, 6 cmake, 7 cmake-extras, 8 dbus, 9 dbus-test-runner, 10 gtest, 11 libqtdbustest, 12 networkmanager, 13 pkg-config, 14 procps, 15 python3, 16 qtbase, 17}: 18 19stdenv.mkDerivation (finalAttrs: { 20 pname = "libqtdbusmock"; 21 version = "0.9.1"; 22 23 src = fetchFromGitLab { 24 owner = "ubports"; 25 repo = "development/core/libqtdbusmock"; 26 rev = finalAttrs.version; 27 hash = "sha256-hVw2HnIHlA7vvt0Sr6F2qVhvBZ33aCeqb9vgbu3rgBo="; 28 }; 29 30 postPatch = '' 31 # Workaround for "error: expected unqualified-id before 'public'" on "**signals" 32 sed -i -e '/add_definitions/a -DQT_NO_KEYWORDS' CMakeLists.txt 33 '' 34 + lib.optionalString (!finalAttrs.finalPackage.doCheck) '' 35 # Don't build tests when we're not running them 36 sed -i -e '/add_subdirectory(tests)/d' CMakeLists.txt 37 ''; 38 39 strictDeps = true; 40 41 nativeBuildInputs = [ 42 cmake 43 pkg-config 44 ]; 45 46 buildInputs = [ 47 cmake-extras 48 libqtdbustest 49 networkmanager 50 qtbase 51 ]; 52 53 nativeCheckInputs = [ 54 dbus 55 dbus-test-runner 56 procps 57 (python3.withPackages ( 58 ps: with ps; [ 59 python-dbusmock 60 ] 61 )) 62 ]; 63 64 checkInputs = [ 65 gtest 66 ]; 67 68 dontWrapQtApps = true; 69 70 doCheck = stdenv.buildPlatform.canExecute stdenv.hostPlatform; 71 72 enableParallelChecking = false; 73 74 checkPhase = '' 75 runHook preCheck 76 77 dbus-test-runner -t make -p test -p "''${enableParallelChecking:+-j $NIX_BUILD_CORES}" 78 79 runHook postCheck 80 ''; 81 82 passthru.tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage; 83 84 meta = with lib; { 85 description = "Library for mocking DBus interactions using Qt"; 86 homepage = "https://launchpad.net/libqtdbusmock"; 87 license = licenses.lgpl3Only; 88 platforms = platforms.unix; 89 teams = [ teams.lomiri ]; 90 pkgConfigModules = [ 91 "libqtdbusmock-1" 92 ]; 93 }; 94})