From a06781877fc7f91016e20c313a2630bf3e5e791f Mon Sep 17 00:00:00 2001 From: georgewhewell Date: Sat, 1 Apr 2017 18:38:40 +0100 Subject: [PATCH] fwup: init at 0.14.2 --- lib/maintainers.nix | 1 + pkgs/tools/misc/fwup/default.nix | 36 +++++++++++++++++++ .../misc/fwup/fix-testrunner-darwin.patch | 25 +++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 4 files changed, 64 insertions(+) create mode 100644 pkgs/tools/misc/fwup/default.nix create mode 100644 pkgs/tools/misc/fwup/fix-testrunner-darwin.patch diff --git a/lib/maintainers.nix b/lib/maintainers.nix index e31a193a77b8..b264938ea17c 100644 --- a/lib/maintainers.nix +++ b/lib/maintainers.nix @@ -196,6 +196,7 @@ garrison = "Jim Garrison "; gavin = "Gavin Rogers "; gebner = "Gabriel Ebner "; + georgewhewell = "George Whewell "; gilligan = "Tobias Pflug "; giogadi = "Luis G. Torres "; gleber = "Gleb Peregud "; diff --git a/pkgs/tools/misc/fwup/default.nix b/pkgs/tools/misc/fwup/default.nix new file mode 100644 index 000000000000..5d2b96d3261a --- /dev/null +++ b/pkgs/tools/misc/fwup/default.nix @@ -0,0 +1,36 @@ +{ stdenv, lib, fetchFromGitHub, autoreconfHook, makeWrapper, pkgconfig +, zlib, lzma, bzip2, mtools, dosfstools, zip, unzip, libconfuse, libsodium +, libarchive, darwin, coreutils }: + +stdenv.mkDerivation rec { + name = "fwup-${version}"; + version = "0.14.2"; + + src = fetchFromGitHub { + owner = "fhunleth"; + repo = "fwup"; + rev = "v${version}"; + sha256 = "0ddyiprq4qnqpdhh48bivl8c5yrh21p4r99qs0d1rjiwx5h9p21l"; + }; + + doCheck = true; + patches = lib.optional stdenv.isDarwin [ ./fix-testrunner-darwin.patch ]; + + nativeBuildInputs = [ pkgconfig autoreconfHook makeWrapper ]; + buildInputs = [ zlib lzma bzip2 libconfuse libsodium libarchive ] + ++ lib.optionals stdenv.isDarwin [ + darwin.apple_sdk.frameworks.DiskArbitration + ]; + propagatedBuildInputs = [ zip unzip mtools dosfstools coreutils ]; + + # segfaults on darwin without + NIX_LDFLAGS = lib.optional stdenv.isDarwin "-F/System/Library/Frameworks"; + + meta = with stdenv.lib; { + description = "Configurable embedded Linux firmware update creator and runner"; + homepage = https://github.com/fhunleth/fwup; + license = licenses.asl20; + maintainers = [ maintainers.georgewhewell ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/tools/misc/fwup/fix-testrunner-darwin.patch b/pkgs/tools/misc/fwup/fix-testrunner-darwin.patch new file mode 100644 index 000000000000..b04b436ff5b1 --- /dev/null +++ b/pkgs/tools/misc/fwup/fix-testrunner-darwin.patch @@ -0,0 +1,25 @@ +diff --git a/tests/common-orig.sh b/tests/common.sh +index 1f2673f..79dcf74 100755 +--- a/tests/common-orig.sh ++++ b/tests/common.sh +@@ -21,20 +21,6 @@ else + fi + + case "$HOST_OS" in +- Darwin) +- # BSD stat +- STAT_FILESIZE_FLAGS="-f %z" +- +- # Not -d? +- BASE64_DECODE=-D +- +- READLINK=/usr/local/bin/greadlink +- [ -e $READLINK ] || ( echo "Please run 'brew install coreutils' to install greadlink"; exit 1 ) +- [ -e /usr/local/bin/mdir ] || ( echo "Please run 'brew install mtools' to install mdir"; exit 1 ) +- +- FSCK_FAT=fsck_msdos +- TIMEOUT=gtimeout +- ;; + FreeBSD|NetBSD|OpenBSD|DragonFly) + # BSD stat + STAT_FILESIZE_FLAGS="-f %z" diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c5177932fda6..fad4b9036878 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -952,6 +952,8 @@ with pkgs; fsmark = callPackage ../tools/misc/fsmark { }; + fwup = callPackage ../tools/misc/fwup { }; + fzf = callPackage ../tools/misc/fzf { }; fzy = callPackage ../tools/misc/fzy { };