Skip to content

Commit

Permalink
Add ic-repl
Browse files Browse the repository at this point in the history
  • Loading branch information
ninegua committed Feb 17, 2022
1 parent 6e9b645 commit fe8d9e8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
9 changes: 9 additions & 0 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
with pkgs;
let
download = callPackage ./nix/download.nix;
ic-repl = download (rec {
name = "ic-repl";
version = "0.1.3";
url =
"https://github.com/chenyan2002/ic-repl/releases/download/${version}/ic-repl-linux64";
sha256 = "11ajgkyfr7wprai3kg0sk3qrwdxsr5hz94lm8pkvshnifd7gmb24";
buildInputs = [ openssl.out ];
});
didc = download (rec {
name = "didc";
version = "linux-static-build";
Expand Down Expand Up @@ -82,6 +90,7 @@ in stdenv.mkDerivation {
quill
vessel
xxd
ic-repl
#rustc
#cargo
];
Expand Down
16 changes: 13 additions & 3 deletions nix/download.nix
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
{ name, version, url, sha256, fetchurl, stdenv }:
stdenv.mkDerivation ({
{ name, version, url, sha256, lib, fetchurl, stdenv, buildInputs ? [], findutils }:
let
libPath = lib.makeLibraryPath buildInputs;
in stdenv.mkDerivation ({
inherit name version;
phases = [ "installPhase" ];
installPhase = ''
mkdir -p $out/bin
tar zxvf $src -C $out/bin 2> /dev/null || install -m 755 $src $out/bin/${name}
tar zxf $src -C $out/bin &>/dev/null || install -m 755 $src $out/bin/${name}
for file in $(${findutils}/bin/find $out/bin -type f); do
patchelf --print-interpreter $file &>/dev/null && \
echo Patching $file && \
patchelf --set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${libPath}" $file || true
done
'';
src = fetchurl { inherit url sha256; };
nationBuildInputs = [ findutils ];
inherit buildInputs;
})

0 comments on commit fe8d9e8

Please sign in to comment.