2021-02-05 17:12:51 +00:00
|
|
|
{ stdenv, lib, fetchurl, fetchpatch, pkg-config, flex, bison, libxslt, autoconf, autoreconfHook
|
2022-07-14 12:49:19 +00:00
|
|
|
, gnome, graphviz, glib, libiconv, libintl, libtool, expat, substituteAll, vala
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
let
|
|
|
|
generic = lib.makeOverridable ({
|
|
|
|
version, sha256,
|
|
|
|
extraNativeBuildInputs ? [],
|
|
|
|
extraBuildInputs ? [],
|
|
|
|
withGraphviz ? false
|
|
|
|
}:
|
|
|
|
let
|
|
|
|
# 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-19 23:45:15 +00:00
|
|
|
{
|
2020-04-24 23:36:52 +00:00
|
|
|
"0.48" = ./disable-graphviz-0.46.1.patch;
|
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
"0.54" = ./disable-graphviz-0.46.1.patch;
|
|
|
|
|
2022-03-30 09:31:56 +00:00
|
|
|
"0.56" = ./disable-graphviz-0.46.1.patch;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
}.${lib.versions.majorMinor version} or (throw "no graphviz patch for this version of vala");
|
|
|
|
|
|
|
|
disableGraphviz = lib.versionAtLeast version "0.38" && !withGraphviz;
|
|
|
|
|
|
|
|
in stdenv.mkDerivation rec {
|
|
|
|
pname = "vala";
|
|
|
|
inherit version;
|
|
|
|
|
|
|
|
setupHook = substituteAll {
|
|
|
|
src = ./setup-hook.sh;
|
|
|
|
apiVersion = lib.versions.majorMinor version;
|
|
|
|
};
|
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
|
|
|
inherit sha256;
|
|
|
|
};
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
patchShebangs tests
|
|
|
|
'';
|
|
|
|
|
|
|
|
# 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-07-14 12:49:19 +00: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\")";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
outputs = [ "out" "devdoc" ];
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config flex bison libxslt
|
2020-04-24 23:36:52 +00:00
|
|
|
] ++ lib.optional (stdenv.isDarwin && (lib.versionAtLeast version "0.38")) expat
|
|
|
|
++ lib.optional disableGraphviz autoreconfHook # if we changed our ./configure script, need to reconfigure
|
2022-07-14 12:49:19 +00:00
|
|
|
++ lib.optionals (stdenv.buildPlatform != stdenv.hostPlatform) [ vala ]
|
2020-04-24 23:36:52 +00:00
|
|
|
++ extraNativeBuildInputs;
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
glib libiconv libintl
|
|
|
|
] ++ lib.optional (lib.versionAtLeast version "0.38" && withGraphviz) graphviz
|
|
|
|
++ extraBuildInputs;
|
|
|
|
|
|
|
|
enableParallelBuilding = true;
|
|
|
|
|
|
|
|
doCheck = false; # fails, requires dbus daemon
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
passthru = {
|
2021-10-17 02:12:59 +00:00
|
|
|
updateScript = gnome.updateScript {
|
2022-03-30 09:31:56 +00: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-17 02:12:59 +00:00
|
|
|
packageName = pname;
|
|
|
|
freeze = true;
|
|
|
|
};
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Compiler for GObject type system";
|
|
|
|
homepage = "https://wiki.gnome.org/Projects/Vala";
|
|
|
|
license = licenses.lgpl21Plus;
|
|
|
|
platforms = platforms.unix;
|
2021-09-28 08:13:01 +00:00
|
|
|
maintainers = with maintainers; [ antono jtojnar maxeaubrey ] ++ teams.pantheon.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
});
|
|
|
|
|
|
|
|
in rec {
|
|
|
|
vala_0_48 = generic {
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "0.48.25";
|
|
|
|
sha256 = "UMs8Xszdx/1DaL+pZBSlVgReedKxWmiRjHJ7jIOxiiQ=";
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2021-10-14 00:43:12 +00:00
|
|
|
vala_0_54 = generic {
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "0.54.9";
|
|
|
|
sha256 = "hXLA6Nd9eMFZfVFgCPBUDH50leA10ou0wlzJk+U85LQ=";
|
2022-03-30 09:31:56 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
vala_0_56 = generic {
|
2022-10-21 18:38:19 +00:00
|
|
|
version = "0.56.3";
|
|
|
|
sha256 = "4QZiIb97icsfpzJ6OIhkXLM7YE3jv0WqgRMv0EC2mb8=";
|
2021-10-14 00:43:12 +00:00
|
|
|
};
|
|
|
|
|
2022-06-16 17:23:12 +00:00
|
|
|
vala = vala_0_56;
|
2020-04-24 23:36:52 +00:00
|
|
|
}
|