Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

btrfs-progs: build from source, not release tarball #124974

Draft
wants to merge 3 commits into
base: staging
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
47 changes: 37 additions & 10 deletions pkgs/tools/filesystems/btrfs-progs/default.nix
Original file line number Diff line number Diff line change
@@ -1,29 +1,56 @@
{ lib, stdenv, fetchurl, pkg-config, attr, acl, zlib, libuuid, e2fsprogs, lzo
, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt, zstd, python3
{ lib
, stdenv
, fetchFromGitHub
, autoconf
, automake
, pkg-config
, 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.12.1";

src = fetchurl {
url = "mirror://kernel/linux/kernel/people/kdave/btrfs-progs/btrfs-progs-v${version}.tar.xz";
sha256 = "sha256-lQhG/qRU+0scOfD6RUmDZEVy35HfXAYEezNb8tVHN1k=";
src = fetchFromGitHub {
owner = "kdave";
repo = pname;
rev = "v${version}";
sha256 = "sha256-rC9X4XzmT6PUDCajLkhuG85nRjJTqQ4mvevF4HWgHNE=";
};

nativeBuildInputs = [
pkg-config asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt
python3 python3.pkgs.setuptools
autoconf
automake
pkg-config
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";
preConfigure = ''
sh autogen.sh
'';

postInstall = ''
install -v -m 444 -D btrfs-completion $out/share/bash-completion/completions/btrfs
Expand Down