Skip to content

Commit

Permalink
libbacktrace: clean up
Browse files Browse the repository at this point in the history
- Prefix version with “unstable-” as per contributing guide
- Do not use rec pointlessly
- Use `lib.enableFeature`
- Add update script
- Format the expression
- Remove unused callPackage input
  • Loading branch information
jtojnar committed Mar 5, 2023
1 parent b1f87ca commit f37d97b
Showing 1 changed file with 17 additions and 8 deletions.
25 changes: 17 additions & 8 deletions pkgs/development/libraries/libbacktrace/default.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,31 @@
{ lib, stdenv, callPackage, fetchFromGitHub
{ stdenv
, lib
, fetchFromGitHub
, enableStatic ? stdenv.hostPlatform.isStatic
, enableShared ? !stdenv.hostPlatform.isStatic
, unstableGitUpdater
}:
let
yesno = b: if b then "yes" else "no";
in stdenv.mkDerivation rec {

stdenv.mkDerivation {
pname = "libbacktrace";
version = "2020-05-13";
version = "unstable-2020-05-13";

src = fetchFromGitHub {
owner = "ianlancetaylor";
repo = pname;
repo = "libbacktrace";
rev = "9b7f216e867916594d81e8b6118f092ac3fcf704";
sha256 = "0qr624v954gnfkmpdlfk66sxz3acyfmv805rybsaggw5gz5sd1nh";
};

configureFlags = [
"--enable-static=${yesno enableStatic}"
"--enable-shared=${yesno enableShared}"
(lib.enableFeature enableStatic "static")
(lib.enableFeature enableShared "shared")
];

passthru = {
updateScript = unstableGitUpdater { };
};

meta = with lib; {
description = "A C library that may be linked into a C/C++ program to produce symbolic backtraces";
homepage = "https://github.com/ianlancetaylor/libbacktrace";
Expand Down

0 comments on commit f37d97b

Please sign in to comment.