nixpkgs/pkgs/development/libraries/libmanette/default.nix
Alyssa Ross fef0a52db9
libmanette: disable introspection if no emulator
e.g. when cross compiling from Linux to FreeBSD.
2023-03-02 14:42:07 +00:00

77 lines
1.6 KiB
Nix

{ lib, stdenv
, fetchurl
, ninja
, meson
, mesonEmulatorHook
, pkg-config
, vala
, gobject-introspection
, buildPackages
, withIntrospection ? stdenv.hostPlatform.emulatorAvailable buildPackages
, gtk-doc
, docbook-xsl-nons
, docbook_xml_dtd_43
, glib
, libgudev
, libevdev
, gnome
}:
stdenv.mkDerivation rec {
pname = "libmanette";
version = "0.2.6";
outputs = [ "out" "dev" ] ++ lib.optional withIntrospection "devdoc";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "1b3bcdkk5xd5asq797cch9id8692grsjxrc1ss87vv11m1ck4rb3";
};
nativeBuildInputs = [
meson
ninja
pkg-config
glib
] ++ lib.optionals withIntrospection [
vala
gobject-introspection
gtk-doc
docbook-xsl-nons
docbook_xml_dtd_43
] ++ lib.optionals (withIntrospection && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
mesonEmulatorHook
];
buildInputs = [
glib
libevdev
] ++ lib.optionals withIntrospection [
libgudev
];
mesonFlags = [
(lib.mesonBool "doc" withIntrospection)
(lib.mesonEnable "gudev" withIntrospection)
(lib.mesonBool "introspection" withIntrospection)
(lib.mesonBool "vapi" withIntrospection)
];
doCheck = true;
passthru = {
updateScript = gnome.updateScript {
packageName = pname;
versionPolicy = "odd-unstable";
};
};
meta = with lib; {
description = "A simple GObject game controller library";
homepage = "https://gnome.pages.gitlab.gnome.org/libmanette/";
license = licenses.lgpl21Plus;
maintainers = teams.gnome.members;
platforms = platforms.unix;
};
}