forked from justinwoo/easy-purescript-nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathzephyr.nix
36 lines (28 loc) · 896 Bytes
/
zephyr.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
{ pkgs ? import <nixpkgs> {} }:
pkgs.stdenv.mkDerivation rec {
name = "zephyr";
version = "v0.2.1";
src = pkgs.fetchurl {
url = "https://github.com/coot/zephyr/releases/download/${version}/linux64.tar.gz";
sha256 = "0afcnpqabjs4b60grkcvz2hb3glpjhlnvqvpgc0zsdwaqnmcrrnk";
};
buildInputs = [
pkgs.gmp
pkgs.zlib
pkgs.ncurses5
];
libPath = pkgs.lib.makeLibraryPath buildInputs;
dontStrip = true;
unpackPhase = ''
mkdir -p $out/bin
tar xf $src --strip 1 -C $out
ZEPHYR=$out/bin/zephyr
install -D -m555 -T $out/zephyr $ZEPHYR
chmod u+w $ZEPHYR
patchelf --interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" --set-rpath ${libPath} $ZEPHYR
chmod u-w $ZEPHYR
mkdir -p $out/etc/bash_completion.d/
$ZEPHYR --bash-completion-script $ZEPHYR > $out/etc/bash_completion.d/zephyr-completion.bash
'';
dontInstall = true;
}