From 0139cd56214c5d378ac9e3f98f9d9ab51f2394f5 Mon Sep 17 00:00:00 2001 From: Daiderd Jordan Date: Sat, 25 Apr 2020 13:34:26 +0200 Subject: [PATCH] move carnix files to workspace --- ofborg/Cargo.nix => Cargo.nix | 35 +++++++++++++++++++++++-- ofborg/crates-io.list => crates-io.list | 0 ofborg/crates-io.nix => crates-io.nix | 0 default.nix | 4 +-- nix/update-carnix.sh | 2 -- ofborg/Cargo.toml | 2 +- 6 files changed, 36 insertions(+), 7 deletions(-) rename ofborg/Cargo.nix => Cargo.nix (92%) rename ofborg/crates-io.list => crates-io.list (100%) rename ofborg/crates-io.nix => crates-io.nix (100%) diff --git a/ofborg/Cargo.nix b/Cargo.nix similarity index 92% rename from ofborg/Cargo.nix rename to Cargo.nix index 506622a..eecf7fc 100644 --- a/ofborg/Cargo.nix +++ b/Cargo.nix @@ -112,7 +112,8 @@ rec { version = "0.1.8"; authors = [ "Graham Christensen " ]; edition = "2018"; - src = include [ "Cargo.toml" "Cargo.lock" "src" "test-srcs" "build.rs" ] ./.; + src = include [ "Cargo.toml" "src" "test-srcs" "build.rs" ] ./.; + 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 " ]; + 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"; diff --git a/ofborg/crates-io.list b/crates-io.list similarity index 100% rename from ofborg/crates-io.list rename to crates-io.list diff --git a/ofborg/crates-io.nix b/crates-io.nix similarity index 100% rename from ofborg/crates-io.nix rename to crates-io.nix diff --git a/default.nix b/default.nix index 8772120..970daa5 100644 --- a/default.nix +++ b/default.nix @@ -10,8 +10,8 @@ let }; }; - drv = ((pkgs.callPackage ./ofborg/Cargo.nix { - cratesIO = pkgs.callPackage ./ofborg/crates-io.nix {}; + drv = ((pkgs.callPackage ./Cargo.nix { + cratesIO = pkgs.callPackage ./crates-io.nix {}; }).ofborg {}).override { release = false; }; src = stripDeps (drv.override ofborgOverrides); diff --git a/nix/update-carnix.sh b/nix/update-carnix.sh index 7cf3cd2..d5da7ca 100755 --- a/nix/update-carnix.sh +++ b/nix/update-carnix.sh @@ -2,7 +2,5 @@ set -eu -cd ofborg - cargo build carnix generate-nix --src . diff --git a/ofborg/Cargo.toml b/ofborg/Cargo.toml index 4a49573..dd0a422 100644 --- a/ofborg/Cargo.toml +++ b/ofborg/Cargo.toml @@ -2,7 +2,7 @@ name = "ofborg" version = "0.1.8" authors = ["Graham Christensen "] -include = ["Cargo.toml", "Cargo.lock", "src", "test-srcs", "build.rs"] +include = ["Cargo.toml", "src", "test-srcs", "build.rs"] build = "build.rs" edition = "2018"