Created
March 23, 2019 23:09
-
-
Save haslersn/f93c639df8beecfad5c2e2e895a9304f to your computer and use it in GitHub Desktop.
Does work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ pkgsPath ? <nixpkgs>, crossSystem ? null }: | |
let | |
mozOverlay = import ( | |
builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz | |
); | |
pkgs = import pkgsPath { | |
overlays = [ mozOverlay ]; | |
inherit crossSystem; | |
}; | |
targets = [ pkgs.stdenv.targetPlatform.config ]; | |
openssl = pkgs.openssl_1_1 or pkgs.openssl_1_1_0; | |
in | |
with pkgs; | |
stdenv.mkDerivation { | |
name = "smart_crest"; | |
# build time dependencies targeting the build platform | |
depsBuildBuild = [ | |
buildPackages.stdenv.cc | |
]; | |
HOST_CC = "cc"; | |
# build time dependencies targeting the host platform | |
nativeBuildInputs = [ | |
(buildPackages.buildPackages.latest.rustChannels.nightly.rust.override { inherit targets; }) | |
buildPackages.buildPackages.rustfmt | |
buildPackages.buildPackages.pkgconfig | |
python2 | |
]; | |
shellHook = '' | |
export RUSTFLAGS="-C linker=$CC" | |
''; | |
CARGO_BUILD_TARGET = targets; | |
# run time dependencies | |
buildInputs = [ | |
pcsclite.dev | |
]; | |
OPENSSL_DIR = openssl.dev; | |
OPENSSL_LIB_DIR = "${openssl.out}/lib"; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment