fix (?) nix build

This commit is contained in:
Jakub Kozłowski 2022-12-01 04:29:42 +01:00
parent d2d8511f54
commit 53c129591c
No known key found for this signature in database
GPG Key ID: A1DC9B6A8B59D4D6
2 changed files with 6 additions and 3 deletions

3
.gitignore vendored
View File

@ -60,3 +60,6 @@ roc_linux_x86_64.tar.gz
*.roc-format-failed
*.roc-format-failed-ast-after
*.roc-format-failed-ast-before
# nix
result

View File

@ -3,7 +3,7 @@ nixpkgsSource ? builtins.fetchTarball {
url = "https://github.com/nixos/nixpkgs/tarball/${rev}";
sha256 = "sha256-5DGKX81wIPAAiLwUmUYECpA3vop94AHHR7WmGXSsQok=";
}, pkgs ? import nixpkgsSource { }
, cargoSha256 ? "sha256-Qmriwe+xSL5/pU8oqqj5Qw6H179KYqOljWl0rpPD6MY=", }:
, cargoSha256 ? "sha256-AH/cWRbshJI2pweoz24AXcDcz/+fM6cGHJU7V9GH/w4", }:
# we only this file to release a nix package, use flake.nix for development
let
rustPlatform = pkgs.rustPlatform;
@ -78,12 +78,12 @@ in rustPlatform.buildRustPackage {
# cp: to copy str.zig,list.zig...
# wrapProgram pkgs.stdenv.cc: to make ld available for compiler/build/src/link.rs
postInstall = if pkgs.stdenv.isLinux then ''
cp -r target/x86_64-unknown-linux-gnu/release/lib/. $out/lib
cp -r target/x86_64-unknown-linux-gnu/release/lib* $out/lib
wrapProgram $out/bin/roc --set NIX_GLIBC_PATH ${nixGlibcPath} --prefix PATH : ${
pkgs.lib.makeBinPath [ pkgs.stdenv.cc ]
}
'' else ''
cp -r target/aarch64-apple-darwin/release/lib/. $out/lib
cp -r target/aarch64-apple-darwin/release/lib* $out/lib
wrapProgram $out/bin/roc --prefix PATH : ${
pkgs.lib.makeBinPath [ pkgs.stdenv.cc ]
}