2020-04-24 23:36:52 +00:00
|
|
|
{ stdenv
|
|
|
|
, lib
|
|
|
|
, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, gettext
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, meson
|
|
|
|
, ninja
|
2021-05-20 23:08:51 +00:00
|
|
|
, gnome
|
2020-04-24 23:36:52 +00:00
|
|
|
, glib
|
|
|
|
, gtk3
|
2022-10-21 18:38:19 +00:00
|
|
|
, gtk4
|
|
|
|
, gtkVersion ? "3"
|
2020-04-24 23:36:52 +00:00
|
|
|
, gobject-introspection
|
|
|
|
, vala
|
2021-05-20 23:08:51 +00:00
|
|
|
, python3
|
2022-10-21 18:38:19 +00:00
|
|
|
, gi-docgen
|
2020-04-24 23:36:52 +00:00
|
|
|
, libxml2
|
|
|
|
, gnutls
|
|
|
|
, gperf
|
|
|
|
, pango
|
|
|
|
, pcre2
|
|
|
|
, fribidi
|
|
|
|
, zlib
|
|
|
|
, icu
|
|
|
|
, systemd
|
2022-03-30 09:31:56 +00:00
|
|
|
, systemdSupport ? stdenv.hostPlatform.isLinux
|
|
|
|
, nixosTests
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "vte";
|
2022-12-17 10:02:37 +00:00
|
|
|
version = "0.70.2";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
outputs = [ "out" "dev" "devdoc" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-05 17:12:51 +00:00
|
|
|
url = "mirror://gnome/sources/${pname}/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
2022-12-17 10:02:37 +00:00
|
|
|
sha256 = "sha256-TRW0OA3j9WTVfqvQBjicQHxwXfWwxwAw/cwklxozTYA=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
patches = [
|
|
|
|
# VTE needs a small patch to work with musl:
|
|
|
|
# https://gitlab.gnome.org/GNOME/vte/issues/72
|
|
|
|
# Taken from https://git.alpinelinux.org/aports/tree/community/vte3
|
|
|
|
(fetchpatch {
|
|
|
|
name = "0001-Add-W_EXITCODE-macro-for-non-glibc-systems.patch";
|
|
|
|
url = "https://git.alpinelinux.org/aports/plain/community/vte3/fix-W_EXITCODE.patch?id=4d35c076ce77bfac7655f60c4c3e4c86933ab7dd";
|
|
|
|
sha256 = "FkVyhsM0mRUzZmS2Gh172oqwcfXv6PyD6IEgjBhy2uU=";
|
|
|
|
})
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
gettext
|
|
|
|
gobject-introspection
|
|
|
|
gperf
|
|
|
|
libxml2
|
|
|
|
meson
|
|
|
|
ninja
|
2021-02-05 17:12:51 +00:00
|
|
|
pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
vala
|
2021-05-20 23:08:51 +00:00
|
|
|
python3
|
2022-10-21 18:38:19 +00:00
|
|
|
gi-docgen
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
fribidi
|
|
|
|
gnutls
|
|
|
|
pcre2
|
|
|
|
zlib
|
|
|
|
icu
|
2022-03-30 09:31:56 +00:00
|
|
|
] ++ lib.optionals systemdSupport [
|
2020-04-24 23:36:52 +00:00
|
|
|
systemd
|
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
propagatedBuildInputs = assert (gtkVersion == "3" || gtkVersion == "4"); [
|
2020-04-24 23:36:52 +00:00
|
|
|
# Required by vte-2.91.pc.
|
2022-10-21 18:38:19 +00:00
|
|
|
(if gtkVersion == "3" then gtk3 else gtk4)
|
2020-04-24 23:36:52 +00:00
|
|
|
glib
|
|
|
|
pango
|
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
mesonFlags = [
|
|
|
|
"-Ddocs=true"
|
|
|
|
] ++ lib.optionals (!systemdSupport) [
|
2022-03-30 09:31:56 +00:00
|
|
|
"-D_systemd=false"
|
2022-10-21 18:38:19 +00:00
|
|
|
] ++ lib.optionals (gtkVersion == "4") [
|
|
|
|
"-Dgtk3=false"
|
|
|
|
"-Dgtk4=true"
|
2022-08-12 12:06:08 +00:00
|
|
|
] ++ lib.optionals stdenv.isDarwin [
|
|
|
|
# -Bsymbolic-functions is not supported on darwin
|
|
|
|
"-D_b_symbolic_functions=false"
|
2022-03-30 09:31:56 +00:00
|
|
|
];
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
# error: argument unused during compilation: '-pie' [-Werror,-Wunused-command-line-argument]
|
|
|
|
NIX_CFLAGS_COMPILE = lib.optionalString stdenv.hostPlatform.isMusl "-Wno-unused-command-line-argument";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
patchShebangs perf/*
|
|
|
|
patchShebangs src/box_drawing_generate.sh
|
2021-05-20 23:08:51 +00:00
|
|
|
patchShebangs src/parser-seq.py
|
|
|
|
patchShebangs src/modes.py
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
2022-10-21 18:38:19 +00:00
|
|
|
postFixup = ''
|
|
|
|
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
|
|
|
|
moveToOutput "share/doc" "$devdoc"
|
|
|
|
'';
|
|
|
|
|
2021-05-20 23:08:51 +00:00
|
|
|
passthru = {
|
|
|
|
updateScript = gnome.updateScript {
|
|
|
|
packageName = pname;
|
|
|
|
versionPolicy = "odd-unstable";
|
|
|
|
};
|
2022-03-30 09:31:56 +00:00
|
|
|
tests = {
|
|
|
|
inherit (nixosTests.terminal-emulators) gnome-terminal lxterminal mlterm roxterm sakura stupidterm terminator termite xfce4-terminal;
|
|
|
|
};
|
2021-05-20 23:08:51 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
meta = with lib; {
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.gnome.org/";
|
|
|
|
description = "A library implementing a terminal emulator widget for GTK";
|
|
|
|
longDescription = ''
|
|
|
|
VTE is a library (libvte) implementing a terminal emulator widget for
|
|
|
|
GTK, and a minimal sample application (vte) using that. Vte is
|
|
|
|
mainly used in gnome-terminal, but can also be used to embed a
|
|
|
|
console/terminal in games, editors, IDEs, etc. VTE supports Unicode and
|
|
|
|
character set conversion, as well as emulating any terminal known to
|
|
|
|
the system's terminfo database.
|
|
|
|
'';
|
2021-05-20 23:08:51 +00:00
|
|
|
license = licenses.lgpl3Plus;
|
|
|
|
maintainers = with maintainers; [ astsmtl antono ] ++ teams.gnome.members;
|
2020-04-24 23:36:52 +00:00
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
}
|