2022-04-27 09:35:20 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
2022-04-27 09:35:20 +00:00
|
|
|
, fetchpatch
|
2020-08-20 17:08:02 +00:00
|
|
|
, nix-update-script
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, meson
|
2022-09-30 11:47:45 +00:00
|
|
|
, mesonEmulatorHook
|
2020-04-24 23:36:52 +00:00
|
|
|
, ninja
|
|
|
|
, python3
|
|
|
|
, mutest
|
|
|
|
, nixosTests
|
|
|
|
, glib
|
|
|
|
, gtk-doc
|
|
|
|
, docbook_xsl
|
|
|
|
, docbook_xml_dtd_43
|
|
|
|
, gobject-introspection
|
2021-06-28 23:13:55 +00:00
|
|
|
, makeWrapper
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "graphene";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "1.10.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
outputs = [ "out" "dev" "devdoc" ]
|
|
|
|
++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "installedTests" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ebassi";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-04-27 09:35:20 +00:00
|
|
|
sha256 = "P6JQhSktzvyMHatP/iojNGXPmcsxsFxdYerXzS23ojI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
patches = [
|
2021-05-20 23:08:51 +00:00
|
|
|
# Add option for changing installation path of installed tests.
|
2020-04-24 23:36:52 +00:00
|
|
|
./0001-meson-add-options-for-tests-installation-dirs.patch
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
# Disable flaky simd_operators_reciprocal test
|
|
|
|
# https://github.com/ebassi/graphene/issues/246
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/ebassi/graphene/commit/4fbdd07ea3bcd0964cca3966010bf71cb6fa8209.patch";
|
|
|
|
sha256 = "uFkkH0u4HuQ/ua1mfO7sJZ7MPrQdV/JON7mTYB4DW80=";
|
|
|
|
includes = [ "tests/simd.c" ];
|
|
|
|
revert = true;
|
|
|
|
})
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
depsBuildBuild = [
|
|
|
|
pkg-config
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
docbook_xml_dtd_43
|
|
|
|
docbook_xsl
|
|
|
|
gtk-doc
|
|
|
|
meson
|
|
|
|
ninja
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
gobject-introspection
|
|
|
|
python3
|
2021-06-28 23:13:55 +00:00
|
|
|
makeWrapper
|
2022-09-30 11:47:45 +00:00
|
|
|
] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
|
|
mesonEmulatorHook
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2020-04-24 23:36:52 +00:00
|
|
|
mutest
|
|
|
|
];
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
mesonFlags = [
|
2022-09-30 11:47:45 +00:00
|
|
|
"-Dgtk_doc=true"
|
|
|
|
"-Dintrospection=enabled"
|
2021-05-20 23:08:51 +00:00
|
|
|
"-Dinstalled_test_datadir=${placeholder "installedTests"}/share"
|
|
|
|
"-Dinstalled_test_bindir=${placeholder "installedTests"}/libexec"
|
2023-11-16 04:20:00 +00:00
|
|
|
] ++ lib.optionals stdenv.isAarch32 [
|
|
|
|
# the box test is failing with SIGBUS on armv7l-linux
|
|
|
|
# https://github.com/ebassi/graphene/issues/215
|
|
|
|
"-Darm_neon=false"
|
2021-05-20 23:08:51 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
doCheck = true;
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs tests/gen-installed-test.py
|
2021-06-28 23:13:55 +00:00
|
|
|
PATH=${python3.withPackages (pp: [ pp.pygobject3 pp.tappy ])}/bin:$PATH patchShebangs tests/introspection.py
|
|
|
|
'';
|
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
postFixup = let
|
|
|
|
introspectionPy = "${placeholder "installedTests"}/libexec/installed-tests/graphene-1.0/introspection.py";
|
|
|
|
in ''
|
|
|
|
if [ -x '${introspectionPy}' ] ; then
|
|
|
|
wrapProgram '${introspectionPy}' \
|
|
|
|
--prefix GI_TYPELIB_PATH : "$out/lib/girepository-1.0"
|
|
|
|
fi
|
2021-05-20 23:08:51 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
installedTests = nixosTests.installed-tests.graphene;
|
|
|
|
};
|
2020-08-20 17:08:02 +00:00
|
|
|
|
2022-12-28 21:21:41 +00:00
|
|
|
updateScript = nix-update-script { };
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "A thin layer of graphic data types";
|
2021-12-30 13:39:12 +00:00
|
|
|
homepage = "https://github.com/ebassi/graphene";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.mit;
|
2021-05-20 23:08:51 +00:00
|
|
|
maintainers = teams.gnome.members ++ (with maintainers; [ ]);
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|