forked from justinwoo/easy-purescript-nix
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpurp.nix
31 lines (24 loc) · 828 Bytes
/
purp.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
{ pkgs ? import <nixpkgs> {} }:
let dynamic-linker = pkgs.stdenv.cc.bintools.dynamicLinker;
in pkgs.stdenv.mkDerivation rec {
name = "purp";
version = "0.3.0.0";
src = pkgs.fetchurl {
url = "https://github.com/justinwoo/purp/releases/download/${version}/linux.tar.gz";
sha256 = "0sz9mc5rdj59kxq370dffd2k4zamgxj8m3hr8d8kmzzrmpp4qk66";
};
buildInputs = [ pkgs.gmp ];
libPath = pkgs.lib.makeLibraryPath buildInputs;
dontStrip = true;
unpackPhase = ''
mkdir -p $out/bin
tar xf $src -C $out/bin
PURP=$out/bin/purp
chmod u+w $PURP
patchelf --interpreter ${dynamic-linker} --set-rpath ${libPath} $PURP
chmod u-w $PURP
mkdir -p $out/etc/bash_completion.d/
$PURP --bash-completion-script $PURP > $out/etc/bash_completion.d/purp-completion.bash
'';
dontInstall = true;
}