summary refs log tree commit diff
path: root/pkgs/tools/misc/fwup
diff options
context:
space:
mode:
authorgeorgewhewell <georgerw@gmail.com>2017-04-01 18:38:40 +0100
committergeorgewhewell <georgerw@gmail.com>2017-05-13 18:22:10 +0100
commita06781877fc7f91016e20c313a2630bf3e5e791f (patch)
treeaf672f8f7bb4b7d3b69f8ea3c296bc9add228a6b /pkgs/tools/misc/fwup
parentd8fd62d3dd659928d979dec2d4ce17601cc51b4b (diff)
downloadnixpkgs-a06781877fc7f91016e20c313a2630bf3e5e791f.tar
nixpkgs-a06781877fc7f91016e20c313a2630bf3e5e791f.tar.gz
nixpkgs-a06781877fc7f91016e20c313a2630bf3e5e791f.tar.bz2
nixpkgs-a06781877fc7f91016e20c313a2630bf3e5e791f.tar.lz
nixpkgs-a06781877fc7f91016e20c313a2630bf3e5e791f.tar.xz
nixpkgs-a06781877fc7f91016e20c313a2630bf3e5e791f.tar.zst
nixpkgs-a06781877fc7f91016e20c313a2630bf3e5e791f.zip
fwup: init at 0.14.2
Diffstat (limited to 'pkgs/tools/misc/fwup')
-rw-r--r--pkgs/tools/misc/fwup/default.nix36
-rw-r--r--pkgs/tools/misc/fwup/fix-testrunner-darwin.patch25
2 files changed, 61 insertions, 0 deletions
diff --git a/pkgs/tools/misc/fwup/default.nix b/pkgs/tools/misc/fwup/default.nix
new file mode 100644
index 00000000000..5d2b96d3261
--- /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 00000000000..b04b436ff5b
--- /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"