From 3f13cb39a904d5a4d235ba9cdee026c95e8802ba Mon Sep 17 00:00:00 2001 From: Atemu Date: Sat, 29 May 2021 19:25:16 +0200 Subject: [PATCH 1/3] btrfs-progs: nixpkgs-fmt --- .../tools/filesystems/btrfs-progs/default.nix | 29 ++++++++++++++++--- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/filesystems/btrfs-progs/default.nix b/pkgs/tools/filesystems/btrfs-progs/default.nix index aad633f3ba461..43b110bc5e615 100644 --- a/pkgs/tools/filesystems/btrfs-progs/default.nix +++ b/pkgs/tools/filesystems/btrfs-progs/default.nix @@ -1,5 +1,20 @@ -{ lib, stdenv, fetchurl, pkg-config, attr, acl, zlib, libuuid, e2fsprogs, lzo -, asciidoc, xmlto, docbook_xml_dtd_45, docbook_xsl, libxslt, zstd, python3 +{ lib +, stdenv +, fetchurl +, pkg-config +, attr +, acl +, zlib +, libuuid +, e2fsprogs +, lzo +, asciidoc +, xmlto +, docbook_xml_dtd_45 +, docbook_xsl +, libxslt +, zstd +, python3 }: stdenv.mkDerivation rec { @@ -12,8 +27,14 @@ stdenv.mkDerivation rec { }; nativeBuildInputs = [ - pkg-config asciidoc xmlto docbook_xml_dtd_45 docbook_xsl libxslt - python3 python3.pkgs.setuptools + pkg-config + asciidoc + xmlto + docbook_xml_dtd_45 + docbook_xsl + libxslt + python3 + python3.pkgs.setuptools ]; buildInputs = [ attr acl zlib libuuid e2fsprogs lzo zstd python3 ]; From adf59f1d6dd5f60dc812258f891fa761c934a52c Mon Sep 17 00:00:00 2001 From: Atemu Date: Sun, 30 May 2021 17:14:09 +0200 Subject: [PATCH 2/3] btrfs-progs: remove ancient gcc workaround If you really need to build btrfs-progs with gcc 4.8 on ARM, add this back with optionalString and substituteInPlace. --- pkgs/tools/filesystems/btrfs-progs/default.nix | 4 ---- 1 file changed, 4 deletions(-) diff --git a/pkgs/tools/filesystems/btrfs-progs/default.nix b/pkgs/tools/filesystems/btrfs-progs/default.nix index 43b110bc5e615..7984923f3bdb9 100644 --- a/pkgs/tools/filesystems/btrfs-progs/default.nix +++ b/pkgs/tools/filesystems/btrfs-progs/default.nix @@ -42,10 +42,6 @@ stdenv.mkDerivation rec { # 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 ''; From 5604558e8c6d02d9ce55750749eb7246a68878b6 Mon Sep 17 00:00:00 2001 From: Atemu Date: Sat, 29 May 2021 19:34:30 +0200 Subject: [PATCH 3/3] btrfs-progs: build from source, not release tarball --- pkgs/tools/filesystems/btrfs-progs/default.nix | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/pkgs/tools/filesystems/btrfs-progs/default.nix b/pkgs/tools/filesystems/btrfs-progs/default.nix index 7984923f3bdb9..43520f5e8529f 100644 --- a/pkgs/tools/filesystems/btrfs-progs/default.nix +++ b/pkgs/tools/filesystems/btrfs-progs/default.nix @@ -1,6 +1,8 @@ { lib , stdenv -, fetchurl +, fetchFromGitHub +, autoconf +, automake , pkg-config , attr , acl @@ -21,12 +23,16 @@ 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 = [ + autoconf + automake pkg-config asciidoc xmlto @@ -42,6 +48,10 @@ stdenv.mkDerivation rec { # for python cross-compiling _PYTHON_HOST_PLATFORM = stdenv.hostPlatform.config; + preConfigure = '' + sh autogen.sh + ''; + postInstall = '' install -v -m 444 -D btrfs-completion $out/share/bash-completion/completions/btrfs '';