summaryrefslogtreecommitdiff
path: root/pkgs/development/libraries/gtk
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/libraries/gtk')
-rw-r--r--pkgs/development/libraries/gtk/2.x.nix5
-rw-r--r--pkgs/development/libraries/gtk/3.x.nix8
-rw-r--r--pkgs/development/libraries/gtk/4.x.nix69
3 files changed, 38 insertions, 44 deletions
diff --git a/pkgs/development/libraries/gtk/2.x.nix b/pkgs/development/libraries/gtk/2.x.nix
index 8f50c922f514..ea112b3d33ce 100644
--- a/pkgs/development/libraries/gtk/2.x.nix
+++ b/pkgs/development/libraries/gtk/2.x.nix
@@ -1,15 +1,12 @@
{ config, lib, substituteAll, stdenv, fetchurl, pkg-config, gettext, glib, atk, pango, cairo, perl, xorg
, gdk-pixbuf, xlibsWrapper, gobject-introspection
, xineramaSupport ? stdenv.isLinux
-, cupsSupport ? config.gtk2.cups or stdenv.isLinux, cups ? null
+, cupsSupport ? config.gtk2.cups or stdenv.isLinux, cups
, gdktarget ? if stdenv.isDarwin then "quartz" else "x11"
, AppKit, Cocoa
, fetchpatch
}:
-assert xineramaSupport -> xorg.libXinerama != null;
-assert cupsSupport -> cups != null;
-
with lib;
let
diff --git a/pkgs/development/libraries/gtk/3.x.nix b/pkgs/development/libraries/gtk/3.x.nix
index 769b722fd438..e14e2ad1be3a 100644
--- a/pkgs/development/libraries/gtk/3.x.nix
+++ b/pkgs/development/libraries/gtk/3.x.nix
@@ -29,7 +29,7 @@
, libxkbcommon
, libxml2
, gmp
-, gnome3
+, gnome
, gsettings-desktop-schemas
, sassc
, trackerSupport ? stdenv.isLinux
@@ -42,14 +42,12 @@
, xineramaSupport ? stdenv.isLinux
, cupsSupport ? stdenv.isLinux
, withGtkDoc ? stdenv.isLinux
-, cups ? null
+, cups
, AppKit
, Cocoa
, broadwaySupport ? true
}:
-assert cupsSupport -> cups != null;
-
let
gtkCleanImmodulesCache = substituteAll {
@@ -208,7 +206,7 @@ stdenv.mkDerivation rec {
'';
passthru = {
- updateScript = gnome3.updateScript {
+ updateScript = gnome.updateScript {
packageName = "gtk+";
attrPath = "gtk3";
};
diff --git a/pkgs/development/libraries/gtk/4.x.nix b/pkgs/development/libraries/gtk/4.x.nix
index ab391c4e0506..44a6f684e9d4 100644
--- a/pkgs/development/libraries/gtk/4.x.nix
+++ b/pkgs/development/libraries/gtk/4.x.nix
@@ -5,9 +5,7 @@
, pkg-config
, gettext
, graphene
-, docbook-xsl-nons
-, docbook_xml_dtd_43
-, gtk-doc
+, gi-docgen
, meson
, ninja
, python3
@@ -30,7 +28,7 @@
, libsoup
, ffmpeg
, gmp
-, gnome3
+, gnome
, gsettings-desktop-schemas
, gst_all_1
, sassc
@@ -45,15 +43,12 @@
, wayland-protocols
, xineramaSupport ? stdenv.isLinux
, cupsSupport ? stdenv.isLinux
-, withGtkDoc ? stdenv.isLinux
-, cups ? null
+, cups
, AppKit
, Cocoa
, broadwaySupport ? true
}:
-assert cupsSupport -> cups != null;
-
let
gtkCleanImmodulesCache = substituteAll {
@@ -66,9 +61,9 @@ in
stdenv.mkDerivation rec {
pname = "gtk4";
- version = "4.0.3";
+ version = "4.2.1";
- outputs = [ "out" "dev" ] ++ lib.optional withGtkDoc "devdoc";
+ outputs = [ "out" "dev" ] ++ lib.optionals x11Support [ "devdoc" ];
outputBin = "dev";
setupHooks = [
@@ -78,7 +73,7 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "mirror://gnome/sources/gtk/${lib.versions.majorMinor version}/gtk-${version}.tar.xz";
- sha256 = "18mJNyV5C1C9mjuyeIVtnVQ7RLa5uVHXtg573swTGJA=";
+ sha256 = "AjFpd13kPwof3gZvvBnXhUXqanViwZFavem4rkpzCeY=";
};
nativeBuildInputs = [
@@ -90,21 +85,17 @@ stdenv.mkDerivation rec {
pkg-config
python3
sassc
- ] ++ setupHooks ++ lib.optionals withGtkDoc [
- pandoc
- docbook_xml_dtd_43
- docbook-xsl-nons
- gtk-doc
- # For xmllint
- libxml2
- ];
+ gi-docgen
+ ] ++ setupHooks;
buildInputs = [
libxkbcommon
epoxy
json-glib
isocodes
+ ] ++ lib.optionals (!stdenv.isDarwin) [
vulkan-headers
+ ] ++ [
librest
libsoup
ffmpeg
@@ -143,18 +134,27 @@ stdenv.mkDerivation rec {
glib
graphene
pango
- vulkan-loader # TODO: Possibly not used on Darwin
-
+ ] ++ lib.optionals (!stdenv.isDarwin) [
+ vulkan-loader
+ ] ++ [
# Required for GSettings schemas at runtime.
# Will be picked up by wrapGAppsHook.
gsettings-desktop-schemas
];
mesonFlags = [
- "-Dgtk_doc=${lib.boolToString withGtkDoc}"
- "-Dtests=false"
- "-Dtracker3=${lib.boolToString trackerSupport}"
- "-Dbroadway_backend=${lib.boolToString broadwaySupport}"
+ # ../docs/tools/shooter.c:4:10: fatal error: 'cairo-xlib.h' file not found
+ "-Dgtk_doc=${lib.boolToString x11Support}"
+ "-Dbuild-tests=false"
+ "-Dtracker=${if trackerSupport then "enabled" else "disabled"}"
+ "-Dbroadway-backend=${lib.boolToString broadwaySupport}"
+ ] ++ lib.optionals (!cupsSupport) [
+ "-Dprint-cups=disabled"
+ ] ++ lib.optionals stdenv.isDarwin [
+ "-Dvulkan=disabled"
+ "-Dmedia-gstreamer=disabled" # requires gstreamer-gl
+ ] ++ lib.optionals (!x11Support) [
+ "-Dx11-backend=false"
];
doCheck = false; # needs X11
@@ -173,20 +173,12 @@ stdenv.mkDerivation rec {
gdk/gen-gdk-gresources-xml.py
gtk/gen-gtk-gresources-xml.py
gtk/gentypefuncs.py
- docs/reference/gtk/gtk-markdown-to-docbook
)
chmod +x ''${files[@]}
patchShebangs ''${files[@]}
'';
- postBuild = lib.optionalString withGtkDoc ''
- # Meson not building `custom_target`s passed to `custom_files` argument of `gnome.gtkdoc` function
- # as part of the `install` target. We have to build the docs manually first.
- # https://github.com/mesonbuild/meson/issues/2831
- ninja g{t,d,s}k4-doc
- '';
-
preInstall = ''
OLD_PATH="$PATH"
PATH="$PATH:$dev/bin" # so the install script finds gtk4-update-icon-cache
@@ -204,6 +196,13 @@ stdenv.mkDerivation rec {
for f in $dev/bin/gtk4-encode-symbolic-svg; do
wrapProgram $f --prefix XDG_DATA_DIRS : "${shared-mime-info}/share"
done
+
+ '' + lib.optionalString x11Support ''
+ # So that DevHelp can find this.
+ # TODO: Remove this with DevHelp 41.
+ mkdir -p "$devdoc/share/devhelp/books"
+ mv "$out/share/doc/"* "$devdoc/share/devhelp/books"
+ rmdir -p --ignore-fail-on-non-empty "$out/share/doc"
'';
# Wrap demos
@@ -217,7 +216,7 @@ stdenv.mkDerivation rec {
'';
passthru = {
- updateScript = gnome3.updateScript {
+ updateScript = gnome.updateScript {
packageName = "gtk";
attrPath = "gtk4";
};
@@ -237,7 +236,7 @@ stdenv.mkDerivation rec {
'';
homepage = "https://www.gtk.org/";
license = licenses.lgpl2Plus;
- maintainers = with maintainers; [ raskin lethalman worldofpeace ];
+ maintainers = teams.gnome.members ++ (with maintainers; [ raskin ]);
platforms = platforms.all;
changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${version}/NEWS";
};