Merge pull request #287 from LnL7/darwin-security

add back Security on darwin and cleanup expression
This commit is contained in:
Graham Christensen 2018-12-04 16:10:44 -05:00 committed by GitHub
commit 931f6ae003
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,6 +1,21 @@
{ pkgs ? import ./nix {}
}:
{ pkgs ? import ./nix {} }:
let
ofborgOverrides = {
crateOverrides = pkgs.defaultCrateOverrides // {
ofborg = attrs: {
buildInputs = pkgs.lib.optional pkgs.stdenv.isDarwin
pkgs.darwin.apple_sdk.frameworks.Security;
};
};
};
drv = (pkgs.callPackage ./ofborg/Cargo.nix {
cratesIO = pkgs.callPackage ./ofborg/crates-io.nix {};
}).ofborg {};
src = stripDeps (drv.override ofborgOverrides);
stripDeps = pkg: pkgs.runCommand "${pkg.name}-deps-stripped" {}
''
cp -r ${pkg} $out
@ -9,14 +24,10 @@ let
find $out/bin -name '*.d' -delete
chmod -R a-w $out
'';
in {
ofborg.rs = let
drv = (pkgs.callPackage ./ofborg/Cargo.nix {
cratesIO = pkgs.callPackage ./ofborg/crates-io.nix {};
}).ofborg {};
in pkgs.runCommand "ofborg-rs-symlink-compat" {
src = stripDeps drv;
} ''
in
{
ofborg.rs = pkgs.runCommand "ofborg-rs-symlink-compat" { inherit src; } ''
mkdir -p $out/bin
for f in $(find $src -type f); do
bn=$(basename "$f")