gtk2: refactor
This commit is contained in:
parent
a2ab9e9c7d
commit
9c28d65755
1 changed files with 74 additions and 45 deletions
|
@ -1,45 +1,63 @@
|
||||||
{ config, lib, substituteAll, stdenv, fetchurl, pkg-config, gettext, glib, atk, pango, cairo, perl, xorg
|
{ config
|
||||||
, gdk-pixbuf, gobject-introspection
|
, lib
|
||||||
, xineramaSupport ? stdenv.isLinux
|
, stdenv
|
||||||
, cupsSupport ? config.gtk2.cups or stdenv.isLinux, cups
|
, fetchurl
|
||||||
, gdktarget ? if stdenv.isDarwin then "quartz" else "x11"
|
, atk
|
||||||
, AppKit, Cocoa
|
, buildPackages
|
||||||
, fetchpatch, buildPackages
|
, cairo
|
||||||
|
, cups
|
||||||
|
, gdk-pixbuf
|
||||||
|
, gettext
|
||||||
|
, glib
|
||||||
|
, gobject-introspection
|
||||||
|
, libXcomposite
|
||||||
|
, libXcursor
|
||||||
|
, libXdamage
|
||||||
|
, libXi
|
||||||
|
, libXinerama
|
||||||
|
, libXrandr
|
||||||
|
, libXrender
|
||||||
|
, pango
|
||||||
|
, perl
|
||||||
|
, pkg-config
|
||||||
|
, substituteAll
|
||||||
, testers
|
, testers
|
||||||
|
, AppKit
|
||||||
|
, Cocoa
|
||||||
|
, gdktarget ? if stdenv.isDarwin then "quartz" else "x11"
|
||||||
|
, cupsSupport ? config.gtk2.cups or stdenv.isLinux
|
||||||
|
, xineramaSupport ? stdenv.isLinux
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
||||||
gtkCleanImmodulesCache = substituteAll {
|
gtkCleanImmodulesCache = substituteAll {
|
||||||
src = ./hooks/clean-immodules-cache.sh;
|
src = ./hooks/clean-immodules-cache.sh;
|
||||||
gtk_module_path = "gtk-2.0";
|
gtk_module_path = "gtk-2.0";
|
||||||
gtk_binary_version = "2.10.0";
|
gtk_binary_version = "2.10.0";
|
||||||
};
|
};
|
||||||
|
|
||||||
in
|
in
|
||||||
|
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "gtk+";
|
pname = "gtk+";
|
||||||
version = "2.24.33";
|
version = "2.24.33";
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "mirror://gnome/sources/gtk+/2.24/${finalAttrs.pname}-${finalAttrs.version}.tar.xz";
|
url = "mirror://gnome/sources/gtk+/2.24/gtk+-${finalAttrs.version}.tar.xz";
|
||||||
sha256 = "rCrHV/WULTGKMRpUsMgLXvKV8pnCpzxjL2v7H/Scxto=";
|
hash = "sha256-rCrHV/WULTGKMRpUsMgLXvKV8pnCpzxjL2v7H/Scxto=";
|
||||||
};
|
};
|
||||||
|
|
||||||
outputs = [ "out" "dev" "devdoc" ];
|
outputs = [ "out" "dev" "devdoc" ];
|
||||||
outputBin = "dev";
|
outputBin = "dev";
|
||||||
|
|
||||||
enableParallelBuilding = true;
|
|
||||||
|
|
||||||
setupHooks = [
|
setupHooks = [
|
||||||
./hooks/drop-icon-theme-cache.sh
|
./hooks/drop-icon-theme-cache.sh
|
||||||
gtkCleanImmodulesCache
|
gtkCleanImmodulesCache
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
nativeBuildInputs = finalAttrs.setupHooks ++ [
|
nativeBuildInputs = finalAttrs.setupHooks ++ [
|
||||||
perl pkg-config gettext gobject-introspection
|
gettext
|
||||||
|
gobject-introspection
|
||||||
|
perl
|
||||||
|
pkg-config
|
||||||
];
|
];
|
||||||
|
|
||||||
patches = [
|
patches = [
|
||||||
|
@ -50,19 +68,31 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
./patches/2.0-darwin-x11.patch
|
./patches/2.0-darwin-x11.patch
|
||||||
];
|
];
|
||||||
|
|
||||||
propagatedBuildInputs = with xorg;
|
propagatedBuildInputs = [
|
||||||
[ glib cairo pango gdk-pixbuf atk ]
|
atk
|
||||||
++ lib.optionals (stdenv.isLinux || stdenv.isDarwin) [
|
cairo
|
||||||
libXrandr libXrender libXcomposite libXi libXcursor
|
gdk-pixbuf
|
||||||
]
|
glib
|
||||||
++ lib.optionals stdenv.isDarwin [ libXdamage ]
|
pango
|
||||||
++ lib.optional xineramaSupport libXinerama
|
] ++ lib.optionals (stdenv.isLinux || stdenv.isDarwin) [
|
||||||
++ lib.optionals cupsSupport [ cups ]
|
libXcomposite
|
||||||
++ lib.optionals stdenv.isDarwin [ AppKit Cocoa ];
|
libXcursor
|
||||||
|
libXi
|
||||||
|
libXrandr
|
||||||
|
libXrender
|
||||||
|
] ++ lib.optional xineramaSupport libXinerama
|
||||||
|
++ lib.optional cupsSupport cups
|
||||||
|
++ lib.optionals stdenv.isDarwin [
|
||||||
|
libXdamage
|
||||||
|
AppKit
|
||||||
|
Cocoa
|
||||||
|
];
|
||||||
|
|
||||||
preConfigure = if (lib.versionAtLeast stdenv.hostPlatform.darwinMinVersion "11" && stdenv.isDarwin) then ''
|
preConfigure =
|
||||||
MACOSX_DEPLOYMENT_TARGET=10.16
|
lib.optionalString (stdenv.isDarwin
|
||||||
'' else null;
|
&& lib.versionAtLeast
|
||||||
|
stdenv.hostPlatform.darwinMinVersion "11")
|
||||||
|
"MACOSX_DEPLOYMENT_TARGET=10.16";
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--sysconfdir=/etc"
|
"--sysconfdir=/etc"
|
||||||
|
@ -77,6 +107,8 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
"ac_cv_path_GDK_PIXBUF_CSOURCE=${buildPackages.gdk-pixbuf.dev}/bin/gdk-pixbuf-csource"
|
"ac_cv_path_GDK_PIXBUF_CSOURCE=${buildPackages.gdk-pixbuf.dev}/bin/gdk-pixbuf-csource"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
installFlags = [
|
installFlags = [
|
||||||
"sysconfdir=${placeholder "out"}/etc"
|
"sysconfdir=${placeholder "out"}/etc"
|
||||||
];
|
];
|
||||||
|
@ -98,11 +130,21 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
tests.pkg-config = testers.testMetaPkgConfig finalAttrs.finalPackage;
|
||||||
};
|
};
|
||||||
|
|
||||||
meta = with lib; {
|
meta = {
|
||||||
description = "A multi-platform toolkit for creating graphical user interfaces";
|
|
||||||
homepage = "https://www.gtk.org/";
|
homepage = "https://www.gtk.org/";
|
||||||
license = licenses.lgpl2Plus;
|
description = "A multi-platform toolkit for creating graphical user interfaces";
|
||||||
maintainers = with maintainers; [ lovek323 raskin ];
|
longDescription = ''
|
||||||
|
GTK is a highly usable, feature rich toolkit for creating graphical user
|
||||||
|
interfaces which boasts cross platform compatibility and an easy to use
|
||||||
|
API. GTK it is written in C, but has bindings to many other popular
|
||||||
|
programming languages such as C++, Python and C# among others. GTK is
|
||||||
|
licensed under the GNU LGPL 2.1 allowing development of both free and
|
||||||
|
proprietary software with GTK without any license fees or royalties.
|
||||||
|
'';
|
||||||
|
changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${finalAttrs.version}/NEWS";
|
||||||
|
license = lib.licenses.lgpl2Plus;
|
||||||
|
maintainers = with lib.maintainers; [ lovek323 raskin ];
|
||||||
|
platforms = lib.platforms.all;
|
||||||
pkgConfigModules = [
|
pkgConfigModules = [
|
||||||
"gdk-2.0"
|
"gdk-2.0"
|
||||||
"gtk+-2.0"
|
"gtk+-2.0"
|
||||||
|
@ -110,18 +152,5 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
"gdk-x11-2.0"
|
"gdk-x11-2.0"
|
||||||
"gtk+-x11-2.0"
|
"gtk+-x11-2.0"
|
||||||
];
|
];
|
||||||
platforms = platforms.all;
|
|
||||||
|
|
||||||
longDescription = ''
|
|
||||||
GTK is a highly usable, feature rich toolkit for creating
|
|
||||||
graphical user interfaces which boasts cross platform
|
|
||||||
compatibility and an easy to use API. GTK it is written in C,
|
|
||||||
but has bindings to many other popular programming languages
|
|
||||||
such as C++, Python and C# among others. GTK is licensed
|
|
||||||
under the GNU LGPL 2.1 allowing development of both free and
|
|
||||||
proprietary software with GTK without any license fees or
|
|
||||||
royalties.
|
|
||||||
'';
|
|
||||||
changelog = "https://gitlab.gnome.org/GNOME/gtk/-/raw/${version}/NEWS";
|
|
||||||
};
|
};
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in a new issue