2018-12-28 08:11:09 +01:00
|
|
|
{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, flex, bison, libxslt, autoconf, automake, autoreconfHook
|
2019-01-19 15:47:53 +01:00
|
|
|
, graphviz, glib, libiconv, libintl, libtool, expat, substituteAll
|
2016-10-12 13:51:54 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2018-12-28 08:11:09 +01:00
|
|
|
generic = lib.makeOverridable ({
|
|
|
|
major, minor, sha256,
|
|
|
|
extraNativeBuildInputs ? [],
|
|
|
|
extraBuildInputs ? [],
|
|
|
|
withGraphviz ? false
|
|
|
|
}:
|
2018-05-21 11:13:14 +02:00
|
|
|
let
|
|
|
|
atLeast = lib.versionAtLeast "${major}.${minor}";
|
2018-12-28 08:11:09 +01:00
|
|
|
|
|
|
|
# Patches from the openembedded-core project to build vala without graphviz
|
|
|
|
# support. We need to apply an additional patch to allow building when the
|
|
|
|
# header file isn't available at all, but that patch (./gvc-compat.patch)
|
|
|
|
# can be shared between all versions of Vala so far.
|
|
|
|
graphvizPatch =
|
|
|
|
let
|
|
|
|
fp = { commit, sha256 }: fetchpatch {
|
|
|
|
url = "https://github.com/openembedded/openembedded-core/raw/${commit}/meta/recipes-devtools/vala/vala/disable-graphviz.patch";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
in {
|
|
|
|
"0.38" = fp {
|
|
|
|
commit = "2c290f7253bba5ceb0d32e7d0b0ec0d0e81cc263";
|
|
|
|
sha256 = "056ybapfx18d7xw1k8k85nsjrc26qk2q2d9v9nz2zrcwbq5brhkp";
|
|
|
|
};
|
|
|
|
|
|
|
|
# NOTE: the openembedded-core project doesn't have a patch for 0.40.12
|
2019-03-18 03:59:58 +01:00
|
|
|
# We've fixed the single merge conflict in the following patch.
|
2018-12-28 08:11:09 +01:00
|
|
|
# 0.40.12: https://github.com/openembedded/openembedded-core/raw/8553c52f174af4c8c433c543f806f5ed5c1ec48c/meta/recipes-devtools/vala/vala/disable-graphviz.patch
|
|
|
|
"0.40" = ./disable-graphviz-0.40.12.patch;
|
2019-03-18 03:59:58 +01:00
|
|
|
|
|
|
|
"0.42" = fp {
|
|
|
|
commit = "f2b4f9ec6f44dced7f88df849cca68961419eeb8";
|
|
|
|
sha256 = "112qhdzix0d7lfpfcam1cxprzmfzpwypb1226m5ma1vq9qy0sn7g";
|
|
|
|
};
|
2018-12-28 08:11:09 +01:00
|
|
|
|
|
|
|
}.${major} or (throw "no graphviz patch for this version of vala");
|
|
|
|
|
|
|
|
disableGraphviz = atLeast "0.38" && !withGraphviz;
|
|
|
|
|
2018-05-21 11:13:14 +02:00
|
|
|
in stdenv.mkDerivation rec {
|
2018-08-08 20:28:43 +02:00
|
|
|
name = "vala-${version}";
|
|
|
|
version = "${major}.${minor}";
|
2016-10-12 13:51:54 +02:00
|
|
|
|
2019-01-19 15:47:53 +01:00
|
|
|
setupHook = substituteAll {
|
|
|
|
src = ./setup-hook.sh;
|
|
|
|
apiVersion = major;
|
|
|
|
};
|
|
|
|
|
2016-10-12 13:51:54 +02:00
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnome/sources/vala/${major}/${name}.tar.xz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2018-08-08 20:28:43 +02:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs tests
|
|
|
|
'';
|
|
|
|
|
2018-12-28 08:11:09 +01:00
|
|
|
# If we're disabling graphviz, apply the patches and corresponding
|
|
|
|
# configure flag. We also need to override the path to the valac compiler
|
|
|
|
# so that it can be used to regenerate documentation.
|
|
|
|
patches = lib.optionals disableGraphviz [ graphvizPatch ./gvc-compat.patch ];
|
|
|
|
configureFlags = lib.optional disableGraphviz "--disable-graphviz";
|
|
|
|
preBuild = lib.optional disableGraphviz "buildFlagsArray+=(\"VALAC=$(pwd)/compiler/valac\")";
|
|
|
|
|
2017-11-24 02:14:13 +01:00
|
|
|
outputs = [ "out" "devdoc" ];
|
|
|
|
|
2018-05-21 11:13:14 +02:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig flex bison libxslt
|
|
|
|
] ++ lib.optional (stdenv.isDarwin && (atLeast "0.38")) expat
|
2018-12-28 08:11:09 +01:00
|
|
|
++ lib.optional disableGraphviz autoreconfHook # if we changed our ./configure script, need to reconfigure
|
2018-05-21 11:13:14 +02:00
|
|
|
++ extraNativeBuildInputs;
|
2016-10-12 13:51:54 +02:00
|
|
|
|
2018-05-21 11:13:14 +02:00
|
|
|
buildInputs = [
|
|
|
|
glib libiconv libintl
|
2018-12-28 08:11:09 +01:00
|
|
|
] ++ lib.optional (atLeast "0.38" && withGraphviz) graphviz
|
2018-05-21 11:13:14 +02:00
|
|
|
++ extraBuildInputs;
|
2016-10-12 13:51:54 +02:00
|
|
|
|
2018-09-04 22:48:01 +02:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-08-08 20:28:43 +02:00
|
|
|
doCheck = false; # fails, requires dbus daemon
|
|
|
|
|
2016-10-12 13:51:54 +02:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Compiler for GObject type system";
|
2018-03-07 05:47:38 +01:00
|
|
|
homepage = https://wiki.gnome.org/Projects/Vala;
|
2016-10-12 13:51:54 +02:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
platforms = platforms.unix;
|
2018-03-07 05:47:38 +01:00
|
|
|
maintainers = with maintainers; [ antono jtojnar lethalman peterhoeg ];
|
2016-10-12 13:51:54 +02:00
|
|
|
};
|
2018-12-28 08:11:09 +01:00
|
|
|
});
|
2016-10-12 13:51:54 +02:00
|
|
|
|
|
|
|
in rec {
|
2017-12-18 08:27:20 +01:00
|
|
|
vala_0_36 = generic {
|
|
|
|
major = "0.36";
|
2019-03-14 04:14:52 +01:00
|
|
|
minor = "18";
|
|
|
|
sha256 = "0csb9skgy663y05kl813dsarzjbfcdsmx5fvz13p8gas3hycciq9";
|
2016-10-12 13:51:54 +02:00
|
|
|
};
|
|
|
|
|
2017-10-03 02:21:00 +02:00
|
|
|
vala_0_38 = generic {
|
|
|
|
major = "0.38";
|
2018-08-29 11:01:53 +02:00
|
|
|
minor = "10";
|
|
|
|
sha256 = "1rdwwqs973qv225v8b5izcgwvqn56jxgr4pa3wxxbliar3aww5sw";
|
2018-05-21 11:13:14 +02:00
|
|
|
extraNativeBuildInputs = [ autoconf ] ++ lib.optional stdenv.isDarwin libtool;
|
2017-10-03 02:21:00 +02:00
|
|
|
};
|
|
|
|
|
2018-03-13 03:30:15 +01:00
|
|
|
vala_0_40 = generic {
|
|
|
|
major = "0.40";
|
2019-03-14 04:20:42 +01:00
|
|
|
minor = "14";
|
|
|
|
sha256 = "0llid9b9cgjcrcclc0pw2skkssb7br7b2clq9cql3p14dl94gki0";
|
2018-03-13 03:30:15 +01:00
|
|
|
};
|
|
|
|
|
2018-09-04 15:18:43 +02:00
|
|
|
vala_0_42 = generic {
|
|
|
|
major = "0.42";
|
2019-03-18 03:59:58 +01:00
|
|
|
minor = "6";
|
|
|
|
sha256 = "14024gvs23q323fmd62hqd8jiypaxbjjvamyd782ixbhxmpz8x1p";
|
2018-09-04 15:18:43 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
vala = vala_0_42;
|
2016-10-12 13:51:54 +02:00
|
|
|
}
|