diff --git a/pkgs/development/tools/rust/svd2rust/cargo-lock.patch b/pkgs/development/tools/rust/svd2rust/cargo-lock.patch new file mode 100644 index 00000000000..5cd1f685fc1 --- /dev/null +++ b/pkgs/development/tools/rust/svd2rust/cargo-lock.patch @@ -0,0 +1,283 @@ +diff --git a/Cargo.lock b/Cargo.lock +new file mode 100644 +--- /dev/null ++++ b/Cargo.lock +@@ -0,0 +1,278 @@ ++[[package]] ++name = "ansi_term" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "atty" ++version = "0.2.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", ++ "termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "autocfg" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "backtrace" ++version = "0.3.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)", ++ "cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", ++ "rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", ++ "winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "backtrace-sys" ++version = "0.1.28" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)", ++ "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "bitflags" ++version = "0.7.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "bitflags" ++version = "1.0.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "cast" ++version = "0.2.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "cc" ++version = "1.0.28" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "cfg-if" ++version = "0.1.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "clap" ++version = "2.32.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)", ++ "bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ++ "strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ++ "vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "either" ++version = "1.5.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "error-chain" ++version = "0.11.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "inflections" ++version = "1.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "libc" ++version = "0.2.46" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "quote" ++version = "0.3.15" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "redox_syscall" ++version = "0.1.50" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "redox_termios" ++version = "0.1.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "rustc-demangle" ++version = "0.1.13" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "strsim" ++version = "0.7.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "svd-parser" ++version = "0.6.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "xmltree 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "svd2rust" ++version = "0.14.0" ++dependencies = [ ++ "cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", ++ "clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "inflections 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ++ "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", ++ "svd-parser 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "syn" ++version = "0.11.11" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", ++ "synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)", ++ "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "synom" ++version = "0.11.3" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "termion" ++version = "1.5.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)", ++ "redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)", ++ "redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "textwrap" ++version = "0.10.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "unicode-width" ++version = "0.1.5" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "unicode-xid" ++version = "0.0.4" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "vec_map" ++version = "0.8.1" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "winapi" ++version = "0.3.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ++ "winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "winapi-i686-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "winapi-x86_64-pc-windows-gnu" ++version = "0.4.0" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++ ++[[package]] ++name = "xml-rs" ++version = "0.3.6" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[[package]] ++name = "xmltree" ++version = "0.3.2" ++source = "registry+https://github.com/rust-lang/crates.io-index" ++dependencies = [ ++ "xml-rs 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", ++] ++ ++[metadata] ++"checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" ++"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652" ++"checksum autocfg 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4e5f34df7a019573fb8bdc7e24a2bfebe51a2a1d6bfdbaeccedb3c41fc574727" ++"checksum backtrace 0.3.13 (registry+https://github.com/rust-lang/crates.io-index)" = "b5b493b66e03090ebc4343eb02f94ff944e0cbc9ac6571491d170ba026741eb5" ++"checksum backtrace-sys 0.1.28 (registry+https://github.com/rust-lang/crates.io-index)" = "797c830ac25ccc92a7f8a7b9862bde440715531514594a6154e3d4a54dd769b6" ++"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d" ++"checksum bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "228047a76f468627ca71776ecdebd732a3423081fcf5125585bcd7c49886ce12" ++"checksum cast 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "926013f2860c46252efceabb19f4a6b308197505082c609025aa6706c011d427" ++"checksum cc 1.0.28 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4a8b715cb4597106ea87c7c84b2f1d452c7492033765df7f32651e66fcf749" ++"checksum cfg-if 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "082bb9b28e00d3c9d39cc03e64ce4cea0f1bb9b3fde493f0cbc008472d22bdf4" ++"checksum clap 2.32.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b957d88f4b6a63b9d70d5f454ac8011819c6efa7727858f458ab71c756ce2d3e" ++"checksum either 1.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "3be565ca5c557d7f59e7cfcf1844f9e3033650c929c6566f511e8005f205c1d0" ++"checksum error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ff511d5dc435d703f4971bc399647c9bc38e20cb41452e3b9feb4765419ed3f3" ++"checksum inflections 1.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a257582fdcde896fd96463bf2d40eefea0580021c0712a0e2b028b60b47a837a" ++"checksum libc 0.2.46 (registry+https://github.com/rust-lang/crates.io-index)" = "023a4cd09b2ff695f9734c1934145a315594b7986398496841c7031a5a1bbdbd" ++"checksum quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "7a6e920b65c65f10b2ae65c831a81a073a89edd28c7cce89475bff467ab4167a" ++"checksum redox_syscall 0.1.50 (registry+https://github.com/rust-lang/crates.io-index)" = "52ee9a534dc1301776eff45b4fa92d2c39b1d8c3d3357e6eb593e0d795506fc2" ++"checksum redox_termios 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7e891cfe48e9100a70a3b6eb652fef28920c117d366339687bd5576160db0f76" ++"checksum rustc-demangle 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "adacaae16d02b6ec37fdc7acfcddf365978de76d1983d3ee22afc260e1ca9619" ++"checksum strsim 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bb4f380125926a99e52bc279241539c018323fab05ad6368b56f93d9369ff550" ++"checksum svd-parser 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f22b4579485b26262f36086d6b74903befc043a57f8377dfcf05bcf5335cb251" ++"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad" ++"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6" ++"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096" ++"checksum textwrap 0.10.0 (registry+https://github.com/rust-lang/crates.io-index)" = "307686869c93e71f94da64286f9a9524c0f308a9e1c87a583de8e9c9039ad3f6" ++"checksum unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "882386231c45df4700b275c7ff55b6f3698780a650026380e72dabe76fa46526" ++"checksum unicode-xid 0.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc" ++"checksum vec_map 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" ++"checksum winapi 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "92c1eb33641e276cfa214a0522acad57be5c56b10cb348b3c5117db75f3ac4b0" ++"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" ++"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" ++"checksum xml-rs 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "7ec6c39eaa68382c8e31e35239402c0a9489d4141a8ceb0c716099a0b515b562" ++"checksum xmltree 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "472a9d37c7c53ab2391161df5b89b1f3bf76dab6ab150d7941ecbdd832282082" diff --git a/pkgs/development/tools/rust/svd2rust/default.nix b/pkgs/development/tools/rust/svd2rust/default.nix new file mode 100644 index 00000000000..2d61ac318e1 --- /dev/null +++ b/pkgs/development/tools/rust/svd2rust/default.nix @@ -0,0 +1,28 @@ +{ stdenv, fetchFromGitHub, rustPlatform }: + +with rustPlatform; + +buildRustPackage rec { + name = "svd2rust-${version}"; + version = "0.14.0"; + + src = fetchFromGitHub { + owner = "rust-embedded"; + repo = "svd2rust"; + rev = "v${version}"; + sha256 = "1a0ldmjkhyv5c52gcq8p8avkj0cgj1b367w6hm85bxdf5j4y8rra"; + }; + cargoPatches = [ ./cargo-lock.patch ]; + + cargoSha256 = "0wsiaa6q9hr9x1cbg6sc8ajg846jjci5qwhdga4d408fmqav72ih"; + + # doc tests fail due to missing dependency + doCheck = false; + + meta = with stdenv.lib; { + description = "Generate Rust register maps (`struct`s) from SVD files"; + homepage = https://github.com/rust-embedded/svd2rust; + license = with licenses; [ mit asl20 ]; + platforms = platforms.all; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a65d6d1adf3..aa94b3cc911 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7553,6 +7553,8 @@ in metaBuildEnv = callPackage ../development/compilers/meta-environment/meta-build-env { }; + svd2rust = callPackage ../development/tools/rust/svd2rust { }; + swift = callPackage ../development/compilers/swift { }; swiProlog = callPackage ../development/compilers/swi-prolog { };