20 gobject-introspection,
24 generic = lib.makeOverridable (
28 extraNativeBuildInputs ? [ ],
29 extraBuildInputs ? [ ],
33 # Build vala (valadoc) without graphviz support. Inspired from the openembedded-core project.
34 # https://github.com/openembedded/openembedded-core/blob/a5440d4288e09d3e/meta/recipes-devtools/vala/vala/disable-graphviz.patch
37 "0.56" = ./disable-graphviz-0.56.8.patch;
39 .${lib.versions.majorMinor version} or (throw "no graphviz patch for this version of vala");
41 disableGraphviz = !withGraphviz;
44 stdenv.mkDerivation rec {
48 setupHook = substituteAll {
49 src = ./setup-hook.sh;
50 apiVersion = lib.versions.majorMinor version;
54 url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
62 # If we're disabling graphviz, apply the patches and corresponding
63 # configure flag. We also need to override the path to the valac compiler
64 # so that it can be used to regenerate documentation.
65 patches = lib.optionals disableGraphviz [ graphvizPatch ];
66 configureFlags = lib.optional disableGraphviz "--disable-graphviz";
67 # when cross-compiling ./compiler/valac is valac for host
68 # so add the build vala in nativeBuildInputs
69 preBuild = lib.optionalString (
70 disableGraphviz && (stdenv.buildPlatform == stdenv.hostPlatform)
71 ) "buildFlagsArray+=(\"VALAC=$(pwd)/compiler/valac\")";
86 ++ lib.optional (stdenv.hostPlatform.isDarwin) expat
87 ++ lib.optional disableGraphviz autoreconfHook # if we changed our ./configure script, need to reconfigure
88 ++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ vala ]
89 ++ extraNativeBuildInputs;
97 ++ lib.optional (withGraphviz) graphviz
100 enableParallelBuilding = true;
102 doCheck = false; # fails, requires dbus daemon
105 updateScript = gnome.updateScript {
108 roundUpToEven = num: num + lib.mod num 2;
110 "${pname}_${lib.versions.major version}_${builtins.toString (roundUpToEven (lib.toInt (lib.versions.minor version)))}";
117 description = "Compiler for GObject type system";
118 homepage = "https://vala.dev";
119 license = licenses.lgpl21Plus;
120 platforms = platforms.unix;
127 ++ teams.pantheon.members;
134 vala_0_56 = generic {
136 hash = "sha256-JhAMTk7wBJxhknXxQNl89WWIPQDHVDyCvM5aQmk07Wo=";