2018-09-04 17:49:11 -07:00
|
|
|
{ stdenv, fetchurl, glib, flex, bison, meson, ninja, pkgconfig, libffi, python3
|
|
|
|
, libintl, cctools, cairo, gnome3, glibcLocales, fetchpatch
|
2016-01-22 14:55:31 -08:00
|
|
|
, substituteAll, nixStoreDir ? builtins.storeDir
|
2018-03-01 04:36:36 -08:00
|
|
|
, x11Support ? true
|
2016-01-22 09:49:33 -08:00
|
|
|
}:
|
2018-12-02 03:41:15 -08:00
|
|
|
# now that gobject-introspection creates large .gir files (eg gtk3 case)
|
2013-08-04 11:59:05 -07:00
|
|
|
# it may be worth thinking about using multiple derivation outputs
|
|
|
|
# In that case its about 6MB which could be separated
|
2010-05-13 08:56:04 -07:00
|
|
|
|
2013-10-05 11:21:13 -07:00
|
|
|
let
|
2018-03-02 17:46:01 -08:00
|
|
|
pname = "gobject-introspection";
|
2019-04-13 07:56:12 -07:00
|
|
|
version = "1.60.1";
|
2013-10-05 11:21:13 -07:00
|
|
|
in
|
2016-03-29 09:04:46 -07:00
|
|
|
with stdenv.lib;
|
2010-05-13 08:56:04 -07:00
|
|
|
stdenv.mkDerivation rec {
|
2018-03-02 17:46:01 -08:00
|
|
|
name = "${pname}-${version}";
|
2010-05-13 08:56:04 -07:00
|
|
|
|
2013-08-04 11:59:05 -07:00
|
|
|
src = fetchurl {
|
2018-10-04 17:12:11 -07:00
|
|
|
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${name}.tar.xz";
|
2019-04-13 07:56:12 -07:00
|
|
|
sha256 = "1cr4r3lh5alrks9q2ycs1kn2crnkhrhn2wrmibng6dndkr4x2i6q";
|
2013-08-04 11:59:05 -07:00
|
|
|
};
|
|
|
|
|
2018-09-04 17:49:11 -07:00
|
|
|
outputs = [ "out" "dev" "man" ];
|
2015-10-28 03:59:42 -07:00
|
|
|
outputBin = "dev";
|
2014-08-30 10:11:52 -07:00
|
|
|
|
2018-09-04 17:49:11 -07:00
|
|
|
LC_ALL = "en_US.UTF-8"; # for tests
|
|
|
|
|
|
|
|
nativeBuildInputs = [ meson ninja pkgconfig libintl glibcLocales ];
|
|
|
|
buildInputs = [ flex bison python3 setupHook/*move .gir*/ ]
|
2016-03-22 18:07:30 -07:00
|
|
|
++ stdenv.lib.optional stdenv.isDarwin cctools;
|
2014-12-08 07:18:29 -08:00
|
|
|
propagatedBuildInputs = [ libffi glib ];
|
2011-02-11 09:27:16 -08:00
|
|
|
|
2018-09-04 17:49:11 -07:00
|
|
|
mesonFlags = [
|
|
|
|
"--datadir=${placeholder "dev"}/share"
|
|
|
|
];
|
2015-10-16 11:49:59 -07:00
|
|
|
|
|
|
|
# outputs TODO: share/gobject-introspection-1.0/tests is needed during build
|
|
|
|
# by pygobject3 (and maybe others), but it's only searched in $out
|
2015-09-25 01:31:16 -07:00
|
|
|
|
2013-08-04 11:59:05 -07:00
|
|
|
setupHook = ./setup-hook.sh;
|
|
|
|
|
2018-01-20 06:08:27 -08:00
|
|
|
patches = [
|
2018-11-22 06:05:02 -08:00
|
|
|
(substituteAll {
|
|
|
|
src = ./test_shlibs.patch;
|
|
|
|
inherit nixStoreDir;
|
|
|
|
})
|
2018-01-20 06:08:27 -08:00
|
|
|
(substituteAll {
|
|
|
|
src = ./absolute_shlib_path.patch;
|
|
|
|
inherit nixStoreDir;
|
|
|
|
})
|
2018-03-01 04:36:36 -08:00
|
|
|
] ++ stdenv.lib.optional x11Support # https://github.com/NixOS/nixpkgs/issues/34080
|
2018-01-20 06:08:27 -08:00
|
|
|
(substituteAll {
|
|
|
|
src = ./absolute_gir_path.patch;
|
|
|
|
cairoLib = "${getLib cairo}/lib";
|
2018-03-01 04:36:36 -08:00
|
|
|
});
|
2014-08-14 13:59:24 -07:00
|
|
|
|
2019-03-15 08:04:16 -07:00
|
|
|
doCheck = !stdenv.isAarch64;
|
2018-04-24 20:20:18 -07:00
|
|
|
|
2018-03-02 17:46:01 -08:00
|
|
|
passthru = {
|
|
|
|
updateScript = gnome3.updateScript {
|
|
|
|
packageName = pname;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2010-05-13 08:56:04 -07:00
|
|
|
meta = with stdenv.lib; {
|
2013-07-03 05:02:40 -07:00
|
|
|
description = "A middleware layer between C libraries and language bindings";
|
|
|
|
homepage = http://live.gnome.org/GObjectIntrospection;
|
2017-03-27 10:11:17 -07:00
|
|
|
maintainers = with maintainers; [ lovek323 lethalman ];
|
2013-07-03 05:02:40 -07:00
|
|
|
platforms = platforms.unix;
|
2018-10-08 14:08:14 -07:00
|
|
|
license = with licenses; [ gpl2 lgpl2 ];
|
2013-07-03 05:02:40 -07:00
|
|
|
|
|
|
|
longDescription = ''
|
|
|
|
GObject introspection is a middleware layer between C libraries (using
|
|
|
|
GObject) and language bindings. The C library can be scanned at compile
|
|
|
|
time and generate a metadata file, in addition to the actual native C
|
|
|
|
library. Then at runtime, language bindings can read this metadata and
|
|
|
|
automatically provide bindings to call into the C library.
|
|
|
|
'';
|
2010-05-13 08:56:04 -07:00
|
|
|
};
|
|
|
|
}
|