lol
1{ stdenv, fetchurl, pkgconfig, libGL, glib, gdk_pixbuf, xorg, libintlOrEmpty
2, pangoSupport ? true, pango, cairo, gobjectIntrospection, wayland, gnome3
3, gstreamerSupport ? true, gst_all_1 }:
4
5let
6 pname = "cogl";
7 version = "1.22.2";
8in stdenv.mkDerivation rec {
9 name = "${pname}-${version}";
10
11 src = fetchurl {
12 url = "mirror://gnome/sources/${pname}/${gnome3.versionBranch version}/${name}.tar.xz";
13 sha256 = "03f0ha3qk7ca0nnkkcr1garrm1n1vvfqhkz9lwjm592fnv6ii9rr";
14 };
15
16 nativeBuildInputs = [ pkgconfig ];
17
18 configureFlags = [
19 "--enable-introspection"
20 "--enable-kms-egl-platform"
21 "--enable-wayland-egl-platform"
22 "--enable-wayland-egl-server"
23 ] ++ stdenv.lib.optional gstreamerSupport "--enable-cogl-gst"
24 ++ stdenv.lib.optionals (!stdenv.isDarwin) [ "--enable-gles1" "--enable-gles2" ];
25
26 propagatedBuildInputs = with xorg; [
27 glib gdk_pixbuf gobjectIntrospection wayland
28 libGL libXrandr libXfixes libXcomposite libXdamage
29 ]
30 ++ libintlOrEmpty
31 ++ stdenv.lib.optionals gstreamerSupport [ gst_all_1.gstreamer
32 gst_all_1.gst-plugins-base ];
33
34 buildInputs = stdenv.lib.optionals pangoSupport [ pango cairo ];
35
36 COGL_PANGO_DEP_CFLAGS
37 = stdenv.lib.optionalString (stdenv.isDarwin && pangoSupport)
38 "-I${pango.dev}/include/pango-1.0 -I${cairo.dev}/include/cairo";
39
40 NIX_LDFLAGS = stdenv.lib.optionalString stdenv.isDarwin "-lintl";
41
42 #doCheck = true; # all tests fail (no idea why)
43
44 passthru = {
45 updateScript = gnome3.updateScript {
46 packageName = pname;
47 };
48 };
49
50 meta = with stdenv.lib; {
51 description = "A small open source library for using 3D graphics hardware for rendering";
52 maintainers = with maintainers; [ lovek323 ];
53
54 longDescription = ''
55 Cogl is a small open source library for using 3D graphics hardware for
56 rendering. The API departs from the flat state machine style of OpenGL
57 and is designed to make it easy to write orthogonal components that can
58 render without stepping on each other's toes.
59 '';
60
61 platforms = stdenv.lib.platforms.mesaPlatforms;
62 };
63}