nixpkgs/pkgs/tools/filesystems/btrfs-progs/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

42 lines
1.3 KiB
Nix

{ lib, stdenv, fetchurl, pkgconfig, attr, acl, zlib, libuuid, e2fsprogs, lzo
, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt, zstd, python3
}:
stdenv.mkDerivation rec {
pname = "btrfs-progs";
version = "5.9";
src = fetchurl {
url = "mirror://kernel/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${version}.tar.xz";
sha256 = "14d7hz07kfczfgmy1ixkgccjn393gpkjn7givz5kwxddcnk5i4xq";
};
nativeBuildInputs = [
pkgconfig asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt
python3 python3.pkgs.setuptools
];
buildInputs = [ attr acl zlib libuuid e2fsprogs lzo zstd python3 ];
# for python cross-compiling
_PYTHON_HOST_PLATFORM = stdenv.hostPlatform.config;
# gcc bug with -O1 on ARM with gcc 4.8
# This should be fine on all platforms so apply universally
postPatch = "sed -i s/-O1/-O2/ configure";
postInstall = ''
install -v -m 444 -D btrfs-completion $out/share/bash-completion/completions/btrfs
'';
configureFlags = stdenv.lib.optional stdenv.hostPlatform.isMusl "--disable-backtrace";
meta = with lib; {
description = "Utilities for the btrfs filesystem";
homepage = "https://btrfs.wiki.kernel.org/";
license = licenses.gpl2;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
};
}