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
|
2024-09-19 14:19:46 +00:00
|
|
|
, withDocumentation ? stdenv.buildPlatform.canExecute stdenv.hostPlatform || stdenv.hostPlatform.emulatorAvailable buildPackages
|
2020-04-24 23:36:52 +00:00
|
|
|
, gtk-doc
|
|
|
|
, docbook_xsl
|
|
|
|
, docbook_xml_dtd_43
|
2024-02-29 20:09:43 +00:00
|
|
|
, buildPackages
|
2020-04-24 23:36:52 +00:00
|
|
|
, gobject-introspection
|
2024-02-29 20:09:43 +00:00
|
|
|
, withIntrospection ? lib.meta.availableOn stdenv.hostPlatform gobject-introspection && stdenv.hostPlatform.emulatorAvailable buildPackages
|
2021-06-28 23:13:55 +00:00
|
|
|
, makeWrapper
|
2024-02-29 20:09:43 +00:00
|
|
|
, testers
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
stdenv.mkDerivation (finalAttrs: {
|
2020-04-24 23:36:52 +00:00
|
|
|
pname = "graphene";
|
2022-04-27 09:35:20 +00:00
|
|
|
version = "1.10.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
outputs = [ "out" "dev" ]
|
|
|
|
++ lib.optionals withDocumentation [ "devdoc" ]
|
2022-09-30 11:47:45 +00:00
|
|
|
++ lib.optionals (stdenv.hostPlatform == stdenv.buildPlatform) [ "installedTests" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "ebassi";
|
2024-07-27 06:49:29 +00:00
|
|
|
repo = "graphene";
|
2024-02-29 20:09:43 +00:00
|
|
|
rev = finalAttrs.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 = [
|
|
|
|
meson
|
|
|
|
ninja
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
python3
|
2021-06-28 23:13:55 +00:00
|
|
|
makeWrapper
|
2024-02-29 20:09:43 +00:00
|
|
|
] ++ lib.optionals withDocumentation [
|
|
|
|
docbook_xml_dtd_43
|
|
|
|
docbook_xsl
|
|
|
|
gtk-doc
|
2024-09-19 14:19:46 +00:00
|
|
|
] ++ lib.optionals (withDocumentation && !stdenv.buildPlatform.canExecute stdenv.hostPlatform) [
|
|
|
|
mesonEmulatorHook
|
2024-02-29 20:09:43 +00:00
|
|
|
] ++ lib.optionals withIntrospection [
|
|
|
|
gobject-introspection
|
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 = [
|
2024-02-29 20:09:43 +00:00
|
|
|
(lib.mesonBool "gtk_doc" withDocumentation)
|
|
|
|
(lib.mesonEnable "introspection" withIntrospection)
|
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
|
2024-02-29 20:09:43 +00:00
|
|
|
'' + lib.optionalString withIntrospection ''
|
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";
|
2024-02-29 20:09:43 +00:00
|
|
|
in lib.optionalString withIntrospection ''
|
2021-12-06 16:07:01 +00:00
|
|
|
if [ -x '${introspectionPy}' ] ; then
|
|
|
|
wrapProgram '${introspectionPy}' \
|
2024-09-19 14:19:46 +00:00
|
|
|
--prefix GI_TYPELIB_PATH : "${lib.makeSearchPath "lib/girepository-1.0" [ glib.out (placeholder "out") ]}"
|
2021-12-06 16:07:01 +00:00
|
|
|
fi
|
2021-05-20 23:08:51 +00:00
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
passthru = {
|
|
|
|
tests = {
|
|
|
|
installedTests = nixosTests.installed-tests.graphene;
|
2024-02-29 20:09:43 +00:00
|
|
|
pkg-config = testers.hasPkgConfigModules {
|
|
|
|
package = finalAttrs.finalPackage;
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
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; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "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;
|
2024-02-29 20:09:43 +00:00
|
|
|
pkgConfigModules = [ "graphene-1.0" "graphene-gobject-1.0" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
2024-02-29 20:09:43 +00:00
|
|
|
})
|