glib: fixup output paths and use system pcre
Now pcre costs us <0.5 MB and using internal one would cost ~0.2 MB, so if we take into account that pcre is often used, e.g. by grep...
This commit is contained in:
parent
30845d07d8
commit
55b7d3a181
@ -31,12 +31,12 @@ let
|
|||||||
# This is intended to be run in postInstall of any package
|
# This is intended to be run in postInstall of any package
|
||||||
# which has $out/include/ containing just some disjunct directories.
|
# which has $out/include/ containing just some disjunct directories.
|
||||||
flattenInclude = ''
|
flattenInclude = ''
|
||||||
for dir in "$out"/include/*; do
|
for dir in "''${!outputInclude}"/include/*; do
|
||||||
cp -r "$dir"/* "$out/include/"
|
cp -r "$dir"/* "''${!outputInclude}/include/"
|
||||||
rm -r "$dir"
|
rm -r "$dir"
|
||||||
ln -s . "$dir"
|
ln -s . "$dir"
|
||||||
done
|
done
|
||||||
ln -sr -t "$out/include/" "$out"/lib/*/include/* 2>/dev/null || true
|
ln -sr -t "''${!outputInclude}/include/" "''${!outputInclude}"/lib/*/include/* 2>/dev/null || true
|
||||||
'';
|
'';
|
||||||
|
|
||||||
ver_maj = "2.46";
|
ver_maj = "2.46";
|
||||||
@ -53,20 +53,21 @@ stdenv.mkDerivation rec {
|
|||||||
|
|
||||||
patches = optional stdenv.isDarwin ./darwin-compilation.patch ++ optional doCheck ./skip-timer-test.patch;
|
patches = optional stdenv.isDarwin ./darwin-compilation.patch ++ optional doCheck ./skip-timer-test.patch;
|
||||||
|
|
||||||
outputs = [ "dev" "out" "doc" ];
|
outputs = [ "dev" "out" "docdev" ];
|
||||||
outputBin = "dev";
|
outputBin = "dev";
|
||||||
|
|
||||||
setupHook = ./setup-hook.sh;
|
setupHook = ./setup-hook.sh;
|
||||||
|
|
||||||
buildInputs = [ libelf setupHook/*get the gtk-doc hook*/ ]
|
buildInputs = [ libelf setupHook pcre ]
|
||||||
++ optionals doCheck [ tzdata libxml2 desktop_file_utils shared_mime_info ];
|
++ optionals doCheck [ tzdata libxml2 desktop_file_utils shared_mime_info ];
|
||||||
|
|
||||||
nativeBuildInputs = [ pkgconfig gettext perl python ];
|
nativeBuildInputs = [ pkgconfig gettext perl python ];
|
||||||
|
|
||||||
propagatedBuildInputs = [ zlib libffi libiconv /*pcre*/ ]
|
propagatedBuildInputs = [ zlib libffi libiconv ]
|
||||||
++ libintlOrEmpty;
|
++ libintlOrEmpty;
|
||||||
|
|
||||||
configureFlags = [ ] # [ "--with-pcre=system" ] # internal pcre only adds <200kB
|
# internal pcre would only add <200kB, but it's relatively common
|
||||||
|
configureFlags = [ "--with-pcre=system" ]
|
||||||
++ optional stdenv.isDarwin "--disable-compile-warnings"
|
++ optional stdenv.isDarwin "--disable-compile-warnings"
|
||||||
++ optional stdenv.isSunOS "--disable-modular-tests";
|
++ optional stdenv.isSunOS "--disable-modular-tests";
|
||||||
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
# Install gschemas, if any, in a package-specific directory
|
|
||||||
installFlagsArray+=("gsettingsschemadir=$out/share/gsettings-schemas/$name/glib-2.0/schemas/")
|
|
||||||
|
|
||||||
make_glib_find_gsettings_schemas() {
|
make_glib_find_gsettings_schemas() {
|
||||||
# For packages that need gschemas of other packages (e.g. empathy)
|
# For packages that need gschemas of other packages (e.g. empathy)
|
||||||
@ -7,32 +5,22 @@ make_glib_find_gsettings_schemas() {
|
|||||||
addToSearchPath GSETTINGS_SCHEMAS_PATH "$1/share/gsettings-schemas/"*
|
addToSearchPath GSETTINGS_SCHEMAS_PATH "$1/share/gsettings-schemas/"*
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
envHooks+=(make_glib_find_gsettings_schemas)
|
envHooks+=(make_glib_find_gsettings_schemas)
|
||||||
|
|
||||||
|
# Install gschemas, if any, in a package-specific directory
|
||||||
|
glibPreInstallPhase() {
|
||||||
|
installFlagsArray+=("gsettingsschemadir=${!outputLib}/share/gsettings-schemas/$name/glib-2.0/schemas/")
|
||||||
|
}
|
||||||
|
preInstallPhases+=(glibPreInstallPhase)
|
||||||
|
|
||||||
glibPreFixupPhase() {
|
glibPreFixupPhase() {
|
||||||
# Move gschemas in case the install flag didn't help
|
# Move gschemas in case the install flag didn't help
|
||||||
if [ -d "$out/share/glib-2.0/schemas" ]; then
|
if [ -d "${!outputLib}/share/glib-2.0/schemas" ]; then
|
||||||
mkdir -p "$out/share/gsettings-schemas/$name/glib-2.0"
|
mkdir -p "${!outputLib}/share/gsettings-schemas/$name/glib-2.0"
|
||||||
mv "$out/share/glib-2.0/schemas" "$out/share/gsettings-schemas/$name/glib-2.0/"
|
mv "${!outputLib}/share/glib-2.0/schemas" "${!outputLib}/share/gsettings-schemas/$name/glib-2.0/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
addToSearchPath GSETTINGS_SCHEMAS_PATH "$out/share/gsettings-schemas/$name"
|
addToSearchPath GSETTINGS_SCHEMAS_PATH "${!outputLib}/share/gsettings-schemas/$name"
|
||||||
}
|
}
|
||||||
|
|
||||||
preFixupPhases+=(glibPreFixupPhase)
|
preFixupPhases+=(glibPreFixupPhase)
|
||||||
|
|
||||||
|
|
||||||
preFixupHooks+=(_multioutGtkDocs)
|
|
||||||
|
|
||||||
# Move documentation to the desired outputs.
|
|
||||||
_multioutGtkDocs() {
|
|
||||||
if [ "$outputs" = "out" ]; then return; fi;
|
|
||||||
_moveToOutput share/gtk-doc "${!outputDoc}"
|
|
||||||
|
|
||||||
# Remove empty share directory.
|
|
||||||
if [ -d "$out/share" ]; then
|
|
||||||
rmdir "$out/share" 2> /dev/null || true
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user