Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 112 lines 2.6 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchurl, 5 docutils, 6 glib, 7 meson, 8 mesonEmulatorHook, 9 ninja, 10 nixosTests, 11 pkg-config, 12 gettext, 13 withIntrospection ? 14 lib.meta.availableOn stdenv.hostPlatform gobject-introspection 15 && stdenv.hostPlatform.emulatorAvailable buildPackages, 16 buildPackages, 17 gobject-introspection, 18 gi-docgen, 19 libxslt, 20 fixDarwinDylibNames, 21 gnome, 22}: 23 24stdenv.mkDerivation rec { 25 pname = "json-glib"; 26 version = "1.10.6"; 27 28 outputs = [ 29 "out" 30 "dev" 31 "installedTests" 32 ] 33 ++ lib.optional withIntrospection "devdoc"; 34 35 src = fetchurl { 36 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz"; 37 hash = "sha256-d/S8v5M5Uo8Wa4BzRYaT8KILd7cFnbwtthdGoZKLApM="; 38 }; 39 40 patches = [ 41 # Add option for changing installation path of installed tests. 42 ./meson-add-installed-tests-prefix-option.patch 43 ]; 44 45 strictDeps = true; 46 47 depsBuildBuild = [ 48 pkg-config 49 ]; 50 51 nativeBuildInputs = [ 52 docutils # for rst2man, rst2html5 53 meson 54 ninja 55 pkg-config 56 gettext 57 glib 58 libxslt 59 ] 60 ++ lib.optionals stdenv.hostPlatform.isDarwin [ 61 fixDarwinDylibNames 62 ] 63 ++ lib.optionals withIntrospection [ 64 gobject-introspection 65 gi-docgen 66 ] 67 ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ 68 mesonEmulatorHook 69 ]; 70 71 propagatedBuildInputs = [ 72 glib 73 ]; 74 75 mesonFlags = [ 76 "-Dinstalled_test_prefix=${placeholder "installedTests"}" 77 (lib.mesonEnable "introspection" withIntrospection) 78 (lib.mesonEnable "documentation" withIntrospection) 79 ]; 80 81 doCheck = true; 82 83 postFixup = '' 84 # Move developer documentation to devdoc output. 85 # Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back. 86 if [[ -d "$out/share/doc" ]]; then 87 find -L "$out/share/doc" -type f -regex '.*\.devhelp2?' -print0 \ 88 | while IFS= read -r -d ''' file; do 89 moveToOutput "$(dirname "''${file/"$out/"/}")" "$devdoc" 90 done 91 fi 92 ''; 93 94 passthru = { 95 tests = { 96 installedTests = nixosTests.installed-tests.json-glib; 97 }; 98 99 updateScript = gnome.updateScript { 100 packageName = pname; 101 versionPolicy = "odd-unstable"; 102 }; 103 }; 104 105 meta = with lib; { 106 description = "Library providing (de)serialization support for the JavaScript Object Notation (JSON) format"; 107 homepage = "https://gitlab.gnome.org/GNOME/json-glib"; 108 license = licenses.lgpl21Plus; 109 teams = [ teams.gnome ]; 110 platforms = with platforms; unix; 111 }; 112}