2021-01-19 07:50:56 +01:00
|
|
|
{ stdenv, lib, fetchurl, fetchpatch, pkg-config, flex, bison, libxslt, autoconf, autoreconfHook
|
2021-06-17 22:41:09 +02:00
|
|
|
, gnome, 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 ({
|
2019-04-25 20:15:59 +02:00
|
|
|
version, sha256,
|
2018-12-28 08:11:09 +01:00
|
|
|
extraNativeBuildInputs ? [],
|
|
|
|
extraBuildInputs ? [],
|
|
|
|
withGraphviz ? false
|
|
|
|
}:
|
2018-05-21 11:13:14 +02:00
|
|
|
let
|
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 {
|
|
|
|
|
|
|
|
# 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
|
|
|
|
2019-03-14 04:47:23 +01:00
|
|
|
# NOTE: the openembedded-core project doesn't have a patch for 0.44.1
|
|
|
|
# We've reverted the addition of the "--disable-valadoc" option
|
|
|
|
# and then applied the following patch.
|
|
|
|
# 0.42.4: https://github.com/openembedded/openembedded-core/raw/f2b4f9ec6f44dced7f88df849cca68961419eeb8/meta/recipes-devtools/vala/vala/disable-graphviz.patch
|
2019-05-03 21:28:22 +02:00
|
|
|
"0.44" = ./disable-graphviz-0.44.3.patch;
|
2019-03-14 04:47:23 +01:00
|
|
|
|
2019-09-19 06:09:18 +02:00
|
|
|
"0.46" = ./disable-graphviz-0.46.1.patch;
|
|
|
|
|
2020-02-10 20:16:11 +01:00
|
|
|
"0.48" = ./disable-graphviz-0.46.1.patch;
|
|
|
|
|
2021-03-11 18:04:36 +01:00
|
|
|
"0.50" = ./disable-graphviz-0.46.1.patch;
|
|
|
|
|
2021-03-20 11:42:05 +01:00
|
|
|
"0.52" = ./disable-graphviz-0.46.1.patch;
|
|
|
|
|
2019-04-25 20:15:59 +02:00
|
|
|
}.${lib.versions.majorMinor version} or (throw "no graphviz patch for this version of vala");
|
2018-12-28 08:11:09 +01:00
|
|
|
|
2019-04-25 20:15:59 +02:00
|
|
|
disableGraphviz = lib.versionAtLeast version "0.38" && !withGraphviz;
|
2018-12-28 08:11:09 +01:00
|
|
|
|
2018-05-21 11:13:14 +02:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-04-25 20:15:59 +02:00
|
|
|
pname = "vala";
|
|
|
|
inherit version;
|
2016-10-12 13:51:54 +02:00
|
|
|
|
2019-01-19 15:47:53 +01:00
|
|
|
setupHook = substituteAll {
|
|
|
|
src = ./setup-hook.sh;
|
2019-04-25 20:15:59 +02:00
|
|
|
apiVersion = lib.versions.majorMinor version;
|
2019-01-19 15:47:53 +01:00
|
|
|
};
|
|
|
|
|
2016-10-12 13:51:54 +02:00
|
|
|
src = fetchurl {
|
2019-04-25 20:15:59 +02:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2016-10-12 13:51:54 +02:00
|
|
|
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 = [
|
2021-01-19 07:50:56 +01:00
|
|
|
pkg-config flex bison libxslt
|
2019-04-25 20:15:59 +02:00
|
|
|
] ++ lib.optional (stdenv.isDarwin && (lib.versionAtLeast version "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
|
2019-04-25 20:15:59 +02:00
|
|
|
] ++ lib.optional (lib.versionAtLeast version "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
|
|
|
|
|
2021-06-17 22:41:09 +02:00
|
|
|
passthru = {
|
|
|
|
updateScript = gnome.updateScript {
|
|
|
|
attrPath = "${pname}_${lib.versions.major version}_${lib.versions.minor version}";
|
|
|
|
packageName = pname;
|
|
|
|
};
|
|
|
|
};
|
2019-04-25 20:15:59 +02:00
|
|
|
|
2021-01-22 12:25:31 +01:00
|
|
|
meta = with lib; {
|
2016-10-12 13:51:54 +02:00
|
|
|
description = "Compiler for GObject type system";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://wiki.gnome.org/Projects/Vala";
|
2016-10-12 13:51:54 +02:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
platforms = platforms.unix;
|
2021-07-18 21:23:26 +02:00
|
|
|
maintainers = with maintainers; [ antono jtojnar peterhoeg maxeaubrey ];
|
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 {
|
2018-03-13 03:30:15 +01:00
|
|
|
vala_0_40 = generic {
|
2021-03-11 18:01:53 +01:00
|
|
|
version = "0.40.25";
|
|
|
|
sha256 = "1pxpack8rrmywlf47v440hc6rv3vi8q9c6niwqnwikxvb2pwf3w7";
|
2018-03-13 03:30:15 +01:00
|
|
|
};
|
|
|
|
|
2019-09-19 06:09:18 +02:00
|
|
|
vala_0_46 = generic {
|
2021-03-11 18:03:29 +01:00
|
|
|
version = "0.46.13";
|
|
|
|
sha256 = "0d7l4vh2xra3q75kw3sy2d9bn5p6s3g3r7j37bdn6ir8l3wp2ivs";
|
2019-09-19 06:09:18 +02:00
|
|
|
};
|
|
|
|
|
2020-02-10 20:16:11 +01:00
|
|
|
vala_0_48 = generic {
|
2021-06-17 15:24:36 +02:00
|
|
|
version = "0.48.18";
|
|
|
|
sha256 = "1pbz4nyrrf9wp8rp953sczx545s4g0h5mars9ynkn788dzs2h3wy";
|
2020-02-10 20:16:11 +01:00
|
|
|
};
|
|
|
|
|
2021-03-11 18:04:36 +01:00
|
|
|
vala_0_50 = generic {
|
2021-06-17 15:25:10 +02:00
|
|
|
version = "0.50.9";
|
|
|
|
sha256 = "0w5ngs90rq7vy21nqfq8drqyb33kxm17j161qvakwpsbjsidv1mn";
|
2021-03-11 18:04:36 +01:00
|
|
|
};
|
|
|
|
|
2021-03-20 11:42:05 +01:00
|
|
|
vala_0_52 = generic {
|
2021-06-17 15:01:53 +02:00
|
|
|
version = "0.52.4";
|
|
|
|
sha256 = "0cfz3xshc9azxx4fn25x9gadnph6jvf1r2wzd7p5krk0a4755ppc";
|
2021-03-20 11:42:05 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
vala = vala_0_52;
|
2016-10-12 13:51:54 +02:00
|
|
|
}
|