Merge pull request #471 from LnL7/carnix-workspace

carnix workspace
This commit is contained in:
Graham Christensen 2020-04-25 08:49:14 -04:00 committed by GitHub
commit bef27f6ab9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 51 additions and 17 deletions

View file

@ -112,7 +112,8 @@ rec {
version = "0.1.8";
authors = [ "Graham Christensen <graham@grahamc.com>" ];
edition = "2018";
src = include [ "Cargo.toml" "Cargo.lock" "src" "test-srcs" "build.rs" ] ./.;
src = include [ "Cargo.toml" "ofborg" ] ./.;
workspace_member = "ofborg";
build = "build.rs";
dependencies = mapFeatures features ([
(crates."amqp"."${deps."ofborg"."0.1.8"."amqp"}" deps)
@ -183,12 +184,38 @@ rec {
];
# end
# ofborg-simple-build-0.1.0
crates.ofborg_simple_build."0.1.0" = deps: { features?(features_.ofborg_simple_build."0.1.0" deps {}) }: buildRustCrate {
crateName = "ofborg-simple-build";
version = "0.1.0";
authors = [ "Daiderd Jordan <daiderd@gmail.com>" ];
edition = "2018";
src = include [ "Cargo.toml" "ofborg-simple-build" ] ./.;
workspace_member = "ofborg-simple-build";
dependencies = mapFeatures features ([
(cratesIO.crates."log"."${deps."ofborg_simple_build"."0.1.0"."log"}" deps)
(crates."ofborg"."${deps."ofborg_simple_build"."0.1.0"."ofborg"}" deps)
]);
};
features_.ofborg_simple_build."0.1.0" = deps: f: updateFeatures f (rec {
log."${deps.ofborg_simple_build."0.1.0".log}".default = true;
ofborg."${deps.ofborg_simple_build."0.1.0".ofborg}".default = true;
ofborg_simple_build."0.1.0".default = (f.ofborg_simple_build."0.1.0".default or true);
}) [
(cratesIO.features_.log."${deps."ofborg_simple_build"."0.1.0"."log"}" deps)
(features_.ofborg."${deps."ofborg_simple_build"."0.1.0"."ofborg"}" deps)
];
# end
};
ofborg = crates.crates.ofborg."0.1.8" deps;
__all = [ (ofborg {}) ];
ofborg_simple_build = crates.crates.ofborg_simple_build."0.1.0" deps;
__all = [ (ofborg {}) (ofborg_simple_build {}) ];
deps.aho_corasick."0.5.3" = {
memchr = "0.1.11";
};
@ -389,6 +416,10 @@ rec {
tempfile = "2.2.0";
uuid = "0.4.0";
};
deps.ofborg_simple_build."0.1.0" = {
log = "0.3.8";
ofborg = "0.1.8";
};
deps.openssl."0.9.24" = {
bitflags = "0.9.1";
foreign_types = "0.3.2";

View file

@ -1,20 +1,13 @@
{ pkgs ? import ./nix { overlays = [ (import ./nix/overlay.nix) ]; } }:
let
ofborgOverrides = {
crateOverrides = pkgs.defaultCrateOverrides // {
ofborg = attrs: {
buildInputs = pkgs.lib.optional pkgs.stdenv.isDarwin
pkgs.darwin.apple_sdk.frameworks.Security;
};
};
ofborgCrates = pkgs.callPackage ./Cargo.nix {
cratesIO = pkgs.callPackage ./crates-io.nix {};
};
drv = ((pkgs.callPackage ./ofborg/Cargo.nix {
cratesIO = pkgs.callPackage ./ofborg/crates-io.nix {};
}).ofborg {}).override { release = false; };
drv = ofborgCrates.ofborg {};
src = stripDeps (drv.override ofborgOverrides);
src = stripDeps (drv.override { release = pkgs.stdenv.isDarwin; });
stripDeps = pkg: pkgs.runCommand "${pkg.name}-deps-stripped" {}
''
@ -27,6 +20,8 @@ let
in
{
ofborg.simple-build = ofborgCrates.ofborg_simple_build {};
ofborg.rs = pkgs.runCommand "ofborg-rs-symlink-compat" { inherit src; } ''
mkdir -p $out/bin
for f in $(find $src -type f); do

View file

@ -1,5 +1,14 @@
(self: super: {
(self: super:
{
defaultCrateOverrides = super.defaultCrateOverrides // {
ofborg = attrs: {
buildInputs = with self.darwin.apple_sdk.frameworks;
super.lib.optional super.stdenv.isDarwin Security;
};
ofborg-simple-build = attrs: {
buildInputs = with self.darwin.apple_sdk.frameworks;
super.lib.optional super.stdenv.isDarwin Security;
};
openssl-sys = attrs: {
buildInputs = [ self.openssl_1_0_2 ];
nativeBuildInputs = [ self.pkgconfig ];

View file

@ -2,7 +2,5 @@
set -eu
cd ofborg
cargo build
carnix generate-nix --src .

View file

@ -2,6 +2,7 @@
name = "ofborg-simple-build"
version = "0.1.0"
authors = ["Daiderd Jordan <daiderd@gmail.com>"]
include = ["Cargo.toml", "ofborg-simple-build"] # TODO remove when carnix is fixed
edition = "2018"
[dependencies]

View file

@ -2,7 +2,7 @@
name = "ofborg"
version = "0.1.8"
authors = ["Graham Christensen <graham@grahamc.com>"]
include = ["Cargo.toml", "Cargo.lock", "src", "test-srcs", "build.rs"]
include = ["Cargo.toml", "ofborg"] # TODO remove when carnix is fixed
build = "build.rs"
edition = "2018"