nixpkgs/pkgs/by-name/gn/gnome-builder/package.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

181 lines
4.2 KiB
Nix
Raw Normal View History

{
stdenv,
lib,
2018-09-13 07:27:08 +00:00
ctags,
cmark,
desktop-file-utils,
editorconfig-core-c,
fetchurl,
flatpak,
gnome,
2018-12-14 15:05:44 +00:00
libgit2-glib,
gi-docgen,
gobject-introspection,
gom,
gtk4,
gtksourceview5,
json-glib,
jsonrpc-glib,
libadwaita,
libdex,
libpanel,
libpeas2,
libportal-gtk4,
libspelling,
libsysprof-capture,
libxml2,
meson,
ninja,
ostree,
pcre2,
pkg-config,
python3,
sysprof,
template-glib,
vala,
vte-gtk4,
webkitgtk_6_0,
wrapGAppsHook4,
dbus,
2021-05-08 13:45:03 +00:00
xvfb-run,
2018-07-29 03:48:43 +00:00
}:
stdenv.mkDerivation (finalAttrs: {
2018-07-29 03:48:43 +00:00
pname = "gnome-builder";
version = "47.2";
outputs = [
"out"
"devdoc"
];
2018-07-29 03:48:43 +00:00
src = fetchurl {
url = "mirror://gnome/sources/gnome-builder/${lib.versions.major finalAttrs.version}/gnome-builder-${finalAttrs.version}.tar.xz";
hash = "sha256-Roe5PEfNHjNmWi3FA3kLYhPugnhy/ABNl40UvL+ptJU=";
2018-07-29 03:48:43 +00:00
};
patches = [
# The test environment hardcodes `GI_TYPELIB_PATH` environment variable to direct dependencies of libide & co.
# https://gitlab.gnome.org/GNOME/gnome-builder/-/commit/2ce510b0ec0518c29427a29b386bb2ac1a121edf
# https://gitlab.gnome.org/GNOME/gnome-builder/-/commit/2964f7c2a0729f2f456cdca29a0f5b7525baf7c1
#
# But Nix does not have a fallback path for typelibs like /usr/lib on FHS distros and relies solely
# on `GI_TYPELIB_PATH` environment variable. So, when Ide started to depend on Vte, which
# depends on Pango, among others, GIrepository was unable to find these indirect dependencies
# and crashed with:
#
# Typelib file for namespace 'Pango', version '1.0' not found (g-irepository-error-quark, 0)
./fix-finding-test-typelibs.patch
];
nativeBuildInputs = [
desktop-file-utils
gi-docgen
gobject-introspection
meson
2018-07-29 03:48:43 +00:00
ninja
pkg-config
python3
wrapGAppsHook4
];
2018-07-29 03:48:43 +00:00
buildInputs = [
2018-09-13 07:27:08 +00:00
ctags
cmark
editorconfig-core-c
flatpak
2018-12-14 15:05:44 +00:00
libgit2-glib
libpeas2
libportal-gtk4
vte-gtk4
gom
gtk4
gtksourceview5
2018-07-29 03:48:43 +00:00
json-glib
jsonrpc-glib
libadwaita
libdex
libpanel
libspelling
libsysprof-capture
2018-07-29 03:48:43 +00:00
libxml2
ostree
pcre2
python3
2018-07-29 03:48:43 +00:00
template-glib
vala
webkitgtk_6_0
2018-07-29 03:48:43 +00:00
];
nativeCheckInputs = [
dbus
2021-05-08 13:45:03 +00:00
xvfb-run
];
2018-07-29 03:48:43 +00:00
mesonFlags = [
"-Ddocs=true"
# Making the build system correctly detect clang header and library paths
# is difficult. Somebody should look into fixing this.
"-Dplugin_clang=false"
# Do not try to check if appstream images exist
"-Dnetwork_tests=false"
2018-07-29 03:48:43 +00:00
];
doCheck = true;
postPatch = ''
patchShebangs build-aux/meson/post_install.py
substituteInPlace build-aux/meson/post_install.py \
--replace "gtk-update-icon-cache" "gtk4-update-icon-cache"
'';
checkPhase = ''
GTK_A11Y=none \
xvfb-run -s '-screen 0 800x600x24' dbus-run-session \
2022-11-21 02:03:50 +00:00
--config-file=${dbus}/share/dbus-1/session.conf \
meson test --print-errorlogs
'';
2018-07-29 03:48:43 +00:00
preFixup = ''
gappsWrapperArgs+=(
# For sysprof-agent
--prefix PATH : "${sysprof}/bin"
2018-07-29 03:48:43 +00:00
)
# Ensure that all plugins get their interpreter paths fixed up.
find $out/lib -name \*.py -type f -print0 | while read -d "" f; do
chmod a+x "$f"
done
'';
postFixup = ''
# Cannot be in postInstall, otherwise _multioutDocs hook in preFixup will move right back.
moveToOutput share/doc/libide "$devdoc"
'';
passthru.updateScript = gnome.updateScript {
packageName = "gnome-builder";
};
2018-07-29 03:48:43 +00:00
meta = with lib; {
2018-07-29 03:48:43 +00:00
description = "IDE for writing GNOME-based software";
longDescription = ''
Global search, auto-completion, source code map, documentation
reference, and other features expected in an IDE, but with a focus
on streamlining GNOME-based development projects.
This package does not pull in the dependencies needed for every
plugin. If you find that a plugin you wish to use doesn't work, we
currently recommend running gnome-builder inside a nix-shell with
appropriate dependencies loaded.
'';
homepage = "https://apps.gnome.org/Builder/";
license = licenses.gpl3Plus;
maintainers = teams.gnome.members;
2018-07-29 03:48:43 +00:00
platforms = platforms.linux;
2023-11-27 01:17:53 +00:00
mainProgram = "gnome-builder";
2018-08-01 20:12:54 +00:00
};
})