Files
nixpkgs/pkgs/by-name/li/libiberty/package.nix
Ihar Hrachyshka 567e8dfd8e treewide: clean up 'meta = with' pattern
This commit was created by a combination of scripts and tools:
- an ast-grep script to prefix things in meta with `lib.`,
- a modified nixf-diagnose / nixf combination to remove unused `with
lib;`, and
- regular nixfmt.

Co-authored-by: Wolfgang Walther <walther@technowledgy.de>
2025-12-10 18:09:49 +01:00

47 lines
1.0 KiB
Nix

{
lib,
stdenv,
buildPackages,
staticBuild ? stdenv.hostPlatform.isStatic,
}:
let
inherit (buildPackages.buildPackages) gcc;
in
stdenv.mkDerivation {
pname = "libiberty";
version = "${gcc.cc.version}";
inherit (gcc.cc) src;
outputs = [
"out"
"dev"
];
postUnpack = "sourceRoot=\${sourceRoot}/libiberty";
# needed until config scripts are updated to not use /usr/bin/uname on FreeBSD native
# updateAutotoolsGnuConfigScriptsHook doesn't seem to work here
postPatch = ''
substituteInPlace ../config.guess --replace-fail /usr/bin/uname uname
'';
configureFlags = [ "--enable-install-libiberty" ] ++ lib.optional (!staticBuild) "--enable-shared";
postInstall = lib.optionalString (!staticBuild) ''
cp pic/libiberty.a $out/lib*/libiberty.a
'';
meta = {
homepage = "https://gcc.gnu.org/";
license = lib.licenses.lgpl2;
description = "Collection of subroutines used by various GNU programs";
maintainers = with lib.maintainers; [
ericson2314
];
platforms = lib.platforms.unix;
};
}