nixpkgs/pkgs/by-name/li/libbacktrace/package.nix
aleksana 571c71e6f7 treewide: migrate packages to pkgs/by-name, take 1
We are migrating packages that meet below requirements:

1. using `callPackage`
2. called path is a directory
3. overriding set is empty (`{ }`)
4. not containing path expressions other than relative path (to
makenixpkgs-vet happy)
5. not referenced by nix files outside of the directory, other
than`pkgs/top-level/all-packages.nix`
6. not referencing nix files outside of the directory
7. not referencing `default.nix` (since it's changed to `package.nix`)
8. `outPath` doesn't change after migration

The tool is here: https://github.com/Aleksanaa/by-name-migrate.
2024-11-09 20:04:51 +08:00

57 lines
1.5 KiB
Nix

{ stdenv
, lib
, fetchFromGitHub
, enableStatic ? stdenv.hostPlatform.isStatic
, enableShared ? !stdenv.hostPlatform.isStatic
, unstableGitUpdater
, autoreconfHook
}:
stdenv.mkDerivation {
pname = "libbacktrace";
version = "0-unstable-2024-03-02";
src = fetchFromGitHub {
owner = "ianlancetaylor";
repo = "libbacktrace";
rev = "28824f2cc9069e3fdc39d3702acdf753e35c41b4";
sha256 = "1k1O1GT22hZAWPF8NYP0y4qe+e3pGfzT9Mz2TH+H/v4=";
};
patches = [
# Fix tests with shared library.
# https://github.com/ianlancetaylor/libbacktrace/pull/99
./0001-libbacktrace-avoid-libtool-wrapping-tests.patch
# Support multiple debug dirs.
# https://github.com/ianlancetaylor/libbacktrace/pull/100
./0002-libbacktrace-Allow-configuring-debug-dir.patch
./0003-libbacktrace-Support-multiple-build-id-directories.patch
# Support NIX_DEBUG_INFO_DIRS environment variable.
./0004-libbacktrace-Support-NIX_DEBUG_INFO_DIRS-environment.patch
];
nativeBuildInputs = [
autoreconfHook
];
configureFlags = [
(lib.enableFeature enableStatic "static")
(lib.enableFeature enableShared "shared")
];
doCheck = stdenv.hostPlatform.isLinux && !stdenv.hostPlatform.isMusl;
passthru = {
updateScript = unstableGitUpdater { };
};
meta = with lib; {
description = "C library that may be linked into a C/C++ program to produce symbolic backtraces";
homepage = "https://github.com/ianlancetaylor/libbacktrace";
maintainers = with maintainers; [ twey ];
license = with licenses; [ bsd3 ];
};
}