2021-01-19 07:50:56 +01:00
|
|
|
{ stdenv, lib, fetchurl, fetchpatch, pkg-config, flex, bison, libxslt, autoconf, autoreconfHook
|
2022-06-12 22:57:17 +02:00
|
|
|
, gnome, graphviz, glib, libiconv, libintl, libtool, expat, substituteAll, vala
|
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 =
|
2022-01-09 03:21:25 +01:00
|
|
|
{
|
2020-02-10 20:16:11 +01:00
|
|
|
"0.48" = ./disable-graphviz-0.46.1.patch;
|
|
|
|
|
2021-09-25 15:19:07 +02:00
|
|
|
"0.54" = ./disable-graphviz-0.46.1.patch;
|
|
|
|
|
2022-03-21 11:11:27 +01:00
|
|
|
"0.56" = ./disable-graphviz-0.46.1.patch;
|
2022-02-19 02:52:52 +01:00
|
|
|
|
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";
|
2022-06-12 22:57:17 +02:00
|
|
|
# when cross-compiling ./compiler/valac is valac for host
|
|
|
|
# so add the build vala in nativeBuildInputs
|
|
|
|
preBuild = lib.optionalString (disableGraphviz && (stdenv.buildPlatform == stdenv.hostPlatform)) "buildFlagsArray+=(\"VALAC=$(pwd)/compiler/valac\")";
|
2018-12-28 08:11:09 +01:00
|
|
|
|
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
|
2022-06-12 22:57:17 +02:00
|
|
|
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ vala ]
|
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 = {
|
2021-10-14 23:05:40 +02:00
|
|
|
updateScript = gnome.updateScript {
|
2022-02-19 02:52:52 +01:00
|
|
|
attrPath =
|
|
|
|
let
|
|
|
|
roundUpToEven = num: num + lib.mod num 2;
|
|
|
|
in "${pname}_${lib.versions.major version}_${builtins.toString (roundUpToEven (lib.toInt (lib.versions.minor version)))}";
|
2021-10-14 23:05:40 +02:00
|
|
|
packageName = pname;
|
|
|
|
freeze = true;
|
|
|
|
};
|
2021-06-17 22:41:09 +02:00
|
|
|
};
|
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-09-21 09:02:19 +02:00
|
|
|
maintainers = with maintainers; [ antono jtojnar maxeaubrey ] ++ teams.pantheon.members;
|
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 {
|
2020-02-10 20:16:11 +01:00
|
|
|
vala_0_48 = generic {
|
2022-03-31 12:41:19 +02:00
|
|
|
version = "0.48.24";
|
|
|
|
sha256 = "NknvhFc7aGX8NHBkDuYDcgCZ65FbOfqtGbdJjeGn3yQ=";
|
2021-03-20 11:42:05 +01:00
|
|
|
};
|
|
|
|
|
2021-09-25 15:19:07 +02:00
|
|
|
vala_0_54 = generic {
|
2022-03-20 03:13:20 +01:00
|
|
|
version = "0.54.8";
|
|
|
|
sha256 = "7fs+eUhqS/SM666pKR5X/HfakyK2lh6VSd9tlz0EvIA=";
|
2021-09-25 15:19:07 +02:00
|
|
|
};
|
|
|
|
|
2022-02-19 02:52:52 +01:00
|
|
|
vala_0_56 = generic {
|
2022-07-23 17:12:50 +02:00
|
|
|
version = "0.56.2";
|
|
|
|
sha256 = "Zslhm7F4Wf0aw6ugpXlwYT44/Soe4wVBF0JgyfuQEkw=";
|
2022-02-19 02:52:52 +01:00
|
|
|
};
|
|
|
|
|
2022-05-12 21:28:49 +02:00
|
|
|
vala = vala_0_56;
|
2016-10-12 13:51:54 +02:00
|
|
|
}
|