Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at fix-function-merge 62 lines 2.4 kB view raw
1{ lib, stdenv, fetchurl, libiconv, vanilla ? false }: 2 3stdenv.mkDerivation rec { 4 pname = "pkg-config"; 5 version = "0.29.2"; 6 7 src = fetchurl { 8 url = "https://pkg-config.freedesktop.org/releases/${pname}-${version}.tar.gz"; 9 sha256 = "14fmwzki1rlz8bs2p810lk6jqdxsk966d8drgsjmi54cd00rrikg"; 10 }; 11 12 outputs = [ "out" "man" "doc" ]; 13 strictDeps = true; 14 15 # Process Requires.private properly, see 16 # http://bugs.freedesktop.org/show_bug.cgi?id=4738, migrated to 17 # https://gitlab.freedesktop.org/pkg-config/pkg-config/issues/28 18 patches = lib.optional (!vanilla) ./requires-private.patch 19 ++ lib.optional stdenv.isCygwin ./2.36.3-not-win32.patch; 20 21 # These three tests fail due to a (desired) behavior change from our ./requires-private.patch 22 postPatch = 23 # this could be accomplished by updateAutotoolsGnuConfigScriptsHook, but that causes infinite recursion 24 # necessary for FreeBSD code path in configure 25 '' 26 substituteInPlace ./config.guess ./glib/config.guess --replace-fail /usr/bin/uname uname 27 '' + lib.optionalString (!vanilla) '' 28 rm -f check/check-requires-private check/check-gtk check/missing 29 ''; 30 31 buildInputs = [ libiconv ]; 32 33 configureFlags = [ "--with-internal-glib" ] 34 ++ lib.optionals (stdenv.isSunOS) [ "--with-libiconv=gnu" "--with-system-library-path" "--with-system-include-path" "CFLAGS=-DENABLE_NLS" ] 35 # Can't run these tests while cross-compiling 36 ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) 37 [ "glib_cv_stack_grows=no" 38 "glib_cv_uscore=no" 39 "ac_cv_func_posix_getpwuid_r=yes" 40 "ac_cv_func_posix_getgrgid_r=yes" 41 ]; 42 43 env.NIX_CFLAGS_COMPILE = toString ( 44 # Silence "incompatible integer to pointer conversion passing 'gsize'" when building with Clang. 45 lib.optionals stdenv.cc.isClang ["-Wno-int-conversion"] 46 # Silence fprintf format errors when building for Windows. 47 ++ lib.optionals stdenv.hostPlatform.isWindows ["-Wno-error=format"] 48 ); 49 50 enableParallelBuilding = true; 51 doCheck = true; 52 53 postInstall = ''rm -f "$out"/bin/*-pkg-config''; # clean the duplicate file 54 55 meta = with lib; { 56 description = "Tool that allows packages to find out information about other packages"; 57 homepage = "http://pkg-config.freedesktop.org/wiki/"; 58 platforms = platforms.all; 59 license = licenses.gpl2Plus; 60 mainProgram = "pkg-config"; 61 }; 62}