2021-02-05 17:12:51 +00:00
|
|
|
{ lib, stdenv, fetchurl, libiconv, vanilla ? false }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "pkg-config";
|
|
|
|
version = "0.29.2";
|
|
|
|
|
|
|
|
src = fetchurl {
|
2021-02-05 17:12:51 +00:00
|
|
|
url = "https://pkg-config.freedesktop.org/releases/${pname}-${version}.tar.gz";
|
2020-04-24 23:36:52 +00:00
|
|
|
sha256 = "14fmwzki1rlz8bs2p810lk6jqdxsk966d8drgsjmi54cd00rrikg";
|
|
|
|
};
|
|
|
|
|
2020-06-18 07:06:33 +00:00
|
|
|
outputs = [ "out" "man" "doc" ];
|
2022-06-16 17:23:12 +00:00
|
|
|
strictDeps = true;
|
2020-06-18 07:06:33 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
# Process Requires.private properly, see
|
2020-06-18 07:06:33 +00:00
|
|
|
# http://bugs.freedesktop.org/show_bug.cgi?id=4738, migrated to
|
|
|
|
# https://gitlab.freedesktop.org/pkg-config/pkg-config/issues/28
|
2023-02-02 18:25:31 +00:00
|
|
|
patches = lib.optional (!vanilla) ./requires-private.patch
|
|
|
|
++ lib.optional stdenv.isCygwin ./2.36.3-not-win32.patch;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# These three tests fail due to a (desired) behavior change from our ./requires-private.patch
|
2024-06-20 14:57:18 +00:00
|
|
|
postPatch =
|
|
|
|
# this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion
|
|
|
|
# necessary for FreeBSD code path in configure
|
|
|
|
''
|
|
|
|
substituteInPlace ./config.guess ./glib/config.guess --replace-fail /usr/bin/uname uname
|
|
|
|
'' + lib.optionalString (!vanilla) ''
|
|
|
|
rm -f check/check-requires-private check/check-gtk check/missing
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
buildInputs = [ libiconv ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
configureFlags = [ "--with-internal-glib" ]
|
2023-02-02 18:25:31 +00:00
|
|
|
++ lib.optionals (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ]
|
2020-04-24 23:36:52 +00:00
|
|
|
# Can't run these tests while cross-compiling
|
2023-02-02 18:25:31 +00:00
|
|
|
++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform)
|
2020-04-24 23:36:52 +00:00
|
|
|
[ "glib_cv_stack_grows=no"
|
|
|
|
"glib_cv_uscore=no"
|
|
|
|
"ac_cv_func_posix_getpwuid_r=yes"
|
|
|
|
"ac_cv_func_posix_getgrgid_r=yes"
|
|
|
|
];
|
|
|
|
|
2024-01-02 11:29:13 +00:00
|
|
|
env.NIX_CFLAGS_COMPILE = toString (
|
|
|
|
# Silence "incompatible integer to pointer conversion passing 'gsize'" when building with Clang.
|
|
|
|
lib.optionals stdenv.cc.isClang ["-Wno-int-conversion"]
|
|
|
|
# Silence fprintf format errors when building for Windows.
|
|
|
|
++ lib.optionals stdenv.hostPlatform.isWindows ["-Wno-error=format"]
|
|
|
|
);
|
2023-07-15 17:15:38 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
enableParallelBuilding = true;
|
|
|
|
doCheck = true;
|
|
|
|
|
|
|
|
postInstall = ''rm -f "$out"/bin/*-pkg-config''; # clean the duplicate file
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
meta = with lib; {
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Tool that allows packages to find out information about other packages";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "http://pkg-config.freedesktop.org/wiki/";
|
|
|
|
platforms = platforms.all;
|
|
|
|
license = licenses.gpl2Plus;
|
2023-10-09 19:29:22 +00:00
|
|
|
mainProgram = "pkg-config";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|