Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add version 0.13.1 #7

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 26 additions & 18 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -47,20 +47,19 @@ let
self.glibc.bin
self.patchelf
self.which
self.autoPatchelfHook
];
buildInputs = [
self.stdenv.cc.cc.lib
self.libunwind
];
# Use `find $(dfx cache show) -type f -executable -print` on macOS to
# help discover what to symlink.
installPhase = ''
export HOME=$TMP

${self.lib.optionalString self.stdenv.isLinux ''
local LD_LINUX_SO=$(ldd $(which iconv)|grep ld-linux-x86|cut -d' ' -f3)
local IS_STATIC=$(ldd ./dfx | grep 'not a dynamic executable')
local USE_LIB64=$(ldd ./dfx | grep '/lib64/ld-linux-x86-64.so.2')
chmod +rw ./dfx
test -n "$IS_STATIC" || test -z "$USE_LIB64" || patchelf --set-interpreter "$LD_LINUX_SO" ./dfx
''}

autoPatchelf .
./dfx cache install

local CACHE_DIR="$out/.cache/dfinity/versions/${version}"
Expand All @@ -69,19 +68,13 @@ let

mkdir -p $out/bin

for binary in dfx ic-ref ic-starter icx-proxy mo-doc mo-ide moc replica; do
${self.lib.optionalString self.stdenv.isLinux ''
local BINARY="$CACHE_DIR/$binary"
test -f "$BINARY" || continue
local IS_STATIC=$(ldd "$BINARY" | grep 'not a dynamic executable')
local USE_LIB64=$(ldd "$BINARY" | grep '/lib64/ld-linux-x86-64.so.2')
chmod +rw "$BINARY"
test -n "$IS_STATIC" || test -z "$USE_LIB64" || patchelf --set-interpreter "$LD_LINUX_SO" "$BINARY"
''}
addAutoPatchelfSearchPath $CACHE_DIR

for binary in dfx ic-ref ic-starter icx-proxy mo-doc mo-ide moc replica ; do
ln -s $CACHE_DIR/$binary $out/bin/$binary
done

wrapProgram $CACHE_DIR/dfx --set DFX_CONFIG_ROOT $out
wrapProgram $CACHE_DIR/dfx --set DFX_CACHE_ROOT $out
rm $out/bin/dfx
ln -s $CACHE_DIR/dfx $out/bin/dfx
'';
Expand Down Expand Up @@ -140,13 +133,28 @@ let
version = "0.9.2";
};

sdk-0_15_0 = makeVersion {
systems = {
"x86_64-darwin" = {
sha256 = self.lib.fakeSha256;
# sha256 = "UITKzQ9Xzlsy00DU72Ah2VH8736eQeW8GL6hzJHTaYA=";
};
"x86_64-linux" = {
# sha256 = self.lib.fakeSha256;
sha256 = "sha256-P24J31kL9eNEtiDpegGatLdMtnj2otxrKRddWEXe7kc=";
};
};
version = "0.15.0";
};

# https://sdk.dfinity.org/manifest.json
versions = {
latest = sdk-0_8_4;
latest = sdk-0_15_0;
"0.6.21" = sdk-0_6_21;
"0.7.0-beta.8" = sdk-0_7_0-beta_8;
"0.8.4" = sdk-0_8_4;
"0.9.2" = sdk-0_9_2;
"0.15.0" = sdk-0_15_0;
};
in
versions // { inherit makeVersion; }
Expand Down
7 changes: 4 additions & 3 deletions examples/flake/flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.