2019-06-16 12:59:06 -07:00
|
|
|
{ stdenv, lib, fetchurl, fetchpatch, pkgconfig, flex, bison, libxslt, autoconf, autoreconfHook
|
|
|
|
, graphviz, glib, libiconv, libintl, libtool, expat, substituteAll
|
2016-10-12 04:51:54 -07:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
2018-12-27 23:11:09 -08:00
|
|
|
generic = lib.makeOverridable ({
|
2019-04-25 11:15:59 -07:00
|
|
|
version, sha256,
|
2018-12-27 23:11:09 -08:00
|
|
|
extraNativeBuildInputs ? [],
|
|
|
|
extraBuildInputs ? [],
|
|
|
|
withGraphviz ? false
|
|
|
|
}:
|
2018-05-21 02:13:14 -07:00
|
|
|
let
|
2018-12-27 23:11:09 -08: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-17 19:59:58 -07:00
|
|
|
# We've fixed the single merge conflict in the following patch.
|
2018-12-27 23:11:09 -08: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-17 19:59:58 -07:00
|
|
|
|
2019-03-13 20:47:23 -07: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 12:28:22 -07:00
|
|
|
"0.44" = ./disable-graphviz-0.44.3.patch;
|
2019-03-13 20:47:23 -07:00
|
|
|
|
2019-09-18 21:09:18 -07:00
|
|
|
"0.46" = ./disable-graphviz-0.46.1.patch;
|
|
|
|
|
2019-04-25 11:15:59 -07:00
|
|
|
}.${lib.versions.majorMinor version} or (throw "no graphviz patch for this version of vala");
|
2018-12-27 23:11:09 -08:00
|
|
|
|
2019-04-25 11:15:59 -07:00
|
|
|
disableGraphviz = lib.versionAtLeast version "0.38" && !withGraphviz;
|
2018-12-27 23:11:09 -08:00
|
|
|
|
2018-05-21 02:13:14 -07:00
|
|
|
in stdenv.mkDerivation rec {
|
2019-04-25 11:15:59 -07:00
|
|
|
pname = "vala";
|
|
|
|
inherit version;
|
2016-10-12 04:51:54 -07:00
|
|
|
|
2019-01-19 06:47:53 -08:00
|
|
|
setupHook = substituteAll {
|
|
|
|
src = ./setup-hook.sh;
|
2019-04-25 11:15:59 -07:00
|
|
|
apiVersion = lib.versions.majorMinor version;
|
2019-01-19 06:47:53 -08:00
|
|
|
};
|
|
|
|
|
2016-10-12 04:51:54 -07:00
|
|
|
src = fetchurl {
|
2019-04-25 11:15:59 -07:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2016-10-12 04:51:54 -07:00
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
2018-08-08 11:28:43 -07:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs tests
|
|
|
|
'';
|
|
|
|
|
2018-12-27 23:11:09 -08: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-23 17:14:13 -08:00
|
|
|
outputs = [ "out" "devdoc" ];
|
|
|
|
|
2018-05-21 02:13:14 -07:00
|
|
|
nativeBuildInputs = [
|
|
|
|
pkgconfig flex bison libxslt
|
2019-04-25 11:15:59 -07:00
|
|
|
] ++ lib.optional (stdenv.isDarwin && (lib.versionAtLeast version "0.38")) expat
|
2018-12-27 23:11:09 -08:00
|
|
|
++ lib.optional disableGraphviz autoreconfHook # if we changed our ./configure script, need to reconfigure
|
2018-05-21 02:13:14 -07:00
|
|
|
++ extraNativeBuildInputs;
|
2016-10-12 04:51:54 -07:00
|
|
|
|
2018-05-21 02:13:14 -07:00
|
|
|
buildInputs = [
|
|
|
|
glib libiconv libintl
|
2019-04-25 11:15:59 -07:00
|
|
|
] ++ lib.optional (lib.versionAtLeast version "0.38" && withGraphviz) graphviz
|
2018-05-21 02:13:14 -07:00
|
|
|
++ extraBuildInputs;
|
2016-10-12 04:51:54 -07:00
|
|
|
|
2018-09-04 13:48:01 -07:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
2018-08-08 11:28:43 -07:00
|
|
|
doCheck = false; # fails, requires dbus daemon
|
|
|
|
|
2019-04-25 11:15:59 -07:00
|
|
|
# Wait for PR #59372
|
2019-10-02 19:57:42 -07:00
|
|
|
# passthru = {
|
2019-04-25 11:15:59 -07:00
|
|
|
# updateScript = gnome3.updateScript {
|
|
|
|
# attrPath = "${pname}_${lib.versions.major version}_${lib.versions.minor version}";
|
|
|
|
# packageName = pname;
|
|
|
|
# };
|
2019-10-02 19:57:42 -07:00
|
|
|
# };
|
2019-04-25 11:15:59 -07:00
|
|
|
|
2016-10-12 04:51:54 -07:00
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "Compiler for GObject type system";
|
2018-03-06 20:47:38 -08:00
|
|
|
homepage = https://wiki.gnome.org/Projects/Vala;
|
2016-10-12 04:51:54 -07:00
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
platforms = platforms.unix;
|
2019-03-15 10:44:35 -07:00
|
|
|
maintainers = with maintainers; [ antono jtojnar lethalman peterhoeg worldofpeace ];
|
2016-10-12 04:51:54 -07:00
|
|
|
};
|
2018-12-27 23:11:09 -08:00
|
|
|
});
|
2016-10-12 04:51:54 -07:00
|
|
|
|
|
|
|
in rec {
|
2017-12-17 23:27:20 -08:00
|
|
|
vala_0_36 = generic {
|
2019-09-18 20:54:44 -07:00
|
|
|
version = "0.36.20";
|
|
|
|
sha256 = "19v7zjhr9yxkh9lxg46n9gjr0lb7j6v0xqfhrdvgz18xhj3hm5my";
|
2016-10-12 04:51:54 -07:00
|
|
|
};
|
|
|
|
|
2018-03-12 19:30:15 -07:00
|
|
|
vala_0_40 = generic {
|
2019-11-12 04:51:30 -08:00
|
|
|
version = "0.40.18";
|
|
|
|
sha256 = "1f7cdkjdysg4dcri1wbzdddm46amk2s48jkwb5ghpdvhjb4l5j2m";
|
2018-03-12 19:30:15 -07:00
|
|
|
};
|
|
|
|
|
2019-03-13 20:47:23 -07:00
|
|
|
vala_0_44 = generic {
|
2019-11-12 04:52:48 -08:00
|
|
|
version = "0.44.11";
|
|
|
|
sha256 = "06spdvm9q9k4riq1d2fxkyc8d88bcv460v360465iy1lnj3z9x2s";
|
2019-03-13 20:47:23 -07:00
|
|
|
};
|
|
|
|
|
2019-09-18 21:09:18 -07:00
|
|
|
vala_0_46 = generic {
|
2019-11-12 04:54:06 -08:00
|
|
|
version = "0.46.5";
|
|
|
|
sha256 = "07fv895sp9wq74b20qig7hic0r4ynrr5pfaqba02r44xb794fy0s";
|
2019-09-18 21:09:18 -07:00
|
|
|
};
|
|
|
|
|
2019-09-18 21:26:36 -07:00
|
|
|
vala = vala_0_46;
|
2016-10-12 04:51:54 -07:00
|
|
|
}
|