diff options
Diffstat (limited to 'nixpkgs/pkgs/development/libraries/graphene')
-rw-r--r-- | nixpkgs/pkgs/development/libraries/graphene/0001-meson-add-options-for-tests-installation-dirs.patch | 76 | ||||
-rw-r--r-- | nixpkgs/pkgs/development/libraries/graphene/default.nix | 79 |
2 files changed, 155 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/libraries/graphene/0001-meson-add-options-for-tests-installation-dirs.patch b/nixpkgs/pkgs/development/libraries/graphene/0001-meson-add-options-for-tests-installation-dirs.patch new file mode 100644 index 000000000000..51bc206659d5 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/graphene/0001-meson-add-options-for-tests-installation-dirs.patch @@ -0,0 +1,76 @@ +From 2bf6614a6d7516e194e39eb691c05b486860153c Mon Sep 17 00:00:00 2001 +From: worldofpeace <worldofpeace@protonmail.ch> +Date: Thu, 16 May 2019 21:15:15 -0400 +Subject: [PATCH] meson: add options for tests installation dirs + +--- + meson_options.txt | 6 ++++++ + tests/meson.build | 19 ++++++++++++++----- + 2 files changed, 20 insertions(+), 5 deletions(-) + +diff --git a/meson_options.txt b/meson_options.txt +index 578bdae..6f5fa23 100644 +--- a/meson_options.txt ++++ b/meson_options.txt +@@ -22,3 +22,9 @@ option('tests', type: 'boolean', + option('installed_tests', type: 'boolean', + value: true, + description: 'Install tests') ++option('installed_test_datadir', type: 'string', ++ value: '', ++ description: 'Installation directory for data files in tests') ++option('installed_test_bindir', type: 'string', ++ value: '', ++ description: 'Installation directory for binary files in tests') +diff --git a/tests/meson.build b/tests/meson.build +index 1f9bd0e..0253ac3 100644 +--- a/tests/meson.build ++++ b/tests/meson.build +@@ -22,8 +22,17 @@ unit_tests = [ + python = python3.find_python() + gen_installed_test = join_paths(meson.current_source_dir(), 'gen-installed-test.py') + +-installed_test_datadir = join_paths(get_option('prefix'), get_option('datadir'), 'installed-tests', graphene_api_path) +-installed_test_bindir = join_paths(get_option('prefix'), get_option('libexecdir'), 'installed-tests', graphene_api_path) ++test_suffix = join_paths('installed-tests', graphene_api_path) ++ ++test_datadir = join_paths(get_option('installed_test_datadir'), test_suffix) ++if test_datadir == '' ++ test_datadir = join_paths(get_option('prefix'), get_option('datadir'), test_suffix) ++endif ++ ++test_bindir = join_paths(get_option('installed_test_bindir'), test_suffix) ++if test_bindir == '' ++ test_bindir = join_paths(get_option('prefix'), get_option('libexecdir'), test_suffix) ++endif + + # Make tests conditional on having mutest-1 installed system-wide, or + # available as a subproject +@@ -42,13 +51,13 @@ if mutest_dep.found() + command: [ + python, + gen_installed_test, +- '--testdir=@0@'.format(installed_test_bindir), ++ '--testdir=@0@'.format(test_bindir), + '--testname=@0@'.format(unit), + '--outdir=@OUTDIR@', + '--outfile=@0@'.format(wrapper), + ], + install: get_option('installed_tests'), +- install_dir: installed_test_datadir, ++ install_dir: test_datadir, + ) + + test(unit, +@@ -57,7 +66,7 @@ if mutest_dep.found() + include_directories: graphene_inc, + c_args: common_cflags, + install: get_option('installed_tests'), +- install_dir: installed_test_bindir, ++ install_dir: test_bindir, + ), + env: ['MUTEST_OUTPUT=tap'], + protocol: 'tap', +-- +2.22.0 + diff --git a/nixpkgs/pkgs/development/libraries/graphene/default.nix b/nixpkgs/pkgs/development/libraries/graphene/default.nix new file mode 100644 index 000000000000..57cad4497653 --- /dev/null +++ b/nixpkgs/pkgs/development/libraries/graphene/default.nix @@ -0,0 +1,79 @@ +{ lib, stdenv +, fetchFromGitHub +, nix-update-script +, pkg-config +, meson +, ninja +, python3 +, mutest +, nixosTests +, glib +, gtk-doc +, docbook_xsl +, docbook_xml_dtd_43 +, gobject-introspection +}: + +stdenv.mkDerivation rec { + pname = "graphene"; + version = "1.10.2"; + + outputs = [ "out" "devdoc" "installedTests" ]; + + src = fetchFromGitHub { + owner = "ebassi"; + repo = pname; + rev = version; + sha256 = "1ljhhjafi1nlndjswx7mg0d01zci90wz77yvz5w8bd9mm8ssw38s"; + }; + + patches = [ + ./0001-meson-add-options-for-tests-installation-dirs.patch + ]; + + mesonFlags = [ + "-Dgtk_doc=true" + "-Dinstalled_test_datadir=${placeholder "installedTests"}/share" + "-Dinstalled_test_bindir=${placeholder "installedTests"}/libexec" + ]; + + nativeBuildInputs = [ + docbook_xml_dtd_43 + docbook_xsl + gtk-doc + meson + ninja + pkg-config + gobject-introspection + python3 + ]; + + buildInputs = [ + glib + gobject-introspection + ]; + + checkInputs = [ + mutest + ]; + + doCheck = true; + + passthru = { + tests = { + installedTests = nixosTests.installed-tests.graphene; + }; + + updateScript = nix-update-script { + attrPath = pname; + }; + }; + + meta = with lib; { + description = "A thin layer of graphic data types"; + homepage = "https://ebassi.github.com/graphene"; + license = licenses.mit; + maintainers = with maintainers; [ worldofpeace ]; + platforms = platforms.unix; + }; +} |