mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-10-31 14:41:27 +00:00
Merge #1901: add preFixupPhases to stdenv; for gsettings
Without this stdenv change it seems difficult to fix some glib's gsettings issues, as the folders in question may (not) be created in installPhase.
This commit is contained in:
parent
1046b4ccab
commit
1f6a15d7de
@ -298,6 +298,13 @@ executed and in what order:
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>preFixupPhases</varname></term>
|
||||
<listitem>
|
||||
<para>Additional phases executed just before the fixup phase.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><varname>preDistPhases</varname></term>
|
||||
<listitem>
|
||||
|
@ -1,7 +1,7 @@
|
||||
{ stdenv, intltool, fetchurl, vala, libgtop
|
||||
, pkgconfig, gtk3, glib, hicolor_icon_theme
|
||||
, bash, makeWrapper, itstool, libxml2
|
||||
, gnome3, librsvg, gdk_pixbuf }:
|
||||
, gnome3, librsvg, gdk_pixbuf, file }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "baobab-3.10.1";
|
||||
@ -22,19 +22,14 @@ stdenv.mkDerivation rec {
|
||||
hicolor_icon_theme gnome3.gnome_icon_theme_symbolic ];
|
||||
|
||||
buildInputs = [ vala pkgconfig gtk3 glib libgtop intltool itstool libxml2
|
||||
gnome3.gsettings_desktop_schemas makeWrapper ];
|
||||
|
||||
installFlags = "gsettingsschemadir=\${out}/share/baobab/glib-2.0/schemas/";
|
||||
|
||||
postInstall = ''
|
||||
wrapProgram "$out/bin/baobab" \
|
||||
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
|
||||
--prefix XDG_DATA_DIRS : "${gtk3}/share:${gnome3.gnome_themes_standard}/share:${gnome3.gsettings_desktop_schemas}/share:$out/share:$out/share/baobab:$XDG_ICON_DIRS"
|
||||
'';
|
||||
gnome3.gsettings_desktop_schemas makeWrapper file ];
|
||||
|
||||
preFixup = ''
|
||||
rm $out/share/icons/hicolor/icon-theme.cache
|
||||
rm $out/share/icons/HighContrast/icon-theme.cache
|
||||
wrapProgram "$out/bin/baobab" \
|
||||
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
|
||||
--prefix XDG_DATA_DIRS : "${gtk3}/share:${gnome3.gnome_themes_standard}/share:${gnome3.gsettings_desktop_schemas}/share:$out/share:$XDG_ICON_DIRS:$GSETTINGS_SCHEMAS_PATH"
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
|
@ -48,6 +48,8 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "1d98mbqjmc34s8095lkw1j1bwvnnkw9581yfvjaikjvfjsaz29qd";
|
||||
};
|
||||
|
||||
setupHook = ./setup-hook.sh;
|
||||
|
||||
buildInputs = [ libelf ]
|
||||
++ optionals doCheck [ tzdata libxml2 desktop_file_utils shared_mime_info ];
|
||||
|
||||
|
17
pkgs/development/libraries/glib/setup-hook.sh
Normal file
17
pkgs/development/libraries/glib/setup-hook.sh
Normal file
@ -0,0 +1,17 @@
|
||||
# Install gschemas, if any, in a package-specific directory
|
||||
installFlagsArray+=("gsettingsschemadir=$out/gsettings-schemas/$name/glib-2.0/schemas/")
|
||||
|
||||
make_glib_find_gsettings_schemas() {
|
||||
# For packages that need gschemas of other packages (e.g. empathy)
|
||||
if [ -d "$1/gsettings-schemas/*/glib-2.0/schemas" ]; then
|
||||
addToSearchPath GSETTINGS_SCHEMAS_PATH "$1/gsettings-schemas/"*
|
||||
fi
|
||||
}
|
||||
|
||||
envHooks+=(make_glib_find_gsettings_schemas)
|
||||
|
||||
glibPreFixupPhase() {
|
||||
addToSearchPath GSETTINGS_SCHEMAS_PATH "$out/gsettings-schemas/$name"
|
||||
}
|
||||
|
||||
preFixupPhases="$preFixupPhases glibPreFixupPhase"
|
@ -877,7 +877,7 @@ genericBuild() {
|
||||
if [ -z "$phases" ]; then
|
||||
phases="$prePhases unpackPhase patchPhase $preConfigurePhases \
|
||||
configurePhase $preBuildPhases buildPhase checkPhase \
|
||||
$preInstallPhases installPhase fixupPhase installCheckPhase \
|
||||
$preInstallPhases installPhase $preFixupPhases fixupPhase installCheckPhase \
|
||||
$preDistPhases distPhase $postPhases";
|
||||
fi
|
||||
|
||||
|
@ -725,7 +725,7 @@ genericBuild() {
|
||||
if test -z "$phases"; then
|
||||
phases="$prePhases unpackPhase patchPhase $preConfigurePhases \
|
||||
configurePhase $preBuildPhases buildPhase checkPhase \
|
||||
$preInstallPhases installPhase fixupPhase \
|
||||
$preInstallPhases installPhase $preFixupPhases fixupPhase \
|
||||
$preDistPhases distPhase $postPhases";
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user