Merge pull request #88518 from Ericson2314/fix-pkg-config
pkg-config, pkgconf: Misc fixes
This commit is contained in:
commit
eae4f22176
@ -4,6 +4,7 @@
|
|||||||
{ stdenvNoCC
|
{ stdenvNoCC
|
||||||
, buildPackages
|
, buildPackages
|
||||||
, pkg-config
|
, pkg-config
|
||||||
|
, baseBinName ? "pkg-config"
|
||||||
, propagateDoc ? pkg-config != null && pkg-config ? man
|
, propagateDoc ? pkg-config != null && pkg-config ? man
|
||||||
, extraPackages ? [], extraBuildCommands ? ""
|
, extraPackages ? [], extraBuildCommands ? ""
|
||||||
}:
|
}:
|
||||||
@ -34,9 +35,9 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
shell = getBin stdenvNoCC.shell + stdenvNoCC.shell.shellPath or "";
|
shell = getBin stdenvNoCC.shell + stdenvNoCC.shell.shellPath or "";
|
||||||
|
|
||||||
inherit targetPrefix suffixSalt;
|
inherit targetPrefix suffixSalt baseBinName;
|
||||||
|
|
||||||
outputs = [ "out" ] ++ optionals propagateDoc [ "man" ];
|
outputs = [ "out" ] ++ optionals propagateDoc ([ "man" ] ++ optional (pkg-config ? doc) "doc");
|
||||||
|
|
||||||
passthru = {
|
passthru = {
|
||||||
inherit pkg-config;
|
inherit pkg-config;
|
||||||
@ -63,7 +64,16 @@ stdenv.mkDerivation {
|
|||||||
|
|
||||||
echo $pkg-config > $out/nix-support/orig-pkg-config
|
echo $pkg-config > $out/nix-support/orig-pkg-config
|
||||||
|
|
||||||
wrap ${targetPrefix}pkg-config ${./pkg-config-wrapper.sh} "${getBin pkg-config}/bin/pkg-config"
|
wrap ${targetPrefix}${baseBinName} ${./pkg-config-wrapper.sh} "${getBin pkg-config}/bin/${baseBinName}"
|
||||||
|
''
|
||||||
|
# symlink in share for autoconf to find macros
|
||||||
|
|
||||||
|
# TODO(@Ericson2314): in the future just make the unwrapped pkg-config a
|
||||||
|
# propagated dep once we can rely on downstream deps comming first in
|
||||||
|
# search paths. (https://github.com/NixOS/nixpkgs/pull/31414 took a crack
|
||||||
|
# at this.)
|
||||||
|
+ ''
|
||||||
|
ln -s ${pkg-config}/share $out/share
|
||||||
'';
|
'';
|
||||||
|
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
@ -76,34 +86,33 @@ stdenv.mkDerivation {
|
|||||||
];
|
];
|
||||||
|
|
||||||
postFixup =
|
postFixup =
|
||||||
|
##
|
||||||
|
## User env support
|
||||||
|
##
|
||||||
|
|
||||||
|
# Propagate the underling unwrapped pkg-config so that if you
|
||||||
|
# install the wrapper, you get anything else it might provide.
|
||||||
''
|
''
|
||||||
|
|
||||||
##
|
|
||||||
## User env support
|
|
||||||
##
|
|
||||||
|
|
||||||
# Propagate the underling unwrapped pkg-config so that if you
|
|
||||||
# install the wrapper, you get anything else it might provide.
|
|
||||||
printWords ${pkg-config} > $out/nix-support/propagated-user-env-packages
|
printWords ${pkg-config} > $out/nix-support/propagated-user-env-packages
|
||||||
''
|
''
|
||||||
|
|
||||||
+ optionalString propagateDoc ''
|
##
|
||||||
##
|
## Man page and doc support
|
||||||
## Man page and info support
|
##
|
||||||
##
|
+ optionalString propagateDoc (''
|
||||||
|
|
||||||
ln -s ${pkg-config.man} $man
|
ln -s ${pkg-config.man} $man
|
||||||
''
|
'' + optionalString (pkg-config ? doc) ''
|
||||||
|
ln -s ${pkg-config.doc} $doc
|
||||||
|
'')
|
||||||
|
|
||||||
+ ''
|
+ ''
|
||||||
substituteAll ${./add-flags.sh} $out/nix-support/add-flags.sh
|
substituteAll ${./add-flags.sh} $out/nix-support/add-flags.sh
|
||||||
substituteAll ${../wrapper-common/utils.bash} $out/nix-support/utils.bash
|
substituteAll ${../wrapper-common/utils.bash} $out/nix-support/utils.bash
|
||||||
|
|
||||||
##
|
|
||||||
## Extra custom steps
|
|
||||||
##
|
|
||||||
''
|
''
|
||||||
|
|
||||||
|
##
|
||||||
|
## Extra custom steps
|
||||||
|
##
|
||||||
+ extraBuildCommands;
|
+ extraBuildCommands;
|
||||||
|
|
||||||
meta =
|
meta =
|
||||||
|
@ -23,7 +23,7 @@ getTargetRoleWrapper
|
|||||||
|
|
||||||
addEnvHooks "$targetOffset" pkgConfigWrapper_addPkgConfigPath
|
addEnvHooks "$targetOffset" pkgConfigWrapper_addPkgConfigPath
|
||||||
|
|
||||||
export PKG_CONFIG${role_post}=@targetPrefix@pkg-config
|
export PKG_CONFIG${role_post}=@targetPrefix@@baseBinName@
|
||||||
|
|
||||||
# No local scope in sourced file
|
# No local scope in sourced file
|
||||||
unset -v role_post
|
unset -v role_post
|
||||||
|
@ -11,13 +11,16 @@ stdenv.mkDerivation rec {
|
|||||||
sha256 = "14fmwzki1rlz8bs2p810lk6jqdxsk966d8drgsjmi54cd00rrikg";
|
sha256 = "14fmwzki1rlz8bs2p810lk6jqdxsk966d8drgsjmi54cd00rrikg";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
outputs = [ "out" "man" "doc" ];
|
||||||
|
|
||||||
# Process Requires.private properly, see
|
# Process Requires.private properly, see
|
||||||
# http://bugs.freedesktop.org/show_bug.cgi?id=4738.
|
# http://bugs.freedesktop.org/show_bug.cgi?id=4738, migrated to
|
||||||
|
# https://gitlab.freedesktop.org/pkg-config/pkg-config/issues/28
|
||||||
patches = optional (!vanilla) ./requires-private.patch
|
patches = optional (!vanilla) ./requires-private.patch
|
||||||
++ optional stdenv.isCygwin ./2.36.3-not-win32.patch;
|
++ optional stdenv.isCygwin ./2.36.3-not-win32.patch;
|
||||||
|
|
||||||
# These three tests fail due to a (desired) behavior change from our ./requires-private.patch
|
# These three tests fail due to a (desired) behavior change from our ./requires-private.patch
|
||||||
postPatch = ''
|
postPatch = if vanilla then null else ''
|
||||||
rm -f check/check-requires-private check/check-gtk check/missing
|
rm -f check/check-requires-private check/check-gtk check/missing
|
||||||
'';
|
'';
|
||||||
|
|
||||||
|
@ -1,14 +1,41 @@
|
|||||||
{ stdenv, fetchurl }:
|
{ stdenv, fetchurl, removeReferencesTo }:
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "pkgconf";
|
pname = "pkgconf";
|
||||||
version = "1.6.3";
|
version = "1.6.3";
|
||||||
|
|
||||||
|
nativeBuildInputs = [ removeReferencesTo ];
|
||||||
|
|
||||||
|
outputs = [ "out" "lib" "dev" "man" "doc" ];
|
||||||
|
|
||||||
|
enableParallelBuilding = true;
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://distfiles.dereferenced.org/${pname}/${pname}-${version}.tar.xz";
|
url = "https://distfiles.dereferenced.org/${pname}/${pname}-${version}.tar.xz";
|
||||||
sha256 = "04525vv0y849vvc2pi60g5wd9fjp1wbhra2lniifi82y1ldv7w31";
|
sha256 = "04525vv0y849vvc2pi60g5wd9fjp1wbhra2lniifi82y1ldv7w31";
|
||||||
};
|
};
|
||||||
|
|
||||||
|
# Debian has outputs like these too:
|
||||||
|
# https://packages.debian.org/source/buster/pkgconf, so take it this
|
||||||
|
# reference removing is safe.
|
||||||
|
postFixup = ''
|
||||||
|
remove-references-to \
|
||||||
|
-t "${placeholder "dev"}" \
|
||||||
|
"${placeholder "lib"}"/lib/* \
|
||||||
|
"${placeholder "out"}"/bin/*
|
||||||
|
remove-references-to \
|
||||||
|
-t "${placeholder "out"}" \
|
||||||
|
"${placeholder "lib"}"/lib/*
|
||||||
|
''
|
||||||
|
# Move back share/aclocal. Yes, this normally goes in the dev output for good
|
||||||
|
# reason, but in this case the dev output is for the `libpkgconf` library,
|
||||||
|
# while the aclocal stuff is for the tool. The tool is already for use during
|
||||||
|
# development, so there is no reason to have separate "dev-bin" and "dev-lib"
|
||||||
|
# outputs or someting.
|
||||||
|
+ ''
|
||||||
|
mv ${placeholder "dev"}/share ${placeholder "out"}
|
||||||
|
'';
|
||||||
|
|
||||||
meta = with stdenv.lib; {
|
meta = with stdenv.lib; {
|
||||||
description = "Package compiler and linker metadata toolkit";
|
description = "Package compiler and linker metadata toolkit";
|
||||||
homepage = "https://git.dereferenced.org/pkgconf/pkgconf";
|
homepage = "https://git.dereferenced.org/pkgconf/pkgconf";
|
||||||
|
@ -10761,7 +10761,11 @@ in
|
|||||||
|
|
||||||
pmccabe = callPackage ../development/tools/misc/pmccabe { };
|
pmccabe = callPackage ../development/tools/misc/pmccabe { };
|
||||||
|
|
||||||
pkgconf = callPackage ../development/tools/misc/pkgconf {};
|
pkgconf-unwrapped = callPackage ../development/tools/misc/pkgconf {};
|
||||||
|
pkgconf = callPackage ../build-support/pkg-config-wrapper {
|
||||||
|
pkg-config = pkgconf-unwrapped;
|
||||||
|
baseBinName = "pkgconf";
|
||||||
|
};
|
||||||
|
|
||||||
pkg-config-unwrapped = callPackage ../development/tools/misc/pkg-config { };
|
pkg-config-unwrapped = callPackage ../development/tools/misc/pkg-config { };
|
||||||
pkg-config = callPackage ../build-support/pkg-config-wrapper {
|
pkg-config = callPackage ../build-support/pkg-config-wrapper {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user