nixpkgs mirror (for testing) github.com/NixOS/nixpkgs
nix
at 20.09 88 lines 2.1 kB view raw
1{ stdenv 2, substituteAll 3, fetchFromGitHub 4, fetchpatch 5, pkg-config 6, meson 7, ninja 8, gobject-introspection 9, python3 10, libyaml 11, rpm 12, file 13, gtk-doc 14, docbook-xsl-nons 15, help2man 16, docbook_xml_dtd_412 17, glib 18}: 19 20stdenv.mkDerivation rec { 21 pname = "libmodulemd"; 22 version = "2.9.2"; 23 24 outputs = [ "bin" "out" "dev" "devdoc" "man" "py" ]; 25 26 src = fetchFromGitHub { 27 owner = "fedora-modularity"; 28 repo = pname; 29 rev = "${pname}-${version}"; 30 sha256 = "0xl5f6a32hmli29b0rfp54h7vnagxdv9qa2r871mrgrr6fzjwvbn"; 31 }; 32 33 patches = [ 34 # Use proper glib devdoc path. 35 (substituteAll { 36 src = ./glib-devdoc.patch; 37 glib_devdoc = glib.devdoc; 38 }) 39 40 # Install pygobject overrides to our prefix instead of python3 one. 41 # https://github.com/fedora-modularity/libmodulemd/pull/469 42 (fetchpatch { 43 url = "https://github.com/fedora-modularity/libmodulemd/commit/f72a4bea092f4d84cfc48a3e820eb10270e828d0.patch"; 44 sha256 = "1rrf94q1yf98w6b9bm67mb6w6qv1zqi306iv1vzspvjhsqvzmzpg"; 45 }) 46 (fetchpatch { 47 url = "https://github.com/fedora-modularity/libmodulemd/commit/021ab08006b5cf601ce153174fdf403b910b8273.patch"; 48 sha256 = "0z35jpnnzzb5bvmc2lglrpfnwarhky2jqmhq9avnnki22fdw89i6"; 49 }) 50 ]; 51 52 nativeBuildInputs = [ 53 pkg-config 54 meson 55 ninja 56 gtk-doc 57 docbook-xsl-nons 58 help2man 59 docbook_xml_dtd_412 60 gobject-introspection 61 ]; 62 63 buildInputs = [ 64 libyaml 65 rpm 66 file # for libmagic 67 glib 68 ]; 69 70 mesonFlags = [ 71 "-Ddeveloper_build=false" 72 "-Dgobject_overrides_dir_py3=${placeholder "py"}/${python3.sitePackages}/gi/overrides" 73 ]; 74 75 postFixup = '' 76 # Python overrides depend our own typelibs and other packages 77 mkdir -p "$py/nix-support" 78 echo "$out ${python3.pkgs.pygobject3} ${python3.pkgs.six}" > "$py/nix-support/propagated-build-inputs" 79 ''; 80 81 meta = with stdenv.lib; { 82 description = "C Library for manipulating module metadata files"; 83 homepage = "https://github.com/fedora-modularity/libmodulemd"; 84 license = licenses.mit; 85 maintainers = with maintainers; [ ]; 86 platforms = platforms.linux; 87 }; 88}