forked from M-Labs/nix-scripts
Compare commits
786 Commits
Author | SHA1 | Date |
---|---|---|
Sebastien Bourdeauducq | f4a1a01e2f | |
Sebastien Bourdeauducq | 3cfc45e524 | |
Sebastien Bourdeauducq | 7256e73ffa | |
Sebastien Bourdeauducq | c0e2eee49d | |
Sebastien Bourdeauducq | b72d035311 | |
Sebastien Bourdeauducq | 05be2516c6 | |
Sebastien Bourdeauducq | 98f03c4833 | |
Florian Agbuya | 02ffc97089 | |
Sebastien Bourdeauducq | 54af3e9297 | |
Sebastien Bourdeauducq | d419b3628b | |
Sebastien Bourdeauducq | 6f72969ec9 | |
Sebastien Bourdeauducq | 052da73d2b | |
Sebastien Bourdeauducq | e097cb96f5 | |
Sebastien Bourdeauducq | 5bab9a19a5 | |
Sebastien Bourdeauducq | d24244541a | |
Robert Jördens | e16033c5fe | |
Sebastien Bourdeauducq | 8da02c60da | |
Robert Jördens | d9a6bdb674 | |
Sebastien Bourdeauducq | e457e3a2d5 | |
Sebastien Bourdeauducq | 2930368075 | |
Sebastien Bourdeauducq | bd612201ed | |
Sebastien Bourdeauducq | 7a9960df69 | |
Sebastien Bourdeauducq | 48af866c61 | |
Robert Jördens | 0ddaddb1dd | |
Robert Jördens | 033e75859e | |
Sebastien Bourdeauducq | 2bf0053836 | |
Sebastien Bourdeauducq | b8bfd3752f | |
Sebastien Bourdeauducq | 70c7289e37 | |
Sebastien Bourdeauducq | a410dd9c32 | |
Sebastien Bourdeauducq | 99629db276 | |
Sebastien Bourdeauducq | f0bbc40ca6 | |
Robert Jördens | e807e7d970 | |
SingularitySurfer | a9ef893ace | |
SingularitySurfer | ff98ed88c1 | |
Sebastien Bourdeauducq | 46f6e33837 | |
Sebastien Bourdeauducq | 76f691b641 | |
Sebastien Bourdeauducq | 8e0ff1d2ff | |
Leon Riesebos | eddcdb4043 | |
Sebastien Bourdeauducq | e340fa7548 | |
Sebastien Bourdeauducq | e5bc3d4598 | |
Sebastien Bourdeauducq | 22f555e7bd | |
Sebastien Bourdeauducq | 58f30f5d87 | |
Sebastien Bourdeauducq | 85fea0ba59 | |
Sebastien Bourdeauducq | bbb883ed82 | |
Sebastien Bourdeauducq | f819d41a77 | |
Sebastien Bourdeauducq | 906093d5e7 | |
mwojcik | 04cfdb54e1 | |
mwojcik | bc460e9490 | |
Sebastien Bourdeauducq | 5cec649d42 | |
Sebastien Bourdeauducq | ab95c16fb9 | |
Sebastien Bourdeauducq | 9bfc4aae59 | |
Sebastien Bourdeauducq | 2f493ab9d3 | |
mwojcik | 3d0e51171b | |
mwojcik | 3df3b7daa0 | |
Sebastien Bourdeauducq | 0fae14a5ad | |
Sebastien Bourdeauducq | 1500722258 | |
mwojcik | 5f90f65d59 | |
Sebastien Bourdeauducq | a069c0aba3 | |
mwojcik | 778dab71a2 | |
Sebastien Bourdeauducq | 436e0d8c88 | |
Sebastien Bourdeauducq | 9a8a59c525 | |
Sebastien Bourdeauducq | eff8968d26 | |
Sebastien Bourdeauducq | a3240b8fee | |
Sebastien Bourdeauducq | 926582acbd | |
Sebastien Bourdeauducq | 300ec387e3 | |
Sebastien Bourdeauducq | c0bf6837d9 | |
Sebastien Bourdeauducq | 679cd25a68 | |
Sebastien Bourdeauducq | e8bb121ece | |
Leon Riesebos | fddbc02db7 | |
Leon Riesebos | 71fd6ed87d | |
Leon Riesebos | 0ef16d8a7d | |
Robert Jördens | 3562f6f189 | |
Sebastien Bourdeauducq | 9a3d7451df | |
Sebastien Bourdeauducq | adc49f1f1c | |
Sebastien Bourdeauducq | 90bc26adc4 | |
Sebastien Bourdeauducq | ce89fc09bb | |
Robert Jördens | b0e723d565 | |
Sebastien Bourdeauducq | 09fd2cf946 | |
Sebastien Bourdeauducq | ecf6d1258a | |
Sebastien Bourdeauducq | d532f43278 | |
Sebastien Bourdeauducq | 3994e503bb | |
Sebastien Bourdeauducq | 1bcfecb9d7 | |
Sebastien Bourdeauducq | 8cb6a0bfd8 | |
Robert Jördens | 643ce70b4c | |
Sebastien Bourdeauducq | 46e745d310 | |
Sebastien Bourdeauducq | ae16ada2e3 | |
Sebastien Bourdeauducq | 7be44217fc | |
Sebastien Bourdeauducq | 70d07a336c | |
Sebastien Bourdeauducq | f8202340ea | |
Sebastien Bourdeauducq | 2c611a924d | |
mwojcik | 70a7719874 | |
Harry Ho | 2d179ac712 | |
mwojcik | 6146aa84dd | |
Sebastien Bourdeauducq | 62c16ce859 | |
Sebastien Bourdeauducq | d739286ff5 | |
Sebastien Bourdeauducq | 45eba9809e | |
Sebastien Bourdeauducq | 575ef05cd5 | |
mwojcik | cf0d3d70e6 | |
ciciwu | 06e1c2975e | |
Sebastien Bourdeauducq | 58f0452f84 | |
Sebastien Bourdeauducq | c706b6e0f4 | |
Sebastien Bourdeauducq | 8d4ffe3a77 | |
Sebastien Bourdeauducq | 9a08799d9b | |
Sebastien Bourdeauducq | 392237b486 | |
Sebastien Bourdeauducq | 6bdf39ef1f | |
Sebastien Bourdeauducq | 2afb9c94f3 | |
Sebastien Bourdeauducq | b456cee553 | |
Sebastien Bourdeauducq | 6416764277 | |
Sebastien Bourdeauducq | 57cc7a0a33 | |
Sebastien Bourdeauducq | c16bcd74d8 | |
Sebastien Bourdeauducq | 65e9f77019 | |
Sebastien Bourdeauducq | 70086fbfe0 | |
Sebastien Bourdeauducq | 88b98ac644 | |
Sebastien Bourdeauducq | 1754b13b73 | |
Sebastien Bourdeauducq | 1899a4f818 | |
Sebastien Bourdeauducq | fcc91513ec | |
Sebastien Bourdeauducq | 07620ae716 | |
Sebastien Bourdeauducq | 3fea3066ac | |
Sebastien Bourdeauducq | 54157028c9 | |
Sebastien Bourdeauducq | 4e00857fe1 | |
Sebastien Bourdeauducq | 45c3fa1817 | |
Sebastien Bourdeauducq | 91a583c960 | |
Sebastien Bourdeauducq | 498cb074af | |
Leon Riesebos | b438bf34b8 | |
Leon Riesebos | 80969c53d4 | |
Leon Riesebos | 8f4183157e | |
Sebastien Bourdeauducq | 108309388e | |
mwojcik | 495dc7ee4e | |
Sebastien Bourdeauducq | 9d34f0d091 | |
Sebastien Bourdeauducq | be78fd8b77 | |
Sebastien Bourdeauducq | 73a895b6e9 | |
mwojcik | 43e02c4f8f | |
Sebastien Bourdeauducq | f129fda7bc | |
Sebastien Bourdeauducq | 5b65a378bf | |
Sebastien Bourdeauducq | 2bb541a6af | |
Sebastien Bourdeauducq | ff4995e9ea | |
Sebastien Bourdeauducq | e8b885d7d0 | |
Sebastien Bourdeauducq | f773b5abeb | |
Sebastien Bourdeauducq | ca6111d0f5 | |
mwojcik | c5fb1c8038 | |
Sebastien Bourdeauducq | bb1585fbbd | |
Sebastien Bourdeauducq | 8d8ea8b377 | |
Sebastien Bourdeauducq | 1319a2f536 | |
Sebastien Bourdeauducq | 367c3d5ed5 | |
Sebastien Bourdeauducq | 9a76e0fdb6 | |
Sebastien Bourdeauducq | e79318171b | |
Sebastien Bourdeauducq | c9efc20aeb | |
Sebastien Bourdeauducq | f595103f17 | |
Sebastien Bourdeauducq | 2355ba148a | |
Harry Ho | 988d411946 | |
Harry Ho | 83baea2c4b | |
Sebastien Bourdeauducq | f23be562e0 | |
Sebastien Bourdeauducq | 7bde5a0406 | |
Sebastien Bourdeauducq | dacc57af74 | |
Sebastien Bourdeauducq | 5ea1d50226 | |
Sebastien Bourdeauducq | 92d2b24e7c | |
Leon Riesebos | 162238b1f7 | |
Leon Riesebos | 7a639e4fb4 | |
Leon Riesebos | f705a9c756 | |
Leon Riesebos | c967b67aa3 | |
Sebastien Bourdeauducq | 591ef2b4a6 | |
Sebastien Bourdeauducq | f581b6a649 | |
Sebastien Bourdeauducq | f35ae55a15 | |
Sebastien Bourdeauducq | ffe1fd2274 | |
Sebastien Bourdeauducq | c8742678c4 | |
Sebastien Bourdeauducq | db1bd9d5ae | |
Leon Riesebos | 4f37c250f4 | |
Harry Ho | a00537688c | |
Harry Ho | 45181c5c56 | |
Harry Ho | 868216eb2d | |
Harry Ho | e43223532c | |
Harry Ho | 2835575ee4 | |
Sebastien Bourdeauducq | 2a87c55e62 | |
Sebastien Bourdeauducq | 8646fd8822 | |
Sebastien Bourdeauducq | f3ddd838da | |
Sebastien Bourdeauducq | 7f0c746f99 | |
Sebastien Bourdeauducq | 6c768586b3 | |
Leon Riesebos | bfced456af | |
Leon Riesebos | 18f39a0868 | |
Leon Riesebos | a3fd10cef0 | |
Leon Riesebos | a162c7a65e | |
Leon Riesebos | fb0c412bb0 | |
Drew Risinger | 005d911fb7 | |
Sebastien Bourdeauducq | b8d4da3004 | |
Sebastien Bourdeauducq | e0b1b8576f | |
Sebastien Bourdeauducq | dc1dd6e61c | |
Sebastien Bourdeauducq | ac7b8b4029 | |
Sebastien Bourdeauducq | 69ba4229d2 | |
Sebastien Bourdeauducq | 63be59a677 | |
Sebastien Bourdeauducq | bdd57d8895 | |
Sebastien Bourdeauducq | 2c146918a9 | |
Sebastien Bourdeauducq | 9c3e77446c | |
Harry Ho | a6acfdca3a | |
Sebastien Bourdeauducq | 4d6d6efb71 | |
Sebastien Bourdeauducq | 79cb6fdcf7 | |
Sebastien Bourdeauducq | 5bd75bcbd2 | |
Drew Risinger | 10e6220703 | |
Sebastien Bourdeauducq | 5f7093fd7a | |
Harry Ho | b5e19a2944 | |
Leon Riesebos | d0e8cf00fa | |
Sebastien Bourdeauducq | 548eb53ccb | |
Sebastien Bourdeauducq | 2c378060e9 | |
Sebastien Bourdeauducq | a1d134ad25 | |
Astro | 84fc1375d1 | |
Leon Riesebos | 50fb3cd8e1 | |
Sebastien Bourdeauducq | b8a803a64f | |
Sebastien Bourdeauducq | 4e9339e3a8 | |
Sebastien Bourdeauducq | f2bdeaf401 | |
Sebastien Bourdeauducq | a57b927418 | |
Sebastien Bourdeauducq | 5b2ee17cb9 | |
Sebastien Bourdeauducq | c46534d41b | |
Sebastien Bourdeauducq | 5eea3a8267 | |
Sebastien Bourdeauducq | 9806228a8c | |
Astro | bc1ffe4fbf | |
Sebastien Bourdeauducq | 0c3f5161e1 | |
Astro | 72fb469b0b | |
Sebastien Bourdeauducq | a6ea6e3666 | |
Astro | 64ee51b673 | |
Astro | 33c33d49df | |
Sebastien Bourdeauducq | d1a6c2f5db | |
Sebastien Bourdeauducq | 5c6dc61d4d | |
Sebastien Bourdeauducq | 87c2586250 | |
Sebastien Bourdeauducq | 42107ff1e9 | |
Sebastien Bourdeauducq | 0d706f000f | |
topquark12 | 29b4cb1b09 | |
topquark12 | b83f40008c | |
topquark12 | 6d0dafb722 | |
topquark12 | f1d689ae78 | |
Harry Ho | 487bf219ba | |
Astro | 4666f1aa6a | |
Astro | d149c66d05 | |
Sebastien Bourdeauducq | 3c1a84a07e | |
Astro | 70a0b8f90f | |
Astro | b0e041c716 | |
Harry Ho | 6fe5a903b9 | |
Harry Ho | 726ee7aa82 | |
Harry Ho | 21f5362b6f | |
Harry Ho | 35c2844612 | |
Sebastien Bourdeauducq | d5b5dbeeb2 | |
Sebastien Bourdeauducq | 57aca5d142 | |
David Nadlinger | 87fdb2c5ea | |
Sebastien Bourdeauducq | 58aabaaa0e | |
Sebastien Bourdeauducq | eac7f4bddb | |
Sebastien Bourdeauducq | b810407aa9 | |
Sebastien Bourdeauducq | e39f359122 | |
occheung | 049de83093 | |
Sebastien Bourdeauducq | 221d2fe793 | |
Sebastien Bourdeauducq | 8b59734705 | |
Sebastien Bourdeauducq | 360eb10ada | |
Sebastien Bourdeauducq | 4d99f4884e | |
Sebastien Bourdeauducq | 45f46f8901 | |
Sebastien Bourdeauducq | 7ee9e4f068 | |
Sebastien Bourdeauducq | 8396cfa1cb | |
Sebastien Bourdeauducq | 7a76d08cb0 | |
Astro | ce676be8e4 | |
Sebastien Bourdeauducq | 2984cff156 | |
occheung | 3cd8e64846 | |
occheung | f5145e23ee | |
occheung | 58b49c173e | |
occheung | d4c78c8d1b | |
Astro | cc6e7095f3 | |
Astro | e189ee4c8f | |
Astro | 2f4b063513 | |
Astro | 0cf2def070 | |
Astro | 22a6d5fb2e | |
Astro | 1c103ccb62 | |
Sebastien Bourdeauducq | 42df27a7fd | |
Drew Risinger | 2577aa52c0 | |
Sebastien Bourdeauducq | a45b6fc771 | |
Sebastien Bourdeauducq | 228a73fc55 | |
occheung | e97e8be246 | |
Sebastien Bourdeauducq | 2814292f05 | |
Robert Jördens | cefb3ce2f2 | |
Robert Jördens | 2f2ed2b68e | |
Robert Jördens | 718230f12a | |
Drew Risinger | ca28925120 | |
Drew Risinger | beb99234fe | |
Sebastien Bourdeauducq | f072c46ee3 | |
occheung | abf17296c8 | |
occheung | 755f36ecdf | |
Sebastien Bourdeauducq | 0c3cb62cde | |
occheung | d1f7e5d25f | |
occheung | 73d7fe2502 | |
Sebastien Bourdeauducq | eb48b4a6b8 | |
Sebastien Bourdeauducq | 093b1b7224 | |
Sebastien Bourdeauducq | faedd3e1ea | |
Sebastien Bourdeauducq | 56382d6301 | |
Robert Jördens | 6721a8ea17 | |
SingularitySurfer | 08241d9ab0 | |
Sebastien Bourdeauducq | 7259a0b3aa | |
SingularitySurfer | b17a99ac3b | |
SingularitySurfer | 3d26cd62cf | |
SingularitySurfer | 8771512787 | |
Sebastien Bourdeauducq | d688ed1a56 | |
Sebastien Bourdeauducq | ea292df252 | |
Astro | 00352b9942 | |
SingularitySurfer | cf4ca3e4f2 | |
Astro | eab83a6a3f | |
occheung | 262ef72eb7 | |
Astro | 12fbe64616 | |
Robert Jördens | 6acf5b3f93 | |
Astro | 5695977531 | |
Astro | 2e62831998 | |
Astro | fd25af0733 | |
Astro | 843da12452 | |
Drew Risinger | 267b497ac4 | |
Sebastien Bourdeauducq | ff54c815d5 | |
Sebastien Bourdeauducq | eb398dcc53 | |
Robert Jördens | 88cd472f90 | |
Robert Jördens | 6eac1b5f3f | |
Robert Jördens | c31b0144d3 | |
Robert Jördens | 34c5ff76b9 | |
Astro | 571cfbd8a6 | |
Sebastien Bourdeauducq | 0db0ffb128 | |
Sebastien Bourdeauducq | 083e389b41 | |
Sebastien Bourdeauducq | 777b9dbecd | |
Sebastien Bourdeauducq | 0a11450df3 | |
Sebastien Bourdeauducq | 30629929a8 | |
Sebastien Bourdeauducq | d53eed3880 | |
Astro | df36762bfe | |
occheung | 8477bc2919 | |
Sebastien Bourdeauducq | 01dbcb5886 | |
Sebastien Bourdeauducq | f2c9e226ac | |
Sebastien Bourdeauducq | b46f418176 | |
Harry Ho | 6ee5fa70ec | |
Sebastien Bourdeauducq | 24510c81d6 | |
occheung | 17e6cbf6b1 | |
Sebastien Bourdeauducq | 59844c28d9 | |
Sebastien Bourdeauducq | 4172f745e3 | |
Sebastien Bourdeauducq | ee9983728e | |
Sebastien Bourdeauducq | b50d1a0f7e | |
Sebastien Bourdeauducq | a9108d5fa3 | |
Sebastien Bourdeauducq | 0064906c6f | |
Sebastien Bourdeauducq | 9754f45904 | |
Sebastien Bourdeauducq | 59ad8b124a | |
Sebastien Bourdeauducq | 1263c7f15f | |
Sebastien Bourdeauducq | 477f9ce197 | |
Sebastien Bourdeauducq | 4dd16d3aa8 | |
Sebastien Bourdeauducq | 497f1970a0 | |
Sebastien Bourdeauducq | bf45666b2b | |
Sebastien Bourdeauducq | 6cbfebf626 | |
Sebastien Bourdeauducq | 9870fce5a6 | |
Sebastien Bourdeauducq | a6f94d37e9 | |
Sebastien Bourdeauducq | 657d3c1b27 | |
Sebastien Bourdeauducq | fe728a7303 | |
Sebastien Bourdeauducq | f392ca6fd6 | |
Sebastien Bourdeauducq | 9a39d707da | |
Sebastien Bourdeauducq | 3e607f7d12 | |
Sebastien Bourdeauducq | f69616307e | |
Astro | 62f7610087 | |
Harry Ho | 68318b05ec | |
Astro | 7c7c0cb58d | |
Sebastien Bourdeauducq | 5ba0896be6 | |
Harry Ho | 7c4eb8e770 | |
Sebastien Bourdeauducq | c64d73649f | |
Sebastien Bourdeauducq | e6fb3088b1 | |
Sebastien Bourdeauducq | e4d6dd253d | |
Sebastien Bourdeauducq | b5d7b1d10a | |
Sebastien Bourdeauducq | 864bddd0b4 | |
Sebastien Bourdeauducq | de7c867866 | |
Sebastien Bourdeauducq | 58c9c6f83c | |
Sebastien Bourdeauducq | 532dd5c861 | |
Sebastien Bourdeauducq | eabcda5013 | |
Sebastien Bourdeauducq | b3715bbfc8 | |
Sebastien Bourdeauducq | 51bd917512 | |
Sebastien Bourdeauducq | b7a1f42a06 | |
Sebastien Bourdeauducq | 53838bd55f | |
Sebastien Bourdeauducq | 354f653a13 | |
Sebastien Bourdeauducq | 33b66b1a65 | |
Sebastien Bourdeauducq | 1b324970e5 | |
Sebastien Bourdeauducq | 44ffc90e3a | |
Sebastien Bourdeauducq | 6c51ea48fa | |
Sebastien Bourdeauducq | 953000afd1 | |
Sebastien Bourdeauducq | 82ff5added | |
Sebastien Bourdeauducq | 51ecc65edc | |
Sebastien Bourdeauducq | 536e26b771 | |
Robert Jördens | a7179589bd | |
Sebastien Bourdeauducq | d88e2287e2 | |
Sebastien Bourdeauducq | 1c43932205 | |
Sebastien Bourdeauducq | 60e554c501 | |
Sebastien Bourdeauducq | 7b27d68841 | |
Sebastien Bourdeauducq | 241d6224cb | |
Sebastien Bourdeauducq | 3c463f7397 | |
Sebastien Bourdeauducq | 4a1de56ce5 | |
Sebastien Bourdeauducq | 7a1ac77c8b | |
Sebastien Bourdeauducq | 7001d011fd | |
Sebastien Bourdeauducq | 454c3d806c | |
Sebastien Bourdeauducq | 4ef1b6e76d | |
Astro | be5787ab55 | |
Astro | bc447638a9 | |
Astro | 7f32f8e438 | |
Astro | 89d700a796 | |
Harry Ho | d86ea71a76 | |
Harry Ho | 756c256c77 | |
Astro | 1d7b1e9175 | |
Astro | 3409eb3c11 | |
Sebastien Bourdeauducq | 6c328f32f1 | |
Sebastien Bourdeauducq | e75d16f55a | |
Sebastien Bourdeauducq | cc00cfc1a8 | |
Sebastien Bourdeauducq | e8054aebbd | |
Sebastien Bourdeauducq | 30e0886a16 | |
Sebastien Bourdeauducq | 888481c0ce | |
Sebastien Bourdeauducq | cc5694dedf | |
Sebastien Bourdeauducq | e0a9253084 | |
Sebastien Bourdeauducq | eaa571b61f | |
Sebastien Bourdeauducq | c0f5d74bd0 | |
Astro | fe8417e229 | |
Sebastien Bourdeauducq | 46388263c4 | |
Sebastien Bourdeauducq | bba16a693e | |
Sebastien Bourdeauducq | e623036a65 | |
Sebastien Bourdeauducq | 8e30790990 | |
Sebastien Bourdeauducq | 1888638dd5 | |
Sebastien Bourdeauducq | 7ab53bb9eb | |
Sebastien Bourdeauducq | eba5934c80 | |
Sebastien Bourdeauducq | e372f357a8 | |
Sebastien Bourdeauducq | a89e2e5e5b | |
Sebastien Bourdeauducq | 0b87a11ae2 | |
Sebastien Bourdeauducq | f6e1164476 | |
Sebastien Bourdeauducq | 2c26169353 | |
Sebastien Bourdeauducq | 1a3c57864d | |
Sebastien Bourdeauducq | 3dfd3b166a | |
Sebastien Bourdeauducq | 563161860e | |
Sebastien Bourdeauducq | 02899d343c | |
Sebastien Bourdeauducq | 50f9897c2e | |
Robert Jördens | eb867a355b | |
Sebastien Bourdeauducq | 4578bbc74e | |
Astro | 088a101d89 | |
Sebastien Bourdeauducq | 8c508de922 | |
Sebastien Bourdeauducq | 48bc991c7c | |
Sebastien Bourdeauducq | 4cd7a559e8 | |
Sebastien Bourdeauducq | 005792ed77 | |
Sebastien Bourdeauducq | 64224a0b51 | |
Sebastien Bourdeauducq | 6eecb5085d | |
Sebastien Bourdeauducq | 486b343b15 | |
Astro | 30f205680f | |
Astro | c00c10e223 | |
Sebastien Bourdeauducq | e87d2b4ecd | |
Sebastien Bourdeauducq | d809926d10 | |
Sebastien Bourdeauducq | 491aae094c | |
Sebastien Bourdeauducq | e347cb7c4b | |
Sebastien Bourdeauducq | 9733ec3509 | |
Sebastien Bourdeauducq | ed313133b8 | |
Sebastien Bourdeauducq | 69d8e02853 | |
Sebastien Bourdeauducq | 80bf1d300e | |
Sebastien Bourdeauducq | 536d45012e | |
Sebastien Bourdeauducq | 4158527dba | |
Sebastien Bourdeauducq | 3f75a81ec1 | |
Sebastien Bourdeauducq | 5c07a9e95d | |
Sebastien Bourdeauducq | 8111b2f42b | |
Sebastien Bourdeauducq | 1b79bdaa20 | |
Sebastien Bourdeauducq | d641e1613f | |
Sebastien Bourdeauducq | 7ca6ada7ee | |
Sebastien Bourdeauducq | 3766781a24 | |
Sebastien Bourdeauducq | 5dc2ed0c79 | |
Sebastien Bourdeauducq | 72d4eab21b | |
Sebastien Bourdeauducq | 11dfff09b9 | |
Sebastien Bourdeauducq | 97bb368cab | |
Sebastien Bourdeauducq | a448d3bdc0 | |
Sebastien Bourdeauducq | 05cde854dd | |
Sebastien Bourdeauducq | bd8fa5d955 | |
Sebastien Bourdeauducq | d895203b5b | |
Sebastien Bourdeauducq | 7838d6e683 | |
Sebastien Bourdeauducq | b2e40e0594 | |
Sebastien Bourdeauducq | dd377e0459 | |
Sebastien Bourdeauducq | ffed59ad95 | |
Sebastien Bourdeauducq | 8c8ede8387 | |
Sebastien Bourdeauducq | 942c654af0 | |
Sebastien Bourdeauducq | 90cc2c5049 | |
Sebastien Bourdeauducq | 77722ae68b | |
Sebastien Bourdeauducq | 8fa63fe916 | |
Sebastien Bourdeauducq | 561eb3a02e | |
Your Name | 5ef34eff97 | |
Astro | 131df3a337 | |
Sebastien Bourdeauducq | 0e4d2e3b54 | |
Sebastien Bourdeauducq | ae201e2aa8 | |
Sebastien Bourdeauducq | b30fa47e53 | |
Sebastien Bourdeauducq | e589989955 | |
Sebastien Bourdeauducq | df38a58ae7 | |
Sebastien Bourdeauducq | eb4fa6ee15 | |
Sebastien Bourdeauducq | 7ff56838b6 | |
Sebastien Bourdeauducq | f18d1d70d2 | |
Sebastien Bourdeauducq | 9479f297fc | |
Sebastien Bourdeauducq | 330636726c | |
Sebastien Bourdeauducq | 21f3b682c5 | |
Sebastien Bourdeauducq | 2db006aa19 | |
Sebastien Bourdeauducq | d64fcec76e | |
Astro | f1325dce29 | |
Sebastien Bourdeauducq | 08d28437e4 | |
Sebastien Bourdeauducq | 1bf63a88ad | |
Sebastien Bourdeauducq | 6d2d0745e0 | |
Sebastien Bourdeauducq | 0e446db26e | |
Sebastien Bourdeauducq | ab90fc88f6 | |
Sebastien Bourdeauducq | 0f99ffc583 | |
Sebastien Bourdeauducq | 465cc193ec | |
Sebastien Bourdeauducq | a5b336f63c | |
Sebastien Bourdeauducq | aa76904361 | |
Sebastien Bourdeauducq | 3d41477178 | |
Sebastien Bourdeauducq | 3e19ee59c9 | |
Sebastien Bourdeauducq | 7ac26d6348 | |
Sebastien Bourdeauducq | a676854640 | |
Sebastien Bourdeauducq | 6437ef3070 | |
Sebastien Bourdeauducq | dd688f7c11 | |
Sebastien Bourdeauducq | 5b5742c3f0 | |
Sebastien Bourdeauducq | 96ba1fab12 | |
Sebastien Bourdeauducq | 40311dc33d | |
Sebastien Bourdeauducq | dc8df8660a | |
Sebastien Bourdeauducq | 20925a3d8d | |
Sebastien Bourdeauducq | 90150c7dbe | |
Sebastien Bourdeauducq | d407eee013 | |
Sebastien Bourdeauducq | 4272fe445c | |
Sebastien Bourdeauducq | 5be1c8aa4a | |
Sebastien Bourdeauducq | 978ea89fe0 | |
Sebastien Bourdeauducq | f464b61290 | |
Sebastien Bourdeauducq | d75e222bfc | |
Sebastien Bourdeauducq | 448905f06e | |
Sebastien Bourdeauducq | 7e50d7de1c | |
Sebastien Bourdeauducq | 5ab186e3dc | |
Sebastien Bourdeauducq | 0ba8000660 | |
Sebastien Bourdeauducq | 38d7c89a8b | |
Sebastien Bourdeauducq | 72357a62f1 | |
Sebastien Bourdeauducq | cb359a0ceb | |
Sebastien Bourdeauducq | b1bb414a74 | |
Sebastien Bourdeauducq | 17b8869da2 | |
Sebastien Bourdeauducq | dcb8e499df | |
Sebastien Bourdeauducq | 107340b08a | |
Sebastien Bourdeauducq | ded12b51fd | |
Sebastien Bourdeauducq | cc37c8232d | |
Sebastien Bourdeauducq | 876f278fdb | |
Sebastien Bourdeauducq | 873b2a0287 | |
Sebastien Bourdeauducq | 4510ae7552 | |
Sebastien Bourdeauducq | 18f84a65c6 | |
Sebastien Bourdeauducq | cc14162e60 | |
Sebastien Bourdeauducq | 70c6a212e2 | |
Sebastien Bourdeauducq | cfc20a13c5 | |
Sebastien Bourdeauducq | 8fc3860e9d | |
Sebastien Bourdeauducq | a9830e0a51 | |
Sebastien Bourdeauducq | 7c758967e0 | |
Sebastien Bourdeauducq | 996802257d | |
Sebastien Bourdeauducq | 446dbbfbf2 | |
Sebastien Bourdeauducq | 0a2e7dae93 | |
Sebastien Bourdeauducq | 768d38db46 | |
Sebastien Bourdeauducq | aa0e0517c2 | |
Sebastien Bourdeauducq | 10bb7df7ed | |
Sebastien Bourdeauducq | a808a5d090 | |
Sebastien Bourdeauducq | d652347dc7 | |
Sebastien Bourdeauducq | 596f4cf4b9 | |
Sebastien Bourdeauducq | 088403cf6f | |
Sebastien Bourdeauducq | 75c44b0369 | |
Sebastien Bourdeauducq | 72d155c047 | |
Sebastien Bourdeauducq | 22a8a5ed92 | |
Sebastien Bourdeauducq | b8a7f84483 | |
Sebastien Bourdeauducq | 40e8cc8407 | |
Sebastien Bourdeauducq | b6c186b632 | |
Sebastien Bourdeauducq | 98e6c29401 | |
Sebastien Bourdeauducq | e15a0235a3 | |
Astro | 8f7308b036 | |
Sebastien Bourdeauducq | dc2c495293 | |
Sebastien Bourdeauducq | 5bc76b0959 | |
Sebastien Bourdeauducq | 27c3940955 | |
Sebastien Bourdeauducq | 6313687278 | |
Sebastien Bourdeauducq | 1ffce94d92 | |
Sebastien Bourdeauducq | f1742db24f | |
Sebastien Bourdeauducq | c7fa00304b | |
Sebastien Bourdeauducq | 649124a463 | |
Sebastien Bourdeauducq | 1f4639c7e4 | |
Sebastien Bourdeauducq | 0292090670 | |
Sebastien Bourdeauducq | 20c2871896 | |
Sebastien Bourdeauducq | 9e900d321e | |
Sebastien Bourdeauducq | e9c07a8985 | |
Sebastien Bourdeauducq | ef8664443a | |
Sebastien Bourdeauducq | ffaa3f74ec | |
Sebastien Bourdeauducq | 37e70bbda1 | |
Sebastien Bourdeauducq | 68078d38d8 | |
Sebastien Bourdeauducq | b7d872a720 | |
Sebastien Bourdeauducq | bf9f5804e2 | |
Sebastien Bourdeauducq | f03d0370db | |
Sebastien Bourdeauducq | 7ab028deb6 | |
Sebastien Bourdeauducq | 0581ac7b69 | |
Sebastien Bourdeauducq | 245b96a844 | |
Sebastien Bourdeauducq | 456a21d363 | |
Sebastien Bourdeauducq | 5d8ffd44ef | |
Sebastien Bourdeauducq | 38eff183a8 | |
Sebastien Bourdeauducq | 2edf38876d | |
Sebastien Bourdeauducq | d6691c2e68 | |
Sebastien Bourdeauducq | e2c1948931 | |
Sebastien Bourdeauducq | 6ac087c823 | |
Sebastien Bourdeauducq | a7ebb7c834 | |
Sebastien Bourdeauducq | 3801458324 | |
Sebastien Bourdeauducq | 47e7231ee0 | |
Sebastien Bourdeauducq | 4b29022876 | |
Robert Jördens | 16fdb7465d | |
Sebastien Bourdeauducq | 6acdcdb180 | |
Sebastien Bourdeauducq | 46738cea8c | |
Sebastien Bourdeauducq | 7c9068c9cc | |
Sebastien Bourdeauducq | 3e4034f936 | |
Sebastien Bourdeauducq | 170e2b3dae | |
Sebastien Bourdeauducq | aa21bde6e5 | |
Sebastien Bourdeauducq | e9d050d1e1 | |
Sebastien Bourdeauducq | ca4f299ab9 | |
Sebastien Bourdeauducq | f9c728aab7 | |
Sebastien Bourdeauducq | ced0ef13b3 | |
Sebastien Bourdeauducq | c4eae355d3 | |
Sebastien Bourdeauducq | a110358e37 | |
Sebastien Bourdeauducq | 00ccf48332 | |
Sebastien Bourdeauducq | 2f1b8ad0f4 | |
Robert Jördens | c3089d0730 | |
Sebastien Bourdeauducq | db65504dab | |
Sebastien Bourdeauducq | 7bd6523807 | |
Sebastien Bourdeauducq | cc8f6d9ae8 | |
Sebastien Bourdeauducq | 86907b40cc | |
Sebastien Bourdeauducq | d05caf3468 | |
Sebastien Bourdeauducq | bd33e26a40 | |
Sebastien Bourdeauducq | 95ccdcc5be | |
Sebastien Bourdeauducq | 43967e2324 | |
Sebastien Bourdeauducq | 6a1476405d | |
Sebastien Bourdeauducq | 19310060e0 | |
Sebastien Bourdeauducq | 9695aaf74f | |
Sebastien Bourdeauducq | dc1e0cf3d7 | |
Astro | 1af80bace3 | |
Astro | 5a5c832de2 | |
Astro | 1bfe9be055 | |
Sebastien Bourdeauducq | bc03ef956e | |
Sebastien Bourdeauducq | bb1658990a | |
Sebastien Bourdeauducq | b1accc9810 | |
Sebastien Bourdeauducq | a6d5f444d1 | |
Sebastien Bourdeauducq | 96578b9ad7 | |
Sebastien Bourdeauducq | 69390df36d | |
Sebastien Bourdeauducq | 1110d6fbb8 | |
Sebastien Bourdeauducq | d11d73c246 | |
Sebastien Bourdeauducq | 06757b311a | |
Sebastien Bourdeauducq | 556fda274d | |
Sebastien Bourdeauducq | 1e568b244b | |
Sebastien Bourdeauducq | cfc843819d | |
Sebastien Bourdeauducq | 50f7c293e8 | |
Sebastien Bourdeauducq | 3cface01af | |
Sebastien Bourdeauducq | aac80b9f84 | |
Sebastien Bourdeauducq | 38a66c9d41 | |
Sebastien Bourdeauducq | fa7c3d2454 | |
Sebastien Bourdeauducq | 5dd966ceb0 | |
Sebastien Bourdeauducq | f7f3ec9a37 | |
Sebastien Bourdeauducq | 4b92e7c00f | |
Sebastien Bourdeauducq | 7f6d54c6cd | |
Sebastien Bourdeauducq | b37f00336e | |
Sebastien Bourdeauducq | 55593d3210 | |
Sebastien Bourdeauducq | 9c86d4b797 | |
Sebastien Bourdeauducq | d7dbb1b1c1 | |
Sebastien Bourdeauducq | aea9642136 | |
Sebastien Bourdeauducq | c9137824e9 | |
Sebastien Bourdeauducq | d939fd7c1a | |
Sebastien Bourdeauducq | 6e8e2824a9 | |
Astro | 9617de32f9 | |
Sebastien Bourdeauducq | a8198e9eea | |
Sebastien Bourdeauducq | ec732461cb | |
Sebastien Bourdeauducq | 2b08520101 | |
Sebastien Bourdeauducq | b13b90f661 | |
Sebastien Bourdeauducq | 61be83c730 | |
Sebastien Bourdeauducq | e8342cdf6b | |
Sebastien Bourdeauducq | 57891b5cae | |
Sebastien Bourdeauducq | 58f507580a | |
Sebastien Bourdeauducq | 438123f76e | |
Sebastien Bourdeauducq | a59a543f81 | |
Sebastien Bourdeauducq | 179d74a137 | |
Sebastien Bourdeauducq | 0c6418755e | |
Sebastien Bourdeauducq | 7d740fd464 | |
Sebastien Bourdeauducq | 6888f2dfd2 | |
Sebastien Bourdeauducq | 9015e109c0 | |
Sebastien Bourdeauducq | 49f5af3eca | |
Sebastien Bourdeauducq | bad4c09735 | |
Sebastien Bourdeauducq | e7b886f07a | |
Astro | 5c43dbd0ea | |
Stewart Mackenzie | fafc71610d | |
Sebastien Bourdeauducq | dec885c896 | |
Sebastien Bourdeauducq | b72369d457 | |
Sebastien Bourdeauducq | 57715ff325 | |
Sebastien Bourdeauducq | 3dfe8d9902 | |
Robert Jördens | 78c3352fb9 | |
Sebastien Bourdeauducq | bb8e95a805 | |
Robert Jördens | c6724c4884 | |
Sebastien Bourdeauducq | a90944bb5f | |
Robert Jördens | 687a09d957 | |
Sebastien Bourdeauducq | 37e464755f | |
Sebastien Bourdeauducq | bc876fa374 | |
Stewart Mackenzie | 010de9691e | |
Stewart Mackenzie | 6db4ccfaa4 | |
Stewart Mackenzie | 36fa4372cd | |
Stewart Mackenzie | fccd9ea62a | |
Robert Jördens | 8e36ea82a6 | |
Stewart Mackenzie | 46624ad101 | |
Stewart Mackenzie | 6b8e2171fc | |
Sebastien Bourdeauducq | 8d29d163f2 | |
Sebastien Bourdeauducq | b0407a3775 | |
Sebastien Bourdeauducq | 9f5be63f8e | |
Sebastien Bourdeauducq | 0217471462 | |
Sebastien Bourdeauducq | 9ee661049c | |
Sebastien Bourdeauducq | 125654bcce | |
Sebastien Bourdeauducq | 3091d20e23 | |
Sebastien Bourdeauducq | 29da8f5ab2 | |
Astro | 99fd8085ed | |
Sebastien Bourdeauducq | 987d1d93d3 | |
Sebastien Bourdeauducq | 102341dcf1 | |
Sebastien Bourdeauducq | 14fe3d5a56 | |
Sebastien Bourdeauducq | d11f13ce3a | |
Sebastien Bourdeauducq | 7efd520ba5 | |
Sebastien Bourdeauducq | 4c6daeda64 | |
Sebastien Bourdeauducq | 369c167327 | |
Sebastien Bourdeauducq | d26906d6d0 | |
Robert Jördens | 661f0ba142 | |
Sebastien Bourdeauducq | f927de3280 | |
Sebastien Bourdeauducq | beee821588 | |
Sebastien Bourdeauducq | 2ba53bff9c | |
Sebastien Bourdeauducq | df6906bf9b | |
Sebastien Bourdeauducq | 0ad6609bf3 | |
Sebastien Bourdeauducq | e795d704d6 | |
Sebastien Bourdeauducq | 58bd5c697e | |
Sebastien Bourdeauducq | dc7bab3abf | |
Sebastien Bourdeauducq | f6d4bc3d83 | |
Sebastien Bourdeauducq | 49f014fb67 | |
Sebastien Bourdeauducq | e34a070124 | |
Sebastien Bourdeauducq | bde01362f7 | |
Sebastien Bourdeauducq | b817b63bcc | |
Sebastien Bourdeauducq | b466d410ec | |
Sebastien Bourdeauducq | 1f2eabed65 | |
Sebastien Bourdeauducq | 8fddcd68e8 | |
Sebastien Bourdeauducq | fbd2a521e1 | |
Robert Jördens | 7f1bd87cfe | |
Astro | dd61844e34 | |
Sebastien Bourdeauducq | 6ca5ab5aac | |
Astro | bdaf824f21 | |
Sebastien Bourdeauducq | 7a2268490d | |
Sebastien Bourdeauducq | 91f36d4ca5 | |
Sebastien Bourdeauducq | 107060f50c | |
Sebastien Bourdeauducq | e6488e16d2 | |
Sebastien Bourdeauducq | 6680dc6c34 | |
Sebastien Bourdeauducq | 76d606c43e | |
Sebastien Bourdeauducq | 5f031e78ac | |
Sebastien Bourdeauducq | ddaaaa543b | |
Robert Jördens | 5c41551a48 | |
Robert Jördens | 89bee91a69 | |
Sebastien Bourdeauducq | b0b78f037d | |
Sebastien Bourdeauducq | e283196520 | |
Robert Jördens | 8c03c73522 | |
Sebastien Bourdeauducq | d88137f8b7 | |
Sebastien Bourdeauducq | 7d7813555d | |
Sebastien Bourdeauducq | 4bd0495834 | |
Sebastien Bourdeauducq | 5b06c68583 | |
Sebastien Bourdeauducq | 3b3371eebf | |
Sebastien Bourdeauducq | 42c09c01d4 | |
Sebastien Bourdeauducq | d16f35b91b | |
Sebastien Bourdeauducq | 596a9bc6b4 | |
Sebastien Bourdeauducq | 3d8252acf8 | |
Sebastien Bourdeauducq | 6c6ad630f9 | |
Sebastien Bourdeauducq | fe805ffa93 | |
Sebastien Bourdeauducq | 303bc7b162 | |
Sebastien Bourdeauducq | 961dcac63d | |
Sebastien Bourdeauducq | e50a89acea | |
Sebastien Bourdeauducq | 9a342421ba | |
Sebastien Bourdeauducq | 26f1418492 | |
Sebastien Bourdeauducq | 5797648204 | |
Astro | 91182a37dd | |
Sebastien Bourdeauducq | 184de89074 | |
Sebastien Bourdeauducq | d7ccb02bfc | |
Sebastien Bourdeauducq | f17599940b | |
Sebastien Bourdeauducq | 0136a154a8 | |
Sebastien Bourdeauducq | 57b817f07e | |
Sebastien Bourdeauducq | c16af00977 | |
Sebastien Bourdeauducq | 525b91cb21 | |
Sebastien Bourdeauducq | a4f9732a3d | |
Sebastien Bourdeauducq | 63625e74b8 | |
Sebastien Bourdeauducq | ebe72e4f51 | |
Sebastien Bourdeauducq | eae4612ecb | |
Sebastien Bourdeauducq | 0565ff9819 | |
Sebastien Bourdeauducq | 648a1d7f41 | |
Sebastien Bourdeauducq | d84a9ba72d | |
Sebastien Bourdeauducq | 9b0bead69b | |
Sebastien Bourdeauducq | e69ddf6c4c | |
Sebastien Bourdeauducq | 430647ef37 | |
Sebastien Bourdeauducq | a0d6fbd6ad | |
Sebastien Bourdeauducq | 6fd6648132 | |
Sebastien Bourdeauducq | a6f8e1a558 | |
Sebastien Bourdeauducq | 60e16ada2a | |
Sebastien Bourdeauducq | c4835c6be7 | |
Sebastien Bourdeauducq | 653cb7ce3b | |
Sebastien Bourdeauducq | 618e817c86 | |
Sebastien Bourdeauducq | c1db80023b | |
Sebastien Bourdeauducq | e463b62bfc | |
Sebastien Bourdeauducq | 1a8c152326 |
|
@ -0,0 +1,98 @@
|
|||
# Install Vivado in /opt and add to /etc/nixos/configuration.nix:
|
||||
# nix.sandboxPaths = ["/opt"];
|
||||
|
||||
{ pkgs ? import <nixpkgs> {}
|
||||
, artiq-fast
|
||||
}:
|
||||
|
||||
let
|
||||
artiqSrc = import (artiq-fast + "/pkgs/artiq-src.nix") { fetchgit = pkgs.fetchgit; };
|
||||
artiqpkgs = import artiq-fast { inherit pkgs; };
|
||||
pythonEnv = pkgs.python3.withPackages (ps: with ps; [
|
||||
jinja2 jsonschema numpy artiqpkgs.migen artiqpkgs.microscope artiqpkgs.misoc artiqpkgs.jesd204b artiqpkgs.artiq
|
||||
]);
|
||||
fetchcargo = import (artiq-fast + "/fetchcargo-legacy.nix") {
|
||||
inherit (pkgs) stdenv lib cacert git;
|
||||
cargo = artiqpkgs.cargo-legacy;
|
||||
cargo-vendor = artiqpkgs.cargo-vendor-legacy;
|
||||
};
|
||||
cargoDeps = fetchcargo rec {
|
||||
name = "artiq-firmware-cargo-deps";
|
||||
src = "${artiqSrc}/artiq/firmware";
|
||||
sha256 = import (artiqSrc + "/artiq/firmware/cargosha256.nix");
|
||||
};
|
||||
|
||||
cargoVendored = pkgs.stdenv.mkDerivation {
|
||||
name = "artiq-firmware-cargo-vendored";
|
||||
src = cargoDeps;
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out/registry
|
||||
cat << EOF > $out/config
|
||||
[source.crates-io]
|
||||
registry = "https://github.com/rust-lang/crates.io-index"
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
[source."https://github.com/m-labs/libfringe"]
|
||||
git = "https://github.com/m-labs/libfringe"
|
||||
rev = "b8a6d8f"
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
[source.vendored-sources]
|
||||
directory = "$out/registry"
|
||||
EOF
|
||||
cp -R * $out/registry
|
||||
'';
|
||||
};
|
||||
in
|
||||
{ target
|
||||
, variant
|
||||
, src ? null
|
||||
, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}"
|
||||
, extraInstallCommands ? ""
|
||||
, ...
|
||||
}:
|
||||
let
|
||||
name = "artiq-board-${target}-${variant}-${artiqpkgs.artiq.version}-xxx";
|
||||
installPath = "${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}";
|
||||
in
|
||||
# Board packages are Python modules so that they get added to the ARTIQ Python
|
||||
# environment, and artiq_flash finds them.
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "artiq-board-${target}-${variant}-${artiqpkgs.artiq.version}";
|
||||
inherit src;
|
||||
phases = [ "buildPhase" "installPhase" ];
|
||||
nativeBuildInputs = [
|
||||
pkgs.gnumake pkgs.which pythonEnv
|
||||
artiqpkgs.cargo-legacy
|
||||
artiqpkgs.rustc-legacy
|
||||
artiqpkgs.binutils-or1k
|
||||
artiqpkgs.llvm-or1k
|
||||
];
|
||||
buildInputs = [ pythonEnv ];
|
||||
buildPhase =
|
||||
''
|
||||
export CARGO_HOME=${cargoVendored}
|
||||
export TARGET_AR=or1k-linux-ar
|
||||
${buildCommand} --no-compile-gateware --gateware-identifier-str=unprogrammed
|
||||
'';
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out
|
||||
cp -ar artiq_${target}/${variant}/gateware $out
|
||||
|
||||
TARGET_DIR=$out/${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}
|
||||
mkdir -p $TARGET_DIR
|
||||
if [ -e artiq_${target}/${variant}/software/bootloader/bootloader.bin ]
|
||||
then cp artiq_${target}/${variant}/software/bootloader/bootloader.bin $TARGET_DIR
|
||||
fi
|
||||
if [ -e artiq_${target}/${variant}/software/runtime ]
|
||||
then cp artiq_${target}/${variant}/software/runtime/runtime.{elf,fbi} $TARGET_DIR
|
||||
else cp artiq_${target}/${variant}/software/satman/satman.{elf,fbi} $TARGET_DIR
|
||||
fi
|
||||
${extraInstallCommands}
|
||||
'';
|
||||
# don't mangle ELF files as they are not for NixOS
|
||||
dontFixup = true;
|
||||
}
|
|
@ -0,0 +1,54 @@
|
|||
{ pkgs ? import <nixpkgs> {}
|
||||
, artiq-fast ? <artiq-fast>
|
||||
}:
|
||||
|
||||
let
|
||||
sinaraSystemsSrc = <sinaraSystemsSrc>;
|
||||
generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; }
|
||||
''
|
||||
mkdir $out
|
||||
cp ${./artiq-board.nix} $out/artiq-board.nix
|
||||
cp ${../artiq-full/artiq-targets.nix} $out/artiq-targets.nix
|
||||
cp -a ${artiq-fast} $out/fast
|
||||
|
||||
REV=`git --git-dir ${sinaraSystemsSrc}/.git rev-parse HEAD`
|
||||
echo -n $REV > $out/sinara-rev.txt
|
||||
SINARA_SRC_CLEAN=`mktemp -d`
|
||||
cp -a ${sinaraSystemsSrc}/. $SINARA_SRC_CLEAN
|
||||
chmod -R 755 $SINARA_SRC_CLEAN/.git
|
||||
chmod 755 $SINARA_SRC_CLEAN
|
||||
rm -rf $SINARA_SRC_CLEAN/.git
|
||||
HASH=`nix-hash --type sha256 --base32 $SINARA_SRC_CLEAN`
|
||||
echo -n $HASH > $out/sinara-hash.txt
|
||||
|
||||
cat > $out/default.nix << EOF
|
||||
{ pkgs ? import <nixpkgs> {}
|
||||
}:
|
||||
|
||||
let
|
||||
sinaraSystemsSrc = pkgs.fetchgit {
|
||||
url = "https://git.m-labs.hk/M-Labs/sinara-systems-legacy.git";
|
||||
rev = "$REV";
|
||||
sha256 = "$HASH";
|
||||
};
|
||||
artiq-fast = import ./fast { inherit pkgs; };
|
||||
artiq-board = import ./artiq-board.nix {
|
||||
inherit pkgs;
|
||||
artiq-fast = ./fast;
|
||||
};
|
||||
in
|
||||
builtins.mapAttrs (_: conf: pkgs.lib.hydraJob (artiq-board conf)) (
|
||||
import ./artiq-targets.nix {
|
||||
inherit pkgs sinaraSystemsSrc;
|
||||
artiqVersion = artiq-fast.artiq.version;
|
||||
}
|
||||
)
|
||||
EOF
|
||||
'';
|
||||
artiq-board-generated = import generatedNix {
|
||||
inherit pkgs;
|
||||
};
|
||||
in
|
||||
artiq-board-generated // {
|
||||
generated-nix = pkgs.lib.hydraJob generatedNix;
|
||||
}
|
|
@ -1,11 +1,17 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
pkgs = import <nixpkgs> { overlays = [ (import ./artiq-fast/mozilla-overlay.nix) ]; };
|
||||
artiqSrc = <artiqSrc>;
|
||||
generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; }
|
||||
# keep in sync with artiq-fast/pkgs/artiq-version.nix
|
||||
''
|
||||
cp --no-preserve=mode,ownership -R ${./artiq-fast} $out
|
||||
REV=`git --git-dir ${artiqSrc}/.git rev-parse HEAD`
|
||||
MAJOR_VERSION=`cat ${artiqSrc}/MAJOR_VERSION`
|
||||
if [ -e ${artiqSrc}/BETA ]; then
|
||||
SUFFIX=".beta"
|
||||
else
|
||||
SUFFIX=""
|
||||
fi
|
||||
COMMIT_COUNT=`git --git-dir ${artiqSrc}/.git rev-list --count HEAD`
|
||||
TIMESTAMP=`git --git-dir ${artiqSrc}/.git log -1 --format=%ct`
|
||||
ARTIQ_SRC_CLEAN=`mktemp -d`
|
||||
|
@ -17,27 +23,19 @@ let
|
|||
cat > $out/pkgs/artiq-src.nix << EOF
|
||||
{ fetchgit }:
|
||||
fetchgit {
|
||||
url = "git://github.com/m-labs/artiq.git";
|
||||
url = "https://github.com/m-labs/artiq.git";
|
||||
rev = "$REV";
|
||||
sha256 = "$HASH";
|
||||
}
|
||||
EOF
|
||||
echo "{ stdenv, git, fetchgit }: \"$MAJOR_VERSION.$COMMIT_COUNT.`cut -c1-8 <<< $REV`.beta\"" > $out/pkgs/artiq-version.nix
|
||||
echo "{ stdenv, git, fetchgit }: \"$MAJOR_VERSION.$COMMIT_COUNT.`cut -c1-8 <<< $REV`$SUFFIX\"" > $out/pkgs/artiq-version.nix
|
||||
echo "{ stdenv, git, fetchgit }: \"$TIMESTAMP\"" > $out/pkgs/artiq-timestamp.nix
|
||||
'';
|
||||
generateTestOkHash = pkgs.runCommand "generate-test-ok-hash" { buildInputs = [ pkgs.nix ]; }
|
||||
''
|
||||
TMPDIR=`mktemp -d`
|
||||
cp ${generatedNix}/pkgs/artiq-version.nix $TMPDIR/passed
|
||||
HASH=`nix-hash --type sha256 --base32 $TMPDIR`
|
||||
echo \"$HASH\" > $out
|
||||
'';
|
||||
artiqpkgs = import "${generatedNix}/default.nix" { inherit pkgs; };
|
||||
artiqVersion = import "${generatedNix}/pkgs/artiq-version.nix" (with pkgs; { inherit stdenv fetchgit git; });
|
||||
windowsRunner = overrides:
|
||||
import "${generatedNix}/windows/run-test.nix" ({
|
||||
inherit pkgs;
|
||||
artiqPkg = artiqpkgs.conda-artiq;
|
||||
inherit pkgs artiqpkgs;
|
||||
} // overrides);
|
||||
jobs = (builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) artiqpkgs);
|
||||
in
|
||||
|
@ -51,51 +49,42 @@ in
|
|||
|
||||
windows-no-hardware-tests = pkgs.stdenv.mkDerivation {
|
||||
name = "windows-no-hardware-tests";
|
||||
buildInputs = [ (windowsRunner {}) ];
|
||||
phases = [ "buildPhase" ];
|
||||
buildPhase = ''
|
||||
${windowsRunner {}}/bin/run.sh
|
||||
${windowsRunner { testCommand = "python -m unittest discover -v sipyco.test && python -m unittest discover -v artiq.test"; }}/bin/wfvm-run-windows-tests
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
|
||||
# HACK: Abuse fixed-output derivations to escape the sandbox and run the hardware
|
||||
# unit tests, all integrated in the Hydra interface.
|
||||
# One major downside of this hack is the tests are only run when generateTestOkHash
|
||||
# changes, i.e. when the ARTIQ version changes (and not the dependencies).
|
||||
# Impure derivations, when they land in Nix/Hydra, should improve the situation.
|
||||
extended-tests = pkgs.stdenv.mkDerivation {
|
||||
name = "extended-tests";
|
||||
|
||||
outputHashAlgo = "sha256";
|
||||
outputHashMode = "recursive";
|
||||
outputHash = import generateTestOkHash;
|
||||
__hydraRetry = false;
|
||||
__networked = true; # compatibility with old patched Nix
|
||||
# breaks hydra, https://github.com/NixOS/hydra/issues/1216
|
||||
#__impure = true; # Nix 2.8+
|
||||
|
||||
buildInputs = [
|
||||
(pkgs.python3.withPackages(ps: [ ps.paramiko artiqpkgs.artiq artiqpkgs.artiq-board-kc705-nist_clock ]))
|
||||
artiqpkgs.binutils-or1k
|
||||
artiqpkgs.openocd
|
||||
pkgs.iputils
|
||||
pkgs.openssh
|
||||
];
|
||||
] ++ (if (pkgs.lib.versionAtLeast artiqVersion "7.0") then [ pkgs.llvm_11 pkgs.lld_11 ] else [ artiqpkgs.binutils-or1k ]);
|
||||
phases = [ "buildPhase" ];
|
||||
buildPhase =
|
||||
''
|
||||
export HOME=`mktemp -d`
|
||||
mkdir $HOME/.ssh
|
||||
cp /opt/hydra_id_rsa $HOME/.ssh/id_rsa
|
||||
cp /opt/hydra_id_rsa.pub $HOME/.ssh/id_rsa.pub
|
||||
echo "rpi-1,192.168.1.188 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIMc7waNkP2HjL5Eo94evoxJhC8CbYj4i2n1THe5TPIR3" > $HOME/.ssh/known_hosts
|
||||
chmod 600 $HOME/.ssh/id_rsa
|
||||
cp /opt/hydra_id_ed25519 $HOME/.ssh/id_ed25519
|
||||
cp /opt/hydra_id_ed25519.pub $HOME/.ssh/id_ed25519.pub
|
||||
echo "rpi-1 ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIACtBFDVBYoAE4fpJCTANZSE0bcVpTR3uvfNvb80C4i5" > $HOME/.ssh/known_hosts
|
||||
chmod 600 $HOME/.ssh/id_ed25519
|
||||
LOCKCTL=$(mktemp -d)
|
||||
mkfifo $LOCKCTL/lockctl
|
||||
|
||||
cat $LOCKCTL/lockctl | ${pkgs.openssh}/bin/ssh \
|
||||
-i $HOME/.ssh/id_rsa \
|
||||
-i $HOME/.ssh/id_ed25519 \
|
||||
-o UserKnownHostsFile=$HOME/.ssh/known_hosts \
|
||||
sb@rpi-1 \
|
||||
'flock /tmp/board_lock-kc705-1 -c "echo Ok; cat"' \
|
||||
rpi-1 \
|
||||
'mkdir -p /tmp/board_lock && flock /tmp/board_lock/kc705-1 -c "echo Ok; cat"' \
|
||||
| (
|
||||
# End remote flock via FIFO
|
||||
atexit_unlock() {
|
||||
|
@ -108,18 +97,15 @@ in
|
|||
|
||||
artiq_flash -t kc705 -H rpi-1
|
||||
sleep 15
|
||||
# ping: socket: Operation not permitted
|
||||
#ping kc705-1 -c10 -w30
|
||||
|
||||
export ARTIQ_ROOT=`python -c "import artiq; print(artiq.__path__[0])"`/examples/kc705_nist_clock
|
||||
export ARTIQ_LOW_LATENCY=1
|
||||
python -m unittest discover -v artiq.test.coredevice
|
||||
|
||||
${windowsRunner { testCommand = "set ARTIQ_ROOT=%cd%\\anaconda\\envs\\artiq-env\\Lib\\site-packages\\artiq\\examples\\kc705_nist_clock&&python -m unittest discover -v artiq.test.coredevice"; }}/bin/run.sh
|
||||
${windowsRunner { testCommand = "set ARTIQ_ROOT=%cd%\\Anaconda3\\envs\\artiq-env\\Lib\\site-packages\\artiq\\examples\\kc705_nist_clock&& python -m unittest discover -v artiq.test.coredevice"; }}/bin/wfvm-run-windows-tests
|
||||
)
|
||||
|
||||
mkdir $out
|
||||
cp ${generatedNix}/pkgs/artiq-version.nix $out/passed
|
||||
touch $out
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,26 +1,28 @@
|
|||
# Install Vivado in /opt and add to /etc/nixos/configuration.nix:
|
||||
# nix.sandboxPaths = ["/opt"];
|
||||
|
||||
{ pkgs }:
|
||||
{ target
|
||||
, variant
|
||||
, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}"
|
||||
, extraInstallCommands ? ""}:
|
||||
{ pkgs
|
||||
, rustPlatform
|
||||
, vivado ? import ./vivado.nix { inherit pkgs; }
|
||||
}:
|
||||
|
||||
let
|
||||
artiqSrc = import ./pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; };
|
||||
fetchcargo = import ./fetchcargo.nix {
|
||||
inherit (pkgs) stdenv cacert git cargo cargo-vendor;
|
||||
artiqpkgs = import ./default.nix { inherit pkgs; };
|
||||
|
||||
fetchcargo-legacy = import ./fetchcargo-legacy.nix {
|
||||
inherit (pkgs) stdenv lib cacert git;
|
||||
cargo = artiqpkgs.cargo-legacy;
|
||||
cargo-vendor = artiqpkgs.cargo-vendor-legacy;
|
||||
};
|
||||
cargoDeps = fetchcargo rec {
|
||||
cargoDeps-legacy = fetchcargo-legacy rec {
|
||||
name = "artiq-firmware-cargo-deps";
|
||||
src = "${artiqSrc}/artiq/firmware";
|
||||
sha256 = "1xzjn9i4rkd9124v2gbdplsgsvp1hlx7czdgc58n316vsnrkbr86";
|
||||
sha256 = (import "${artiqSrc}/artiq/firmware/cargosha256.nix");
|
||||
};
|
||||
|
||||
cargoVendored = pkgs.stdenv.mkDerivation {
|
||||
cargoVendored-legacy = pkgs.stdenv.mkDerivation {
|
||||
name = "artiq-firmware-cargo-vendored";
|
||||
src = cargoDeps;
|
||||
src = cargoDeps-legacy;
|
||||
phases = [ "unpackPhase" "installPhase" ];
|
||||
installPhase =
|
||||
''
|
||||
|
@ -42,40 +44,82 @@ let
|
|||
'';
|
||||
};
|
||||
|
||||
vivado = import ./vivado.nix { inherit pkgs; };
|
||||
artiqpkgs = import ./default.nix { inherit pkgs; };
|
||||
cargoDeps = rustPlatform.fetchCargoTarball {
|
||||
name = "artiq-firmware-cargo-deps";
|
||||
src = "${artiqSrc}/artiq/firmware";
|
||||
sha256 = "sha256-YyycMsDzR+JRcMZJd6A/CRi2J9nKmaWY/KXUnAQaZ00=";
|
||||
};
|
||||
|
||||
cargo-xbuild = rustPlatform.buildRustPackage rec {
|
||||
pname = "cargo-xbuild";
|
||||
version = "0.6.5";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "rust-osdev";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "18djvygq9v8rmfchvi2hfj0i6fhn36m716vqndqnj56fiqviwxvf";
|
||||
};
|
||||
cargoSha256 = "13sj9j9kl6js75h9xq0yidxy63vixxm9q3f8jil6ymarml5wkhx8";
|
||||
};
|
||||
|
||||
artiq7 = pkgs.lib.strings.versionAtLeast artiqpkgs.artiq.version "7.0";
|
||||
|
||||
in
|
||||
{ target
|
||||
, variant
|
||||
, src ? null
|
||||
, buildCommand ? "python -m artiq.gateware.targets.${target} -V ${variant}"
|
||||
, extraInstallCommands ? ""
|
||||
, ... }:
|
||||
|
||||
# Board packages are Python modules so that they get added to the ARTIQ Python
|
||||
# environment, and artiq_flash finds them.
|
||||
in pkgs.python3Packages.toPythonModule (pkgs.stdenv.mkDerivation rec {
|
||||
pkgs.python3Packages.toPythonModule (pkgs.stdenv.mkDerivation rec {
|
||||
name = "artiq-board-${target}-${variant}-${version}";
|
||||
version = import ./pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; });
|
||||
phases = [ "buildPhase" "installCheckPhase" "installPhase" ];
|
||||
buildInputs = [
|
||||
vivado
|
||||
pkgs.gnumake
|
||||
(pkgs.python3.withPackages(ps: with ps; [ jinja2 numpy artiqpkgs.migen artiqpkgs.microscope artiqpkgs.misoc artiqpkgs.jesd204b artiqpkgs.artiq ]))
|
||||
pkgs.cargo
|
||||
artiqpkgs.rustc
|
||||
artiqpkgs.binutils-or1k
|
||||
artiqpkgs.llvm-or1k
|
||||
];
|
||||
buildPhase =
|
||||
''
|
||||
export CARGO_HOME=${cargoVendored}
|
||||
export TARGET_AR=or1k-linux-ar
|
||||
${buildCommand}
|
||||
'';
|
||||
inherit src;
|
||||
phases = [ "buildPhase" "checkPhase" "installPhase" ];
|
||||
nativeBuildInputs = [ vivado pkgs.gnumake ]
|
||||
++ (if artiq7
|
||||
then [
|
||||
rustPlatform.rust.rustc
|
||||
rustPlatform.rust.cargo
|
||||
pkgs.llvmPackages_11.clang-unwrapped
|
||||
pkgs.llvm_11
|
||||
pkgs.lld_11
|
||||
rustPlatform.cargoSetupHook
|
||||
cargo-xbuild
|
||||
] else [
|
||||
artiqpkgs.cargo-legacy
|
||||
artiqpkgs.rustc-legacy
|
||||
artiqpkgs.binutils-or1k
|
||||
artiqpkgs.llvm-or1k
|
||||
]);
|
||||
buildInputs = [ (pkgs.python3.withPackages(ps: with ps; [ artiqpkgs.migen artiqpkgs.microscope artiqpkgs.misoc artiqpkgs.jesd204b artiqpkgs.artiq ] ++ (pkgs.lib.optional artiq7 jsonschema))) ];
|
||||
buildPhase = if artiq7
|
||||
then
|
||||
''
|
||||
ARTIQ_PATH=`python -c "import artiq; print(artiq.__path__[0])"`
|
||||
ln -s $ARTIQ_PATH/firmware/Cargo.lock .
|
||||
cargoDeps=${cargoDeps}
|
||||
cargoSetupPostUnpackHook
|
||||
cargoSetupPostPatchHook
|
||||
export TARGET_AR=llvm-ar
|
||||
${buildCommand}
|
||||
''
|
||||
else
|
||||
''
|
||||
export CARGO_HOME=${cargoVendored-legacy}
|
||||
export TARGET_AR=or1k-linux-ar
|
||||
${buildCommand}
|
||||
'';
|
||||
# temporarily disabled because there is currently always at least one Kasli bitstream
|
||||
# that fails timing and blocks the conda channel.
|
||||
doCheck = artiq7;
|
||||
checkPhase = ''
|
||||
# Search for PCREs in the Vivado output to check for errors
|
||||
check_log() {
|
||||
set +e
|
||||
grep -Pe "$1" artiq_${target}/${variant}/gateware/vivado.log
|
||||
FOUND=$?
|
||||
set -e
|
||||
if [ $FOUND != 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
grep -Pe "$1" artiq_${target}/${variant}/gateware/vivado.log && exit 1 || true
|
||||
}
|
||||
check_log "\d+ constraint not met\."
|
||||
check_log "Timing constraints are not met\."
|
||||
|
@ -94,4 +138,6 @@ in pkgs.python3Packages.toPythonModule (pkgs.stdenv.mkDerivation rec {
|
|||
fi
|
||||
${extraInstallCommands}
|
||||
'';
|
||||
# don't mangle ELF files as they are not for NixOS
|
||||
dontFixup = true;
|
||||
})
|
||||
|
|
|
@ -1,18 +0,0 @@
|
|||
[
|
||||
"python >=3.5.3,<3.6"
|
||||
"llvmlite-artiq 0.23.0.dev py35_5"
|
||||
"binutils-or1k-linux >=2.27"
|
||||
"pythonparser >=1.1"
|
||||
"openocd 0.10.0 6"
|
||||
"scipy"
|
||||
"numpy"
|
||||
"prettytable"
|
||||
"h5py 2.8"
|
||||
"python-dateutil"
|
||||
"pyqt >=5.5"
|
||||
"quamash"
|
||||
"pyqtgraph 0.10.0"
|
||||
"pygit2"
|
||||
"aiohttp >=3"
|
||||
"python-levenshtein"
|
||||
]
|
|
@ -1,16 +0,0 @@
|
|||
{ pkgs }:
|
||||
|
||||
let
|
||||
version = import ./pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; });
|
||||
fakeCondaSource = import ./conda-fake-source.nix { inherit pkgs; } {
|
||||
name = "artiq";
|
||||
inherit version;
|
||||
src = import ./pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; };
|
||||
dependencies = import ./conda-artiq-deps.nix;
|
||||
};
|
||||
conda-artiq = import ./conda-build.nix { inherit pkgs; } {
|
||||
name = "conda-artiq";
|
||||
src = fakeCondaSource;
|
||||
};
|
||||
in
|
||||
conda-artiq
|
|
@ -1,20 +0,0 @@
|
|||
# We need to pass the whole source to conda for the git variables to work.
|
||||
# recipe must be a string pointing to a path within the source.
|
||||
|
||||
{ pkgs }:
|
||||
{ name, src, recipe ? "fake-conda"}:
|
||||
|
||||
let
|
||||
condaBuilderEnv = import ./conda-builder-env.nix { inherit pkgs; };
|
||||
in pkgs.stdenv.mkDerivation {
|
||||
inherit name src;
|
||||
buildCommand =
|
||||
''
|
||||
HOME=`pwd`
|
||||
mkdir $out
|
||||
${condaBuilderEnv}/bin/conda-builder-env -c "PYTHON=python conda build --no-anaconda-upload --no-test --output-folder $out $src/${recipe}"
|
||||
|
||||
mkdir -p $out/nix-support
|
||||
echo file conda $out/noarch/*.tar.bz2 >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{ pkgs }:
|
||||
|
||||
with pkgs;
|
||||
|
||||
let
|
||||
condaDeps = [ stdenv.cc xorg.libSM xorg.libICE xorg.libXrender libselinux ];
|
||||
# Use the full Anaconda distribution, which already contains conda-build and its many dependencies,
|
||||
# so we don't have to manually deal with them.
|
||||
condaInstaller = fetchurl {
|
||||
url = "https://repo.anaconda.com/archive/Anaconda3-2019.03-Linux-x86_64.sh";
|
||||
sha256 = "0fmpdd5876ylds98mydmv5klnwlzasa461k0l1f4vhbw96vm3j25";
|
||||
};
|
||||
condaSrcChmod = runCommand "conda-src-chmod" { } "mkdir $out; cp ${condaInstaller} $out/conda-installer.sh; chmod +x $out/conda-installer.sh";
|
||||
condaInstallerEnv = buildFHSUserEnv {
|
||||
name = "conda-installer-env";
|
||||
targetPkgs = pkgs: ([ condaSrcChmod ] ++ condaDeps);
|
||||
};
|
||||
|
||||
condaInstalled = runCommand "conda-installed" { }
|
||||
''
|
||||
${condaInstallerEnv}/bin/conda-installer-env -c "${condaSrcChmod}/conda-installer.sh -p $out -b"
|
||||
substituteInPlace $out/lib/python3.7/site-packages/conda/gateways/disk/__init__.py \
|
||||
--replace "os.chmod(path, 0o2775)" "pass"
|
||||
'';
|
||||
in
|
||||
buildFHSUserEnv {
|
||||
name = "conda-builder-env";
|
||||
targetPkgs = pkgs: [ condaInstalled ] ++ condaDeps;
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
--- a/intl/relocatable.c 2018-02-28 18:19:46.318224392 +0000
|
||||
+++ b/intl/relocatable.c 2018-02-28 18:19:37.614224749 +0000
|
||||
@@ -145,7 +145,7 @@
|
||||
libcharset_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
|
||||
#endif
|
||||
#if DEPENDS_ON_LIBICONV && HAVE_ICONV && _LIBICONV_VERSION >= 0x0109
|
||||
- libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
|
||||
+ // libiconv_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
|
||||
#endif
|
||||
#if DEPENDS_ON_LIBINTL && ENABLE_NLS && defined libintl_set_relocation_prefix
|
||||
libintl_set_relocation_prefix (orig_prefix_arg, curr_prefix_arg);
|
|
@ -0,0 +1,21 @@
|
|||
set MSYS=C:\MSYS64
|
||||
set TRIPLE=x86_64-w64-mingw32
|
||||
set PATH=%MSYS%\usr\bin;%MSYS%\mingw64\bin;%PATH%
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
set CFLAGS=-I%PREFIX:\=/%/Library/include/
|
||||
set LDFLAGS=-L%PREFIX:\=/%/Library/lib/
|
||||
sh ../configure --build=%TRIPLE% ^
|
||||
--prefix="%PREFIX:\=/%/Library" ^
|
||||
--target=##TARGET##
|
||||
if errorlevel 1 exit 1
|
||||
|
||||
make -j4
|
||||
if errorlevel 1 exit 1
|
||||
|
||||
make install
|
||||
if errorlevel 1 exit 1
|
||||
|
||||
rem this is a copy of prefixed executables
|
||||
rmdir /S /Q %PREFIX%\Library\##TARGET##
|
|
@ -0,0 +1,17 @@
|
|||
package:
|
||||
name: binutils-##TARGET##
|
||||
version: ##VERSION##
|
||||
|
||||
source:
|
||||
url: ../src.tar.bz2
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- libiconv
|
||||
run:
|
||||
- libiconv
|
||||
|
||||
about:
|
||||
home: https://www.gnu.org/software/binutils/
|
||||
license: GPL
|
||||
summary: 'A set of programming tools for creating and managing binary programs, object files, libraries, profile data, and assembly source code.'
|
|
@ -0,0 +1,54 @@
|
|||
{ pkgs, version, src, target }:
|
||||
|
||||
let
|
||||
wfvm = import ../wfvm.nix { inherit pkgs; };
|
||||
libiconv-filename = "libiconv-1.15-h1df5818_7.tar.bz2";
|
||||
libiconv = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/anaconda/libiconv/1.15/download/win-64/${libiconv-filename}";
|
||||
sha256 = "0p431madykrjmi9sbl2sy9kzb0l3vhgs677i8q7cx8g210ab5g52";
|
||||
};
|
||||
vc14-filename = "vc-14.1-h0510ff6_4.tar.bz2";
|
||||
vc14 = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/anaconda/vc/14.1/download/win-64/${vc14-filename}";
|
||||
sha256 = "0nsyxph667x8ky1nybakpnk816dkrzbf1684jd7pp6wm5x73p34v";
|
||||
};
|
||||
vs2015_runtime-filename = "vs2015_runtime-14.16.27012-hf0eaf9b_2.tar.bz2";
|
||||
vs2015_runtime = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/anaconda/vs2015_runtime/14.16.27012/download/win-64/${vs2015_runtime-filename}";
|
||||
sha256 = "1gbm6i6nkp8linmak5mm42hj1nzqd5ppak8kv1n3wfn52p21ngvs";
|
||||
};
|
||||
build = wfvm.utils.wfvm-run {
|
||||
name = "build-binutils";
|
||||
image = wfvm.makeWindowsImage { installCommands = with wfvm.layers; [ anaconda3 msys2 (msys2-packages (import ./msys_packages.nix { inherit pkgs; } )) ]; };
|
||||
script = ''
|
||||
# Create a fake channel to work around another pile of bugs and cretinous design decisions from conda.
|
||||
${wfvm.utils.win-exec}/bin/win-exec "mkdir fake-channel && mkdir fake-channel\win-64"
|
||||
ln -s ${libiconv} ${libiconv-filename}
|
||||
${wfvm.utils.win-put}/bin/win-put ${libiconv-filename} ./fake-channel/win-64
|
||||
ln -s ${vc14} ${vc14-filename}
|
||||
${wfvm.utils.win-put}/bin/win-put ${vc14-filename} ./fake-channel/win-64
|
||||
ln -s ${vs2015_runtime} ${vs2015_runtime-filename}
|
||||
${wfvm.utils.win-put}/bin/win-put ${vs2015_runtime-filename} ./fake-channel/win-64
|
||||
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda index fake-channel"
|
||||
|
||||
cp --no-preserve=mode,ownership -R ${./binutils-recipe} binutils
|
||||
sed -i s/##TARGET##/${target}/g binutils/*
|
||||
sed -i s/##VERSION##/${version}/g binutils/*
|
||||
${wfvm.utils.win-put}/bin/win-put binutils .
|
||||
tar xjf ${src}
|
||||
patch -d binutils-${version} -p1 < ${./binutils-hack-libiconv.patch}
|
||||
tar cjf src.tar.bz2 binutils-${version}
|
||||
${wfvm.utils.win-put}/bin/win-put src.tar.bz2 .
|
||||
|
||||
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda build --no-anaconda-upload --no-test -c file:///C:/users/wfvm/fake-channel --override-channels binutils"
|
||||
|
||||
${wfvm.utils.win-get}/bin/win-get "Anaconda3/conda-bld/win-64/binutils-${target}-${version}-0.tar.bz2"
|
||||
'';
|
||||
};
|
||||
in
|
||||
pkgs.runCommand "conda-windows-binutils-${target}" { buildInputs = [ build ]; } ''
|
||||
wfvm-run-build-binutils
|
||||
mkdir -p $out/win-64 $out/nix-support
|
||||
cp binutils-*.tar.bz2 $out/win-64
|
||||
echo file conda $out/win-64/*.tar.bz2 >> $out/nix-support/hydra-build-products
|
||||
''
|
|
@ -0,0 +1,83 @@
|
|||
{ pkgs, version, src }:
|
||||
|
||||
let
|
||||
wfvm = import ../wfvm.nix { inherit pkgs; };
|
||||
conda-vs2015_runtime-filename = "vs2015_runtime-14.16.27012-hf0eaf9b_2.tar.bz2";
|
||||
conda-vs2015_runtime = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/anaconda/vs2015_runtime/14.16.27012/download/win-64/${conda-vs2015_runtime-filename}";
|
||||
sha256 = "1gbm6i6nkp8linmak5mm42hj1nzqd5ppak8kv1n3wfn52p21ngvs";
|
||||
};
|
||||
conda-cmake-filename = "cmake-3.17.2-h33f27b4_0.tar.bz2";
|
||||
conda-cmake = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/anaconda/cmake/3.17.2/download/win-64/${conda-cmake-filename}";
|
||||
sha256 = "0lg782pj2i9h20rwfkwwskis038r98b3z4c9j1a6ih95rc6m2acn";
|
||||
};
|
||||
build = wfvm.utils.wfvm-run {
|
||||
name = "build-llvm-or1k";
|
||||
image = wfvm.makeWindowsImage { installCommands = with wfvm.layers; [ anaconda3 msvc msvc-ide-unbreak ]; };
|
||||
script = ''
|
||||
# Create a fake channel so that the conda garbage doesn't complain about not finding the packages it just installed.
|
||||
ln -s ${conda-vs2015_runtime} ${conda-vs2015_runtime-filename}
|
||||
ln -s ${conda-cmake} ${conda-cmake-filename}
|
||||
${wfvm.utils.win-exec}/bin/win-exec "mkdir fake-channel && mkdir fake-channel\win-64"
|
||||
${wfvm.utils.win-put}/bin/win-put ${conda-vs2015_runtime-filename} ./fake-channel/win-64
|
||||
${wfvm.utils.win-put}/bin/win-put ${conda-cmake-filename} ./fake-channel/win-64
|
||||
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda index fake-channel"
|
||||
|
||||
cat > meta.yaml << EOF
|
||||
package:
|
||||
name: llvm-or1k
|
||||
version: ${version}
|
||||
|
||||
source:
|
||||
url: ../src.tar
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- cmake
|
||||
EOF
|
||||
|
||||
cat > bld.bat << EOF
|
||||
set BUILD_TYPE=Release
|
||||
set CMAKE_GENERATOR=Visual Studio 15 2017 Win64
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "%CMAKE_GENERATOR%" ^
|
||||
-Thost=x64 ^
|
||||
-DCMAKE_BUILD_TYPE="%BUILD_TYPE%" ^
|
||||
-DCMAKE_INSTALL_PREFIX="%LIBRARY_PREFIX%" ^
|
||||
-DLLVM_BUILD_LLVM_DYLIB=ON ^
|
||||
-DLLVM_TARGETS_TO_BUILD=X86;ARM ^
|
||||
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=OR1K ^
|
||||
-DLLVM_ENABLE_ASSERTIONS=OFF ^
|
||||
-DLLVM_INSTALL_UTILS=ON ^
|
||||
-DLLVM_INCLUDE_TESTS=OFF ^
|
||||
-DLLVM_INCLUDE_DOCS=OFF ^
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF
|
||||
if errorlevel 1 exit 1
|
||||
cmake --build . --config "%BUILD_TYPE%" --parallel 4
|
||||
if errorlevel 1 exit 1
|
||||
cmake --build . --config "%BUILD_TYPE%" --target install
|
||||
if errorlevel 1 exit 1
|
||||
EOF
|
||||
|
||||
${wfvm.utils.win-exec}/bin/win-exec "mkdir llvm-or1k"
|
||||
${wfvm.utils.win-put}/bin/win-put meta.yaml llvm-or1k
|
||||
${wfvm.utils.win-put}/bin/win-put bld.bat llvm-or1k
|
||||
ln -s ${src} src
|
||||
tar chf src.tar src
|
||||
${wfvm.utils.win-put}/bin/win-put src.tar .
|
||||
|
||||
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda build --no-anaconda-upload --no-test -c file:///C:/users/wfvm/fake-channel --override-channels llvm-or1k"
|
||||
|
||||
${wfvm.utils.win-get}/bin/win-get "Anaconda3/conda-bld/win-64/llvm-or1k-${version}-0.tar.bz2"
|
||||
'';
|
||||
};
|
||||
in
|
||||
pkgs.runCommand "conda-windows-llvm-or1k" { buildInputs = [ build ]; } ''
|
||||
wfvm-run-build-llvm-or1k
|
||||
mkdir -p $out/win-64 $out/nix-support
|
||||
cp llvm-or1k-*.tar.bz2 $out/win-64
|
||||
echo file conda $out/win-64/*.tar.bz2 >> $out/nix-support/hydra-build-products
|
||||
''
|
|
@ -0,0 +1,76 @@
|
|||
{ pkgs, conda-windows-llvm-or1k, version, src }:
|
||||
|
||||
let
|
||||
wfvm = import ../wfvm.nix { inherit pkgs; };
|
||||
conda-vs2015_runtime-filename = "vs2015_runtime-14.16.27012-hf0eaf9b_2.tar.bz2";
|
||||
conda-vs2015_runtime = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/anaconda/vs2015_runtime/14.16.27012/download/win-64/${conda-vs2015_runtime-filename}";
|
||||
sha256 = "1gbm6i6nkp8linmak5mm42hj1nzqd5ppak8kv1n3wfn52p21ngvs";
|
||||
};
|
||||
conda-cmake-filename = "cmake-3.17.2-h33f27b4_0.tar.bz2";
|
||||
conda-cmake = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/anaconda/cmake/3.17.2/download/win-64/${conda-cmake-filename}";
|
||||
sha256 = "0lg782pj2i9h20rwfkwwskis038r98b3z4c9j1a6ih95rc6m2acn";
|
||||
};
|
||||
build = wfvm.utils.wfvm-run {
|
||||
name = "build-llvmlite-artiq";
|
||||
image = wfvm.makeWindowsImage { installCommands = with wfvm.layers; [ anaconda3 msvc msvc-ide-unbreak ]; };
|
||||
script = ''
|
||||
ln -s ${conda-vs2015_runtime} ${conda-vs2015_runtime-filename}
|
||||
ln -s ${conda-cmake} ${conda-cmake-filename}
|
||||
${wfvm.utils.win-exec}/bin/win-exec "mkdir fake-channel && mkdir fake-channel\win-64"
|
||||
${wfvm.utils.win-put}/bin/win-put ${conda-vs2015_runtime-filename} ./fake-channel/win-64
|
||||
${wfvm.utils.win-put}/bin/win-put ${conda-cmake-filename} ./fake-channel/win-64
|
||||
${wfvm.utils.win-put}/bin/win-put ${conda-windows-llvm-or1k}/win-64/llvm-or1k-*.tar.bz2 ./fake-channel/win-64
|
||||
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda index fake-channel"
|
||||
|
||||
cat > meta.yaml << EOF
|
||||
package:
|
||||
name: llvmlite-artiq
|
||||
version: ${version}
|
||||
|
||||
source:
|
||||
url: ../src.tar
|
||||
|
||||
requirements:
|
||||
build:
|
||||
- cmake
|
||||
- llvm-or1k
|
||||
run:
|
||||
- python<3.9
|
||||
EOF
|
||||
|
||||
cat > bld.bat << EOF
|
||||
@rem Let CMake know about the LLVM install path, for find_package()
|
||||
set CMAKE_PREFIX_PATH=%LIBRARY_PREFIX%
|
||||
|
||||
@rem Ensure there are no build leftovers (CMake can complain)
|
||||
if exist ffi\build rmdir /S /Q ffi\build
|
||||
|
||||
python setup.py install \
|
||||
--prefix=%PREFIX% \
|
||||
--single-version-externally-managed \
|
||||
--record=record.txt \
|
||||
--no-compile
|
||||
if errorlevel 1 exit 1
|
||||
EOF
|
||||
|
||||
${wfvm.utils.win-exec}/bin/win-exec "mkdir llvmlite-artiq"
|
||||
${wfvm.utils.win-put}/bin/win-put meta.yaml llvmlite-artiq
|
||||
${wfvm.utils.win-put}/bin/win-put bld.bat llvmlite-artiq
|
||||
ln -s ${src} src
|
||||
tar chf src.tar src
|
||||
${wfvm.utils.win-put}/bin/win-put src.tar .
|
||||
|
||||
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda build --no-anaconda-upload --no-test -c file:///C:/users/wfvm/fake-channel --override-channels llvmlite-artiq"
|
||||
|
||||
${wfvm.utils.win-get}/bin/win-get "Anaconda3/conda-bld/win-64/llvmlite-artiq-${version}-0.tar.bz2"
|
||||
'';
|
||||
};
|
||||
in
|
||||
pkgs.runCommand "conda-windows-llvmlite-artiq" { buildInputs = [ build ]; } ''
|
||||
wfvm-run-build-llvmlite-artiq
|
||||
mkdir -p $out/win-64 $out/nix-support
|
||||
cp llvmlite-artiq-*.tar.bz2 $out/win-64
|
||||
echo file conda $out/win-64/*.tar.bz2 >> $out/nix-support/hydra-build-products
|
||||
''
|
|
@ -0,0 +1,177 @@
|
|||
{ pkgs } : [
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libiconv-1.16-1-any.pkg.tar.xz";
|
||||
sha256 = "0w8jkjr5gwybw9469216vs6vpibkq36wx47bbl4r0smi4wvh2yxk";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zlib-1.2.11-7-any.pkg.tar.xz";
|
||||
sha256 = "1hnfagn5m0ys4f8349d8dpbqvh9p900jjn83r7fi1az6i9dz1v0x";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-binutils-2.34-3-any.pkg.tar.zst";
|
||||
sha256 = "0ahlwbg5ir89nbra407yrzsplib4cia9m0dggcqjw1i4bxi7ypj1";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-headers-git-8.0.0.5905.066f1b3c-1-any.pkg.tar.zst";
|
||||
sha256 = "0sskg0vvgggs932i09ipm5rrllv6vdf1ai3d3fvbi5pxis1xc9g0";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-crt-git-8.0.0.5905.066f1b3c-1-any.pkg.tar.zst";
|
||||
sha256 = "1sjizkvknivbjs962fqxcmjkgnrvhd1frq96cfj2fyzk5cz7kfx0";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-isl-0.22.1-1-any.pkg.tar.xz";
|
||||
sha256 = "1nj7sj3hgxhziqs1l7k42ginl10w7iy1b753mwvqiczfs322hb90";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gmp-6.2.0-1-any.pkg.tar.xz";
|
||||
sha256 = "1l4qdxr8xp6xyxabwcf9b876db3rhj4v54zsvb4v1kwm3jrs7caw";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpfr-4.0.2-2-any.pkg.tar.xz";
|
||||
sha256 = "0hriryx58bkk3sihnhd4i6966civ3hq8i68rnc9kjivk47wi49rj";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-mpc-1.1.0-1-any.pkg.tar.xz";
|
||||
sha256 = "0x1kg178l6mf9ivdy71bci36h2a37vypg4jk3k7y31ks6i79zifp";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-libwinpthread-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst";
|
||||
sha256 = "16aqi04drn252cxdh1brpbi4syn4bfjb84qk4xqbnffnpxpvv5ph";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-libs-10.1.0-3-any.pkg.tar.zst";
|
||||
sha256 = "0bmkrb9x7z0azzxl3z08r6chcl0pbnaijar7cdjxb2nh7fbbdzzp";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-windows-default-manifest-6.4-3-any.pkg.tar.xz";
|
||||
sha256 = "1kwxb3q2slgsg17lkd0dc9fjks5f205dgm79fj0xq0zmrsns83kc";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-winpthreads-git-8.0.0.5906.c9a21571-1-any.pkg.tar.zst";
|
||||
sha256 = "17nq8gs1nnxgligdrp5n6h4pnk46xw0yhjk2hn6y12vvpn7iv05v";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-zstd-1.4.5-1-any.pkg.tar.zst";
|
||||
sha256 = "1jfxzajmbvlap1c0v17s8dzwdx0fi8kyrkmgr6gw1snisgllifyh";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/mingw/x86_64/mingw-w64-x86_64-gcc-10.1.0-3-any.pkg.tar.zst";
|
||||
sha256 = "1gkcc6hh20glx4b96ldsnd70r8dbp460bxfznm9z2rwgr0mxb374";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/make-4.3-1-x86_64.pkg.tar.xz";
|
||||
sha256 = "0bmgggw56gkx7dcd8simpi2lhgz98limikx8wm0cb8cn7awi9w82";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/m4-1.4.18-2-x86_64.pkg.tar.xz";
|
||||
sha256 = "05x7myqwwxk3vfqmliwk5pfn0w04fnjh1sqafsynpb9hx0c563ji";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/diffutils-3.7-1-x86_64.pkg.tar.xz";
|
||||
sha256 = "11qdxn4mr8a96palhp5jkam904fh77bsw5v7mslhnzag4cg3kybx";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/autoconf-2.69-5-any.pkg.tar.xz";
|
||||
sha256 = "1fxvgbjnmmb7dvmssfxkiw151dfd1wzj04hf45zklmzs4h2kkwda";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake1.6-1.6.3-2-any.pkg.tar.xz";
|
||||
sha256 = "0if4wrr1vm2f1zjjh6dpln97xc1l1052bcawzmndwfh561cfxqb6";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake1.7-1.7.9-2-any.pkg.tar.xz";
|
||||
sha256 = "1mjhp1k4c0xm8hfm3yckqvfb4ablzgg8a87l7wxaq1mmmskjmhpq";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake1.8-1.8.5-3-any.pkg.tar.xz";
|
||||
sha256 = "046bzr44ss0lglx9lzccj9li74arz632hyvz6l9fcp98dndr3qjk";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake1.9-1.9.6-2-any.pkg.tar.xz";
|
||||
sha256 = "0bh0dldmrd46xhix5358nj9sgf298n4ap0y8dsl6rvjsb5c0l5hd";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake1.10-1.10.3-3-any.pkg.tar.xz";
|
||||
sha256 = "0p26lkx5n1mmmw1y98bgwzbxfxkfa18fqxvkgsm60fznjig4dq61";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake1.11-1.11.6-3-any.pkg.tar.xz";
|
||||
sha256 = "1cjkav2bskf9rdm8g3hsl2l7wz1lx8dfigwqib0xhm7n8i8gc560";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake1.12-1.12.6-3-any.pkg.tar.xz";
|
||||
sha256 = "1c0h2lngfjjfvw0jkrfah1fs25k0vdm80hlxfjs912almh2yg5gv";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake1.13-1.13.4-4-any.pkg.tar.xz";
|
||||
sha256 = "0mczn8hanqn3hxr104klb832b4cnzn44bbn7lvqfsbvvjpklv9ld";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake1.14-1.14.1-3-any.pkg.tar.xz";
|
||||
sha256 = "04gjyfszyphxy7qc1rr8378ms9hql0sy8a1gyj0mvpbmgb0phgkp";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake1.15-1.15.1-1-any.pkg.tar.xz";
|
||||
sha256 = "00n1f3c6fwznpm1f6xmj30q41ixw5vdg52yg48yvr4jswb78qf8q";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake1.16-1.16.1-1-any.pkg.tar.xz";
|
||||
sha256 = "1ds8rpagrlkzi28n5rh0jcibbic49xssl2hz6sy41my0vd8a3z9y";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/automake-wrapper-11-1-any.pkg.tar.xz";
|
||||
sha256 = "1dzymv59wri7qqmgmy5xfkq6zvfcb0znwspc149a04d0bhxs75gw";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/libltdl-2.4.6-9-x86_64.pkg.tar.xz";
|
||||
sha256 = "0j0xazjpj28dib9vjn3paibhry77k903rzvbkdn6gnl20smj18g2";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/tar-1.32-1-x86_64.pkg.tar.xz";
|
||||
sha256 = "0ynz2qwzbcmixcxddp05q2wc7iqli6svzkrjss9izrpmbkv5ifa5";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/libtool-2.4.6-9-x86_64.pkg.tar.xz";
|
||||
sha256 = "0mrnkayrhmrgq446nyysvj3kadqm1xhyl97qqv6hrq57lhkcry2p";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "http://repo.msys2.org/msys/x86_64/texinfo-6.7-1-x86_64.pkg.tar.xz";
|
||||
sha256 = "0c50809yg9g95m8yib867q8m28sjabqppz2qbzh3gr83z55kknnw";
|
||||
})
|
||||
]
|
|
@ -0,0 +1,13 @@
|
|||
{ pkgs, name, filename, baseurl, sha256 }:
|
||||
|
||||
let
|
||||
download = pkgs.fetchurl {
|
||||
url = "${baseurl}${filename}";
|
||||
inherit sha256;
|
||||
};
|
||||
in
|
||||
pkgs.runCommand "conda-windows-${name}" { } ''
|
||||
mkdir -p $out/win-64 $out/nix-support
|
||||
ln -s ${download} $out/win-64/${filename}
|
||||
echo file conda $out/win-64/${filename} >> $out/nix-support/hydra-build-products
|
||||
''
|
|
@ -0,0 +1,36 @@
|
|||
{ pkgs }:
|
||||
|
||||
let
|
||||
version = import ../pkgs/artiq-version.nix (with pkgs; { inherit stdenv fetchgit git; });
|
||||
fakeCondaSource = import ./fake-source.nix { inherit pkgs; } {
|
||||
name = "artiq";
|
||||
inherit version;
|
||||
src = import ../pkgs/artiq-src.nix { fetchgit = pkgs.fetchgit; };
|
||||
dependencies = [
|
||||
"pythonparser"
|
||||
"scipy"
|
||||
"numpy"
|
||||
"prettytable"
|
||||
"h5py"
|
||||
"python-dateutil"
|
||||
"pyqt"
|
||||
(if (pkgs.lib.strings.versionAtLeast version "6.0") then "qasync" else "quamash")
|
||||
"pyqtgraph"
|
||||
"pygit2"
|
||||
"python-levenshtein"
|
||||
"sipyco"
|
||||
] ++ (if (pkgs.lib.strings.versionAtLeast version "7.0") then ["llvmlite" "llvm-tools" "lld"] else ["llvmlite-artiq" "binutils-or1k-linux"]);
|
||||
extraYaml =
|
||||
''
|
||||
about:
|
||||
home: https://m-labs.hk/artiq
|
||||
license: LGPL
|
||||
summary: 'A leading-edge control system for quantum information experiments'
|
||||
'';
|
||||
};
|
||||
conda-artiq = import ./build.nix { inherit pkgs; } {
|
||||
name = "conda-artiq";
|
||||
src = fakeCondaSource;
|
||||
};
|
||||
in
|
||||
conda-artiq
|
|
@ -0,0 +1,45 @@
|
|||
{ pkgs, version, src, target }:
|
||||
|
||||
let
|
||||
fake-src = pkgs.runCommand "conda-fake-source-binutils-${target}" { }
|
||||
''
|
||||
mkdir -p $out/fake-conda;
|
||||
|
||||
cat << EOF > $out/fake-conda/meta.yaml
|
||||
package:
|
||||
name: binutils-${target}
|
||||
version: ${version}
|
||||
|
||||
source:
|
||||
url: ${src}
|
||||
|
||||
# Note: libiconv is also a build dependency, but the conda garbage won't find it
|
||||
# if installed from a file (even if it shows up in conda list), as is the case
|
||||
# when using this script.
|
||||
requirements:
|
||||
run:
|
||||
- libiconv
|
||||
|
||||
EOF
|
||||
|
||||
cat << EOF > $out/fake-conda/build.sh
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
mkdir build
|
||||
cd build
|
||||
../configure --target=${target} --prefix=\$PREFIX
|
||||
make
|
||||
make install
|
||||
|
||||
# this is a copy of prefixed executables
|
||||
rm -rf $PREFIX/${target}
|
||||
|
||||
EOF
|
||||
chmod 755 $out/fake-conda/build.sh
|
||||
'';
|
||||
in
|
||||
import ./build.nix { inherit pkgs; } {
|
||||
name = "conda-binutils-${target}";
|
||||
src = fake-src;
|
||||
}
|
|
@ -0,0 +1,36 @@
|
|||
{ pkgs, bscan_spi_bitstreams }:
|
||||
|
||||
let
|
||||
src = pkgs.runCommand "conda-fake-source-bscan_spi_bitstreams" { }
|
||||
''
|
||||
mkdir -p $out/fake-conda;
|
||||
|
||||
# work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files.
|
||||
cp --no-preserve=mode,ownership -L -R ${bscan_spi_bitstreams} workaround-conda
|
||||
pushd workaround-conda
|
||||
tar cf $out/src.tar .
|
||||
popd
|
||||
rm -rf workaround-conda
|
||||
|
||||
cat << EOF > $out/fake-conda/meta.yaml
|
||||
package:
|
||||
name: bscan-spi-bitstreams
|
||||
version: "0.10.0"
|
||||
|
||||
source:
|
||||
url: ../src.tar
|
||||
|
||||
build:
|
||||
noarch: generic
|
||||
binary_relocation: false
|
||||
script:
|
||||
- "mkdir -p \$PREFIX/share/bscan-spi-bitstreams"
|
||||
- "cp *.bit \$PREFIX/share/bscan-spi-bitstreams"
|
||||
|
||||
EOF
|
||||
'';
|
||||
in
|
||||
import ./build.nix { inherit pkgs; } {
|
||||
name = "conda-bscan_spi_bitstreams";
|
||||
inherit src;
|
||||
}
|
|
@ -0,0 +1,30 @@
|
|||
# We need to pass the whole source to conda for the git variables to work.
|
||||
# recipe must be a string pointing to a path within the source.
|
||||
|
||||
{ pkgs }:
|
||||
{ name ? null
|
||||
, src
|
||||
, pname ? null
|
||||
, version ? null
|
||||
, recipe ? "fake-conda"
|
||||
}:
|
||||
|
||||
# Check that either name is specified or both pname & version are specified.
|
||||
assert (name == null) -> pname != null && version != null;
|
||||
assert (name != null) -> pname == null && version == null;
|
||||
let
|
||||
condaBuilderEnv = import ./builder-env.nix { inherit pkgs; };
|
||||
realName = if (name != null) then name else "${pname}-${version}";
|
||||
in pkgs.stdenvNoCC.mkDerivation {
|
||||
name = realName;
|
||||
inherit src;
|
||||
buildCommand =
|
||||
''
|
||||
HOME=`pwd`
|
||||
mkdir $out
|
||||
${condaBuilderEnv}/bin/conda-builder-env -c "conda build --no-anaconda-upload --no-test --output-folder $out $src/${recipe}"
|
||||
|
||||
mkdir -p $out/nix-support
|
||||
echo file conda $out/*/*.tar.bz2 >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
}
|
|
@ -0,0 +1,59 @@
|
|||
{ pkgs }:
|
||||
|
||||
with pkgs;
|
||||
|
||||
let
|
||||
condaDeps = [ zlib xorg.libSM xorg.libICE xorg.libX11 xorg.libXau xorg.libXi xorg.libXrender libselinux libGL ];
|
||||
# Use the full Anaconda distribution, which already contains conda-build and its many dependencies,
|
||||
# so we don't have to manually deal with them.
|
||||
condaInstaller = fetchurl {
|
||||
url = "https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh";
|
||||
sha256 = "0lrxwd3pwz8k3jxwgkd9x47wgkqqy9s8m7hgx1x2gw4gcwysnl97";
|
||||
};
|
||||
condaSrcChmod = runCommand "conda-src-chmod" { }
|
||||
''
|
||||
mkdir $out
|
||||
cp ${condaInstaller} $out/conda-installer.sh
|
||||
chmod +x $out/conda-installer.sh
|
||||
# keep the same file length to avoid breaking embedded payload offsets
|
||||
sed -i 0,/unset\ LD_LIBRARY_PATH/s//\#nset\ LD_LIBRARY_PATH/ $out/conda-installer.sh
|
||||
'';
|
||||
condaInstallerEnv = buildFHSUserEnv {
|
||||
name = "conda-installer-env";
|
||||
targetPkgs = pkgs: ([ condaSrcChmod ] ++ condaDeps);
|
||||
};
|
||||
|
||||
# for binutils
|
||||
libiconv-filename = "libiconv-1.15-h516909a_1006.tar.bz2";
|
||||
libiconv = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/conda-forge/libiconv/1.15/download/linux-64/${libiconv-filename}";
|
||||
sha256 = "1y1g807881j95f9s6mjinf6b7mqa51vc9jf0v7cx8hn7xx4d10ik";
|
||||
};
|
||||
|
||||
condaInstalled = runCommand "conda-installed" { }
|
||||
''
|
||||
${condaInstallerEnv}/bin/conda-installer-env -c "${condaSrcChmod}/conda-installer.sh -p $out -b"
|
||||
substituteInPlace $out/lib/python3.8/site-packages/conda/gateways/disk/__init__.py \
|
||||
--replace "os.chmod(path, 0o2775)" "pass"
|
||||
|
||||
# The conda garbage breaks if the package filename is prefixed with the Nix store hash.
|
||||
# Symptom is "WARNING conda.core.prefix_data:_load_single_record(167): Ignoring malformed
|
||||
# prefix record at: /nix/store/[...].json", and the package is not registered in the conda
|
||||
# list, even though its files are installed.
|
||||
ln -s ${libiconv} ${libiconv-filename}
|
||||
${condaInstallerEnv}/bin/conda-installer-env -c "$out/bin/conda install ${libiconv-filename}"
|
||||
'';
|
||||
|
||||
binutils-fhs = (pkgs.binutils.overrideAttrs(oa: {postFixup = oa.postFixup + "echo /lib64/ld-linux-x86-64.so.2 > $out/nix-support/dynamic-linker";}));
|
||||
gcc-fhs = (pkgs.gcc.override {bintools = binutils-fhs;} );
|
||||
in
|
||||
buildFHSUserEnv {
|
||||
name = "conda-builder-env";
|
||||
targetPkgs = pkgs: ([ condaInstalled ] ++ condaDeps ++ [
|
||||
binutils-fhs
|
||||
gcc-fhs
|
||||
# for llvm-or1k
|
||||
cmake
|
||||
]
|
||||
);
|
||||
}
|
|
@ -1,5 +1,5 @@
|
|||
{ pkgs }:
|
||||
{ name, version, src, dependencies ? []}:
|
||||
{ name, version, src, extraSrcCommands ? "", dependencies ? [], extraYaml ? ""}:
|
||||
pkgs.runCommand "conda-fake-source-${name}" { }
|
||||
''
|
||||
mkdir -p $out/fake-conda;
|
||||
|
@ -7,6 +7,7 @@ pkgs.runCommand "conda-fake-source-${name}" { }
|
|||
# work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files.
|
||||
cp --no-preserve=mode,ownership -R ${src} workaround-conda
|
||||
pushd workaround-conda
|
||||
${extraSrcCommands}
|
||||
tar cf $out/src.tar .
|
||||
popd
|
||||
rm -rf workaround-conda
|
||||
|
@ -35,6 +36,8 @@ pkgs.runCommand "conda-fake-source-${name}" { }
|
|||
requirements:
|
||||
run:
|
||||
${pkgs.lib.concatStringsSep "\n" (map (s: " - ${s}") dependencies)}
|
||||
|
||||
${extraYaml}
|
||||
EOF
|
||||
|
||||
cat << EOF > $out/fake-conda/build.sh
|
||||
|
@ -42,6 +45,7 @@ pkgs.runCommand "conda-fake-source-${name}" { }
|
|||
set -e
|
||||
|
||||
export VERSIONEER_OVERRIDE=${version}
|
||||
export LD_LIBRARY_PATH=/lib
|
||||
python setup.py install \
|
||||
--prefix=\$PREFIX \
|
||||
--single-version-externally-managed \
|
|
@ -0,0 +1,52 @@
|
|||
{ pkgs, version, src }:
|
||||
|
||||
let
|
||||
fake-src = pkgs.runCommand "conda-fake-source-llvm-or1k" { }
|
||||
''
|
||||
mkdir -p $out/fake-conda;
|
||||
|
||||
# work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files.
|
||||
cp --no-preserve=mode,ownership -R ${src} workaround-conda
|
||||
pushd workaround-conda
|
||||
tar cf $out/src.tar .
|
||||
popd
|
||||
rm -rf workaround-conda
|
||||
|
||||
cat << EOF > $out/fake-conda/meta.yaml
|
||||
package:
|
||||
name: llvm-or1k
|
||||
version: ${version}
|
||||
|
||||
# Use the nixpkgs cmake to build, so we are less bothered by conda idiocy.
|
||||
|
||||
source:
|
||||
url: ../src.tar
|
||||
|
||||
EOF
|
||||
|
||||
cat << EOF > $out/fake-conda/build.sh
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. \$COMPILER32 \
|
||||
-DCMAKE_BUILD_TYPE=Release \
|
||||
-DCMAKE_INSTALL_PREFIX=\$PREFIX \
|
||||
-DLLVM_BUILD_LLVM_DYLIB=ON \
|
||||
-DLLVM_LINK_LLVM_DYLIB=ON \
|
||||
-DLLVM_TARGETS_TO_BUILD=X86\;ARM \
|
||||
-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=OR1K \
|
||||
-DLLVM_ENABLE_ASSERTIONS=OFF \
|
||||
-DLLVM_INSTALL_UTILS=ON \
|
||||
-DLLVM_INCLUDE_TESTS=OFF \
|
||||
-DLLVM_INCLUDE_DOCS=OFF \
|
||||
-DLLVM_INCLUDE_EXAMPLES=OFF
|
||||
make -j2
|
||||
make install
|
||||
|
||||
EOF
|
||||
chmod 755 $out/fake-conda/build.sh
|
||||
'';
|
||||
in
|
||||
import ./build.nix { inherit pkgs; } {
|
||||
name = "conda-llvm-or1k";
|
||||
src = fake-src;
|
||||
}
|
|
@ -0,0 +1,69 @@
|
|||
{ pkgs, conda-llvm-or1k, version, src }:
|
||||
|
||||
let
|
||||
condaBuilderEnv = import ./builder-env.nix { inherit pkgs; };
|
||||
fake-src = pkgs.runCommand "conda-fake-source-llvmlite-artiq" { }
|
||||
''
|
||||
mkdir -p $out/fake-conda;
|
||||
|
||||
# work around yet more idiotic conda behavior - build breaks if write permissions aren't set on source files.
|
||||
cp --no-preserve=mode,ownership -R ${src} workaround-conda
|
||||
pushd workaround-conda
|
||||
tar cf $out/src.tar .
|
||||
popd
|
||||
rm -rf workaround-conda
|
||||
|
||||
cat << EOF > $out/fake-conda/meta.yaml
|
||||
package:
|
||||
name: llvmlite-artiq
|
||||
version: ${version}
|
||||
|
||||
source:
|
||||
url: ../src.tar
|
||||
|
||||
# Again, we don't specify build dependencies since the conda garbage mistakenly thinks
|
||||
# that they are not there if they have been installed from files.
|
||||
requirements:
|
||||
run:
|
||||
- python<3.9
|
||||
- ncurses [linux]
|
||||
EOF
|
||||
|
||||
cat << EOF > $out/fake-conda/build.sh
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
export LD_LIBRARY_PATH=/lib
|
||||
python setup.py install \
|
||||
--prefix=\$PREFIX \
|
||||
--single-version-externally-managed \
|
||||
--record=record.txt \
|
||||
--no-compile
|
||||
|
||||
EOF
|
||||
chmod 755 $out/fake-conda/build.sh
|
||||
'';
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "conda-llvmlite-artiq";
|
||||
src = fake-src;
|
||||
buildCommand =
|
||||
''
|
||||
HOME=`pwd`
|
||||
mkdir $out
|
||||
cat << EOF > conda-commands.sh
|
||||
set -e
|
||||
|
||||
conda create --prefix ./conda_tmp ${conda-llvm-or1k}/*/*.tar.bz2
|
||||
conda init
|
||||
source .bashrc
|
||||
conda activate ./conda_tmp
|
||||
|
||||
conda build --no-anaconda-upload --no-test --output-folder $out $src/fake-conda
|
||||
EOF
|
||||
${condaBuilderEnv}/bin/conda-builder-env conda-commands.sh
|
||||
|
||||
mkdir -p $out/nix-support
|
||||
echo file conda $out/*/*.tar.bz2 >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
}
|
|
@ -0,0 +1,88 @@
|
|||
{ pkgs, src }:
|
||||
|
||||
let
|
||||
condaBuilderEnv = import ./builder-env.nix { inherit pkgs; };
|
||||
fake-src = pkgs.runCommand "conda-fake-source-llvmlite" { }
|
||||
''
|
||||
mkdir -p $out/fake-conda;
|
||||
|
||||
mkdir conda-sucks
|
||||
pushd conda-sucks
|
||||
tar xvf ${src} --strip-components=1
|
||||
tar cf $out/src.tar .
|
||||
patch -p1 < ${../pkgs/llvmlite-callsite.diff}
|
||||
patch -p1 < ${../pkgs/llvmlite-abiname.diff}
|
||||
popd
|
||||
rm -rf conda-sucks
|
||||
|
||||
cat << EOF > $out/fake-conda/meta.yaml
|
||||
package:
|
||||
name: llvmlite
|
||||
version: 0.99 # high version number to entice the conda filth to choose it over others
|
||||
|
||||
source:
|
||||
url: ../src.tar
|
||||
|
||||
# Again, we don't specify build dependencies since the conda garbage mistakenly thinks
|
||||
# that they are not there if they have been installed from files.
|
||||
requirements:
|
||||
run:
|
||||
- libllvm11
|
||||
- python<3.9
|
||||
- zlib
|
||||
EOF
|
||||
|
||||
cat << EOF > $out/fake-conda/build.sh
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
export LD_LIBRARY_PATH=/lib
|
||||
python setup.py install \
|
||||
--prefix=\$PREFIX \
|
||||
--single-version-externally-managed \
|
||||
--record=record.txt \
|
||||
--no-compile
|
||||
|
||||
EOF
|
||||
chmod 755 $out/fake-conda/build.sh
|
||||
'';
|
||||
conda-zlib = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/conda-forge/zlib/1.2.11/download/linux-64/zlib-1.2.11-h36c2ea0_1013.tar.bz2";
|
||||
sha256 = "sha256-zsSNs1p97wARv9qiuR5eBdKgrXiLiHGiE+uMrP63QYo=";
|
||||
};
|
||||
conda-llvm = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/conda-forge/llvm/11.1.0/download/linux-64/llvm-11.1.0-h32600fe_2.tar.bz2";
|
||||
sha256 = "sha256-E+jnVeGHad3LH+dKqFKH0/lBuQqZKtybXF44uArmNz8=";
|
||||
};
|
||||
conda-llvm-tools = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/conda-forge/llvm-tools/11.1.0/download/linux-64/llvm-tools-11.1.0-hf817b99_2.tar.bz2";
|
||||
sha256 = "sha256-Y87krT+d9vdVIPliJVc/szIVBRA3NNcUDdY9Gc9KpXg=";
|
||||
};
|
||||
conda-llvmdev = pkgs.fetchurl {
|
||||
url = "https://anaconda.org/conda-forge/llvmdev/11.1.0/download/linux-64/llvmdev-11.1.0-hf817b99_2.tar.bz2";
|
||||
sha256 = "sha256-vN87BWggPfpFp51Qm60R3D5krQ4AQwiEJaqPfVb6x40=";
|
||||
};
|
||||
in
|
||||
pkgs.stdenv.mkDerivation {
|
||||
name = "conda-llvmlite";
|
||||
src = fake-src;
|
||||
buildCommand =
|
||||
''
|
||||
HOME=`pwd`
|
||||
mkdir $out
|
||||
cat << EOF > conda-commands.sh
|
||||
set -e
|
||||
|
||||
conda create --prefix ./conda_tmp ${conda-zlib} ${conda-llvm} ${conda-llvm-tools} ${conda-llvmdev}
|
||||
conda init
|
||||
source .bashrc
|
||||
conda activate ./conda_tmp
|
||||
|
||||
conda build --no-anaconda-upload --no-test --output-folder $out $src/fake-conda
|
||||
EOF
|
||||
${condaBuilderEnv}/bin/conda-builder-env conda-commands.sh
|
||||
|
||||
mkdir -p $out/nix-support
|
||||
echo file conda $out/*/*.tar.bz2 >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
}
|
|
@ -1,7 +1,10 @@
|
|||
{ pkgs ? import <nixpkgs> {}}:
|
||||
{ pkgs ? import <nixpkgs> { overlays = [ (import ./mozilla-overlay.nix) ]; }}:
|
||||
with pkgs;
|
||||
let
|
||||
pythonDeps = import ./pkgs/python-deps.nix { inherit (pkgs) stdenv fetchFromGitHub python3Packages; };
|
||||
artiq6 = pkgs.lib.strings.versionAtLeast mainPackages.artiq.version "6.0";
|
||||
artiq7 = pkgs.lib.strings.versionAtLeast mainPackages.artiq.version "7.0";
|
||||
pythonDeps = import ./pkgs/python-deps.nix { inherit (pkgs) lib fetchgit fetchFromGitHub python3Packages; misoc-new = artiq7; };
|
||||
rustPlatform = import ./rust-platform.nix { inherit pkgs; };
|
||||
|
||||
boards = [
|
||||
{ target = "kasli"; variant = "tester"; }
|
||||
|
@ -9,7 +12,7 @@ let
|
|||
];
|
||||
boardPackages = pkgs.lib.lists.foldr (board: start:
|
||||
let
|
||||
boardBinaries = import ./artiq-board.nix { inherit pkgs; } {
|
||||
boardBinaries = import ./artiq-board.nix { inherit pkgs rustPlatform; } {
|
||||
target = board.target;
|
||||
variant = board.variant;
|
||||
};
|
||||
|
@ -17,22 +20,153 @@ let
|
|||
start // {
|
||||
"artiq-board-${board.target}-${board.variant}" = boardBinaries;
|
||||
}) {} boards;
|
||||
|
||||
mainPackages = rec {
|
||||
inherit (pythonDeps) asyncserial levenshtein pythonparser quamash pyqtgraph-qt5 misoc migen microscope jesd204b migen-axi lit outputcheck;
|
||||
inherit (pythonDeps) sipyco asyncserial pythonparser artiq-netboot misoc migen microscope jesd204b migen-axi lit outputcheck qasync;
|
||||
binutils-or1k = callPackage ./pkgs/binutils.nix { platform = "or1k"; target = "or1k-linux"; };
|
||||
binutils-arm = callPackage ./pkgs/binutils.nix { platform = "arm"; target = "armv7-unknown-linux-gnueabihf"; };
|
||||
llvm-or1k = callPackage ./pkgs/llvm-or1k.nix {};
|
||||
rustc = callPackage ./pkgs/rust
|
||||
((stdenv.lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) {
|
||||
rustc-legacy = callPackage ./pkgs/rust-legacy/rustc-with-crates.nix
|
||||
((lib.optionalAttrs (stdenv.cc.isGNU && stdenv.hostPlatform.isi686) {
|
||||
stdenv = overrideCC stdenv gcc6; # with gcc-7: undefined reference to `__divmoddi4'
|
||||
}) //
|
||||
{ inherit llvm-or1k; });
|
||||
rustc = if artiq7 then rustPlatform.rust.rustc else rustc-legacy;
|
||||
cargo-legacy = callPackage ./pkgs/rust-legacy/cargo.nix { inherit rustc; rustPlatform = rustPackages_1_45.rustPlatform; };
|
||||
cargo-vendor-legacy = callPackage ./pkgs/rust-legacy/cargo-vendor.nix {};
|
||||
llvmlite-artiq = callPackage ./pkgs/llvmlite-artiq.nix { inherit llvm-or1k; };
|
||||
llvmlite-llvm11 = callPackage ./pkgs/llvmlite-llvm11.nix { };
|
||||
libartiq-support = callPackage ./pkgs/libartiq-support.nix { inherit rustc; };
|
||||
artiq = callPackage ./pkgs/artiq.nix { inherit binutils-or1k llvm-or1k llvmlite-artiq libartiq-support lit outputcheck; };
|
||||
artiq = callPackage ./pkgs/artiq.nix { inherit pythonDeps binutils-or1k binutils-arm llvm-or1k llvmlite-artiq llvmlite-llvm11 libartiq-support lit outputcheck; };
|
||||
artiq-env = (pkgs.python3.withPackages(ps: [ artiq ])).overrideAttrs (oldAttrs: { name = "${pkgs.python3.name}-artiq-env-${artiq.version}"; });
|
||||
openocd = callPackage ./pkgs/openocd.nix {};
|
||||
conda-artiq = import ./conda-artiq.nix { inherit pkgs; };
|
||||
openocd = callPackage ./pkgs/openocd.nix { };
|
||||
};
|
||||
|
||||
condaNoarch = {
|
||||
conda-pythonparser = import ./conda/build.nix { inherit pkgs; } {
|
||||
pname = "conda-pythonparser";
|
||||
inherit (pythonDeps.pythonparser) version;
|
||||
src = import ./conda/fake-source.nix { inherit pkgs; } {
|
||||
name = "pythonparser";
|
||||
inherit (pythonDeps.pythonparser) version src;
|
||||
dependencies = ["regex"];
|
||||
};
|
||||
};
|
||||
conda-sipyco = import ./conda/build.nix { inherit pkgs; } {
|
||||
pname = "conda-sipyco";
|
||||
inherit (pythonDeps.sipyco) version;
|
||||
src = import ./conda/fake-source.nix { inherit pkgs; } {
|
||||
name = "sipyco";
|
||||
inherit (pythonDeps.sipyco) version src;
|
||||
dependencies = ["numpy"];
|
||||
};
|
||||
};
|
||||
conda-quamash = import ./conda/build.nix { inherit pkgs; } {
|
||||
pname = "conda-quamash";
|
||||
inherit (pkgs.python3Packages.quamash) version;
|
||||
src = import ./conda/fake-source.nix { inherit pkgs; } {
|
||||
name = "quamash";
|
||||
inherit (pkgs.python3Packages.quamash) version src;
|
||||
};
|
||||
};
|
||||
conda-qasync = import ./conda/build.nix { inherit pkgs; } {
|
||||
pname = "conda-qasync";
|
||||
inherit (pythonDeps.qasync) version;
|
||||
src = import ./conda/fake-source.nix { inherit pkgs; } {
|
||||
name = "qasync";
|
||||
inherit (pythonDeps.qasync) version src;
|
||||
};
|
||||
};
|
||||
conda-bscan-spi-bitstreams = import ./conda/bscan-spi-bitstreams.nix {
|
||||
inherit pkgs;
|
||||
bscan_spi_bitstreams = "${mainPackages.openocd}/share/bscan-spi-bitstreams";
|
||||
};
|
||||
conda-artiq = import ./conda/artiq.nix { inherit pkgs; };
|
||||
conda-asyncserial = import ./conda/build.nix { inherit pkgs; } {
|
||||
pname = "conda-asyncserial";
|
||||
inherit (pythonDeps.asyncserial) version;
|
||||
src = import ./conda/fake-source.nix { inherit pkgs; } {
|
||||
name = "asyncserial";
|
||||
inherit (pythonDeps.asyncserial) version src;
|
||||
dependencies = ["pyserial"];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
condaLinux = if artiq7 then ({
|
||||
# ARTIQ-7 uses upstream conda-forge packages except llvmlite
|
||||
conda-llvmlite = import ./conda/llvmlite-patched.nix {
|
||||
inherit pkgs;
|
||||
inherit (mainPackages.llvmlite-llvm11) src;
|
||||
};
|
||||
}) else (rec {
|
||||
conda-binutils-or1k = import ./conda/binutils.nix {
|
||||
inherit pkgs;
|
||||
inherit (mainPackages.binutils-or1k) version src;
|
||||
target = "or1k-linux";
|
||||
};
|
||||
conda-binutils-arm = import ./conda/binutils.nix {
|
||||
inherit pkgs;
|
||||
inherit (mainPackages.binutils-arm) version src;
|
||||
target = "armv7-unknown-linux-gnueabihf";
|
||||
};
|
||||
conda-llvm-or1k = import ./conda/llvm-or1k.nix {
|
||||
inherit pkgs;
|
||||
inherit (mainPackages.llvm-or1k) version;
|
||||
src = mainPackages.llvm-or1k.llvm-src;
|
||||
};
|
||||
conda-llvmlite-artiq = import ./conda/llvmlite-artiq.nix {
|
||||
inherit pkgs conda-llvm-or1k;
|
||||
inherit (mainPackages.llvmlite-artiq) version src;
|
||||
};
|
||||
});
|
||||
|
||||
condaWindows5 = {
|
||||
conda-windows-binutils-or1k = import ./conda-windows/redistribute.nix {
|
||||
inherit pkgs;
|
||||
name = "binutils-or1k";
|
||||
filename = "binutils-or1k-linux-2.27-h93a10e1_6.tar.bz2";
|
||||
baseurl = "https://anaconda.org/m-labs/binutils-or1k-linux/2.27/download/win-64/";
|
||||
sha256 = "0gbks36hfsx3893mihj0bdmg5vwccrq5fw8xp9b9xb8p5pr8qhzx";
|
||||
};
|
||||
conda-windows-llvm-or1k = import ./conda-windows/redistribute.nix {
|
||||
inherit pkgs;
|
||||
name = "llvm-or1k";
|
||||
filename = "llvm-or1k-6.0.0-25.tar.bz2";
|
||||
baseurl = "https://anaconda.org/m-labs/llvm-or1k/6.0.0/download/win-64/";
|
||||
sha256 = "06mnrg79rn9ni0d5z0x3jzb300nhqhbc2h9qbq5m50x3sgm8km63";
|
||||
};
|
||||
conda-windows-llvmlite-artiq = import ./conda-windows/redistribute.nix {
|
||||
inherit pkgs;
|
||||
name = "llvmlite-artiq";
|
||||
filename = "llvmlite-artiq-0.23.0.dev-py35_5.tar.bz2";
|
||||
baseurl = "https://anaconda.org/m-labs/llvmlite-artiq/0.23.0.dev/download/win-64/";
|
||||
sha256 = "10w24w5ljvan06pbvwqj4pzal072jnyynmwm42dn06pq88ryz9wj";
|
||||
};
|
||||
};
|
||||
|
||||
condaWindows6 = rec {
|
||||
conda-windows-binutils-or1k = import ./conda-windows/binutils.nix {
|
||||
inherit pkgs;
|
||||
inherit (mainPackages.binutils-or1k) version src;
|
||||
target = "or1k-linux";
|
||||
};
|
||||
conda-windows-binutils-arm = import ./conda-windows/binutils.nix {
|
||||
inherit pkgs;
|
||||
inherit (mainPackages.binutils-or1k) version src;
|
||||
target = "armv7-unknown-linux-gnueabihf";
|
||||
};
|
||||
conda-windows-llvm-or1k = import ./conda-windows/llvm-or1k.nix {
|
||||
inherit pkgs;
|
||||
inherit (mainPackages.llvm-or1k) version;
|
||||
src = mainPackages.llvm-or1k.llvm-src;
|
||||
};
|
||||
conda-windows-llvmlite-artiq = import ./conda-windows/llvmlite-artiq.nix {
|
||||
inherit pkgs conda-windows-llvm-or1k;
|
||||
inherit (mainPackages.llvmlite-artiq) version src;
|
||||
};
|
||||
};
|
||||
|
||||
condaWindows = if artiq6 then (if artiq7 then {} else condaWindows6) else condaWindows5;
|
||||
in
|
||||
mainPackages // boardPackages
|
||||
boardPackages // mainPackages // condaNoarch // condaLinux // condaWindows
|
||||
|
|
|
@ -1,7 +1,8 @@
|
|||
{ stdenv, cacert, git, cargo, cargo-vendor }:
|
||||
{ stdenv, lib, cacert, git, cargo, cargo-vendor }:
|
||||
{ name, src, sha256 }:
|
||||
stdenv.mkDerivation {
|
||||
name = "${name}-vendor";
|
||||
strictDeps = true;
|
||||
nativeBuildInputs = [ cacert git cargo cargo-vendor ];
|
||||
inherit src;
|
||||
|
||||
|
@ -30,6 +31,6 @@ stdenv.mkDerivation {
|
|||
outputHashMode = "recursive";
|
||||
outputHash = sha256;
|
||||
|
||||
impureEnvVars = stdenv.lib.fetchers.proxyImpureEnvVars;
|
||||
impureEnvVars = lib.fetchers.proxyImpureEnvVars;
|
||||
preferLocalBuild = true;
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
overlay = pkgs.fetchFromGitHub {
|
||||
owner = "mozilla";
|
||||
repo = "nixpkgs-mozilla";
|
||||
rev = "0510159186dd2ef46e5464484fbdf119393afa58";
|
||||
sha256 = "sha256-HJX4Pc5ZUAg4apxB/XHuJ+6ukzvRQqeZMjscOBst2bA=";
|
||||
};
|
||||
in
|
||||
import overlay
|
|
@ -3,13 +3,19 @@ let
|
|||
artiq-version = stdenv.mkDerivation {
|
||||
name = "artiq-version";
|
||||
src = import ./artiq-src.nix { inherit fetchgit; };
|
||||
# keep in sync with ../../artiq-fast.nix
|
||||
buildPhase = ''
|
||||
REV=`${git}/bin/git rev-parse HEAD`
|
||||
MAJOR_VERSION=`cat MAJOR_VERSION`
|
||||
if [ -e BETA ]; then
|
||||
SUFFIX=".beta"
|
||||
else
|
||||
SUFFIX=""
|
||||
fi
|
||||
COMMIT_COUNT=`${git}/bin/git rev-list --count HEAD`
|
||||
'';
|
||||
installPhase = ''
|
||||
echo -n $MAJOR_VERSION.$COMMIT_COUNT.`cut -c1-8 <<< $REV`.beta > $out
|
||||
echo -n $MAJOR_VERSION.$COMMIT_COUNT.`cut -c1-8 <<< $REV`$SUFFIX > $out
|
||||
'';
|
||||
};
|
||||
in
|
||||
|
|
|
@ -1,29 +1,52 @@
|
|||
{ stdenv, callPackage, fetchgit, git, python3Packages, qt5Full, binutils-or1k, llvm-or1k, llvmlite-artiq, libartiq-support, lit, outputcheck }:
|
||||
{ stdenv, lib, pythonDeps, fetchgit, git, python3Packages, qt5, libartiq-support, lit, outputcheck, fontconfig,
|
||||
binutils-or1k, binutils-arm, llvm-or1k, llvmlite-artiq,
|
||||
llvm_11, lld_11, llvmlite-llvm11 }:
|
||||
|
||||
let
|
||||
pythonDeps = callPackage ./python-deps.nix {};
|
||||
in
|
||||
python3Packages.buildPythonPackage rec {
|
||||
name = "artiq-${version}";
|
||||
version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
|
||||
src = import ./artiq-src.nix { inherit fetchgit; };
|
||||
preBuild = "export VERSIONEER_OVERRIDE=${version}";
|
||||
propagatedBuildInputs = [ binutils-or1k llvm-or1k llvmlite-artiq qt5Full ]
|
||||
++ (with pythonDeps; [ levenshtein pyqtgraph-qt5 quamash pythonparser ])
|
||||
++ (with python3Packages; [ aiohttp pygit2 numpy dateutil scipy prettytable pyserial h5py pyqt5 ]);
|
||||
checkInputs = [ binutils-or1k outputcheck ];
|
||||
checkPhase =
|
||||
''
|
||||
python -m unittest discover -v artiq.test
|
||||
python3Packages.buildPythonPackage rec {
|
||||
pname = "artiq";
|
||||
version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
|
||||
src = import ./artiq-src.nix { inherit fetchgit; };
|
||||
|
||||
TESTDIR=`mktemp -d`
|
||||
cp --no-preserve=mode,ownership -R ${src}/artiq/test/lit $TESTDIR
|
||||
LIBARTIQ_SUPPORT=${libartiq-support}/libartiq_support.so ${lit}/bin/lit -v $TESTDIR/lit
|
||||
'';
|
||||
meta = with stdenv.lib; {
|
||||
description = "A leading-edge control system for quantum information experiments";
|
||||
homepage = https://m-labs/artiq;
|
||||
license = licenses.lgpl3;
|
||||
maintainers = [ maintainers.sb0 ];
|
||||
};
|
||||
}
|
||||
preBuild = "export VERSIONEER_OVERRIDE=${version}";
|
||||
|
||||
nativeBuildInputs = [ qt5.wrapQtAppsHook ];
|
||||
propagatedBuildInputs = [ ]
|
||||
++ (lib.lists.optionals (!lib.strings.versionAtLeast version "7.0") [ binutils-or1k llvm-or1k llvmlite-artiq ])
|
||||
++ (lib.lists.optionals (lib.strings.versionAtLeast version "7.0") [ llvm_11 lld_11 llvmlite-llvm11 ])
|
||||
++ (lib.lists.optionals (lib.strings.versionAtLeast version "6.0" && !lib.strings.versionAtLeast version "7.0") [ binutils-arm ])
|
||||
++ (with pythonDeps; [ sipyco pythonparser ])
|
||||
++ (with python3Packages; [ pygit2 numpy dateutil scipy prettytable pyserial python-Levenshtein h5py pyqt5 pyqtgraph ])
|
||||
++ [(if (lib.strings.versionAtLeast version "6.0") then pythonDeps.qasync else python3Packages.quamash)];
|
||||
|
||||
dontWrapQtApps = true;
|
||||
postFixup = ''
|
||||
wrapQtApp "$out/bin/artiq_dashboard"
|
||||
wrapQtApp "$out/bin/artiq_browser"
|
||||
wrapQtApp "$out/bin/artiq_session"
|
||||
'';
|
||||
|
||||
# Modifies PATH to pass the wrapped python environment (i.e. python3.withPackages(...) to subprocesses.
|
||||
# Allows subprocesses using python to find all packages you have installed
|
||||
makeWrapperArgs = [
|
||||
''--run 'if [ ! -z "$NIX_PYTHONPREFIX" ]; then export PATH=$NIX_PYTHONPREFIX/bin:$PATH;fi' ''
|
||||
"--set FONTCONFIG_FILE ${fontconfig.out}/etc/fonts/fonts.conf"
|
||||
];
|
||||
|
||||
checkInputs = [ lit outputcheck ] ++ (if (lib.strings.versionAtLeast version "7.0") then [ lld_11 llvm_11 ] else [ binutils-or1k ]);
|
||||
checkPhase =
|
||||
''
|
||||
python -m unittest discover -v artiq.test
|
||||
|
||||
TESTDIR=`mktemp -d`
|
||||
cp --no-preserve=mode,ownership -R $src/artiq/test/lit $TESTDIR
|
||||
LIBARTIQ_SUPPORT=${libartiq-support}/libartiq_support.so lit -v $TESTDIR/lit
|
||||
'';
|
||||
|
||||
|
||||
meta = with lib; {
|
||||
description = "A leading-edge control system for quantum information experiments";
|
||||
homepage = https://m-labs/artiq;
|
||||
license = licenses.lgpl3;
|
||||
maintainers = [ maintainers.sb0 ];
|
||||
};
|
||||
}
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, buildPackages
|
||||
{ stdenv, lib, buildPackages
|
||||
, fetchurl, zlib
|
||||
, platform, target
|
||||
}:
|
||||
|
@ -27,7 +27,7 @@ stdenv.mkDerivation rec {
|
|||
`gprof', `nm', `strip', etc.
|
||||
'';
|
||||
homepage = http://www.gnu.org/software/binutils/;
|
||||
license = stdenv.lib.licenses.gpl3Plus;
|
||||
license = lib.licenses.gpl3Plus;
|
||||
/* Give binutils a lower priority than gcc-wrapper to prevent a
|
||||
collision due to the ld/as wrappers/symlinks in the latter. */
|
||||
priority = "10";
|
||||
|
|
|
@ -1,13 +1,15 @@
|
|||
{ stdenv, fetchgit, git, rustc }:
|
||||
stdenv.mkDerivation rec {
|
||||
name = "libartiq-support-${version}";
|
||||
pname = "libartiq-support";
|
||||
version = import ./artiq-version.nix { inherit stdenv fetchgit git; };
|
||||
|
||||
src = import ./artiq-src.nix { inherit fetchgit; };
|
||||
|
||||
buildInputs = [ rustc ];
|
||||
phases = [ "buildPhase" ];
|
||||
# keep in sync with artiq/test/lit/lit.cfg or remove build from the latter once we don't use buildbot/conda anymore
|
||||
buildPhase =
|
||||
''
|
||||
mkdir $out
|
||||
${rustc}/bin/rustc ${src}/artiq/test/libartiq_support/lib.rs --out-dir $out -Cpanic=unwind -g
|
||||
rustc $src/artiq/test/libartiq_support/lib.rs --out-dir $out -Cpanic=unwind -g
|
||||
'';
|
||||
}
|
||||
|
|
|
@ -1,14 +1,14 @@
|
|||
{ stdenv
|
||||
{ stdenv, lib
|
||||
, fetchFromGitHub, runCommand
|
||||
, perl, groff, cmake, libxml2, python, libffi, valgrind
|
||||
}:
|
||||
|
||||
let
|
||||
llvm-src = fetchFromGitHub {
|
||||
rev = "527aa86b578da5dfb9cf4510b71f0f46a11249f7";
|
||||
rev = "7746fe85489e92e1caffda18b9d7b2ae9e5da1a8";
|
||||
owner = "m-labs";
|
||||
repo = "llvm-or1k";
|
||||
sha256 = "0lmcg9xj66pf4mb6racipw67vm8kwm84dl861hyqnywd61kvhrwa";
|
||||
sha256 = "0jqbb3k9r91swsyrdak8fzvs1qi451zy8dqmpqriaxk5g83ny5b7";
|
||||
};
|
||||
clang-src = fetchFromGitHub {
|
||||
rev = "9e996136d52ed506ed8f57ef8b13b0f0f735e6a3";
|
||||
|
@ -25,10 +25,12 @@ let
|
|||
'';
|
||||
in
|
||||
stdenv.mkDerivation rec {
|
||||
name = "llvm-or1k";
|
||||
pname = "llvm-or1k";
|
||||
version = "6.0.0";
|
||||
passthru.llvm-src = llvm-src;
|
||||
src = llvm-clang-src;
|
||||
|
||||
buildInputs = [ perl groff cmake libxml2 python libffi ] ++ stdenv.lib.optional stdenv.isLinux valgrind;
|
||||
buildInputs = [ perl groff cmake libxml2 python libffi ] ++ lib.optional stdenv.isLinux valgrind;
|
||||
|
||||
preBuild = ''
|
||||
NIX_BUILD_CORES=4
|
||||
|
@ -57,8 +59,8 @@ in
|
|||
meta = {
|
||||
description = "Collection of modular and reusable compiler and toolchain technologies";
|
||||
homepage = http://llvm.org/;
|
||||
license = stdenv.lib.licenses.bsd3;
|
||||
maintainers = with stdenv.lib.maintainers; [ sb0 ];
|
||||
platforms = stdenv.lib.platforms.all;
|
||||
license = lib.licenses.bsd3;
|
||||
maintainers = with lib.maintainers; [ sb0 ];
|
||||
platforms = lib.platforms.all;
|
||||
};
|
||||
}
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
diff --git a/ffi/targets.cpp b/ffi/targets.cpp
|
||||
index 98de259fc..1ce472c20 100644
|
||||
--- a/ffi/targets.cpp
|
||||
+++ b/ffi/targets.cpp
|
||||
@@ -182,7 +182,8 @@ LLVMPY_CreateTargetMachine(LLVMTargetRef T,
|
||||
const char *RelocModel,
|
||||
const char *CodeModel,
|
||||
int PrintMC,
|
||||
- int JIT)
|
||||
+ int JIT,
|
||||
+ const char *ABIName)
|
||||
{
|
||||
using namespace llvm;
|
||||
CodeGenOpt::Level cgol;
|
||||
@@ -233,6 +234,7 @@ LLVMPY_CreateTargetMachine(LLVMTargetRef T,
|
||||
|
||||
TargetOptions opt;
|
||||
opt.PrintMachineCode = PrintMC;
|
||||
+ opt.MCOptions.ABIName = ABIName;
|
||||
|
||||
bool jit = JIT;
|
||||
|
||||
diff --git a/llvmlite/binding/targets.py b/llvmlite/binding/targets.py
|
||||
index eb53f09f2..a7e6ffdc3 100644
|
||||
--- a/llvmlite/binding/targets.py
|
||||
+++ b/llvmlite/binding/targets.py
|
||||
@@ -218,7 +218,7 @@ def __str__(self):
|
||||
|
||||
def create_target_machine(self, cpu='', features='',
|
||||
opt=2, reloc='default', codemodel='jitdefault',
|
||||
- printmc=False, jit=False):
|
||||
+ printmc=False, jit=False, abiname=''):
|
||||
"""
|
||||
Create a new TargetMachine for this target and the given options.
|
||||
|
||||
@@ -230,6 +230,9 @@ def create_target_machine(self, cpu='', features='',
|
||||
|
||||
The `jit` option should be set when the target-machine is to be used
|
||||
in a JIT engine.
|
||||
+
|
||||
+ The `abiname` option specifies the ABI. RISC-V targets with hard-float
|
||||
+ needs to pass the ABI name to LLVM.
|
||||
"""
|
||||
assert 0 <= opt <= 3
|
||||
assert reloc in RELOC
|
||||
@@ -249,6 +252,7 @@ def create_target_machine(self, cpu='', features='',
|
||||
_encode_string(codemodel),
|
||||
int(printmc),
|
||||
int(jit),
|
||||
+ _encode_string(abiname),
|
||||
)
|
||||
if tm:
|
||||
return TargetMachine(tm)
|
||||
@@ -403,6 +407,8 @@ def has_svml():
|
||||
c_int,
|
||||
# JIT
|
||||
c_int,
|
||||
+ # ABIName
|
||||
+ c_char_p,
|
||||
]
|
||||
ffi.lib.LLVMPY_CreateTargetMachine.restype = ffi.LLVMTargetMachineRef
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
{ stdenv, fetchFromGitHub, llvm-or1k, makeWrapper, python3, ncurses, zlib, python3Packages }:
|
||||
{ stdenv, lib, fetchFromGitHub, llvm-or1k, makeWrapper, python3, ncurses, zlib, python3Packages }:
|
||||
python3Packages.buildPythonPackage rec {
|
||||
name = "llvmlite-artiq";
|
||||
pname = "llvmlite-artiq";
|
||||
version = "0.23.0.dev";
|
||||
src = fetchFromGitHub {
|
||||
rev = "158f9d3a898dbf055ca513d69505df288c681fea";
|
||||
owner = "m-labs";
|
||||
|
@ -12,7 +13,7 @@ python3Packages.buildPythonPackage rec {
|
|||
|
||||
preBuild = "export LLVM_CONFIG=${llvm-or1k}/bin/llvm-config";
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
description = "A lightweight LLVM python binding for writing JIT compilers";
|
||||
homepage = "http://llvmlite.pydata.org/";
|
||||
maintainers = with maintainers; [ sb0 ];
|
||||
|
|
|
@ -0,0 +1,185 @@
|
|||
diff --git a/llvmlite/ir/builder.py b/llvmlite/ir/builder.py
|
||||
index f18a8d8bd..b4958770e 100644
|
||||
--- a/llvmlite/ir/builder.py
|
||||
+++ b/llvmlite/ir/builder.py
|
||||
@@ -872,14 +872,14 @@ def resume(self, landingpad):
|
||||
# Call APIs
|
||||
|
||||
def call(self, fn, args, name='', cconv=None, tail=False, fastmath=(),
|
||||
- attrs=()):
|
||||
+ attrs=(), arg_attrs=None):
|
||||
"""
|
||||
Call function *fn* with *args*:
|
||||
name = fn(args...)
|
||||
"""
|
||||
inst = instructions.CallInstr(self.block, fn, args, name=name,
|
||||
cconv=cconv, tail=tail, fastmath=fastmath,
|
||||
- attrs=attrs)
|
||||
+ attrs=attrs, arg_attrs=arg_attrs)
|
||||
self._insert(inst)
|
||||
return inst
|
||||
|
||||
@@ -908,9 +908,11 @@ def store_reg(self, value, reg_type, reg_name, name=''):
|
||||
return self.asm(ftype, "", "{%s}" % reg_name, [value], True, name)
|
||||
|
||||
def invoke(self, fn, args, normal_to, unwind_to,
|
||||
- name='', cconv=None, tail=False):
|
||||
+ name='', cconv=None, fastmath=(), attrs=(), arg_attrs=None):
|
||||
inst = instructions.InvokeInstr(self.block, fn, args, normal_to,
|
||||
- unwind_to, name=name, cconv=cconv)
|
||||
+ unwind_to, name=name, cconv=cconv,
|
||||
+ fastmath=fastmath, attrs=attrs,
|
||||
+ arg_attrs=arg_attrs)
|
||||
self._set_terminator(inst)
|
||||
return inst
|
||||
|
||||
diff --git a/llvmlite/ir/instructions.py b/llvmlite/ir/instructions.py
|
||||
index 7e82ee032..f337c1586 100644
|
||||
--- a/llvmlite/ir/instructions.py
|
||||
+++ b/llvmlite/ir/instructions.py
|
||||
@@ -5,7 +5,7 @@
|
||||
from llvmlite.ir import types
|
||||
from llvmlite.ir.values import (Block, Function, Value, NamedValue, Constant,
|
||||
MetaDataArgument, MetaDataString, AttributeSet,
|
||||
- Undefined)
|
||||
+ Undefined, ArgumentAttributes)
|
||||
from llvmlite.ir._utils import _HasMetadata
|
||||
|
||||
|
||||
@@ -63,13 +63,20 @@ class FastMathFlags(AttributeSet):
|
||||
|
||||
class CallInstr(Instruction):
|
||||
def __init__(self, parent, func, args, name='', cconv=None, tail=False,
|
||||
- fastmath=(), attrs=()):
|
||||
+ fastmath=(), attrs=(), arg_attrs=None):
|
||||
self.cconv = (func.calling_convention
|
||||
if cconv is None and isinstance(func, Function)
|
||||
else cconv)
|
||||
self.tail = tail
|
||||
self.fastmath = FastMathFlags(fastmath)
|
||||
self.attributes = CallInstrAttributes(attrs)
|
||||
+ self.arg_attributes = {}
|
||||
+ if arg_attrs:
|
||||
+ for idx, attrs in arg_attrs.items():
|
||||
+ if not (0 <= idx < len(args)):
|
||||
+ raise ValueError("Invalid argument index {}"
|
||||
+ .format(idx))
|
||||
+ self.arg_attributes[idx] = ArgumentAttributes(attrs)
|
||||
|
||||
# Fix and validate arguments
|
||||
args = list(args)
|
||||
@@ -111,8 +118,13 @@ def called_function(self):
|
||||
return self.callee
|
||||
|
||||
def _descr(self, buf, add_metadata):
|
||||
- args = ', '.join(['{0} {1}'.format(a.type, a.get_reference())
|
||||
- for a in self.args])
|
||||
+ def descr_arg(i, a):
|
||||
+ if i in self.arg_attributes:
|
||||
+ attrs = ' '.join(self.arg_attributes[i]._to_list()) + ' '
|
||||
+ else:
|
||||
+ attrs = ''
|
||||
+ return '{0} {1}{2}'.format(a.type, attrs, a.get_reference())
|
||||
+ args = ', '.join([descr_arg(i, a) for i, a in enumerate(self.args)])
|
||||
|
||||
fnty = self.callee.function_type
|
||||
# Only print function type if variable-argument
|
||||
@@ -142,10 +154,12 @@ def descr(self, buf):
|
||||
|
||||
class InvokeInstr(CallInstr):
|
||||
def __init__(self, parent, func, args, normal_to, unwind_to, name='',
|
||||
- cconv=None):
|
||||
+ cconv=None, fastmath=(), attrs=(), arg_attrs=None):
|
||||
assert isinstance(normal_to, Block)
|
||||
assert isinstance(unwind_to, Block)
|
||||
- super(InvokeInstr, self).__init__(parent, func, args, name, cconv)
|
||||
+ super(InvokeInstr, self).__init__(parent, func, args, name, cconv,
|
||||
+ tail=False, fastmath=fastmath,
|
||||
+ attrs=attrs, arg_attrs=arg_attrs)
|
||||
self.opname = "invoke"
|
||||
self.normal_to = normal_to
|
||||
self.unwind_to = unwind_to
|
||||
diff --git a/llvmlite/tests/test_ir.py b/llvmlite/tests/test_ir.py
|
||||
index e97e528ac..ab5864719 100644
|
||||
--- a/llvmlite/tests/test_ir.py
|
||||
+++ b/llvmlite/tests/test_ir.py
|
||||
@@ -1181,6 +1181,39 @@ def test_call_metadata(self):
|
||||
call void @"llvm.dbg.declare"(metadata i32* %"a", metadata !0, metadata !0)
|
||||
""") # noqa E501
|
||||
|
||||
+ def test_call_attributes(self):
|
||||
+ block = self.block(name='my_block')
|
||||
+ builder = ir.IRBuilder(block)
|
||||
+ fun_ty = ir.FunctionType(
|
||||
+ ir.VoidType(), (int32.as_pointer(), int32, int32.as_pointer()))
|
||||
+ fun = ir.Function(builder.function.module, fun_ty, 'fun')
|
||||
+ fun.args[0].add_attribute('sret')
|
||||
+ retval = builder.alloca(int32, name='retval')
|
||||
+ other = builder.alloca(int32, name='other')
|
||||
+ builder.call(
|
||||
+ fun,
|
||||
+ (retval, ir.Constant(int32, 42), other),
|
||||
+ arg_attrs={
|
||||
+ 0: ('sret', 'noalias'),
|
||||
+ 2: 'noalias'
|
||||
+ }
|
||||
+ )
|
||||
+ self.check_block(block, """\
|
||||
+ my_block:
|
||||
+ %"retval" = alloca i32
|
||||
+ %"other" = alloca i32
|
||||
+ call void @"fun"(i32* noalias sret %"retval", i32 42, i32* noalias %"other")
|
||||
+ """) # noqa E501
|
||||
+
|
||||
+ def test_invalid_call_attributes(self):
|
||||
+ block = self.block()
|
||||
+ builder = ir.IRBuilder(block)
|
||||
+ fun_ty = ir.FunctionType(ir.VoidType(), ())
|
||||
+ fun = ir.Function(builder.function.module, fun_ty, 'fun')
|
||||
+ with self.assertRaises(ValueError):
|
||||
+ # The function has no arguments, so this should fail.
|
||||
+ builder.call(fun, (), arg_attrs={0: 'sret'})
|
||||
+
|
||||
def test_invoke(self):
|
||||
block = self.block(name='my_block')
|
||||
builder = ir.IRBuilder(block)
|
||||
@@ -1196,6 +1229,39 @@ def test_invoke(self):
|
||||
to label %"normal" unwind label %"unwind"
|
||||
""")
|
||||
|
||||
+ def test_invoke_attributes(self):
|
||||
+ block = self.block(name='my_block')
|
||||
+ builder = ir.IRBuilder(block)
|
||||
+ fun_ty = ir.FunctionType(
|
||||
+ ir.VoidType(), (int32.as_pointer(), int32, int32.as_pointer()))
|
||||
+ fun = ir.Function(builder.function.module, fun_ty, 'fun')
|
||||
+ fun.calling_convention = "fastcc"
|
||||
+ fun.args[0].add_attribute('sret')
|
||||
+ retval = builder.alloca(int32, name='retval')
|
||||
+ other = builder.alloca(int32, name='other')
|
||||
+ bb_normal = builder.function.append_basic_block(name='normal')
|
||||
+ bb_unwind = builder.function.append_basic_block(name='unwind')
|
||||
+ builder.invoke(
|
||||
+ fun,
|
||||
+ (retval, ir.Constant(int32, 42), other),
|
||||
+ bb_normal,
|
||||
+ bb_unwind,
|
||||
+ cconv='fastcc',
|
||||
+ fastmath='fast',
|
||||
+ attrs='noinline',
|
||||
+ arg_attrs={
|
||||
+ 0: ('sret', 'noalias'),
|
||||
+ 2: 'noalias'
|
||||
+ }
|
||||
+ )
|
||||
+ self.check_block(block, """\
|
||||
+ my_block:
|
||||
+ %"retval" = alloca i32
|
||||
+ %"other" = alloca i32
|
||||
+ invoke fast fastcc void @"fun"(i32* noalias sret %"retval", i32 42, i32* noalias %"other") noinline
|
||||
+ to label %"normal" unwind label %"unwind"
|
||||
+ """) # noqa E501
|
||||
+
|
||||
def test_landingpad(self):
|
||||
block = self.block(name='my_block')
|
||||
builder = ir.IRBuilder(block)
|
|
@ -0,0 +1,26 @@
|
|||
{ python3Packages, llvm_11 }:
|
||||
|
||||
python3Packages.buildPythonPackage rec {
|
||||
pname = "llvmlite";
|
||||
version = "0.37.0-artiq";
|
||||
src = python3Packages.fetchPypi {
|
||||
inherit pname;
|
||||
version = "0.37.0";
|
||||
sha256 = "sha256-Y5K4cM0BjsDGRda7uRjWqg7sqMYmdLqu4whi1raGWxU=";
|
||||
};
|
||||
# https://github.com/numba/llvmlite/pull/702
|
||||
# https://github.com/numba/llvmlite/pull/775
|
||||
patches = [ ./llvmlite-callsite.diff ./llvmlite-abiname.diff ];
|
||||
nativeBuildInputs = [ llvm_11 ];
|
||||
# Disable static linking
|
||||
# https://github.com/numba/llvmlite/issues/93
|
||||
postPatch = ''
|
||||
substituteInPlace ffi/Makefile.linux --replace "-static-libstdc++" ""
|
||||
substituteInPlace llvmlite/tests/test_binding.py --replace "test_linux" "nope"
|
||||
'';
|
||||
# Set directory containing llvm-config binary
|
||||
preConfigure = ''
|
||||
export LLVM_CONFIG=${llvm_11.dev}/bin/llvm-config
|
||||
'';
|
||||
doCheck = false; # FIXME
|
||||
}
|
|
@ -0,0 +1,830 @@
|
|||
diff --git a/doc/openocd.texi b/doc/openocd.texi
|
||||
index 138922d08..ad9f10d2e 100644
|
||||
--- a/doc/openocd.texi
|
||||
+++ b/doc/openocd.texi
|
||||
@@ -5565,6 +5565,10 @@ will not work. These include all @command{*_image} and
|
||||
functionality is available through the @command{flash write_bank},
|
||||
@command{flash read_bank}, and @command{flash verify_bank} commands.
|
||||
|
||||
+According to device size, 1- to 4-byte addresses are sent. However, some
|
||||
+flash chips additionally have to be switched to 4-byte addresses by an extra
|
||||
+command, see below.
|
||||
+
|
||||
@itemize
|
||||
@item @var{ir} ... is loaded into the JTAG IR to map the flash as the JTAG DR.
|
||||
For the bitstreams generated from @file{xilinx_bscan_spi.py} this is the
|
||||
@@ -5577,6 +5581,29 @@ set _XILINX_USER1 0x02
|
||||
flash bank $_FLASHNAME spi 0x0 0 0 0 \
|
||||
$_TARGETNAME $_XILINX_USER1
|
||||
@end example
|
||||
+
|
||||
+@deffn Command {jtagspi set} bank_id name total_size page_size read_cmd unused pprg_cmd mass_erase_cmd sector_size sector_erase_cmd
|
||||
+Sets flash parameters: @var{name} human readable string, @var{total_size}
|
||||
+size in bytes, @var{page_size} is write page size. @var{read_cmd} and @var{pprg_cmd}
|
||||
+are commands for read and page program, respectively. @var{mass_erase_cmd},
|
||||
+@var{sector_size} and @var{sector_erase_cmd} are optional.
|
||||
+@example
|
||||
+jtagspi set 0 w25q128 0x1000000 0x100 0x03 0 0x02 0xC7 0x10000 0xD8
|
||||
+@end example
|
||||
+@end deffn
|
||||
+
|
||||
+@deffn Command {jtagspi cmd} bank_id resp_num cmd_byte ...
|
||||
+Sends command @var{cmd_byte} and at most 20 following bytes and reads
|
||||
+@var{resp_num} bytes afterwards. E.g. for 'Enter 4-byte address mode'
|
||||
+@example
|
||||
+jtagspi cmd 0 0 0xB7
|
||||
+@end example
|
||||
+@end deffn
|
||||
+
|
||||
+@deffn Command {jtagspi always_4byte} bank_id [ on | off ]
|
||||
+Some devices use 4-byte addresses for all commands except the legacy 0x03 read
|
||||
+regardless of device size. This command controls the corresponding hack.
|
||||
+@end deffn
|
||||
@end deffn
|
||||
|
||||
@deffn {Flash Driver} {xcf}
|
||||
diff --git a/src/flash/nor/jtagspi.c b/src/flash/nor/jtagspi.c
|
||||
index dc49fda61..e9a643d12 100644
|
||||
--- a/src/flash/nor/jtagspi.c
|
||||
+++ b/src/flash/nor/jtagspi.c
|
||||
@@ -29,9 +29,12 @@
|
||||
|
||||
struct jtagspi_flash_bank {
|
||||
struct jtag_tap *tap;
|
||||
- const struct flash_device *dev;
|
||||
+ struct flash_device dev;
|
||||
+ char devname[32];
|
||||
bool probed;
|
||||
+ bool always_4byte; /* use always 4-byte address except for basic read 0x03 */
|
||||
uint32_t ir;
|
||||
+ unsigned int addr_len; /* address length in bytes */
|
||||
};
|
||||
|
||||
FLASH_BANK_COMMAND_HANDLER(jtagspi_flash_bank_command)
|
||||
@@ -42,10 +45,11 @@ FLASH_BANK_COMMAND_HANDLER(jtagspi_flash_bank_command)
|
||||
return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
|
||||
info = malloc(sizeof(struct jtagspi_flash_bank));
|
||||
- if (!info) {
|
||||
+ if (info == NULL) {
|
||||
LOG_ERROR("no memory for flash bank info");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
+ bank->sectors = NULL;
|
||||
bank->driver_priv = info;
|
||||
|
||||
info->tap = NULL;
|
||||
@@ -69,70 +73,59 @@ static void jtagspi_set_ir(struct flash_bank *bank)
|
||||
jtag_add_ir_scan(info->tap, &field, TAP_IDLE);
|
||||
}
|
||||
|
||||
-static void flip_u8(uint8_t *in, uint8_t *out, int len)
|
||||
+static void flip_u8(const uint8_t *in, uint8_t *out, unsigned int len)
|
||||
{
|
||||
- for (int i = 0; i < len; i++)
|
||||
+ for (unsigned int i = 0; i < len; i++)
|
||||
out[i] = flip_u32(in[i], 8);
|
||||
}
|
||||
|
||||
static int jtagspi_cmd(struct flash_bank *bank, uint8_t cmd,
|
||||
- uint32_t *addr, uint8_t *data, int len)
|
||||
+ uint8_t *write_buffer, unsigned int write_len, uint8_t *data_buffer, int data_len)
|
||||
{
|
||||
- struct jtagspi_flash_bank *info = bank->driver_priv;
|
||||
+ assert(write_buffer || write_len == 0);
|
||||
+ assert(data_buffer || data_len == 0);
|
||||
+
|
||||
struct scan_field fields[6];
|
||||
- uint8_t marker = 1;
|
||||
- uint8_t xfer_bits_buf[4];
|
||||
- uint8_t addr_buf[3];
|
||||
- uint8_t *data_buf;
|
||||
- uint32_t xfer_bits;
|
||||
- int is_read, lenb, n;
|
||||
|
||||
- /* LOG_DEBUG("cmd=0x%02x len=%i", cmd, len); */
|
||||
+ LOG_DEBUG("cmd=0x%02x write_len=%d data_len=%d", cmd, write_len, data_len);
|
||||
|
||||
- is_read = (len < 0);
|
||||
+ /* negative data_len == read operation */
|
||||
+ const bool is_read = (data_len < 0);
|
||||
if (is_read)
|
||||
- len = -len;
|
||||
-
|
||||
- n = 0;
|
||||
+ data_len = -data_len;
|
||||
|
||||
+ int n = 0;
|
||||
+ const uint8_t marker = 1;
|
||||
fields[n].num_bits = 1;
|
||||
fields[n].out_value = ▮
|
||||
fields[n].in_value = NULL;
|
||||
n++;
|
||||
|
||||
- xfer_bits = 8 + len - 1;
|
||||
- /* cmd + read/write - 1 due to the counter implementation */
|
||||
- if (addr)
|
||||
- xfer_bits += 24;
|
||||
- h_u32_to_be(xfer_bits_buf, xfer_bits);
|
||||
- flip_u8(xfer_bits_buf, xfer_bits_buf, 4);
|
||||
- fields[n].num_bits = 32;
|
||||
- fields[n].out_value = xfer_bits_buf;
|
||||
+ /* transfer length = cmd + address + read/write,
|
||||
+ * -1 due to the counter implementation */
|
||||
+ uint8_t xfer_bits[4];
|
||||
+ h_u32_to_be(xfer_bits, ((sizeof(cmd) + write_len + data_len) * CHAR_BIT) - 1);
|
||||
+ flip_u8(xfer_bits, xfer_bits, sizeof(xfer_bits));
|
||||
+ fields[n].num_bits = sizeof(xfer_bits) * CHAR_BIT;
|
||||
+ fields[n].out_value = xfer_bits;
|
||||
fields[n].in_value = NULL;
|
||||
n++;
|
||||
|
||||
- cmd = flip_u32(cmd, 8);
|
||||
- fields[n].num_bits = 8;
|
||||
+ flip_u8(&cmd, &cmd, sizeof(cmd));
|
||||
+ fields[n].num_bits = sizeof(cmd) * CHAR_BIT;
|
||||
fields[n].out_value = &cmd;
|
||||
fields[n].in_value = NULL;
|
||||
n++;
|
||||
|
||||
- if (addr) {
|
||||
- h_u24_to_be(addr_buf, *addr);
|
||||
- flip_u8(addr_buf, addr_buf, 3);
|
||||
- fields[n].num_bits = 24;
|
||||
- fields[n].out_value = addr_buf;
|
||||
+ if (write_len) {
|
||||
+ flip_u8(write_buffer, write_buffer, write_len);
|
||||
+ fields[n].num_bits = write_len * CHAR_BIT;
|
||||
+ fields[n].out_value = write_buffer;
|
||||
fields[n].in_value = NULL;
|
||||
n++;
|
||||
}
|
||||
|
||||
- lenb = DIV_ROUND_UP(len, 8);
|
||||
- data_buf = malloc(lenb);
|
||||
- if (lenb > 0) {
|
||||
- if (!data_buf) {
|
||||
- LOG_ERROR("no memory for spi buffer");
|
||||
- return ERROR_FAIL;
|
||||
- }
|
||||
+ if (data_len > 0) {
|
||||
if (is_read) {
|
||||
fields[n].num_bits = jtag_tap_count_enabled();
|
||||
fields[n].out_value = NULL;
|
||||
@@ -140,78 +133,313 @@ static int jtagspi_cmd(struct flash_bank *bank, uint8_t cmd,
|
||||
n++;
|
||||
|
||||
fields[n].out_value = NULL;
|
||||
- fields[n].in_value = data_buf;
|
||||
+ fields[n].in_value = data_buffer;
|
||||
} else {
|
||||
- flip_u8(data, data_buf, lenb);
|
||||
- fields[n].out_value = data_buf;
|
||||
+ flip_u8(data_buffer, data_buffer, data_len);
|
||||
+ fields[n].out_value = data_buffer;
|
||||
fields[n].in_value = NULL;
|
||||
}
|
||||
- fields[n].num_bits = len;
|
||||
+ fields[n].num_bits = data_len * CHAR_BIT;
|
||||
n++;
|
||||
}
|
||||
|
||||
jtagspi_set_ir(bank);
|
||||
/* passing from an IR scan to SHIFT-DR clears BYPASS registers */
|
||||
+ struct jtagspi_flash_bank *info = bank->driver_priv;
|
||||
jtag_add_dr_scan(info->tap, n, fields, TAP_IDLE);
|
||||
int retval = jtag_execute_queue();
|
||||
|
||||
if (is_read)
|
||||
- flip_u8(data_buf, data, lenb);
|
||||
- free(data_buf);
|
||||
+ flip_u8(data_buffer, data_buffer, data_len);
|
||||
return retval;
|
||||
}
|
||||
|
||||
+COMMAND_HANDLER(jtagspi_handle_set)
|
||||
+{
|
||||
+ struct flash_bank *bank = NULL;
|
||||
+ struct jtagspi_flash_bank *info = NULL;
|
||||
+ struct flash_sector *sectors = NULL;
|
||||
+ uint32_t temp;
|
||||
+ unsigned int index = 1;
|
||||
+ int retval;
|
||||
+
|
||||
+ LOG_DEBUG("%s", __func__);
|
||||
+
|
||||
+ /* there are 6 mandatory arguments:
|
||||
+ * devname, size_in_bytes, pagesize, read_cmd, unused, pprog_cmd */
|
||||
+ if (index + 6 > CMD_ARGC) {
|
||||
+ command_print(CMD, "jtagspi: not enough arguments");
|
||||
+ return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
|
||||
+ if (ERROR_OK != retval)
|
||||
+ return retval;
|
||||
+ info = bank->driver_priv;
|
||||
+
|
||||
+ /* invalidate all old info */
|
||||
+ if (info->probed) {
|
||||
+ bank->size = 0;
|
||||
+ bank->num_sectors = 0;
|
||||
+ if (bank->sectors)
|
||||
+ free(bank->sectors);
|
||||
+ bank->sectors = NULL;
|
||||
+ info->always_4byte = false;
|
||||
+ info->probed = false;
|
||||
+ }
|
||||
+ memset(&info->dev, 0, sizeof(info->dev));
|
||||
+
|
||||
+ strncpy(info->devname, CMD_ARGV[index++], sizeof(info->devname) - 1);
|
||||
+ info->devname[sizeof(info->devname) - 1] = '\0';
|
||||
+
|
||||
+ COMMAND_PARSE_NUMBER(u32, CMD_ARGV[index++], temp);
|
||||
+ info->dev.size_in_bytes = temp;
|
||||
+ if ((temp & (temp - 1)) || (temp < (1UL << 8))) {
|
||||
+ command_print(CMD, "jtagspi: device size must be 2^n with n >= 8");
|
||||
+ return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ COMMAND_PARSE_NUMBER(u32, CMD_ARGV[index++], temp);
|
||||
+ info->dev.pagesize = temp;
|
||||
+ if (info->dev.pagesize == 0)
|
||||
+ info->dev.pagesize = SPIFLASH_DEF_PAGESIZE;
|
||||
+ if ((temp & (temp - 1)) || (temp > info->dev.size_in_bytes)) {
|
||||
+ command_print(CMD, "jtagspi: page size must be 2^n and <= device size");
|
||||
+ return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ COMMAND_PARSE_NUMBER(u8, CMD_ARGV[index++], info->dev.read_cmd);
|
||||
+ if ((info->dev.read_cmd != 0x03) &&
|
||||
+ (info->dev.read_cmd != 0x13)) {
|
||||
+ command_print(CMD, "jtagspi: only 0x03/0x13 READ allowed");
|
||||
+ return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ COMMAND_PARSE_NUMBER(u8, CMD_ARGV[index++], info->dev.qread_cmd);
|
||||
+
|
||||
+ COMMAND_PARSE_NUMBER(u8, CMD_ARGV[index++], info->dev.pprog_cmd);
|
||||
+ if ((info->dev.pprog_cmd != 0x02) &&
|
||||
+ (info->dev.pprog_cmd != 0x12)) {
|
||||
+ command_print(CMD, "jtagspi: only 0x02/0x12 PPRG allowed");
|
||||
+ return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ /* remaining params are optional */
|
||||
+ if (index < CMD_ARGC)
|
||||
+ COMMAND_PARSE_NUMBER(u8, CMD_ARGV[index++], info->dev.chip_erase_cmd);
|
||||
+ else
|
||||
+ info->dev.chip_erase_cmd = 0x00;
|
||||
+
|
||||
+ if (index < CMD_ARGC) {
|
||||
+ COMMAND_PARSE_NUMBER(u32, CMD_ARGV[index++], temp);
|
||||
+ info->dev.sectorsize = temp;
|
||||
+ if ((info->dev.sectorsize > info->dev.size_in_bytes) ||
|
||||
+ (info->dev.sectorsize < info->dev.pagesize) || (temp & (temp - 1))) {
|
||||
+ command_print(CMD, "jtagspi: sector size must be 2^n and <= device size");
|
||||
+ return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ if (index < CMD_ARGC)
|
||||
+ COMMAND_PARSE_NUMBER(u8, CMD_ARGV[index++], info->dev.erase_cmd);
|
||||
+ else {
|
||||
+ command_print(CMD, "jtagspi: erase command missing");
|
||||
+ return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
+ }
|
||||
+ } else {
|
||||
+ /* no sector size / sector erase cmd given, treat whole bank as a single sector */
|
||||
+ info->dev.erase_cmd = 0x00;
|
||||
+ info->dev.sectorsize = info->dev.size_in_bytes;
|
||||
+ }
|
||||
+
|
||||
+ if (index < CMD_ARGC) {
|
||||
+ command_print(CMD, "jtagspi: extra arguments");
|
||||
+ return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ /* set correct size value */
|
||||
+ bank->size = info->dev.size_in_bytes;
|
||||
+
|
||||
+ /* calculate address length in bytes */
|
||||
+ if (bank->size <= (1UL << 8))
|
||||
+ info->addr_len = 1;
|
||||
+ else if (bank->size <= (1UL << 16))
|
||||
+ info->addr_len = 2;
|
||||
+ else if (bank->size <= (1UL << 24))
|
||||
+ info->addr_len = 3;
|
||||
+ else {
|
||||
+ info->addr_len = 4;
|
||||
+ LOG_WARNING("4-byte addresses needed, might need extra command to enable");
|
||||
+ }
|
||||
+
|
||||
+ /* create and fill sectors array */
|
||||
+ bank->num_sectors =
|
||||
+ info->dev.size_in_bytes / info->dev.sectorsize;
|
||||
+ sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
|
||||
+ if (sectors == NULL) {
|
||||
+ LOG_ERROR("Not enough memory");
|
||||
+ return ERROR_FAIL;
|
||||
+ }
|
||||
+
|
||||
+ for (unsigned int sector = 0; sector < bank->num_sectors; sector++) {
|
||||
+ sectors[sector].offset = sector * (info->dev.sectorsize);
|
||||
+ sectors[sector].size = info->dev.sectorsize;
|
||||
+ sectors[sector].is_erased = -1;
|
||||
+ sectors[sector].is_protected = 0;
|
||||
+ }
|
||||
+
|
||||
+ bank->sectors = sectors;
|
||||
+ info->dev.name = info->devname;
|
||||
+ if (info->dev.size_in_bytes / 4096)
|
||||
+ LOG_INFO("flash \'%s\' id = unknown\nflash size = %" PRIu32 " kbytes",
|
||||
+ info->dev.name, info->dev.size_in_bytes / 1024);
|
||||
+ else
|
||||
+ LOG_INFO("flash \'%s\' id = unknown\nflash size = %" PRIu32 " bytes",
|
||||
+ info->dev.name, info->dev.size_in_bytes);
|
||||
+ info->probed = true;
|
||||
+
|
||||
+ return ERROR_OK;
|
||||
+}
|
||||
+
|
||||
+COMMAND_HANDLER(jtagspi_handle_cmd)
|
||||
+{
|
||||
+ struct flash_bank *bank;
|
||||
+ unsigned int index = 1;
|
||||
+ const int max = 21;
|
||||
+ uint8_t num_write, num_read, write_buffer[max], read_buffer[1 << CHAR_BIT];
|
||||
+ uint8_t data, *ptr;
|
||||
+ char temp[4], output[(2 + max + (1 << CHAR_BIT)) * 3 + 8];
|
||||
+ int retval;
|
||||
+
|
||||
+ LOG_DEBUG("%s", __func__);
|
||||
+
|
||||
+ if (CMD_ARGC < 3) {
|
||||
+ command_print(CMD, "jtagspi: not enough arguments");
|
||||
+ return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ num_write = CMD_ARGC - 2;
|
||||
+ if (num_write > max) {
|
||||
+ LOG_ERROR("at most %d bytes may be send", max);
|
||||
+ return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
+ }
|
||||
+
|
||||
+ retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
|
||||
+ if (ERROR_OK != retval)
|
||||
+ return retval;
|
||||
+
|
||||
+ COMMAND_PARSE_NUMBER(u8, CMD_ARGV[index++], num_read);
|
||||
+
|
||||
+ snprintf(output, sizeof(output), "spi: ");
|
||||
+ for (ptr = &write_buffer[0] ; index < CMD_ARGC; index++) {
|
||||
+ COMMAND_PARSE_NUMBER(u8, CMD_ARGV[index], data);
|
||||
+ *ptr++ = data;
|
||||
+ snprintf(temp, sizeof(temp), "%02" PRIx8 " ", data);
|
||||
+ strncat(output, temp, sizeof(output) - strlen(output) - 1);
|
||||
+ }
|
||||
+ strncat(output, "-> ", sizeof(output) - strlen(output) - 1);
|
||||
+
|
||||
+ /* process command */
|
||||
+ ptr = &read_buffer[0];
|
||||
+ jtagspi_cmd(bank, write_buffer[0], &write_buffer[1], num_write - 1, ptr, -num_read);
|
||||
+ if (retval != ERROR_OK)
|
||||
+ return retval;
|
||||
+
|
||||
+ for ( ; num_read > 0; num_read--) {
|
||||
+ snprintf(temp, sizeof(temp), "%02" PRIx8 " ", *ptr++);
|
||||
+ strncat(output, temp, sizeof(output) - strlen(output) - 1);
|
||||
+ }
|
||||
+ command_print(CMD, "%s", output);
|
||||
+
|
||||
+ return ERROR_OK;
|
||||
+}
|
||||
+
|
||||
+COMMAND_HANDLER(jtagspi_handle_always_4byte)
|
||||
+{
|
||||
+ struct flash_bank *bank;
|
||||
+ struct jtagspi_flash_bank *jtagspi_info;
|
||||
+ int retval;
|
||||
+
|
||||
+ LOG_DEBUG("%s", __func__);
|
||||
+
|
||||
+ if ((CMD_ARGC != 1) && (CMD_ARGC != 2))
|
||||
+ return ERROR_COMMAND_SYNTAX_ERROR;
|
||||
+
|
||||
+ retval = CALL_COMMAND_HANDLER(flash_command_get_bank, 0, &bank);
|
||||
+ if (ERROR_OK != retval)
|
||||
+ return retval;
|
||||
+
|
||||
+ jtagspi_info = bank->driver_priv;
|
||||
+
|
||||
+ if (CMD_ARGC == 1)
|
||||
+ command_print(CMD, jtagspi_info->always_4byte ? "on" : "off");
|
||||
+ else
|
||||
+ COMMAND_PARSE_BOOL(CMD_ARGV[1], jtagspi_info->always_4byte, "on", "off");
|
||||
+
|
||||
+ return ERROR_OK;
|
||||
+}
|
||||
+
|
||||
static int jtagspi_probe(struct flash_bank *bank)
|
||||
{
|
||||
struct jtagspi_flash_bank *info = bank->driver_priv;
|
||||
struct flash_sector *sectors;
|
||||
+ const struct flash_device *p;
|
||||
uint8_t in_buf[3];
|
||||
uint32_t id, sectorsize;
|
||||
|
||||
- if (info->probed)
|
||||
+ if (bank->sectors) {
|
||||
free(bank->sectors);
|
||||
+ bank->sectors = NULL;
|
||||
+ }
|
||||
info->probed = false;
|
||||
|
||||
- if (!bank->target->tap) {
|
||||
+ if (bank->target->tap == NULL) {
|
||||
LOG_ERROR("Target has no JTAG tap");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
info->tap = bank->target->tap;
|
||||
|
||||
- jtagspi_cmd(bank, SPIFLASH_READ_ID, NULL, in_buf, -24);
|
||||
+ jtagspi_cmd(bank, SPIFLASH_READ_ID, NULL, 0, in_buf, -3);
|
||||
/* the table in spi.c has the manufacturer byte (first) as the lsb */
|
||||
id = le_to_h_u24(in_buf);
|
||||
|
||||
- info->dev = NULL;
|
||||
- for (const struct flash_device *p = flash_devices; p->name ; p++)
|
||||
+ memset(&info->dev, 0, sizeof(info->dev));
|
||||
+ for (p = flash_devices; p->name ; p++)
|
||||
if (p->device_id == id) {
|
||||
- info->dev = p;
|
||||
+ memcpy(&info->dev, p, sizeof(info->dev));
|
||||
break;
|
||||
}
|
||||
|
||||
- if (!(info->dev)) {
|
||||
- LOG_ERROR("Unknown flash device (ID 0x%08" PRIx32 ")", id);
|
||||
+ if (!(p->name)) {
|
||||
+ LOG_ERROR("Unknown flash device (ID 0x%06" PRIx32 ")", id & 0xFFFFFF);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
|
||||
- LOG_INFO("Found flash device \'%s\' (ID 0x%08" PRIx32 ")",
|
||||
- info->dev->name, info->dev->device_id);
|
||||
+ LOG_INFO("Found flash device \'%s\' (ID 0x%06" PRIx32 ")",
|
||||
+ info->dev.name, info->dev.device_id & 0xFFFFFF);
|
||||
|
||||
/* Set correct size value */
|
||||
- bank->size = info->dev->size_in_bytes;
|
||||
- if (bank->size <= (1UL << 16))
|
||||
- LOG_WARNING("device needs 2-byte addresses - not implemented");
|
||||
- if (bank->size > (1UL << 24))
|
||||
- LOG_WARNING("device needs paging or 4-byte addresses - not implemented");
|
||||
+ bank->size = info->dev.size_in_bytes;
|
||||
+
|
||||
+ /* calculate address length in bytes */
|
||||
+ if (bank->size <= (1UL << 8))
|
||||
+ info->addr_len = 1;
|
||||
+ else if (bank->size <= (1UL << 16))
|
||||
+ info->addr_len = 2;
|
||||
+ else if (bank->size <= (1UL << 24))
|
||||
+ info->addr_len = 3;
|
||||
+ else {
|
||||
+ info->addr_len = 4;
|
||||
+ LOG_WARNING("4-byte addresses needed, might need extra command to enable");
|
||||
+ }
|
||||
|
||||
/* if no sectors, treat whole bank as single sector */
|
||||
- sectorsize = info->dev->sectorsize ?
|
||||
- info->dev->sectorsize : info->dev->size_in_bytes;
|
||||
+ sectorsize = info->dev.sectorsize ?
|
||||
+ info->dev.sectorsize : info->dev.size_in_bytes;
|
||||
|
||||
/* create and fill sectors array */
|
||||
- bank->num_sectors = info->dev->size_in_bytes / sectorsize;
|
||||
+ bank->num_sectors = info->dev.size_in_bytes / sectorsize;
|
||||
sectors = malloc(sizeof(struct flash_sector) * bank->num_sectors);
|
||||
- if (!sectors) {
|
||||
+ if (sectors == NULL) {
|
||||
LOG_ERROR("not enough memory");
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
@@ -228,27 +456,35 @@ static int jtagspi_probe(struct flash_bank *bank)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
+static int jtagspi_auto_probe(struct flash_bank *bank)
|
||||
+{
|
||||
+ struct jtagspi_flash_bank *info = bank->driver_priv;
|
||||
+
|
||||
+ if (info->probed)
|
||||
+ return ERROR_OK;
|
||||
+ return jtagspi_probe(bank);
|
||||
+}
|
||||
+
|
||||
static int jtagspi_read_status(struct flash_bank *bank, uint32_t *status)
|
||||
{
|
||||
uint8_t buf;
|
||||
- int err = jtagspi_cmd(bank, SPIFLASH_READ_STATUS, NULL, &buf, -8);
|
||||
+ int err = jtagspi_cmd(bank, SPIFLASH_READ_STATUS, NULL, 0, &buf, -1);
|
||||
if (err == ERROR_OK) {
|
||||
*status = buf;
|
||||
- /* LOG_DEBUG("status=0x%08" PRIx32, *status); */
|
||||
+ LOG_DEBUG("status=0x%02" PRIx8, *status);
|
||||
}
|
||||
-
|
||||
return err;
|
||||
}
|
||||
|
||||
static int jtagspi_wait(struct flash_bank *bank, int timeout_ms)
|
||||
{
|
||||
- uint32_t status;
|
||||
int64_t t0 = timeval_ms();
|
||||
int64_t dt;
|
||||
|
||||
do {
|
||||
dt = timeval_ms() - t0;
|
||||
|
||||
+ uint32_t status = (uint32_t)-1;
|
||||
int retval = jtagspi_read_status(bank, &status);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
@@ -266,16 +502,15 @@ static int jtagspi_wait(struct flash_bank *bank, int timeout_ms)
|
||||
|
||||
static int jtagspi_write_enable(struct flash_bank *bank)
|
||||
{
|
||||
- uint32_t status;
|
||||
-
|
||||
- jtagspi_cmd(bank, SPIFLASH_WRITE_ENABLE, NULL, NULL, 0);
|
||||
+ jtagspi_cmd(bank, SPIFLASH_WRITE_ENABLE, NULL, 0, NULL, 0);
|
||||
|
||||
+ uint32_t status = (uint32_t)-1;
|
||||
int retval = jtagspi_read_status(bank, &status);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
|
||||
if ((status & SPIFLASH_WE_BIT) == 0) {
|
||||
- LOG_ERROR("Cannot enable write to flash. Status=0x%08" PRIx32, status);
|
||||
+ LOG_ERROR("Cannot enable write to flash. Status=0x%02" PRIx8, status);
|
||||
return ERROR_FAIL;
|
||||
}
|
||||
return ERROR_OK;
|
||||
@@ -287,28 +522,51 @@ static int jtagspi_bulk_erase(struct flash_bank *bank)
|
||||
int retval;
|
||||
int64_t t0 = timeval_ms();
|
||||
|
||||
- if (info->dev->chip_erase_cmd == 0x00)
|
||||
+ if (info->dev.chip_erase_cmd == 0x00)
|
||||
return ERROR_FLASH_OPER_UNSUPPORTED;
|
||||
|
||||
retval = jtagspi_write_enable(bank);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
- jtagspi_cmd(bank, info->dev->chip_erase_cmd, NULL, NULL, 0);
|
||||
- retval = jtagspi_wait(bank, bank->num_sectors*JTAGSPI_MAX_TIMEOUT);
|
||||
+
|
||||
+ jtagspi_cmd(bank, info->dev.chip_erase_cmd, NULL, 0, NULL, 0);
|
||||
+ if (retval != ERROR_OK)
|
||||
+ return retval;
|
||||
+
|
||||
+ retval = jtagspi_wait(bank, bank->num_sectors * JTAGSPI_MAX_TIMEOUT);
|
||||
LOG_INFO("took %" PRId64 " ms", timeval_ms() - t0);
|
||||
return retval;
|
||||
}
|
||||
|
||||
+static uint8_t *fill_addr(uint32_t addr, unsigned int addr_len, uint8_t *buffer)
|
||||
+{
|
||||
+ for (buffer += addr_len; addr_len > 0; --addr_len) {
|
||||
+ *--buffer = addr;
|
||||
+ addr >>= 8;
|
||||
+ }
|
||||
+
|
||||
+ return buffer;
|
||||
+}
|
||||
+
|
||||
static int jtagspi_sector_erase(struct flash_bank *bank, unsigned int sector)
|
||||
{
|
||||
struct jtagspi_flash_bank *info = bank->driver_priv;
|
||||
int retval;
|
||||
+ uint8_t addr[sizeof(uint32_t)];
|
||||
int64_t t0 = timeval_ms();
|
||||
|
||||
retval = jtagspi_write_enable(bank);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
- jtagspi_cmd(bank, info->dev->erase_cmd, &bank->sectors[sector].offset, NULL, 0);
|
||||
+
|
||||
+ /* ATXP032/064/128 use always 4-byte addresses except for 0x03 read */
|
||||
+ unsigned int addr_len = info->always_4byte ? 4 : info->addr_len;
|
||||
+
|
||||
+ retval = jtagspi_cmd(bank, info->dev.erase_cmd, fill_addr(bank->sectors[sector].offset, addr_len, addr),
|
||||
+ addr_len, NULL, 0);
|
||||
+ if (retval != ERROR_OK)
|
||||
+ return retval;
|
||||
+
|
||||
retval = jtagspi_wait(bank, JTAGSPI_MAX_TIMEOUT);
|
||||
LOG_INFO("sector %u took %" PRId64 " ms", sector, timeval_ms() - t0);
|
||||
return retval;
|
||||
@@ -339,8 +597,9 @@ static int jtagspi_erase(struct flash_bank *bank, unsigned int first,
|
||||
}
|
||||
}
|
||||
|
||||
- if (first == 0 && last == (bank->num_sectors - 1)
|
||||
- && info->dev->chip_erase_cmd != info->dev->erase_cmd) {
|
||||
+ if (first == 0 && last == (bank->num_sectors - 1) &&
|
||||
+ info->dev.chip_erase_cmd != 0x00 &&
|
||||
+ info->dev.chip_erase_cmd != info->dev.erase_cmd) {
|
||||
LOG_DEBUG("Trying bulk erase.");
|
||||
retval = jtagspi_bulk_erase(bank);
|
||||
if (retval == ERROR_OK)
|
||||
@@ -349,7 +608,7 @@ static int jtagspi_erase(struct flash_bank *bank, unsigned int first,
|
||||
LOG_WARNING("Bulk flash erase failed. Falling back to sector erase.");
|
||||
}
|
||||
|
||||
- if (info->dev->erase_cmd == 0x00)
|
||||
+ if (info->dev.erase_cmd == 0x00)
|
||||
return ERROR_FLASH_OPER_UNSUPPORTED;
|
||||
|
||||
for (unsigned int sector = first; sector <= last; sector++) {
|
||||
@@ -374,49 +633,93 @@ static int jtagspi_protect(struct flash_bank *bank, int set, unsigned int first,
|
||||
static int jtagspi_read(struct flash_bank *bank, uint8_t *buffer, uint32_t offset, uint32_t count)
|
||||
{
|
||||
struct jtagspi_flash_bank *info = bank->driver_priv;
|
||||
+ uint32_t pagesize, currsize;
|
||||
+ uint8_t addr[sizeof(uint32_t)];
|
||||
+ int retval;
|
||||
|
||||
if (!(info->probed)) {
|
||||
- LOG_ERROR("Flash bank not yet probed.");
|
||||
+ LOG_ERROR("Flash bank not probed.");
|
||||
return ERROR_FLASH_BANK_NOT_PROBED;
|
||||
}
|
||||
|
||||
- jtagspi_cmd(bank, SPIFLASH_READ, &offset, buffer, -count*8);
|
||||
+ /* if no sectorsize, use reasonable default */
|
||||
+ pagesize = info->dev.sectorsize ? info->dev.sectorsize : info->dev.pagesize;
|
||||
+ if (pagesize == 0)
|
||||
+ pagesize = (info->dev.size_in_bytes <= SPIFLASH_DEF_PAGESIZE) ?
|
||||
+ info->dev.size_in_bytes : SPIFLASH_DEF_PAGESIZE;
|
||||
+
|
||||
+ /* ATXP032/064/128 use always 4-byte addresses except for 0x03 read */
|
||||
+ unsigned int addr_len = ((info->dev.read_cmd != 0x03) && info->always_4byte) ? 4 : info->addr_len;
|
||||
+
|
||||
+ while (count > 0) {
|
||||
+ /* length up to end of current page */
|
||||
+ currsize = ((offset + pagesize) & ~(pagesize - 1)) - offset;
|
||||
+ /* but no more than remaining size */
|
||||
+ currsize = (count < currsize) ? count : currsize;
|
||||
+
|
||||
+ retval = jtagspi_cmd(bank, info->dev.read_cmd, fill_addr(offset, addr_len, addr),
|
||||
+ addr_len, buffer, -currsize);
|
||||
+ if (retval != ERROR_OK) {
|
||||
+ LOG_ERROR("page read error");
|
||||
+ return retval;
|
||||
+ }
|
||||
+ LOG_DEBUG("read page at 0x%08" PRIx32, offset);
|
||||
+ offset += currsize;
|
||||
+ buffer += currsize;
|
||||
+ count -= currsize;
|
||||
+ }
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
static int jtagspi_page_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
|
||||
{
|
||||
+ struct jtagspi_flash_bank *info = bank->driver_priv;
|
||||
+ uint8_t addr[sizeof(uint32_t)];
|
||||
int retval;
|
||||
|
||||
retval = jtagspi_write_enable(bank);
|
||||
if (retval != ERROR_OK)
|
||||
return retval;
|
||||
- jtagspi_cmd(bank, SPIFLASH_PAGE_PROGRAM, &offset, (uint8_t *) buffer, count*8);
|
||||
+
|
||||
+ /* ATXP032/064/128 use always 4-byte addresses except for 0x03 read */
|
||||
+ unsigned int addr_len = ((info->dev.read_cmd != 0x03) && info->always_4byte) ? 4 : info->addr_len;
|
||||
+
|
||||
+ retval = jtagspi_cmd(bank, info->dev.pprog_cmd, fill_addr(offset, addr_len, addr),
|
||||
+ addr_len, (uint8_t *) buffer, count);
|
||||
+ if (retval != ERROR_OK)
|
||||
+ return retval;
|
||||
return jtagspi_wait(bank, JTAGSPI_MAX_TIMEOUT);
|
||||
}
|
||||
|
||||
static int jtagspi_write(struct flash_bank *bank, const uint8_t *buffer, uint32_t offset, uint32_t count)
|
||||
{
|
||||
struct jtagspi_flash_bank *info = bank->driver_priv;
|
||||
+ uint32_t pagesize, currsize;
|
||||
int retval;
|
||||
- uint32_t n, pagesize;
|
||||
|
||||
if (!(info->probed)) {
|
||||
- LOG_ERROR("Flash bank not yet probed.");
|
||||
+ LOG_ERROR("Flash bank not probed.");
|
||||
return ERROR_FLASH_BANK_NOT_PROBED;
|
||||
}
|
||||
|
||||
/* if no write pagesize, use reasonable default */
|
||||
- pagesize = info->dev->pagesize ? info->dev->pagesize : SPIFLASH_DEF_PAGESIZE;
|
||||
+ pagesize = info->dev.pagesize ? info->dev.pagesize : SPIFLASH_DEF_PAGESIZE;
|
||||
+
|
||||
+ while (count > 0) {
|
||||
+ /* length up to end of current page */
|
||||
+ currsize = ((offset + pagesize) & ~(pagesize - 1)) - offset;
|
||||
+ /* but no more than remaining size */
|
||||
+ currsize = (count < currsize) ? count : currsize;
|
||||
|
||||
- for (n = 0; n < count; n += pagesize) {
|
||||
- retval = jtagspi_page_write(bank, buffer + n, offset + n,
|
||||
- MIN(count - n, pagesize));
|
||||
+ retval = jtagspi_page_write(bank, buffer, offset, currsize);
|
||||
if (retval != ERROR_OK) {
|
||||
LOG_ERROR("page write error");
|
||||
return retval;
|
||||
}
|
||||
- LOG_DEBUG("wrote page at 0x%08" PRIx32, offset + n);
|
||||
+ LOG_DEBUG("wrote page at 0x%08" PRIx32, offset);
|
||||
+ offset += currsize;
|
||||
+ buffer += currsize;
|
||||
+ count -= currsize;
|
||||
}
|
||||
return ERROR_OK;
|
||||
}
|
||||
@@ -430,22 +733,72 @@ static int jtagspi_info(struct flash_bank *bank, struct command_invocation *cmd)
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
- command_print_sameline(cmd, "\nSPIFI flash information:\n"
|
||||
- " Device \'%s\' (ID 0x%08" PRIx32 ")\n",
|
||||
- info->dev->name, info->dev->device_id);
|
||||
+ command_print_sameline(cmd, "flash \'%s\', device id = 0x%06" PRIx32
|
||||
+ ", flash size = %" PRIu32 " %sbytes\n(page size = %" PRIu32
|
||||
+ ", read = 0x%02" PRIx8 ", qread = 0x%02" PRIx8
|
||||
+ ", pprog = 0x%02" PRIx8 ", mass_erase = 0x%02" PRIx8
|
||||
+ ", sector size = %" PRIu32 " %sbytes, sector_erase = 0x%02" PRIx8 ")",
|
||||
+ info->dev.name, info->dev.device_id & 0xFFFFFF,
|
||||
+ bank->size / 4096 ? bank->size / 1024 : bank->size,
|
||||
+ bank->size / 4096 ? "k" : "", info->dev.pagesize,
|
||||
+ info->dev.read_cmd, info->dev.qread_cmd,
|
||||
+ info->dev.pprog_cmd, info->dev.chip_erase_cmd,
|
||||
+ info->dev.sectorsize / 4096 ?
|
||||
+ info->dev.sectorsize / 1024 : info->dev.sectorsize,
|
||||
+ info->dev.sectorsize / 4096 ? "k" : "",
|
||||
+ info->dev.erase_cmd);
|
||||
|
||||
return ERROR_OK;
|
||||
}
|
||||
|
||||
+static const struct command_registration jtagspi_exec_command_handlers[] = {
|
||||
+ {
|
||||
+ .name = "set",
|
||||
+ .handler = jtagspi_handle_set,
|
||||
+ .mode = COMMAND_EXEC,
|
||||
+ .usage = "bank_id name chip_size page_size read_cmd unused pprg_cmd "
|
||||
+ "[ mass_erase_cmd ] [ sector_size sector_erase_cmd ]",
|
||||
+ .help = "Set device parameters if not autodetected.",
|
||||
+ },
|
||||
+ {
|
||||
+ .name = "cmd",
|
||||
+ .handler = jtagspi_handle_cmd,
|
||||
+ .mode = COMMAND_EXEC,
|
||||
+ .usage = "bank_id num_resp cmd_byte ...",
|
||||
+ .help = "Send low-level command cmd_byte and following bytes, read num_bytes.",
|
||||
+ },
|
||||
+ {
|
||||
+ .name = "always_4byte",
|
||||
+ .handler = jtagspi_handle_always_4byte,
|
||||
+ .mode = COMMAND_EXEC,
|
||||
+ .usage = "bank_id [ on | off ]",
|
||||
+ .help = "Use always 4-byte address except for basic 0x03.",
|
||||
+ },
|
||||
+
|
||||
+ COMMAND_REGISTRATION_DONE
|
||||
+};
|
||||
+
|
||||
+static const struct command_registration jtagspi_command_handlers[] = {
|
||||
+ {
|
||||
+ .name = "jtagspi",
|
||||
+ .mode = COMMAND_ANY,
|
||||
+ .help = "jtagspi command group",
|
||||
+ .usage = "",
|
||||
+ .chain = jtagspi_exec_command_handlers,
|
||||
+ },
|
||||
+ COMMAND_REGISTRATION_DONE
|
||||
+};
|
||||
+
|
||||
const struct flash_driver jtagspi_flash = {
|
||||
.name = "jtagspi",
|
||||
+ .commands = jtagspi_command_handlers,
|
||||
.flash_bank_command = jtagspi_flash_bank_command,
|
||||
.erase = jtagspi_erase,
|
||||
.protect = jtagspi_protect,
|
||||
.write = jtagspi_write,
|
||||
.read = jtagspi_read,
|
||||
.probe = jtagspi_probe,
|
||||
- .auto_probe = jtagspi_probe,
|
||||
+ .auto_probe = jtagspi_auto_probe,
|
||||
.erase_check = default_flash_blank_check,
|
||||
.info = jtagspi_info,
|
||||
.free_driver_priv = default_flash_free_driver_priv,
|
|
@ -1,73 +1,35 @@
|
|||
{ stdenv, fetchFromGitHub, autoreconfHook, libftdi, libusb1, pkgconfig, hidapi }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
name = "openocd-mlabs-${version}";
|
||||
version = "0.10.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "openocd";
|
||||
fetchSubmodules = true;
|
||||
rev = "c383a57adcff332b2c5cf8d55a84626285b42c2c";
|
||||
sha256 = "0xlj9cs72acx3zqagvr7f1c0v6lnqhl8fgrlhgmhmvk5n9knk492";
|
||||
};
|
||||
bscan_spi_bitstreams = fetchFromGitHub {
|
||||
{ stdenv, buildEnv, lib, fetchFromGitHub, autoreconfHook269, openocd }:
|
||||
let
|
||||
bscan_spi_bitstreams-pkg = stdenv.mkDerivation {
|
||||
name = "bscan_spi_bitstreams";
|
||||
src = fetchFromGitHub {
|
||||
owner = "quartiq";
|
||||
repo = "bscan_spi_bitstreams";
|
||||
rev = "01d8f819f15baf9a8cc5d96945a51e4d267ff564";
|
||||
sha256 = "1zqv47kzgvbn4c8cr019a6wcja7gn5h1z4kvw5bhpc72fyhagal9";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ pkgconfig ];
|
||||
buildInputs = [ autoreconfHook libftdi libusb1 hidapi ];
|
||||
|
||||
configureFlags = [
|
||||
"--enable-jtag_vpi"
|
||||
"--enable-usb_blaster_libftdi"
|
||||
"--enable-amtjtagaccel"
|
||||
"--enable-gw16012"
|
||||
"--enable-presto_libftdi"
|
||||
"--enable-openjtag_ftdi"
|
||||
"--enable-oocd_trace"
|
||||
"--enable-buspirate"
|
||||
"--enable-sysfsgpio"
|
||||
"--enable-remote-bitbang"
|
||||
];
|
||||
|
||||
NIX_CFLAGS_COMPILE = [
|
||||
"-Wno-implicit-fallthrough"
|
||||
"-Wno-format-truncation"
|
||||
"-Wno-format-overflow"
|
||||
"-Wno-error=tautological-compare"
|
||||
];
|
||||
|
||||
postInstall = ''
|
||||
mkdir -p "$out/etc/udev/rules.d"
|
||||
rules="$out/share/openocd/contrib/60-openocd.rules"
|
||||
if [ ! -f "$rules" ]; then
|
||||
echo "$rules is missing, must update the Nix file."
|
||||
exit 1
|
||||
fi
|
||||
ln -s "$rules" "$out/etc/udev/rules.d/"
|
||||
|
||||
mkdir -p "$out/share/bscan-spi-bitstreams"
|
||||
cp ${bscan_spi_bitstreams}/*.bit "$out/share/bscan-spi-bitstreams"
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
description = "Free and Open On-Chip Debugging, In-System Programming and Boundary-Scan Testing";
|
||||
longDescription = ''
|
||||
OpenOCD provides on-chip programming and debugging support with a layered
|
||||
architecture of JTAG interface and TAP support, debug target support
|
||||
(e.g. ARM, MIPS), and flash chip drivers (e.g. CFI, NAND, etc.). Several
|
||||
network interfaces are available for interactiving with OpenOCD: HTTP,
|
||||
telnet, TCL, and GDB. The GDB server enables OpenOCD to function as a
|
||||
"remote target" for source-level debugging of embedded systems using the
|
||||
GNU GDB program.
|
||||
};
|
||||
phases = ["installPhase"];
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out/share/bscan-spi-bitstreams
|
||||
cp $src/*.bit $out/share/bscan-spi-bitstreams
|
||||
'';
|
||||
homepage = http://openocd.sourceforge.net/;
|
||||
license = licenses.gpl2Plus;
|
||||
maintainers = with maintainers; [ sb0 ];
|
||||
platforms = platforms.linux;
|
||||
};
|
||||
}
|
||||
openocd-fixed = openocd.overrideAttrs(oa: {
|
||||
version = "unstable-2021-09-15";
|
||||
src = fetchFromGitHub {
|
||||
owner = "openocd-org";
|
||||
repo = "openocd";
|
||||
rev = "a0bd3c9924870c3b8f428648410181040dabc33c";
|
||||
sha256 = "sha256-YgUsl4/FohfsOncM4uiz/3c6g2ZN4oZ0y5vV/2Skwqg=";
|
||||
fetchSubmodules = true;
|
||||
};
|
||||
# https://review.openocd.org/c/openocd/+/4876
|
||||
patches = oa.patches or [] ++ [ ./openocd-jtagspi.diff ];
|
||||
nativeBuildInputs = oa.nativeBuildInputs or [] ++ [ autoreconfHook269 ];
|
||||
});
|
||||
in
|
||||
buildEnv {
|
||||
name = "openocd-bscanspi";
|
||||
paths = [ openocd-fixed bscan_spi_bitstreams-pkg ];
|
||||
}
|
||||
|
|
|
@ -1,9 +1,22 @@
|
|||
{ stdenv, fetchFromGitHub, python3Packages }:
|
||||
{ lib, fetchgit, fetchFromGitHub, python3Packages, misoc-new }:
|
||||
|
||||
rec {
|
||||
# User dependencies
|
||||
sipyco = python3Packages.buildPythonPackage rec {
|
||||
pname = "sipyco";
|
||||
version = "1.2";
|
||||
src = fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "sipyco";
|
||||
rev = "v${version}";
|
||||
sha256 = "02x2s66x9bbzj82d823vjg2i73w7iqwvkrjbbyrsav6ccj7f90sj";
|
||||
};
|
||||
propagatedBuildInputs = with python3Packages; [ numpy ];
|
||||
};
|
||||
|
||||
asyncserial = python3Packages.buildPythonPackage rec {
|
||||
name = "asyncserial";
|
||||
pname = "asyncserial";
|
||||
version = "0.1";
|
||||
src = fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "asyncserial";
|
||||
|
@ -11,89 +24,77 @@ rec {
|
|||
sha256 = "0yzkka9jk3612v8gx748x6ziwykq5lr7zmr9wzkcls0v2yilqx9k";
|
||||
};
|
||||
propagatedBuildInputs = with python3Packages; [ pyserial ];
|
||||
doCheck = false;
|
||||
};
|
||||
|
||||
levenshtein = python3Packages.buildPythonPackage rec {
|
||||
name = "levenshtein";
|
||||
src = fetchFromGitHub {
|
||||
owner = "ztane";
|
||||
repo = "python-Levenshtein";
|
||||
rev = "854e61a05bb8b750e990add96df412cd5448b75e";
|
||||
sha256 = "1yf21kg1g2ivm5a4dx1jra9k0c33np54d0hk5ymnfyc4f6pg386q";
|
||||
};
|
||||
doCheck = false;
|
||||
};
|
||||
|
||||
pythonparser = python3Packages.buildPythonPackage rec {
|
||||
name = "pythonparser";
|
||||
pname = "pythonparser";
|
||||
version = "1.4";
|
||||
src = fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "pythonparser";
|
||||
rev = "5b391fe86f43bb9f4f96c5bc0532e2a112db2936";
|
||||
sha256 = "1gw1fk4y2l6bwq0fg2a9dfc1rvq8cv492dyil96amjdhsxvnx35b";
|
||||
rev = "5413ee5c9f8760e95c6acd5d6e88dabb831ad201";
|
||||
sha256 = "1b9p3pjnfaiaf2k0a3iq39aj2vymfxx139hqdqkd3q4awrwy1957";
|
||||
};
|
||||
patches = [ ./python37hack.patch ];
|
||||
propagatedBuildInputs = with python3Packages; [ regex ];
|
||||
};
|
||||
|
||||
quamash = python3Packages.buildPythonPackage rec {
|
||||
name = "quamash";
|
||||
src = fetchFromGitHub {
|
||||
owner = "harvimt";
|
||||
repo = "quamash";
|
||||
rev = "e513b30f137415c5e098602fa383e45debab85e7";
|
||||
sha256 = "117rp9r4lz0kfz4dmmpa35hp6nhbh6b4xq0jmgvqm68g9hwdxmqa";
|
||||
};
|
||||
propagatedBuildInputs = with python3Packages; [ pyqt5 ];
|
||||
doCheck = false;
|
||||
};
|
||||
|
||||
pyqtgraph-qt5 = python3Packages.buildPythonPackage rec {
|
||||
name = "pyqtgraph_qt5-${version}";
|
||||
qasync = python3Packages.buildPythonPackage rec {
|
||||
pname = "qasync";
|
||||
version = "0.10.0";
|
||||
doCheck = false;
|
||||
src = fetchFromGitHub {
|
||||
owner = "pyqtgraph";
|
||||
repo = "pyqtgraph";
|
||||
rev = "1426e334e1d20542400d77c72c132b04c6d17ddb";
|
||||
sha256 = "1079haxyr316jf0wpirxdj0ry6j8mr16cqr0dyyrd5cnxwl7zssh";
|
||||
};
|
||||
propagatedBuildInputs = with python3Packages; [ scipy numpy pyqt5 pyopengl ];
|
||||
};
|
||||
|
||||
# TODO: use python3Packages.pyftdi starting with NixOS 19.09 or later
|
||||
# Upstream PR: https://github.com/NixOS/nixpkgs/pull/61256
|
||||
pyftdi = python3Packages.buildPythonPackage rec {
|
||||
name = "pyftdi";
|
||||
src = fetchFromGitHub {
|
||||
owner = "eblot";
|
||||
repo = "pyftdi";
|
||||
rev = "8e6f0bab6cff3eb60d2dbe578d0c5a2d1a9e135c";
|
||||
sha256 = "0mw79fjnvswa0j3bzr0y906rz1vjbr8lwy0albgvsfr0ngwbajqy";
|
||||
owner = "CabbageDevelopment";
|
||||
repo = "qasync";
|
||||
rev = "v${version}";
|
||||
sha256 = "1zga8s6dr7gk6awmxkh4pf25gbg8n6dv1j4b0by7y0fhi949qakq";
|
||||
};
|
||||
propagatedBuildInputs = with python3Packages; [ pyusb pyserial ];
|
||||
};
|
||||
|
||||
propagatedBuildInputs = [ python3Packages.pyqt5 ];
|
||||
|
||||
checkInputs = [ python3Packages.pytest ];
|
||||
checkPhase = ''
|
||||
pytest -k 'test_qthreadexec.py' # the others cause the test execution to be aborted, I think because of asyncio
|
||||
'';
|
||||
};
|
||||
|
||||
# Development/firmware dependencies
|
||||
misoc = python3Packages.buildPythonPackage rec {
|
||||
name = "misoc";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "misoc";
|
||||
rev = "e7f76c3ca302d9b1040bb818d7cd07a5c031c63b";
|
||||
sha256 = "1cdqjgbhgrnds8m0mrgd9phb8gqmhlv8v3ivrz1mvs7cb1bwl0pf";
|
||||
fetchSubmodules = true;
|
||||
artiq-netboot = python3Packages.buildPythonPackage rec {
|
||||
pname = "artiq-netboot";
|
||||
version = "unstable-2020-10-15";
|
||||
|
||||
src = fetchgit {
|
||||
url = "https://git.m-labs.hk/m-labs/artiq-netboot.git";
|
||||
rev = "04f69eb07df73abe4b89fde2c24084f7664f2104";
|
||||
sha256 = "0ql4fr8m8gpb2yql8aqsdqsssxb8zqd6l65kl1f6s9845zy7shs9";
|
||||
};
|
||||
};
|
||||
|
||||
misoc = python3Packages.buildPythonPackage {
|
||||
pname = "misoc";
|
||||
version = if misoc-new then "unstable-2021-10-10" else "unstable-2021-02-15";
|
||||
|
||||
src = if misoc-new
|
||||
then (fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "misoc";
|
||||
rev = "f5203e406520874e15ab5d070058ef642fc57fd9";
|
||||
sha256 = "sha256-/2XTejqj0Bo81HaTrlTSWwInnWwsuqnq+CURXbpIrkA=";
|
||||
fetchSubmodules = true;
|
||||
})
|
||||
else (fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "misoc";
|
||||
rev = "d84551418042cea0891ea743442e20684b51e77a";
|
||||
sha256 = "1id5qjr9dl4r3vi6jdn7dfpnr2wb08nrm3nfscn18clbbdxybyjn";
|
||||
fetchSubmodules = true;
|
||||
});
|
||||
|
||||
# TODO: fix misoc bitrot and re-enable tests
|
||||
doCheck = false;
|
||||
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [ pyserial jinja2 numpy asyncserial migen ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
description = "A high performance and small footprint system-on-chip based on Migen";
|
||||
homepage = "https://m-labs.hk/migen";
|
||||
license = licenses.bsd2;
|
||||
|
@ -102,18 +103,19 @@ rec {
|
|||
};
|
||||
|
||||
migen = python3Packages.buildPythonPackage rec {
|
||||
name = "migen";
|
||||
pname = "migen";
|
||||
version = "unstable-2021-12-16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "migen";
|
||||
rev = "41922fde2a8c36cd0f99d4b7ebb3ba9c37ce1489";
|
||||
sha256 = "0srn7lr98sqjss3z2zsk9w7ydl1p6rwskr0r7alss1x720n8hhiw";
|
||||
rev = "ac703010eaa06ac9b6e32f97c6fa98b15de22b31";
|
||||
sha256 = "sha256-qpVj/yJf4hDDc99XXpVPH4EbLC8aCmEtACn5qNc3DGI=";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [ colorama sphinx sphinx_rtd_theme ];
|
||||
propagatedBuildInputs = with python3Packages; [ colorama ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
description = "A Python toolbox for building complex digital hardware";
|
||||
homepage = "https://m-labs.hk/migen";
|
||||
license = licenses.bsd2;
|
||||
|
@ -122,7 +124,8 @@ rec {
|
|||
};
|
||||
|
||||
microscope = python3Packages.buildPythonPackage rec {
|
||||
name = "microscope";
|
||||
pname = "microscope";
|
||||
version = "unstable-2019-05-17";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
|
@ -133,7 +136,7 @@ rec {
|
|||
|
||||
propagatedBuildInputs = with python3Packages; [ pyserial prettytable msgpack migen ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
description = "Finding the bacteria in rotting FPGA designs";
|
||||
homepage = "https://m-labs.hk/migen";
|
||||
license = licenses.bsd2;
|
||||
|
@ -142,18 +145,19 @@ rec {
|
|||
};
|
||||
|
||||
jesd204b = python3Packages.buildPythonPackage rec {
|
||||
name = "jesd204b";
|
||||
pname = "jesd204b";
|
||||
version = "unstable-2021-05-05";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "jesd204b";
|
||||
rev = "2fd6391c0a9197580d60f7d8a146191dc7337b03";
|
||||
sha256 = "1lhw8f0dp42xx4g6d7hyhqhrnd6i5ll4a1wcg265rqz3600i4009";
|
||||
rev = "bf1cd9014c8b7a9db67609f653634daaf3bcd39b";
|
||||
sha256 = "035csm6as4p75cjz7kd6gnras14856i2jzi9g1gd800g284hw9n3";
|
||||
};
|
||||
|
||||
propagatedBuildInputs = with python3Packages; [ migen misoc ];
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
description = "JESD204B core for Migen/MiSoC";
|
||||
homepage = "https://m-labs.hk/migen";
|
||||
license = licenses.bsd2;
|
||||
|
@ -170,7 +174,7 @@ rec {
|
|||
sha256 = "0j15i54p7nri6hkzn1wal9pxri4pgql01wgjccig6ar0v5jjbvsy";
|
||||
};
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
description = "Super-fast and clean conversions to numbers";
|
||||
homepage = "https://github.com/SethMMorton/fastnumbers";
|
||||
license = licenses.mit;
|
||||
|
@ -179,7 +183,8 @@ rec {
|
|||
};
|
||||
|
||||
ramda = python3Packages.buildPythonPackage {
|
||||
name = "ramda";
|
||||
pname = "ramda";
|
||||
version = "unstable-2019-02-01";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "peteut";
|
||||
|
@ -189,7 +194,7 @@ rec {
|
|||
};
|
||||
|
||||
nativeBuildInputs = [ python3Packages.pbr ];
|
||||
propagatedBuildInputs = [ fastnumbers ];
|
||||
propagatedBuildInputs = [ python3Packages.future fastnumbers ];
|
||||
|
||||
checkInputs = [ python3Packages.pytest python3Packages.pytest-flake8 ];
|
||||
checkPhase = "pytest";
|
||||
|
@ -198,7 +203,7 @@ rec {
|
|||
export PBR_VERSION=0.0.1
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
description = "Ramda, ported to Python";
|
||||
homepage = "https://github.com/peteut/ramda.py";
|
||||
license = licenses.mit;
|
||||
|
@ -207,33 +212,43 @@ rec {
|
|||
};
|
||||
|
||||
migen-axi = python3Packages.buildPythonPackage {
|
||||
name = "migen-axi";
|
||||
pname = "migen-axi";
|
||||
version = "unstable-2021-09-15";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "peteut";
|
||||
repo = "migen-axi";
|
||||
rev = "8526eca769c01e18cc0a6024aacc515ceb8b9bd5";
|
||||
sha256 = "19gycn7s32j7zzy064qj2yv9g9jk9kn9z3q0fap2dg308g6d1pjs";
|
||||
rev = "9763505ee96acd7572280a2d1233721342dc7c3f";
|
||||
sha256 = "15c7g05n183rka66fl1glzp6h7xjlpy1p6k8biry24dangsmxmvg";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ python3Packages.pbr ];
|
||||
propagatedBuildInputs = [ python3Packages.click python3Packages.numpy python3Packages.toolz python3Packages.jinja2 ramda migen misoc ];
|
||||
|
||||
postPatch = ''
|
||||
substituteInPlace src/migen_axi/integration/soc_core.py \
|
||||
--replace "identifier_mem" "identifier"
|
||||
substituteInPlace tests/test_integration.py \
|
||||
--replace "zedboard.Platform(name=\"soc\", toolchain=\"vivado\")" "zedboard.Platform()"
|
||||
substituteInPlace requirements.txt \
|
||||
--replace "jinja2==2.11.3" "jinja2"
|
||||
substituteInPlace requirements.txt \
|
||||
--replace "future==0.18.2" "future"
|
||||
substituteInPlace requirements.txt \
|
||||
--replace "ramda==0.5.5" "ramda"
|
||||
substituteInPlace requirements.txt \
|
||||
--replace "colorama==0.4.3" "colorama"
|
||||
substituteInPlace requirements.txt \
|
||||
--replace "toolz==0.10.0" "toolz"
|
||||
substituteInPlace requirements.txt \
|
||||
--replace "pyserial==3.4" "pyserial"
|
||||
'';
|
||||
|
||||
nativeBuildInputs = [ python3Packages.pbr ];
|
||||
propagatedBuildInputs = [ python3Packages.click python3Packages.numpy python3Packages.toolz ramda migen misoc ];
|
||||
|
||||
checkInputs = [ python3Packages.pytest python3Packages.pytest-flake8 ];
|
||||
checkInputs = [ python3Packages.pytest python3Packages.pytest-timeout python3Packages.pytest-flake8 ];
|
||||
checkPhase = "pytest";
|
||||
|
||||
preBuild = ''
|
||||
export PBR_VERSION=0.0.1
|
||||
'';
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
description = "AXI support for Migen/MiSoC";
|
||||
homepage = "https://github.com/peteut/migen-axi";
|
||||
license = licenses.mit;
|
||||
|
@ -254,7 +269,7 @@ rec {
|
|||
# Non-standard test suite. Needs custom checkPhase.
|
||||
doCheck = false;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
description = "Portable tool for executing LLVM and Clang style test suites";
|
||||
homepage = http://llvm.org/docs/CommandGuide/lit.html;
|
||||
license = licenses.ncsa;
|
||||
|
@ -273,7 +288,7 @@ rec {
|
|||
};
|
||||
prePatch = "echo ${version} > RELEASE-VERSION";
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
description = "A tool for checking tool output inspired by LLVM's FileCheck";
|
||||
homepage = "https://github.com/stp/OutputCheck";
|
||||
license = licenses.bsd3;
|
||||
|
|
|
@ -1,33 +0,0 @@
|
|||
diff --git a/pythonparser/lexer.py b/pythonparser/lexer.py
|
||||
index a62eaf1..2c48d36 100644
|
||||
--- a/pythonparser/lexer.py
|
||||
+++ b/pythonparser/lexer.py
|
||||
@@ -79,6 +79,7 @@ class Lexer:
|
||||
(3, 4): _reserved_3_1,
|
||||
(3, 5): _reserved_3_5,
|
||||
(3, 6): _reserved_3_5,
|
||||
+ (3, 7): _reserved_3_5,
|
||||
}
|
||||
"""
|
||||
A map from a tuple (*major*, *minor*) corresponding to Python version to
|
||||
@@ -102,6 +103,7 @@ class Lexer:
|
||||
(3, 4): _string_prefixes_3_3,
|
||||
(3, 5): _string_prefixes_3_3,
|
||||
(3, 6): _string_prefixes_3_6,
|
||||
+ (3, 7): _string_prefixes_3_6,
|
||||
}
|
||||
"""
|
||||
A map from a tuple (*major*, *minor*) corresponding to Python version to
|
||||
diff --git a/pythonparser/parser.py b/pythonparser/parser.py
|
||||
index 10c741d..f748695 100644
|
||||
--- a/pythonparser/parser.py
|
||||
+++ b/pythonparser/parser.py
|
||||
@@ -419,7 +419,7 @@ class Parser(object):
|
||||
self.expr_stmt_1 = self.expr_stmt_1__26
|
||||
self.yield_expr = self.yield_expr__26
|
||||
return
|
||||
- elif version in ((3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6)):
|
||||
+ elif version in ((3, 0), (3, 1), (3, 2), (3, 3), (3, 4), (3, 5), (3, 6), (3, 7)):
|
||||
if version == (3, 0):
|
||||
self.with_stmt = self.with_stmt__26 # lol
|
||||
else:
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, makeWrapper, bash, buildRustPackage, curl, darwin
|
||||
{ stdenv, lib, makeWrapper, bash, buildRustPackage, curl, darwin
|
||||
, version
|
||||
, src
|
||||
, platform
|
||||
|
@ -6,7 +6,7 @@
|
|||
}:
|
||||
|
||||
let
|
||||
inherit (stdenv.lib) optionalString;
|
||||
inherit (lib) optionalString;
|
||||
inherit (darwin.apple_sdk.frameworks) Security;
|
||||
|
||||
bootstrapping = versionType == "bootstrap";
|
||||
|
@ -26,14 +26,14 @@ rec {
|
|||
inherit version;
|
||||
inherit src;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
homepage = http://www.rust-lang.org/;
|
||||
description = "A safe, concurrent, practical language";
|
||||
maintainers = with maintainers; [ sb0 ];
|
||||
license = [ licenses.mit licenses.asl20 ];
|
||||
};
|
||||
|
||||
buildInputs = [ bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
|
||||
buildInputs = [ bash ] ++ lib.optional stdenv.isDarwin Security;
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs .
|
||||
|
@ -60,7 +60,7 @@ rec {
|
|||
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/rustdoc"
|
||||
install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo"
|
||||
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo"
|
||||
install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
|
||||
install_name_tool -change /usr/lib/libcurl.4.dylib '${lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
|
||||
for f in $out/lib/lib*.dylib; do
|
||||
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$f"
|
||||
done
|
||||
|
@ -80,14 +80,14 @@ rec {
|
|||
inherit version;
|
||||
inherit src;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
homepage = http://www.rust-lang.org/;
|
||||
description = "A safe, concurrent, practical language";
|
||||
maintainers = with maintainers; [ sb0 ];
|
||||
license = [ licenses.mit licenses.asl20 ];
|
||||
};
|
||||
|
||||
buildInputs = [ makeWrapper bash ] ++ stdenv.lib.optional stdenv.isDarwin Security;
|
||||
buildInputs = [ makeWrapper bash ] ++ lib.optional stdenv.isDarwin Security;
|
||||
|
||||
postPatch = ''
|
||||
patchShebangs .
|
||||
|
@ -107,7 +107,7 @@ rec {
|
|||
${optionalString (stdenv.isDarwin && bootstrapping) ''
|
||||
install_name_tool -change /usr/lib/libiconv.2.dylib '${darwin.libiconv}/lib/libiconv.2.dylib' "$out/bin/cargo"
|
||||
install_name_tool -change /usr/lib/libresolv.9.dylib '${darwin.libresolv}/lib/libresolv.9.dylib' "$out/bin/cargo"
|
||||
install_name_tool -change /usr/lib/libcurl.4.dylib '${stdenv.lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
|
||||
install_name_tool -change /usr/lib/libcurl.4.dylib '${lib.getLib curl}/lib/libcurl.4.dylib' "$out/bin/cargo"
|
||||
''}
|
||||
|
||||
wrapProgram "$out/bin/cargo" \
|
|
@ -0,0 +1,693 @@
|
|||
# Generated by carnix 0.10.0: carnix generate-nix --src .
|
||||
{ lib, buildPlatform, buildRustCrate, buildRustCrateHelpers, cratesIO, fetchgit }:
|
||||
with buildRustCrateHelpers;
|
||||
let inherit (lib.lists) fold;
|
||||
inherit (lib.attrsets) recursiveUpdate;
|
||||
in
|
||||
rec {
|
||||
crates = cratesIO // rec {
|
||||
# cargo-vendor-0.1.23
|
||||
|
||||
crates.cargo_vendor."0.1.23" = deps: { features?(features_.cargo_vendor."0.1.23" deps {}) }: buildRustCrate {
|
||||
crateName = "cargo-vendor";
|
||||
version = "0.1.23";
|
||||
description = "A Cargo subcommand to vendor all crates.io dependencies onto the local\nfilesystem.\n";
|
||||
authors = [ "Alex Crichton <alex@alexcrichton.com>" ];
|
||||
edition = "2018";
|
||||
src = exclude [ ".git" "target" ] ./.;
|
||||
dependencies = mapFeatures features ([
|
||||
(cratesIO.crates."cargo"."${deps."cargo_vendor"."0.1.23"."cargo"}" deps)
|
||||
(cratesIO.crates."docopt"."${deps."cargo_vendor"."0.1.23"."docopt"}" deps)
|
||||
(cratesIO.crates."env_logger"."${deps."cargo_vendor"."0.1.23"."env_logger"}" deps)
|
||||
(cratesIO.crates."failure"."${deps."cargo_vendor"."0.1.23"."failure"}" deps)
|
||||
(cratesIO.crates."serde"."${deps."cargo_vendor"."0.1.23"."serde"}" deps)
|
||||
(cratesIO.crates."serde_json"."${deps."cargo_vendor"."0.1.23"."serde_json"}" deps)
|
||||
(cratesIO.crates."toml"."${deps."cargo_vendor"."0.1.23"."toml"}" deps)
|
||||
]
|
||||
++ (if features.cargo_vendor."0.1.23".openssl or false then [ (cratesIO.crates.openssl."${deps."cargo_vendor"."0.1.23".openssl}" deps) ] else []));
|
||||
features = mkFeatures (features."cargo_vendor"."0.1.23" or {});
|
||||
};
|
||||
features_.cargo_vendor."0.1.23" = deps: f: updateFeatures f (rec {
|
||||
cargo."${deps.cargo_vendor."0.1.23".cargo}".default = true;
|
||||
cargo_vendor."0.1.23".default = (f.cargo_vendor."0.1.23".default or true);
|
||||
docopt."${deps.cargo_vendor."0.1.23".docopt}".default = true;
|
||||
env_logger."${deps.cargo_vendor."0.1.23".env_logger}".default = true;
|
||||
failure."${deps.cargo_vendor."0.1.23".failure}".default = true;
|
||||
openssl = fold recursiveUpdate {} [
|
||||
{ "${deps.cargo_vendor."0.1.23".openssl}"."vendored" =
|
||||
(f.openssl."${deps.cargo_vendor."0.1.23".openssl}"."vendored" or false) ||
|
||||
(cargo_vendor."0.1.23"."vendored-openssl" or false) ||
|
||||
(f."cargo_vendor"."0.1.23"."vendored-openssl" or false); }
|
||||
{ "${deps.cargo_vendor."0.1.23".openssl}".default = true; }
|
||||
];
|
||||
serde = fold recursiveUpdate {} [
|
||||
{ "${deps.cargo_vendor."0.1.23".serde}"."derive" = true; }
|
||||
{ "${deps.cargo_vendor."0.1.23".serde}".default = true; }
|
||||
];
|
||||
serde_json."${deps.cargo_vendor."0.1.23".serde_json}".default = true;
|
||||
toml."${deps.cargo_vendor."0.1.23".toml}".default = true;
|
||||
}) [
|
||||
(cratesIO.features_.cargo."${deps."cargo_vendor"."0.1.23"."cargo"}" deps)
|
||||
(cratesIO.features_.docopt."${deps."cargo_vendor"."0.1.23"."docopt"}" deps)
|
||||
(cratesIO.features_.env_logger."${deps."cargo_vendor"."0.1.23"."env_logger"}" deps)
|
||||
(cratesIO.features_.failure."${deps."cargo_vendor"."0.1.23"."failure"}" deps)
|
||||
(cratesIO.features_.openssl."${deps."cargo_vendor"."0.1.23"."openssl"}" deps)
|
||||
(cratesIO.features_.serde."${deps."cargo_vendor"."0.1.23"."serde"}" deps)
|
||||
(cratesIO.features_.serde_json."${deps."cargo_vendor"."0.1.23"."serde_json"}" deps)
|
||||
(cratesIO.features_.toml."${deps."cargo_vendor"."0.1.23"."toml"}" deps)
|
||||
];
|
||||
|
||||
|
||||
# end
|
||||
|
||||
};
|
||||
|
||||
cargo_vendor = crates.crates.cargo_vendor."0.1.23" deps;
|
||||
__all = [ (cargo_vendor {}) ];
|
||||
deps.adler32."1.0.3" = {};
|
||||
deps.aho_corasick."0.7.3" = {
|
||||
memchr = "2.2.0";
|
||||
};
|
||||
deps.ansi_term."0.11.0" = {
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.atty."0.2.11" = {
|
||||
termion = "1.5.1";
|
||||
libc = "0.2.51";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.autocfg."0.1.2" = {};
|
||||
deps.backtrace."0.3.15" = {
|
||||
cfg_if = "0.1.7";
|
||||
rustc_demangle = "0.1.14";
|
||||
autocfg = "0.1.2";
|
||||
backtrace_sys = "0.1.28";
|
||||
libc = "0.2.51";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.backtrace_sys."0.1.28" = {
|
||||
libc = "0.2.51";
|
||||
cc = "1.0.35";
|
||||
};
|
||||
deps.bitflags."1.0.4" = {};
|
||||
deps.bstr."0.1.2" = {
|
||||
memchr = "2.2.0";
|
||||
};
|
||||
deps.build_const."0.2.1" = {};
|
||||
deps.byteorder."1.3.1" = {};
|
||||
deps.bytes."0.4.12" = {
|
||||
byteorder = "1.3.1";
|
||||
iovec = "0.1.2";
|
||||
};
|
||||
deps.bytesize."1.0.0" = {};
|
||||
deps.cargo."0.35.0" = {
|
||||
atty = "0.2.11";
|
||||
byteorder = "1.3.1";
|
||||
bytesize = "1.0.0";
|
||||
clap = "2.33.0";
|
||||
crates_io = "0.23.0";
|
||||
crossbeam_utils = "0.6.5";
|
||||
crypto_hash = "0.3.3";
|
||||
curl = "0.4.21";
|
||||
curl_sys = "0.4.18";
|
||||
env_logger = "0.6.1";
|
||||
failure = "0.1.5";
|
||||
filetime = "0.2.4";
|
||||
flate2 = "1.0.7";
|
||||
fs2 = "0.4.3";
|
||||
git2 = "0.8.0";
|
||||
git2_curl = "0.9.0";
|
||||
glob = "0.2.11";
|
||||
hex = "0.3.2";
|
||||
home = "0.3.4";
|
||||
ignore = "0.4.7";
|
||||
im_rc = "12.3.4";
|
||||
jobserver = "0.1.13";
|
||||
lazy_static = "1.3.0";
|
||||
lazycell = "1.2.1";
|
||||
libc = "0.2.51";
|
||||
libgit2_sys = "0.7.11";
|
||||
log = "0.4.6";
|
||||
num_cpus = "1.10.0";
|
||||
opener = "0.3.2";
|
||||
rustc_workspace_hack = "1.0.0";
|
||||
rustfix = "0.4.5";
|
||||
same_file = "1.0.4";
|
||||
semver = "0.9.0";
|
||||
serde = "1.0.90";
|
||||
serde_ignored = "0.0.4";
|
||||
serde_json = "1.0.39";
|
||||
shell_escape = "0.1.4";
|
||||
tar = "0.4.22";
|
||||
tempfile = "3.0.7";
|
||||
termcolor = "1.0.4";
|
||||
toml = "0.4.10";
|
||||
unicode_width = "0.1.5";
|
||||
url = "1.7.2";
|
||||
url_serde = "0.2.0";
|
||||
core_foundation = "0.6.4";
|
||||
fwdansi = "1.0.1";
|
||||
miow = "0.3.3";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.cargo_vendor."0.1.23" = {
|
||||
cargo = "0.35.0";
|
||||
docopt = "1.1.0";
|
||||
env_logger = "0.6.1";
|
||||
failure = "0.1.5";
|
||||
openssl = "0.10.20";
|
||||
serde = "1.0.90";
|
||||
serde_json = "1.0.39";
|
||||
toml = "0.5.0";
|
||||
};
|
||||
deps.cc."1.0.35" = {};
|
||||
deps.cfg_if."0.1.7" = {};
|
||||
deps.clap."2.33.0" = {
|
||||
atty = "0.2.11";
|
||||
bitflags = "1.0.4";
|
||||
strsim = "0.8.0";
|
||||
textwrap = "0.11.0";
|
||||
unicode_width = "0.1.5";
|
||||
vec_map = "0.8.1";
|
||||
ansi_term = "0.11.0";
|
||||
};
|
||||
deps.cloudabi."0.0.3" = {
|
||||
bitflags = "1.0.4";
|
||||
};
|
||||
deps.commoncrypto."0.2.0" = {
|
||||
commoncrypto_sys = "0.2.0";
|
||||
};
|
||||
deps.commoncrypto_sys."0.2.0" = {
|
||||
libc = "0.2.51";
|
||||
};
|
||||
deps.core_foundation."0.6.4" = {
|
||||
core_foundation_sys = "0.6.2";
|
||||
libc = "0.2.51";
|
||||
};
|
||||
deps.core_foundation_sys."0.6.2" = {};
|
||||
deps.crates_io."0.23.0" = {
|
||||
curl = "0.4.21";
|
||||
failure = "0.1.5";
|
||||
http = "0.1.17";
|
||||
serde = "1.0.90";
|
||||
serde_derive = "1.0.90";
|
||||
serde_json = "1.0.39";
|
||||
url = "1.7.2";
|
||||
};
|
||||
deps.crc."1.8.1" = {
|
||||
build_const = "0.2.1";
|
||||
};
|
||||
deps.crc32fast."1.2.0" = {
|
||||
cfg_if = "0.1.7";
|
||||
};
|
||||
deps.crossbeam_channel."0.3.8" = {
|
||||
crossbeam_utils = "0.6.5";
|
||||
smallvec = "0.6.9";
|
||||
};
|
||||
deps.crossbeam_utils."0.6.5" = {
|
||||
cfg_if = "0.1.7";
|
||||
lazy_static = "1.3.0";
|
||||
};
|
||||
deps.crypto_hash."0.3.3" = {
|
||||
hex = "0.3.2";
|
||||
commoncrypto = "0.2.0";
|
||||
openssl = "0.10.20";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.curl."0.4.21" = {
|
||||
curl_sys = "0.4.18";
|
||||
libc = "0.2.51";
|
||||
socket2 = "0.3.8";
|
||||
openssl_probe = "0.1.2";
|
||||
openssl_sys = "0.9.43";
|
||||
kernel32_sys = "0.2.2";
|
||||
schannel = "0.1.15";
|
||||
winapi = "0.2.8";
|
||||
};
|
||||
deps.curl_sys."0.4.18" = {
|
||||
libc = "0.2.51";
|
||||
libnghttp2_sys = "0.1.1";
|
||||
libz_sys = "1.0.25";
|
||||
cc = "1.0.35";
|
||||
pkg_config = "0.3.14";
|
||||
openssl_sys = "0.9.43";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.docopt."1.1.0" = {
|
||||
lazy_static = "1.3.0";
|
||||
regex = "1.1.6";
|
||||
serde = "1.0.90";
|
||||
strsim = "0.9.1";
|
||||
};
|
||||
deps.either."1.5.2" = {};
|
||||
deps.env_logger."0.6.1" = {
|
||||
atty = "0.2.11";
|
||||
humantime = "1.2.0";
|
||||
log = "0.4.6";
|
||||
regex = "1.1.6";
|
||||
termcolor = "1.0.4";
|
||||
};
|
||||
deps.failure."0.1.5" = {
|
||||
backtrace = "0.3.15";
|
||||
failure_derive = "0.1.5";
|
||||
};
|
||||
deps.failure_derive."0.1.5" = {
|
||||
proc_macro2 = "0.4.27";
|
||||
quote = "0.6.12";
|
||||
syn = "0.15.32";
|
||||
synstructure = "0.10.1";
|
||||
};
|
||||
deps.filetime."0.2.4" = {
|
||||
cfg_if = "0.1.7";
|
||||
redox_syscall = "0.1.54";
|
||||
libc = "0.2.51";
|
||||
};
|
||||
deps.flate2."1.0.7" = {
|
||||
crc32fast = "1.2.0";
|
||||
libc = "0.2.51";
|
||||
libz_sys = "1.0.25";
|
||||
miniz_sys = "0.1.11";
|
||||
miniz_oxide_c_api = "0.2.1";
|
||||
};
|
||||
deps.fnv."1.0.6" = {};
|
||||
deps.foreign_types."0.3.2" = {
|
||||
foreign_types_shared = "0.1.1";
|
||||
};
|
||||
deps.foreign_types_shared."0.1.1" = {};
|
||||
deps.fs2."0.4.3" = {
|
||||
libc = "0.2.51";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.fuchsia_cprng."0.1.1" = {};
|
||||
deps.fwdansi."1.0.1" = {
|
||||
memchr = "2.2.0";
|
||||
termcolor = "1.0.4";
|
||||
};
|
||||
deps.git2."0.8.0" = {
|
||||
bitflags = "1.0.4";
|
||||
libc = "0.2.51";
|
||||
libgit2_sys = "0.7.11";
|
||||
log = "0.4.6";
|
||||
url = "1.7.2";
|
||||
openssl_probe = "0.1.2";
|
||||
openssl_sys = "0.9.43";
|
||||
};
|
||||
deps.git2_curl."0.9.0" = {
|
||||
curl = "0.4.21";
|
||||
git2 = "0.8.0";
|
||||
log = "0.4.6";
|
||||
url = "1.7.2";
|
||||
};
|
||||
deps.glob."0.2.11" = {};
|
||||
deps.globset."0.4.3" = {
|
||||
aho_corasick = "0.7.3";
|
||||
bstr = "0.1.2";
|
||||
fnv = "1.0.6";
|
||||
log = "0.4.6";
|
||||
regex = "1.1.6";
|
||||
};
|
||||
deps.hashbrown."0.1.8" = {
|
||||
byteorder = "1.3.1";
|
||||
scopeguard = "0.3.3";
|
||||
};
|
||||
deps.hex."0.3.2" = {};
|
||||
deps.home."0.3.4" = {
|
||||
scopeguard = "0.3.3";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.http."0.1.17" = {
|
||||
bytes = "0.4.12";
|
||||
fnv = "1.0.6";
|
||||
itoa = "0.4.3";
|
||||
};
|
||||
deps.humantime."1.2.0" = {
|
||||
quick_error = "1.2.2";
|
||||
};
|
||||
deps.idna."0.1.5" = {
|
||||
matches = "0.1.8";
|
||||
unicode_bidi = "0.3.4";
|
||||
unicode_normalization = "0.1.8";
|
||||
};
|
||||
deps.ignore."0.4.7" = {
|
||||
crossbeam_channel = "0.3.8";
|
||||
globset = "0.4.3";
|
||||
lazy_static = "1.3.0";
|
||||
log = "0.4.6";
|
||||
memchr = "2.2.0";
|
||||
regex = "1.1.6";
|
||||
same_file = "1.0.4";
|
||||
thread_local = "0.3.6";
|
||||
walkdir = "2.2.7";
|
||||
winapi_util = "0.1.2";
|
||||
};
|
||||
deps.im_rc."12.3.4" = {
|
||||
sized_chunks = "0.1.3";
|
||||
typenum = "1.10.0";
|
||||
rustc_version = "0.2.3";
|
||||
};
|
||||
deps.iovec."0.1.2" = {
|
||||
libc = "0.2.51";
|
||||
winapi = "0.2.8";
|
||||
};
|
||||
deps.itertools."0.7.11" = {
|
||||
either = "1.5.2";
|
||||
};
|
||||
deps.itoa."0.4.3" = {};
|
||||
deps.jobserver."0.1.13" = {
|
||||
log = "0.4.6";
|
||||
libc = "0.2.51";
|
||||
rand = "0.6.5";
|
||||
};
|
||||
deps.kernel32_sys."0.2.2" = {
|
||||
winapi = "0.2.8";
|
||||
winapi_build = "0.1.1";
|
||||
};
|
||||
deps.lazy_static."1.3.0" = {};
|
||||
deps.lazycell."1.2.1" = {};
|
||||
deps.libc."0.2.51" = {};
|
||||
deps.libgit2_sys."0.7.11" = {
|
||||
curl_sys = "0.4.18";
|
||||
libc = "0.2.51";
|
||||
libssh2_sys = "0.2.11";
|
||||
libz_sys = "1.0.25";
|
||||
cc = "1.0.35";
|
||||
pkg_config = "0.3.14";
|
||||
openssl_sys = "0.9.43";
|
||||
};
|
||||
deps.libnghttp2_sys."0.1.1" = {
|
||||
libc = "0.2.51";
|
||||
cc = "1.0.35";
|
||||
};
|
||||
deps.libssh2_sys."0.2.11" = {
|
||||
libc = "0.2.51";
|
||||
libz_sys = "1.0.25";
|
||||
cc = "1.0.35";
|
||||
pkg_config = "0.3.14";
|
||||
openssl_sys = "0.9.43";
|
||||
};
|
||||
deps.libz_sys."1.0.25" = {
|
||||
libc = "0.2.51";
|
||||
cc = "1.0.35";
|
||||
pkg_config = "0.3.14";
|
||||
};
|
||||
deps.lock_api."0.1.5" = {
|
||||
scopeguard = "0.3.3";
|
||||
};
|
||||
deps.log."0.4.6" = {
|
||||
cfg_if = "0.1.7";
|
||||
};
|
||||
deps.matches."0.1.8" = {};
|
||||
deps.matrixmultiply."0.1.15" = {
|
||||
rawpointer = "0.1.0";
|
||||
};
|
||||
deps.memchr."2.2.0" = {};
|
||||
deps.miniz_sys."0.1.11" = {
|
||||
libc = "0.2.51";
|
||||
cc = "1.0.35";
|
||||
};
|
||||
deps.miniz_oxide."0.2.1" = {
|
||||
adler32 = "1.0.3";
|
||||
};
|
||||
deps.miniz_oxide_c_api."0.2.1" = {
|
||||
crc = "1.8.1";
|
||||
libc = "0.2.51";
|
||||
miniz_oxide = "0.2.1";
|
||||
cc = "1.0.35";
|
||||
};
|
||||
deps.miow."0.3.3" = {
|
||||
socket2 = "0.3.8";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.ndarray."0.12.1" = {
|
||||
itertools = "0.7.11";
|
||||
matrixmultiply = "0.1.15";
|
||||
num_complex = "0.2.1";
|
||||
num_traits = "0.2.6";
|
||||
};
|
||||
deps.num_complex."0.2.1" = {
|
||||
num_traits = "0.2.6";
|
||||
};
|
||||
deps.num_traits."0.2.6" = {};
|
||||
deps.num_cpus."1.10.0" = {
|
||||
libc = "0.2.51";
|
||||
};
|
||||
deps.once_cell."0.1.8" = {
|
||||
parking_lot = "0.7.1";
|
||||
};
|
||||
deps.opener."0.3.2" = {
|
||||
failure = "0.1.5";
|
||||
failure_derive = "0.1.5";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.openssl."0.10.20" = {
|
||||
bitflags = "1.0.4";
|
||||
cfg_if = "0.1.7";
|
||||
foreign_types = "0.3.2";
|
||||
lazy_static = "1.3.0";
|
||||
libc = "0.2.51";
|
||||
openssl_sys = "0.9.43";
|
||||
};
|
||||
deps.openssl_probe."0.1.2" = {};
|
||||
deps.openssl_src."111.2.1+1.1.1b" = {
|
||||
cc = "1.0.35";
|
||||
};
|
||||
deps.openssl_sys."0.9.43" = {
|
||||
libc = "0.2.51";
|
||||
cc = "1.0.35";
|
||||
openssl_src = "111.2.1+1.1.1b";
|
||||
pkg_config = "0.3.14";
|
||||
rustc_version = "0.2.3";
|
||||
};
|
||||
deps.parking_lot."0.7.1" = {
|
||||
lock_api = "0.1.5";
|
||||
parking_lot_core = "0.4.0";
|
||||
};
|
||||
deps.parking_lot_core."0.4.0" = {
|
||||
rand = "0.6.5";
|
||||
smallvec = "0.6.9";
|
||||
rustc_version = "0.2.3";
|
||||
libc = "0.2.51";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.percent_encoding."1.0.1" = {};
|
||||
deps.pkg_config."0.3.14" = {};
|
||||
deps.proc_macro2."0.4.27" = {
|
||||
unicode_xid = "0.1.0";
|
||||
};
|
||||
deps.quick_error."1.2.2" = {};
|
||||
deps.quote."0.6.12" = {
|
||||
proc_macro2 = "0.4.27";
|
||||
};
|
||||
deps.rand."0.6.5" = {
|
||||
rand_chacha = "0.1.1";
|
||||
rand_core = "0.4.0";
|
||||
rand_hc = "0.1.0";
|
||||
rand_isaac = "0.1.1";
|
||||
rand_jitter = "0.1.3";
|
||||
rand_os = "0.1.3";
|
||||
rand_pcg = "0.1.2";
|
||||
rand_xorshift = "0.1.1";
|
||||
autocfg = "0.1.2";
|
||||
libc = "0.2.51";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.rand_chacha."0.1.1" = {
|
||||
rand_core = "0.3.1";
|
||||
autocfg = "0.1.2";
|
||||
};
|
||||
deps.rand_core."0.3.1" = {
|
||||
rand_core = "0.4.0";
|
||||
};
|
||||
deps.rand_core."0.4.0" = {};
|
||||
deps.rand_hc."0.1.0" = {
|
||||
rand_core = "0.3.1";
|
||||
};
|
||||
deps.rand_isaac."0.1.1" = {
|
||||
rand_core = "0.3.1";
|
||||
};
|
||||
deps.rand_jitter."0.1.3" = {
|
||||
rand_core = "0.4.0";
|
||||
libc = "0.2.51";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.rand_os."0.1.3" = {
|
||||
rand_core = "0.4.0";
|
||||
rdrand = "0.4.0";
|
||||
cloudabi = "0.0.3";
|
||||
fuchsia_cprng = "0.1.1";
|
||||
libc = "0.2.51";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.rand_pcg."0.1.2" = {
|
||||
rand_core = "0.4.0";
|
||||
autocfg = "0.1.2";
|
||||
};
|
||||
deps.rand_xorshift."0.1.1" = {
|
||||
rand_core = "0.3.1";
|
||||
};
|
||||
deps.rawpointer."0.1.0" = {};
|
||||
deps.rdrand."0.4.0" = {
|
||||
rand_core = "0.3.1";
|
||||
};
|
||||
deps.redox_syscall."0.1.54" = {};
|
||||
deps.redox_termios."0.1.1" = {
|
||||
redox_syscall = "0.1.54";
|
||||
};
|
||||
deps.regex."1.1.6" = {
|
||||
aho_corasick = "0.7.3";
|
||||
memchr = "2.2.0";
|
||||
regex_syntax = "0.6.6";
|
||||
thread_local = "0.3.6";
|
||||
utf8_ranges = "1.0.2";
|
||||
};
|
||||
deps.regex_syntax."0.6.6" = {
|
||||
ucd_util = "0.1.3";
|
||||
};
|
||||
deps.remove_dir_all."0.5.1" = {
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.rustc_demangle."0.1.14" = {};
|
||||
deps.rustc_workspace_hack."1.0.0" = {};
|
||||
deps.rustc_version."0.2.3" = {
|
||||
semver = "0.9.0";
|
||||
};
|
||||
deps.rustfix."0.4.5" = {
|
||||
failure = "0.1.5";
|
||||
log = "0.4.6";
|
||||
serde = "1.0.90";
|
||||
serde_derive = "1.0.90";
|
||||
serde_json = "1.0.39";
|
||||
};
|
||||
deps.ryu."0.2.7" = {};
|
||||
deps.same_file."1.0.4" = {
|
||||
winapi_util = "0.1.2";
|
||||
};
|
||||
deps.schannel."0.1.15" = {
|
||||
lazy_static = "1.3.0";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.scopeguard."0.3.3" = {};
|
||||
deps.semver."0.9.0" = {
|
||||
semver_parser = "0.7.0";
|
||||
serde = "1.0.90";
|
||||
};
|
||||
deps.semver_parser."0.7.0" = {};
|
||||
deps.serde."1.0.90" = {
|
||||
serde_derive = "1.0.90";
|
||||
};
|
||||
deps.serde_derive."1.0.90" = {
|
||||
proc_macro2 = "0.4.27";
|
||||
quote = "0.6.12";
|
||||
syn = "0.15.32";
|
||||
};
|
||||
deps.serde_ignored."0.0.4" = {
|
||||
serde = "1.0.90";
|
||||
};
|
||||
deps.serde_json."1.0.39" = {
|
||||
itoa = "0.4.3";
|
||||
ryu = "0.2.7";
|
||||
serde = "1.0.90";
|
||||
};
|
||||
deps.shell_escape."0.1.4" = {};
|
||||
deps.sized_chunks."0.1.3" = {
|
||||
typenum = "1.10.0";
|
||||
};
|
||||
deps.smallvec."0.6.9" = {};
|
||||
deps.socket2."0.3.8" = {
|
||||
cfg_if = "0.1.7";
|
||||
libc = "0.2.51";
|
||||
redox_syscall = "0.1.54";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.strsim."0.8.0" = {};
|
||||
deps.strsim."0.9.1" = {
|
||||
hashbrown = "0.1.8";
|
||||
ndarray = "0.12.1";
|
||||
};
|
||||
deps.syn."0.15.32" = {
|
||||
proc_macro2 = "0.4.27";
|
||||
quote = "0.6.12";
|
||||
unicode_xid = "0.1.0";
|
||||
};
|
||||
deps.synstructure."0.10.1" = {
|
||||
proc_macro2 = "0.4.27";
|
||||
quote = "0.6.12";
|
||||
syn = "0.15.32";
|
||||
unicode_xid = "0.1.0";
|
||||
};
|
||||
deps.tar."0.4.22" = {
|
||||
filetime = "0.2.4";
|
||||
redox_syscall = "0.1.54";
|
||||
libc = "0.2.51";
|
||||
};
|
||||
deps.tempfile."3.0.7" = {
|
||||
cfg_if = "0.1.7";
|
||||
rand = "0.6.5";
|
||||
remove_dir_all = "0.5.1";
|
||||
redox_syscall = "0.1.54";
|
||||
libc = "0.2.51";
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.termcolor."1.0.4" = {
|
||||
wincolor = "1.0.1";
|
||||
};
|
||||
deps.termion."1.5.1" = {
|
||||
libc = "0.2.51";
|
||||
redox_syscall = "0.1.54";
|
||||
redox_termios = "0.1.1";
|
||||
};
|
||||
deps.textwrap."0.11.0" = {
|
||||
unicode_width = "0.1.5";
|
||||
};
|
||||
deps.thread_local."0.3.6" = {
|
||||
lazy_static = "1.3.0";
|
||||
};
|
||||
deps.toml."0.4.10" = {
|
||||
serde = "1.0.90";
|
||||
};
|
||||
deps.toml."0.5.0" = {
|
||||
serde = "1.0.90";
|
||||
};
|
||||
deps.typenum."1.10.0" = {};
|
||||
deps.ucd_util."0.1.3" = {};
|
||||
deps.unicode_bidi."0.3.4" = {
|
||||
matches = "0.1.8";
|
||||
};
|
||||
deps.unicode_normalization."0.1.8" = {
|
||||
smallvec = "0.6.9";
|
||||
};
|
||||
deps.unicode_width."0.1.5" = {};
|
||||
deps.unicode_xid."0.1.0" = {};
|
||||
deps.url."1.7.2" = {
|
||||
idna = "0.1.5";
|
||||
matches = "0.1.8";
|
||||
percent_encoding = "1.0.1";
|
||||
};
|
||||
deps.url_serde."0.2.0" = {
|
||||
serde = "1.0.90";
|
||||
url = "1.7.2";
|
||||
};
|
||||
deps.utf8_ranges."1.0.2" = {};
|
||||
deps.vcpkg."0.2.6" = {};
|
||||
deps.vec_map."0.8.1" = {};
|
||||
deps.walkdir."2.2.7" = {
|
||||
same_file = "1.0.4";
|
||||
winapi = "0.3.7";
|
||||
winapi_util = "0.1.2";
|
||||
};
|
||||
deps.winapi."0.2.8" = {};
|
||||
deps.winapi."0.3.7" = {
|
||||
winapi_i686_pc_windows_gnu = "0.4.0";
|
||||
winapi_x86_64_pc_windows_gnu = "0.4.0";
|
||||
};
|
||||
deps.winapi_build."0.1.1" = {};
|
||||
deps.winapi_i686_pc_windows_gnu."0.4.0" = {};
|
||||
deps.winapi_util."0.1.2" = {
|
||||
winapi = "0.3.7";
|
||||
};
|
||||
deps.winapi_x86_64_pc_windows_gnu."0.4.0" = {};
|
||||
deps.wincolor."1.0.1" = {
|
||||
winapi = "0.3.7";
|
||||
winapi_util = "0.1.2";
|
||||
};
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
{ callPackage, fetchFromGitHub }:
|
||||
|
||||
((callPackage ./cargo-vendor-carnix.nix {}).cargo_vendor {}).overrideAttrs (attrs: {
|
||||
src = fetchFromGitHub {
|
||||
owner = "alexcrichton";
|
||||
repo = "cargo-vendor";
|
||||
rev = "9355661303ce2870d68a69d99953fce22581e31e";
|
||||
sha256 = "0d4j3r09am3ynwhczimzv39264f5xz37jxa9js123y46w5by3wd2";
|
||||
};
|
||||
})
|
|
@ -0,0 +1,62 @@
|
|||
{ stdenv, lib, file, curl, pkgconfig, python, openssl, cmake, zlib
|
||||
, makeWrapper, libiconv, cacert, rustPlatform, rustc, libgit2
|
||||
, fetchurl
|
||||
}:
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
# Note: we can't build cargo 1.28.0 because rustc tightened the borrow checker rules and broke
|
||||
# backward compatibility, which affects old cargo versions.
|
||||
# There are also issues with asm/llvm_asm with recent rustc and cargo versions prior to 1.39.
|
||||
pname = "cargo";
|
||||
version = "1.39.0";
|
||||
src = fetchurl {
|
||||
url = "https://static.rust-lang.org/dist/rustc-1.39.0-src.tar.gz";
|
||||
sha256 = "0mwkc1bnil2cfyf6nglpvbn2y0zfbv44zfhsd5qg4c9rm6vgd8dl";
|
||||
};
|
||||
|
||||
# the rust source tarball already has all the dependencies vendored, no need to fetch them again
|
||||
cargoVendorDir = "vendor";
|
||||
preBuild = "pushd src/tools/cargo";
|
||||
postBuild = "popd";
|
||||
|
||||
passthru.rustc = rustc;
|
||||
|
||||
# changes hash of vendor directory otherwise
|
||||
dontUpdateAutotoolsGnuConfigScripts = true;
|
||||
|
||||
nativeBuildInputs = [ pkgconfig cmake makeWrapper ];
|
||||
buildInputs = [ cacert file curl python openssl zlib libgit2 ];
|
||||
|
||||
LIBGIT2_SYS_USE_PKG_CONFIG = 1;
|
||||
|
||||
# fixes: the cargo feature `edition` requires a nightly version of Cargo, but this is the `stable` channel
|
||||
RUSTC_BOOTSTRAP = 1;
|
||||
|
||||
postInstall = ''
|
||||
# NOTE: We override the `http.cainfo` option usually specified in
|
||||
# `.cargo/config`. This is an issue when users want to specify
|
||||
# their own certificate chain as environment variables take
|
||||
# precedence
|
||||
wrapProgram "$out/bin/cargo" \
|
||||
--suffix PATH : "${rustc}/bin" \
|
||||
--set CARGO_HTTP_CAINFO "${cacert}/etc/ssl/certs/ca-bundle.crt" \
|
||||
--set SSL_CERT_FILE "${cacert}/etc/ssl/certs/ca-bundle.crt"
|
||||
'';
|
||||
|
||||
checkPhase = ''
|
||||
# Disable cross compilation tests
|
||||
export CFG_DISABLE_CROSS_TESTS=1
|
||||
cargo test
|
||||
'';
|
||||
|
||||
# Disable check phase as there are failures (4 tests fail)
|
||||
doCheck = false;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = https://crates.io;
|
||||
description = "Downloads your Rust project's dependencies and builds your project";
|
||||
maintainers = with maintainers; [ wizeman retrry ];
|
||||
license = [ licenses.mit licenses.asl20 ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
|
@ -81,11 +81,15 @@ let
|
|||
'';
|
||||
};
|
||||
in
|
||||
runCommand "rustc" {}
|
||||
''
|
||||
mkdir -p $out/lib/rustlib/or1k-unknown-none/lib/
|
||||
cp -r ${or1k-crates}/* $out/lib/rustlib/or1k-unknown-none/lib/
|
||||
mkdir -p $out/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/
|
||||
cp -r ${arm-crates}/* $out/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/
|
||||
cp -r ${rustc_internal}/* $out
|
||||
''
|
||||
stdenv.mkDerivation {
|
||||
name = "rustc";
|
||||
inherit src version;
|
||||
buildCommand = ''
|
||||
mkdir -p $out/lib/rustlib/or1k-unknown-none/lib/
|
||||
cp -r ${or1k-crates}/* $out/lib/rustlib/or1k-unknown-none/lib/
|
||||
mkdir -p $out/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/
|
||||
cp -r ${arm-crates}/* $out/lib/rustlib/armv7-unknown-linux-gnueabihf/lib/
|
||||
cp -r ${rustc_internal}/* $out
|
||||
'';
|
||||
passAsFile = [ "buildCommand" ];
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
{ stdenv, targetPackages
|
||||
{ stdenv, lib, targetPackages
|
||||
, fetchurl, file, python2, tzdata, ps
|
||||
, llvm-or1k, ncurses, zlib, darwin, rustPlatform, git, cmake, curl
|
||||
, which, libffi, gdb
|
||||
|
@ -14,7 +14,7 @@
|
|||
}:
|
||||
|
||||
let
|
||||
inherit (stdenv.lib) optional optionalString;
|
||||
inherit (lib) optional optionalString;
|
||||
inherit (darwin.apple_sdk.frameworks) Security;
|
||||
|
||||
target = builtins.replaceStrings [" "] [","] (builtins.toString targets);
|
||||
|
@ -26,7 +26,7 @@ let
|
|||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "rustc-${version}";
|
||||
pname = "rustc";
|
||||
inherit version;
|
||||
|
||||
inherit src;
|
||||
|
@ -171,7 +171,7 @@ stdenv.mkDerivation {
|
|||
# https://github.com/rust-lang/rust/issues/30181
|
||||
# enableParallelBuilding = false;
|
||||
|
||||
meta = with stdenv.lib; {
|
||||
meta = with lib; {
|
||||
homepage = https://www.rust-lang.org/;
|
||||
description = "A safe, concurrent, practical language";
|
||||
maintainers = with maintainers; [ sb0 ];
|
|
@ -0,0 +1,20 @@
|
|||
{ pkgs }:
|
||||
let
|
||||
rustManifest = pkgs.fetchurl {
|
||||
url = "https://static.rust-lang.org/dist/2021-01-29/channel-rust-nightly.toml";
|
||||
sha256 = "sha256-EZKgw89AH4vxaJpUHmIMzMW/80wAFQlfcxRoBD9nz0c=";
|
||||
};
|
||||
targets = [];
|
||||
rustChannelOfTargets = _channel: _date: targets:
|
||||
(pkgs.lib.rustLib.fromManifestFile rustManifest {
|
||||
inherit (pkgs) stdenv lib fetchurl patchelf;
|
||||
}).rust.override {
|
||||
inherit targets;
|
||||
extensions = ["rust-src"];
|
||||
};
|
||||
rust = rustChannelOfTargets "nightly" null targets;
|
||||
in
|
||||
pkgs.recurseIntoAttrs (pkgs.makeRustPlatform {
|
||||
rustc = rust;
|
||||
cargo = rust;
|
||||
})
|
|
@ -4,13 +4,14 @@ let
|
|||
artiqpkgs = import ./default.nix { inherit pkgs; };
|
||||
vivado = import ./vivado.nix { inherit pkgs; };
|
||||
in
|
||||
assert pkgs.lib.asserts.assertMsg (!pkgs.lib.strings.versionAtLeast artiqpkgs.artiq.version "7.0") "For ARTIQ 7+, use 'nix develop' on the flake instead.";
|
||||
pkgs.mkShell {
|
||||
buildInputs = [
|
||||
vivado
|
||||
pkgs.gnumake
|
||||
(pkgs.python3.withPackages(ps: (with ps; [ jinja2 numpy paramiko ]) ++ (with artiqpkgs; [ migen microscope misoc jesd204b migen-axi artiq ])))
|
||||
pkgs.cargo
|
||||
artiqpkgs.rustc
|
||||
(pkgs.python3.withPackages(ps: (with ps; [ jinja2 jsonschema numpy paramiko ]) ++ (with artiqpkgs; [ migen microscope misoc jesd204b migen-axi artiq ])))
|
||||
artiqpkgs.cargo-legacy
|
||||
artiqpkgs.rustc-legacy
|
||||
artiqpkgs.binutils-or1k
|
||||
artiqpkgs.binutils-arm
|
||||
artiqpkgs.llvm-or1k
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
# Install Vivado in /opt and add to /etc/nixos/configuration.nix:
|
||||
# nix.sandboxPaths = ["/opt"];
|
||||
|
||||
{ pkgs, vivadoPath ? "/opt/Xilinx/Vivado/2019.1" }:
|
||||
{ pkgs, vivadoPath ? "/opt/Xilinx/Vivado/2021.2" }:
|
||||
|
||||
pkgs.buildFHSUserEnv {
|
||||
name = "vivado";
|
||||
|
@ -17,7 +17,7 @@ pkgs.buildFHSUserEnv {
|
|||
xorg.libXext
|
||||
xorg.libXtst
|
||||
xorg.libXi
|
||||
]
|
||||
] ++ ( if pkgs ? libxcrypt-legacy then [ pkgs.libxcrypt-legacy ] else [])
|
||||
);
|
||||
profile = "source ${vivadoPath}/settings64.sh";
|
||||
runScript = "vivado";
|
||||
|
|
|
@ -0,0 +1,16 @@
|
|||
{ pkgs }:
|
||||
|
||||
let
|
||||
# Pin nixpkgs to avoid frequent resource-intensive Windows reinstallations on Hydra.
|
||||
wfvm-pkgs = pkgs.fetchFromGitHub {
|
||||
owner = "NixOS";
|
||||
repo = "nixpkgs";
|
||||
rev = "f8248ab6d9e69ea9c07950d73d48807ec595e923";
|
||||
sha256 = "009i9j6mbq6i481088jllblgdnci105b2q4mscprdawg3knlyahk";
|
||||
};
|
||||
wfvm = pkgs.fetchgit {
|
||||
url = "https://git.m-labs.hk/M-Labs/wfvm.git";
|
||||
rev = "4b497938ffd9fcddf84a3dbe2f01524395292adb";
|
||||
sha256 = "0m3kdbbcskqc1lf8b5f7ccbll9b7vkl4r00kbyx3yjb2rs6cqvil";
|
||||
};
|
||||
in import "${wfvm}/wfvm" { pkgs = (import wfvm-pkgs {}); }
|
|
@ -0,0 +1,16 @@
|
|||
{ pkgs }:
|
||||
|
||||
let
|
||||
# Pin nixpkgs to avoid frequent resource-intensive Windows reinstallations on Hydra.
|
||||
wfvm-pkgs = pkgs.fetchFromGitHub {
|
||||
owner = "NixOS";
|
||||
repo = "nixpkgs";
|
||||
rev = "f8248ab6d9e69ea9c07950d73d48807ec595e923";
|
||||
sha256 = "009i9j6mbq6i481088jllblgdnci105b2q4mscprdawg3knlyahk";
|
||||
};
|
||||
wfvm = pkgs.fetchgit {
|
||||
url = "https://git.m-labs.hk/M-Labs/wfvm.git";
|
||||
rev = "c7d9060eeef46bebaf376c95ca37c7a65a2ea896";
|
||||
sha256 = "022fb7zpn48hg9qihmqmzqdphks7b7cbnw6f5s1qy1in5c7f8rx9";
|
||||
};
|
||||
in import "${wfvm}/wfvm" { pkgs = (import wfvm-pkgs {}); }
|
|
@ -1,25 +0,0 @@
|
|||
# Preparation steps
|
||||
|
||||
## Install a Windows image
|
||||
|
||||
```shell
|
||||
nix-build install.nix -I artiqSrc=…/artiq
|
||||
result/bin/windows-installer.sh
|
||||
```
|
||||
|
||||
Follow the instructions.
|
||||
|
||||
## Install Anaconda to the image
|
||||
|
||||
```shell
|
||||
result/bin/anaconda-installer.sh
|
||||
```
|
||||
|
||||
Move the image `c.img` to one of Nix' `extra-sandbox-paths` (`nix.sandboxPaths` on NixOS).
|
||||
|
||||
|
||||
# Running the tests manually
|
||||
|
||||
```shell
|
||||
nix-build --pure --arg diskImage "\"…/c.img\"" -I artiqSrc=…/artiq manual-test-run.nix
|
||||
```
|
|
@ -0,0 +1,17 @@
|
|||
{ pkgs } : [
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/noarch/prettytable-0.7.2-py_3.tar.bz2";
|
||||
sha256 = "0b7s4xm6bbkcg37sf1i3mxrbac0vxhryq22m3qx4x9kh6k2c5g5q";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/pycparser-2.20-py_0.tar.bz2";
|
||||
sha256 = "1qwcb07q8cjz0qpj6pfxb0qb68kddmx9bv9wr5pghwz78q8073z9";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/six-1.15.0-py_0.tar.bz2";
|
||||
sha256 = "08rsfp9bd2mz8r120s8w5vgncy0gn732xa0lfgbmx833548cfqmb";
|
||||
})
|
||||
]
|
|
@ -0,0 +1,22 @@
|
|||
{ pkgs } : [
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/noarch/prettytable-2.1.0-pyhd8ed1ab_0.tar.bz2";
|
||||
sha256 = "1w71padwzy6ay5g8zl575ali994cssgcgzf5917rap3fmw2mgg4d";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/six-1.16.0-pyhd3eb1b0_0.tar.bz2";
|
||||
sha256 = "120wav3bxbyv0jsvbl94rxsigqqchsqg4qqxccg9ij7ydirmqaql";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/pyqtgraph-0.11.0-py_0.tar.bz2";
|
||||
sha256 = "1jnid69dpvhd8nscmkm761qpqz8ip0gka5av90xs3i0pqkqmffqg";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/cached-property-1.5.2-py_0.tar.bz2";
|
||||
sha256 = "01mcbrsrdwvinyvp0fs2hbkczydb33gbz59ldhb1484w5mm9y9bi";
|
||||
})
|
||||
]
|
|
@ -0,0 +1,52 @@
|
|||
{ pkgs } : [
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/cached-property-1.5.2-py_0.tar.bz2";
|
||||
sha256 = "01mcbrsrdwvinyvp0fs2hbkczydb33gbz59ldhb1484w5mm9y9bi";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/zipp-3.6.0-pyhd3eb1b0_0.tar.bz2";
|
||||
sha256 = "1wj0hmhn09b4szs5zyslpd1mggy90pbjil6q3lyqkw3z492za80q";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/noarch/prettytable-2.4.0-pyhd8ed1ab_0.tar.bz2";
|
||||
sha256 = "1iv2x8m8xf2y8v68kz2lil2zaji7gsz099zs8wsrap03j5vpraf0";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/wheel-0.37.0-pyhd3eb1b0_1.tar.bz2";
|
||||
sha256 = "10bxbfy7dlmbr8b21ddb1k2wkrzhs7j2zgmss38pv4g5xidv9v74";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/pyqtgraph-0.11.0-py_0.tar.bz2";
|
||||
sha256 = "1jnid69dpvhd8nscmkm761qpqz8ip0gka5av90xs3i0pqkqmffqg";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/six-1.16.0-pyhd3eb1b0_0.tar.bz2";
|
||||
sha256 = "120wav3bxbyv0jsvbl94rxsigqqchsqg4qqxccg9ij7ydirmqaql";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/python-dateutil-2.8.2-pyhd3eb1b0_0.tar.bz2";
|
||||
sha256 = "1brzm9v9yvs3xhdh89jzw5xjq4a3r9vizhkhdfcax86d2q52ji97";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/pycparser-2.21-pyhd3eb1b0_0.tar.bz2";
|
||||
sha256 = "1dyi89xx73kq0caz4jx493czn16w0dl1gjhw0c5kw28bxz6i8wm8";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/wcwidth-0.2.5-pyhd3eb1b0_0.tar.bz2";
|
||||
sha256 = "1x3sncbrp7bml6qjss24qyy0rsjbdhnzjwpf6apcd14kzspnr21a";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/noarch/tzdata-2021e-hda174b7_0.tar.bz2";
|
||||
sha256 = "1sxgc0pamsskszm29cxpwzlffydxjr3aqpgly7j1f3ansvchxvb4";
|
||||
})
|
||||
]
|
|
@ -0,0 +1,167 @@
|
|||
{ pkgs } : [
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/pyqt-5.9.2-py35h6538335_2.tar.bz2";
|
||||
sha256 = "1anwq53nic50cijngxaylpn6232j9wdc2wz2rykqpgzvs1ms108s";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/zlib-1.2.11-h62dcd97_4.tar.bz2";
|
||||
sha256 = "1jxd7sg0c278hqv09q6hridpdnyhkd34gbs92wkravj3gwsr1adk";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/openssl-1.1.1g-he774522_0.tar.bz2";
|
||||
sha256 = "1gwfj33qb8inikdhmgcm30iz1ag8x71lzicsxbdr7ni4153df5gb";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl_random-1.0.1-py35h77b88f5_1.tar.bz2";
|
||||
sha256 = "0899qg9ih8srpw9q5mxd85hg4gpawb7lmz25x9xi401cfwhgwq7l";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/hdf5-1.10.2-hac2f561_1.tar.bz2";
|
||||
sha256 = "0l1i5bpxl0bn9hf738ywygjwc32d4cq5fjkgzij3x27cxi8nvd21";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/tbb4py-2018.0.5-py35he980bc4_0.tar.bz2";
|
||||
sha256 = "0gypjcmciw3rnd2cq0sqmvspgzaas13fghv633dqj8g3bvl4lfif";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/wheel-0.31.1-py35_0.tar.bz2";
|
||||
sha256 = "07zmbg57lpvqd9nmahiff1mhzxmzchx1v128dcrj4iamymjcdlzf";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/vs2015_runtime-14.16.27012-hf0eaf9b_2.tar.bz2";
|
||||
sha256 = "1gbm6i6nkp8linmak5mm42hj1nzqd5ppak8kv1n3wfn52p21ngvs";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/win-64/pygit2-0.27.1-py35hfa6e2cd_0.tar.bz2";
|
||||
sha256 = "1jypm8vxs4j4yr37ai4ki9qsslv3wz6slklmisnvjraz1a4vzaf8";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/pip-10.0.1-py35_0.tar.bz2";
|
||||
sha256 = "0zwlkfgnag1s64wbwdcg44zqj2dpfcq1g4b6dsk82q24j7fw40i3";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/h5py-2.8.0-py35h3bdd7fb_2.tar.bz2";
|
||||
sha256 = "0743wrf51b2vs8ybasjpn7ricbh740r7drxcimkhbxp8r6vd66vp";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/numpy-1.15.2-py35ha559c80_0.tar.bz2";
|
||||
sha256 = "1igf4gm726s4kg7km24flxdxr73fafaz3z18y3ndcb5f6r9zwa44";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl-2018.0.3-1.tar.bz2";
|
||||
sha256 = "01pq0f2787q58avg5ylfrbpf4jlg2b6rbajvf3swjpm1cmzxkm81";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/libssh2-1.9.0-h7a1dbc1_1.tar.bz2";
|
||||
sha256 = "0sz405ab3n7991hxy8l9affs1slivsimgadxsdr6wvpgx3j4aqgx";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/tk-8.6.10-he774522_0.tar.bz2";
|
||||
sha256 = "15bfncacdxmcbn4xixmfz2m7a09k7hcpwxvwn1lki84bx0fmzsis";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/sqlite-3.32.2-h2a8f88b_0.tar.bz2";
|
||||
sha256 = "086jjnxfchypkr8cp1q8nsis0jfvl293bv4bcg7ikv7aia3vda8p";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/wincertstore-0.2-py35hfebbdb8_0.tar.bz2";
|
||||
sha256 = "1624bzqlbiq4jlz46l65574smw739p7l38ydzxmayq3jmwx6zaar";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/certifi-2018.8.24-py35_1.tar.bz2";
|
||||
sha256 = "06ygpkx3f71rwmq9lgc29r6jj4g1zi8rvrmn4mrrsb9b5sf0rzgf";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/icu-58.2-ha925a31_3.tar.bz2";
|
||||
sha256 = "0vcl0j3v9ab022s2g3a9iv1pn7sflh670yyf5m08hdyf049m3jz7";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/regex-2018.08.29-py35hfa6e2cd_0.tar.bz2";
|
||||
sha256 = "16cjgwpaqnfy8bg35iz12bb9whpws4abiz4cq4shpnh6gnwpwzj3";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/cffi-1.11.5-py35h74b6da3_1.tar.bz2";
|
||||
sha256 = "0nc3ps4xl8rqpwiqaqqr5lrqzk8lx1a4hh3fpm7i7rlppqn5pm6a";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/libcurl-7.69.1-h2a8f88b_0.tar.bz2";
|
||||
sha256 = "182zrmgl2142gfgnbgjsk0gbj85vw75xzxvhn9lzm485ghxsasvg";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl_fft-1.0.6-py35hdbbee80_0.tar.bz2";
|
||||
sha256 = "0xb02rx28rjlp5clavg19jb129ihcarrkz46pncaar91qxckbbxz";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/pyqtgraph-0.10.0-py35h28b3542_3.tar.bz2";
|
||||
sha256 = "0ywzw3i4kf5ccck9whmg1j7s22x6i5fpywndy8rkr9va38g4nazq";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/sip-4.19.8-py35h6538335_0.tar.bz2";
|
||||
sha256 = "1y761zpm6bi0pb61x1y26ap56hylh6mjg1xq9zl08bmcl2dlkwfy";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/setuptools-40.2.0-py35_0.tar.bz2";
|
||||
sha256 = "146piyifnip1flqph19nxilnhfbzzsxlhfyx0i61wv7krr6ln9yy";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/win-64/python-levenshtein-0.12.0-py35_0.tar.bz2";
|
||||
sha256 = "1rdpzv1y535swf17nm88chkp1m8w3wd3nwdy7jk1xfcnx1da5ss6";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/win-64/libgit2-0.27.8-hfac1375_0.tar.bz2";
|
||||
sha256 = "05pjzwmm5vyxwcgi6vv3i961x3dgdd9c4b1ihagq9kyxgqfy21kd";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/scipy-1.1.0-py35h4f6bf74_1.tar.bz2";
|
||||
sha256 = "0sdyj5nlycv4krz7f8rzhi0kxv302gpx65x1zwhj8dn6b2c50li0";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/curl-7.69.1-h2a8f88b_0.tar.bz2";
|
||||
sha256 = "0hw5dh7gzx8fap4c3vkc2xc2q9by3f5ndbigr6pm6w5v29qaydn4";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/intel-openmp-2019.4-245.tar.bz2";
|
||||
sha256 = "13qid5aagyxsfy5ng4bbwb7hs9jj29jvqbpvvkjiy6bgv36m8kr8";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/numpy-base-1.15.2-py35h8128ebf_0.tar.bz2";
|
||||
sha256 = "166w4wkp9dwl505hc00hny1mq2mlvb169n7c9nws7dz8j36pqfrx";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/python-3.5.6-he025d50_0.tar.bz2";
|
||||
sha256 = "0ygvmbyvhc2jisb5bzb0r5709qmn8392gr7rv6c8vrdiylfiqr73";
|
||||
})
|
||||
]
|
|
@ -0,0 +1,67 @@
|
|||
{ pkgs } : [
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/numpy-base-1.20.2-py38hc2deb75_0.tar.bz2";
|
||||
sha256 = "1940fryxlil04d5y0df1s1sydhny8l97slvfm7v40mxibdmf2sdn";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/hdf5-1.10.6-h7ebc959_0.tar.bz2";
|
||||
sha256 = "09bik65gspyrqj3j5p67wf2ywhgyfz3pkw39gwdzha7yyjkkzx0q";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/certifi-2021.5.30-py38haa95532_0.tar.bz2";
|
||||
sha256 = "0hzj23xjw88wllz1l4qdnzp335608vm8pl7w1ka9pkg6ip69lnpm";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/sqlite-3.36.0-h2bbff1b_0.tar.bz2";
|
||||
sha256 = "15w0lhcl97wafqvc6ccc96311wc5rrmh16i4ki1pw6kzkfmr1k6r";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/win-64/libgit2-1.1.1-h8648793_0.tar.bz2";
|
||||
sha256 = "0rwmd48g7sywmxgcyjad3hznpm15d3w5604syrkcs2ryih0cgwkd";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/h5py-3.2.1-py38h3de5c98_0.tar.bz2";
|
||||
sha256 = "17czl7gvv6d9v6ng9l6c0i1iy181cr1qq7cyn2s90kamnfh3dx8b";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/numpy-1.20.2-py38ha4e8547_0.tar.bz2";
|
||||
sha256 = "0w4hkirwgh4bp7djzxp2yh086jfdbz1y3njsrpqm441rjjq39hpz";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/win-64/python_abi-3.8-2_cp38.tar.bz2";
|
||||
sha256 = "1j62rls5r6646b7gagc7d6jj6sqiyqd9vq442dqg3pwyldlz3zqg";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/python-levenshtein-0.12.2-py38h2bbff1b_0.tar.bz2";
|
||||
sha256 = "0xvl3v7q1wr0a8li3f8d7hara58lcvrr6hmcd6cqkvcnhggkhp9s";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/win-64/pygit2-1.6.1-py38h294d835_0.tar.bz2";
|
||||
sha256 = "0frgv2b1ckgp8w574abliz369lbziyqsipkwxcjy4l9rbn2pa0rj";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/ca-certificates-2021.5.25-haa95532_1.tar.bz2";
|
||||
sha256 = "0g77ic1hs9gj9nknjgrn7byk63z82ima7gqynjcds1kbk8cy4hcd";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/pip-21.1.3-py38haa95532_0.tar.bz2";
|
||||
sha256 = "1wzb3f3n1lndmxbr3agmx4rr1k11jf60fcrqmgr1d7a3ygqvqy4q";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/python-3.8.10-hdbf39b2_7.tar.bz2";
|
||||
sha256 = "05p2g1552crfmcf4a9wfjg4d1qngsvi1srpca2hqr6s9slip2w19";
|
||||
})
|
||||
]
|
|
@ -0,0 +1,182 @@
|
|||
{ pkgs } : [
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/ca-certificates-2021.10.26-haa95532_2.tar.bz2";
|
||||
sha256 = "14zdv6whd7cw298mkwpgkfydpz6zwhjq6gvxpw5s77m9b8jyi08w";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/jpeg-9d-h2bbff1b_0.tar.bz2";
|
||||
sha256 = "0jdwx9bl89byaqi73h0wr9hkjdi0ia47izgj602xfzc8ylhg0fxl";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/win-64/python_abi-3.9-2_cp39.tar.bz2";
|
||||
sha256 = "04d9pbqzck0330jv7mi8x4r1883sv421lwai2p9yamr2yl6xpan0";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/certifi-2021.10.8-py39haa95532_0.tar.bz2";
|
||||
sha256 = "032gmb2lyd0kwb7cr1j90fqyb44aar9jnki9jzjp6p65lbckc27l";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/python-3.9.7-h6244533_1.tar.bz2";
|
||||
sha256 = "1pgnrci071wbjdsarjrjssqvbk6nr2hbsvwdvzvf255f33264jj3";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/pip-21.2.4-py39haa95532_0.tar.bz2";
|
||||
sha256 = "06a916f8fyjydy5rrrhvwjxn5jwr1w2b6dvhgpsa09bq4p1c2qid";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/regex-2021.8.3-py39h2bbff1b_0.tar.bz2";
|
||||
sha256 = "1p8kf8d2d3cb6z91fl2sjrn3mpaxb7pq1rc20705k1lqbjf9biga";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl-2021.4.0-haa95532_640.tar.bz2";
|
||||
sha256 = "115zmm4n769xl442qmv5h2ik5fyc1hb8cm1hc5a1vyb7bqwj2xrx";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/setuptools-58.0.4-py39haa95532_0.tar.bz2";
|
||||
sha256 = "0avlsc1k3ms92panb24z5vas5gkfm9zxy0mh71pv7yqc466k2qc0";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/importlib-metadata-4.8.2-py39haa95532_0.tar.bz2";
|
||||
sha256 = "1fjr69ibknprp25742vzpbck6byrw84w2g3zxa5vqsyz7pyv27xb";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/numba/win-64/llvmlite-0.38.0rc1-py39_0.tar.bz2";
|
||||
sha256 = "0xmd338r5vl9f456cvmmf4s1bz1jxc3yv58050xqgifpkrx3z3vr";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/hdf5-1.10.6-h7ebc959_0.tar.bz2";
|
||||
sha256 = "09bik65gspyrqj3j5p67wf2ywhgyfz3pkw39gwdzha7yyjkkzx0q";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/intel-openmp-2021.4.0-haa95532_3556.tar.bz2";
|
||||
sha256 = "19mmjvcm7f8nzyk7djjsd9lf6qx01f35wrvmragv1fhzsis3ddgf";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl_random-1.2.2-py39hf11a4ad_0.tar.bz2";
|
||||
sha256 = "03h3857xvp5klhc24jn7lh0h7227qrk7q7ch768w27bx27g27js3";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/numpy-base-1.21.2-py39h0829f74_0.tar.bz2";
|
||||
sha256 = "1x97k4kdvdwh0aahrpzfaypsf7zvxkqwn0xw7cph2p9fzk7j88zw";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/win-64/pygit2-1.7.2-py39hb82d6ee_0.tar.bz2";
|
||||
sha256 = "1l56b7x1mrha9fs4j2zw4f2c199ab0yw1yggdivjyn40xll9x2sd";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/openssl-1.1.1l-h2bbff1b_0.tar.bz2";
|
||||
sha256 = "1w37wciivy4dqa1gvkwq23myv7sk7vr4davarvxc9hjl2is3r4dm";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/sip-4.19.13-py39hd77b12b_0.tar.bz2";
|
||||
sha256 = "1p2wgpzy1ccya314m53qjqnw2wns7wj4lxv3lkmddx940f12i76r";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/win-64/libssh2-1.10.0-h680486a_2.tar.bz2";
|
||||
sha256 = "1nnzz9hxgj63gs48flj6pxq6nqz9gkx54gwibyq502za1rbhbyw6";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/python-levenshtein-0.12.2-py39h2bbff1b_0.tar.bz2";
|
||||
sha256 = "1y5g9l07whv614qyafkzbph30zi9kypxfswdxh0gknsih8941j0k";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/pyreadline-2.1-py39haa95532_1.tar.bz2";
|
||||
sha256 = "0581i2vp5b1dx7z9v4q41dd9ppj9bh9xgy0cnd7zd01zblafdbj5";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/h5py-3.6.0-py39h3de5c98_0.tar.bz2";
|
||||
sha256 = "0g6jw2c6qn4vzmn6k3yal8qxrdzcdzpx6grwq1mjxpamb11akni7";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/numba/win-64/icc_rt-2020.2-intel_254.tar.bz2";
|
||||
sha256 = "195km05did3n7zaljg7vwz11n8ibf935gk0m7dy07ngfk97s8w9f";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/lld-12.0.0-he71bc95_0.tar.bz2";
|
||||
sha256 = "0f6aw6d72w339jyqyjavnnsv35k2dc4pl79ymylczwf2my37rqpk";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl-service-2.4.0-py39h2bbff1b_0.tar.bz2";
|
||||
sha256 = "05sbxqipw9cp2c4p5imadk4hc9ds1d25hys5vamjp6pnl6435ipk";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/pyqt-5.9.2-py39hd77b12b_6.tar.bz2";
|
||||
sha256 = "1v3qbmidh2h4vkzf5w8lisjc58z2714bbvaf0dg5m2k5vga4zh84";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/llvm-tools-12.0.0-h05d9aec_3.tar.bz2";
|
||||
sha256 = "0ly686hb730mvhw47xyz92dqchq46wkdaw1v2a6i0fzzdgf3ww9p";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/libxml2-2.9.12-h0ad7f3c_0.tar.bz2";
|
||||
sha256 = "0gm1ajhiwdk23cc62nkayqqwqcccxwzj01dmypycx5d6cbh46l9y";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/wincertstore-0.2-py39haa95532_2.tar.bz2";
|
||||
sha256 = "0fvcgpmn13i9rxql4dvw8ybzj2vvck0fqsqk1qrgdl3zkh841f1z";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://conda.anaconda.org/conda-forge/win-64/libgit2-1.3.0-h8648793_1.tar.bz2";
|
||||
sha256 = "0gw71dk8a2b80822p44rarq5nqiww8g9braxvbxnwanam5wl5611";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/cffi-1.15.0-py39h2bbff1b_0.tar.bz2";
|
||||
sha256 = "1akbnswb1zigf1cx8im6s96rjmfryl4i20sg3xgaqy5papz926hf";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/mkl_fft-1.3.1-py39h277e83a_0.tar.bz2";
|
||||
sha256 = "0i2v4vzwklvwp1n003yyr2hgpb1gjsh05ibsc92w0c5angf0s4wp";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/numpy-1.21.2-py39hfca59bb_0.tar.bz2";
|
||||
sha256 = "1f10ka0vyx319z3f51zfxfcbwipa3vscw175c6i2qsb9ynlihqi7";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/scipy-1.7.1-py39hbe87c03_2.tar.bz2";
|
||||
sha256 = "131xc7qr5lrfnxdy8p09y6gghx0h7wbaif2kq4r1jmmmm8pksjm6";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/libllvm12-12.0.0-h425c57c_3.tar.bz2";
|
||||
sha256 = "1k5396hvb4hbylcpnx4m7v7kggw9kn8j1w0v91lwzc3gv64q83l9";
|
||||
})
|
||||
|
||||
(pkgs.fetchurl {
|
||||
url = "https://repo.anaconda.com/pkgs/main/win-64/sqlite-3.36.0-h2bbff1b_0.tar.bz2";
|
||||
sha256 = "15w0lhcl97wafqvc6ccc96311wc5rrmh16i4ki1pw6kzkfmr1k6r";
|
||||
})
|
||||
]
|
|
@ -1,91 +0,0 @@
|
|||
{ pkgs ? import <nixpkgs> {},
|
||||
diskImageSize ? "22G",
|
||||
qemuMem ? "4G",
|
||||
}:
|
||||
|
||||
with pkgs;
|
||||
|
||||
let
|
||||
windowsIso = fetchurl {
|
||||
url = "https://software-download.microsoft.com/download/sg/17763.107.101029-1455.rs5_release_svc_refresh_CLIENT_LTSC_EVAL_x64FRE_en-us.iso";
|
||||
sha256 = "668fe1af70c2f7416328aee3a0bb066b12dc6bbd2576f40f812b95741e18bc3a";
|
||||
};
|
||||
anaconda = fetchurl {
|
||||
url = "https://repo.anaconda.com/archive/Anaconda3-2019.03-Windows-x86_64.exe";
|
||||
sha256 = "1f9icm5rwab6l1f23a70dw0qixzrl62wbglimip82h4zhxlh3jfj";
|
||||
};
|
||||
|
||||
escape = builtins.replaceStrings [ "\\" ] [ "\\\\" ];
|
||||
qemu = import ./qemu.nix {
|
||||
inherit pkgs qemuMem;
|
||||
diskImage = "c.img";
|
||||
};
|
||||
# Double-escape because we produce a script from a shell heredoc
|
||||
ssh = cmd: qemu.ssh (escape cmd);
|
||||
scp = qemu.scp;
|
||||
|
||||
sshCondaEnv = cmd: ssh "anaconda\\scripts\\activate && ${cmd}";
|
||||
condaEnv = "artiq-env";
|
||||
condaDepSpecs =
|
||||
builtins.concatStringsSep " "
|
||||
(map (s: "\"${s}\"")
|
||||
(import ../conda-artiq-deps.nix));
|
||||
|
||||
instructions =
|
||||
builtins.toFile "install.txt"
|
||||
(builtins.readFile ./install.txt);
|
||||
in
|
||||
stdenv.mkDerivation {
|
||||
name = "windows-installer";
|
||||
src = windowsIso;
|
||||
setSourceRoot = "sourceRoot=`pwd`";
|
||||
unpackCmd = ''
|
||||
ln -s $curSrc windows.iso
|
||||
'';
|
||||
propagatedBuildInputs = qemu.inputs;
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin $out/data
|
||||
ln -s $(readlink windows.iso) $out/data/windows.iso
|
||||
cat > $out/bin/windows-installer.sh << EOF
|
||||
#!/usr/bin/env bash
|
||||
set -e -m
|
||||
|
||||
${qemu.qemu-img} create -f qcow2 c.img ${diskImageSize}
|
||||
${qemu.runQemu false [] [
|
||||
"-boot" "order=d"
|
||||
"-drive" "file=c.img,index=0,media=disk,cache=unsafe"
|
||||
"-drive" "file=$out/data/windows.iso,index=1,media=cdrom,cache=unsafe"
|
||||
]} &
|
||||
cat ${instructions}
|
||||
wait
|
||||
EOF
|
||||
|
||||
cat > $out/bin/anaconda-installer.sh << EOF
|
||||
#!/usr/bin/env bash
|
||||
set -e -m
|
||||
|
||||
${qemu.runQemu false [] [
|
||||
"-boot" "order=c"
|
||||
"-drive" "file=c.img,index=0,media=disk"
|
||||
]} &
|
||||
sleep 10
|
||||
${ssh "ver"}
|
||||
|
||||
${scp anaconda "Anaconda.exe"}
|
||||
${ssh "start /wait \"\" Anaconda.exe /S /D=%cd%\\anaconda"}
|
||||
|
||||
${sshCondaEnv "conda config --add channels conda-forge"}
|
||||
${sshCondaEnv "conda config --add channels m-labs"}
|
||||
( ${sshCondaEnv "conda update -y conda"} ) || true
|
||||
${sshCondaEnv "conda update -y --all"}
|
||||
${sshCondaEnv "conda create -y -n ${condaEnv}"}
|
||||
${sshCondaEnv "conda install -y -n ${condaEnv} ${condaDepSpecs}"}
|
||||
${ssh "shutdown /p /f"}
|
||||
|
||||
echo "Waiting for qemu exit"
|
||||
wait
|
||||
EOF
|
||||
chmod a+x $out/bin/*.sh
|
||||
'';
|
||||
}
|
|
@ -1,13 +0,0 @@
|
|||
Add user account with expected password [user/user].
|
||||
Enable the OpenSSH server:
|
||||
- "Add or remove programs"
|
||||
- "Manage optional features"
|
||||
- "Add a feature"
|
||||
- "OpenSSH Server"
|
||||
- "Install"
|
||||
- Open "Services"
|
||||
- Double-click the "OpenSSH SSH Server" service
|
||||
- Set "Startup type" to "Automatic"
|
||||
- "Start"
|
||||
- "Ok"
|
||||
Then press ENTER here to proceed with automatic installation
|
|
@ -0,0 +1,79 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Run manually to build the list of conda dependencies to install in the
|
||||
# test environments.
|
||||
|
||||
# NOTE: This procedure encounters failing HTTPS handshakes. To circumvent just
|
||||
# for testing, insert `call conda config --set ssl_verify no` into
|
||||
# getcondapackages.bat. To securely update the sources lists update the RTC
|
||||
# hack to the proper date instead.
|
||||
|
||||
set -e
|
||||
|
||||
nix-build -E "
|
||||
let
|
||||
pkgs = import <nixpkgs> {};
|
||||
wfvm = import ../wfvm.nix { inherit pkgs; };
|
||||
in
|
||||
wfvm.utils.wfvm-run {
|
||||
name = \"get-conda-packages\";
|
||||
image = wfvm.makeWindowsImage { installCommands = [ wfvm.layers.anaconda3 ]; };
|
||||
# TODO: fix wfvm login expiry and also remove 'date' workarounds below
|
||||
#fakeRtc = false;
|
||||
isolateNetwork = false;
|
||||
script = ''
|
||||
cat > getcondapackages.bat << EOF
|
||||
date 12-14-21
|
||||
call conda config --prepend channels https://conda.m-labs.hk/artiq-beta
|
||||
call conda config --append channels conda-forge
|
||||
call conda config --prepend channels numba
|
||||
call conda create -n artiq -y
|
||||
call conda install --dry-run --json -n artiq artiq > packages.json
|
||||
EOF
|
||||
\${wfvm.utils.win-put}/bin/win-put getcondapackages.bat
|
||||
\${wfvm.utils.win-exec}/bin/win-exec '.\Anaconda3\Scripts\activate && getcondapackages'
|
||||
\${wfvm.utils.win-get}/bin/win-get packages.json
|
||||
'';
|
||||
}
|
||||
"
|
||||
|
||||
./result/bin/wfvm-run-get-conda-packages
|
||||
|
||||
python -c "
|
||||
import json
|
||||
|
||||
with open('packages.json') as json_file:
|
||||
packages = json.load(json_file)
|
||||
|
||||
with open('packages_noarch.txt', 'w') as list_noarch:
|
||||
with open('packages_win-64.txt', 'w') as list_win64:
|
||||
for fetch in packages['actions']['FETCH']:
|
||||
if 'm-labs' not in fetch['channel']:
|
||||
if fetch['subdir'] == 'noarch':
|
||||
list = list_noarch
|
||||
elif fetch['subdir'] == 'win-64':
|
||||
list = list_win64
|
||||
else:
|
||||
raise ValueError
|
||||
url = fetch['url']
|
||||
if url.endswith('.conda'):
|
||||
url = url[:-6] + '.tar.bz2'
|
||||
print(url, file=list)
|
||||
"
|
||||
|
||||
for type in "noarch" "win-64"; do
|
||||
echo Downloading $type packages
|
||||
out=conda_$type\_packages.nix
|
||||
echo "{ pkgs } : [" > $out
|
||||
while read package; do
|
||||
hash=$(nix-prefetch-url $package)
|
||||
echo "
|
||||
(pkgs.fetchurl {
|
||||
url = \"$package\";
|
||||
sha256 = \"$hash\";
|
||||
})" >> $out
|
||||
done < packages_$type.txt
|
||||
echo "]" >> $out
|
||||
done
|
||||
|
||||
rm result getcondapackages.bat packages.json packages_noarch.txt packages_win-64.txt
|
|
@ -1,27 +1,10 @@
|
|||
# This runs `run-test.nix` with `nix-build`
|
||||
|
||||
{ pkgs ? import <nixpkgs> {},
|
||||
diskImage ? "/opt/windows/c.img",
|
||||
qemuMem ? "2G",
|
||||
testTimeout ? 180,
|
||||
}:
|
||||
|
||||
with pkgs;
|
||||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
let
|
||||
windowsRunner = overrides:
|
||||
import ./run-test.nix ({
|
||||
inherit pkgs diskImage qemuMem testTimeout;
|
||||
} // overrides);
|
||||
artiqpkgs = import ../. { inherit pkgs; };
|
||||
run-test = import ./run-test.nix {
|
||||
inherit pkgs artiqpkgs;
|
||||
testCommand = "set ARTIQ_ROOT=%cd%\\Anaconda3\\envs\\artiq-env\\Lib\\site-packages\\artiq\\examples\\kc705_nist_clock&& python -m unittest discover -v sipyco.test && python -m unittest discover -v artiq.test";
|
||||
};
|
||||
in
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "windows-test";
|
||||
|
||||
phases = [ "installPhase" "checkPhase" ];
|
||||
installPhase = "touch $out";
|
||||
doCheck = true;
|
||||
checkPhase = ''
|
||||
${windowsRunner { testCommand = "set ARTIQ_ROOT=%cd%\\anaconda\\envs\\artiq-env\\Lib\\site-packages\\artiq\\examples\\kc705_nist_clock&&python -m unittest discover -v artiq.test"; }}/bin/run.sh
|
||||
'';
|
||||
}
|
||||
run-test
|
||||
|
|
|
@ -1,54 +0,0 @@
|
|||
{ pkgs,
|
||||
diskImage,
|
||||
qemuMem,
|
||||
sshUser ? "user",
|
||||
sshPassword ? "user",
|
||||
}:
|
||||
|
||||
with pkgs;
|
||||
|
||||
let
|
||||
qemu-img = "${qemu_kvm}/bin/qemu-img";
|
||||
runQemu = isolateNetwork: forwardedPorts: extraArgs:
|
||||
let
|
||||
restrict =
|
||||
if isolateNetwork
|
||||
then "on"
|
||||
else "off";
|
||||
# use socat instead of `tcp:…` to allow multiple connections
|
||||
guestfwds =
|
||||
builtins.concatStringsSep ""
|
||||
(map ({ listenAddr, targetAddr, port }:
|
||||
",guestfwd=tcp:${listenAddr}:${toString port}-cmd:${socat}/bin/socat\\ -\\ tcp:${targetAddr}:${toString port}"
|
||||
) forwardedPorts);
|
||||
args = [
|
||||
"-enable-kvm"
|
||||
"-m" qemuMem
|
||||
"-bios" "${OVMF.fd}/FV/OVMF.fd"
|
||||
"-netdev" "user,id=n1,net=192.168.1.0/24,restrict=${restrict},hostfwd=tcp::2022-:22${guestfwds}"
|
||||
"-device" "e1000,netdev=n1"
|
||||
];
|
||||
argStr = builtins.concatStringsSep " " (args ++ extraArgs);
|
||||
in "${qemu_kvm}/bin/qemu-system-x86_64 ${argStr}";
|
||||
|
||||
# Pass empty config file to prevent ssh from failing to create ~/.ssh
|
||||
sshOpts = "-F /dev/null -o StrictHostKeyChecking=accept-new -o UserKnownHostsFile=\$TMP/known_hosts";
|
||||
ssh = cmd: ''
|
||||
echo ssh windows '${cmd}'
|
||||
${sshpass}/bin/sshpass -p${sshPassword} -- \
|
||||
${openssh}/bin/ssh -np 2022 ${sshOpts} \
|
||||
${sshUser}@localhost \
|
||||
'${cmd}'
|
||||
'';
|
||||
scp = src: target: ''
|
||||
echo "Copy ${src} to ${target}"
|
||||
${sshpass}/bin/sshpass -p${sshPassword} -- \
|
||||
${openssh}/bin/scp -P 2022 ${sshOpts} \
|
||||
"${src}" "${sshUser}@localhost:${target}"
|
||||
'';
|
||||
|
||||
in
|
||||
{
|
||||
inherit qemu-img runQemu ssh scp;
|
||||
inputs = [ qemu_kvm openssh sshpass ];
|
||||
}
|
|
@ -1,22 +1,6 @@
|
|||
{ pkgs,
|
||||
diskImage ? "/opt/windows/c.img",
|
||||
qemuMem ? "2G",
|
||||
testTimeout ? 600,
|
||||
artiqPkg ? import ../conda-artiq.nix { inherit pkgs; },
|
||||
testCommand ? "python -m unittest discover -v artiq.test",
|
||||
}:
|
||||
|
||||
with pkgs;
|
||||
{ pkgs, artiqpkgs, testCommand, testTimeout ? 600 }:
|
||||
|
||||
let
|
||||
escape = builtins.replaceStrings [ "\\" ] [ "\\\\" ];
|
||||
qemu = import ./qemu.nix {
|
||||
inherit pkgs qemuMem;
|
||||
diskImage = "c.img";
|
||||
};
|
||||
# Double-escape because we produce a script from a shell heredoc
|
||||
ssh = cmd: qemu.ssh (escape cmd);
|
||||
scp = qemu.scp;
|
||||
condaEnv = "artiq-env";
|
||||
tcpPorts = [ 1380 1381 1382 1383 ];
|
||||
forwardedPorts =
|
||||
|
@ -25,56 +9,57 @@ let
|
|||
targetAddr = "192.168.1.50";
|
||||
inherit port;
|
||||
}) tcpPorts;
|
||||
|
||||
artiq6 = pkgs.lib.strings.versionAtLeast artiqpkgs.artiq.version "6.0";
|
||||
artiq7 = pkgs.lib.strings.versionAtLeast artiqpkgs.artiq.version "7.0";
|
||||
wfvm = import (if artiq6 then ../wfvm.nix else ../wfvm-legacy.nix) { inherit pkgs; };
|
||||
conda-deps = {
|
||||
name = "conda-deps";
|
||||
script = let
|
||||
qt-asyncio-package = if artiq6 then artiqpkgs.conda-qasync else artiqpkgs.conda-quamash;
|
||||
conda-deps-noarch = import (if artiq7 then ./conda_noarch_packages-7.nix else if artiq6 then ./conda_noarch_packages-6.nix else ./conda_noarch_packages-5.nix) { inherit pkgs; };
|
||||
conda-deps-win-64 = import (if artiq7 then ./conda_win-64_packages-7.nix else if artiq6 then ./conda_win-64_packages-6.nix else ./conda_win-64_packages-5.nix) { inherit pkgs; };
|
||||
conda-packages-put = pkgs.lib.strings.concatStringsSep "\n"
|
||||
( (map (package: ''win-put ${package} 'fake-channel/noarch' '') conda-deps-noarch)
|
||||
++ (map (package: ''win-put ${package} 'fake-channel/win-64' '') conda-deps-win-64) );
|
||||
conda-packages-legacy-put = if artiq7 then "" else
|
||||
''
|
||||
win-put ${artiqpkgs.conda-windows-binutils-or1k}/win-64/*.tar.bz2 'fake-channel/win-64'
|
||||
win-put ${artiqpkgs.conda-windows-llvm-or1k}/win-64/*.tar.bz2 'fake-channel/win-64'
|
||||
win-put ${artiqpkgs.conda-windows-llvmlite-artiq}/win-64/*.tar.bz2 'fake-channel/win-64'
|
||||
'';
|
||||
in
|
||||
''
|
||||
win-exec 'mkdir fake-channel && mkdir fake-channel\noarch && mkdir fake-channel\win-64'
|
||||
|
||||
${conda-packages-put}
|
||||
|
||||
${conda-packages-legacy-put}
|
||||
|
||||
win-put ${artiqpkgs.conda-pythonparser}/noarch/*.tar.bz2 'fake-channel/noarch'
|
||||
win-put ${artiqpkgs.conda-sipyco}/noarch/*.tar.bz2 'fake-channel/noarch'
|
||||
win-put ${qt-asyncio-package}/noarch/*.tar.bz2 'fake-channel/noarch'
|
||||
'';
|
||||
};
|
||||
in
|
||||
wfvm.utils.wfvm-run {
|
||||
name = "windows-tests";
|
||||
image = wfvm.makeWindowsImage { installCommands = [ wfvm.layers.anaconda3 conda-deps ]; };
|
||||
inherit forwardedPorts;
|
||||
script =
|
||||
''
|
||||
${wfvm.utils.win-put}/bin/win-put ${artiqpkgs.conda-artiq}/noarch/*.tar.bz2 'fake-channel/noarch'
|
||||
|
||||
stdenv.mkDerivation {
|
||||
name = "windows-test-runner";
|
||||
src = ./.;
|
||||
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda index fake-channel"
|
||||
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate && conda create -n ${condaEnv} --offline"
|
||||
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate ${condaEnv} && conda install -y -c file:///C:/users/wfvm/fake-channel --offline artiq"\
|
||||
|
||||
propagatedBuildInputs = qemu.inputs;
|
||||
dontBuild = true;
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
cat > $out/bin/run.sh << EOF
|
||||
#!/usr/bin/env bash
|
||||
set -e -m
|
||||
# Schedule a timed shutdown against hanging test runs
|
||||
${wfvm.utils.win-exec}/bin/win-exec "shutdown -s -t ${toString testTimeout}"
|
||||
|
||||
# +1 day from last modification of the disk image
|
||||
CLOCK=$(date -Is -d @$(expr $(stat -c %Y ${diskImage}) + 86400))
|
||||
${qemu.runQemu true forwardedPorts [
|
||||
"-boot" "order=c"
|
||||
"-snapshot"
|
||||
"-drive" "file=${diskImage},index=0,media=disk,cache=unsafe"
|
||||
"-rtc" "base=\\$CLOCK"
|
||||
"-display" "none"
|
||||
]} &
|
||||
${wfvm.utils.win-exec}/bin/win-exec ".\Anaconda3\scripts\activate ${condaEnv} && ${testCommand}"
|
||||
|
||||
echo "Wait for Windows to boot"
|
||||
sleep 10
|
||||
${ssh "ver"}
|
||||
for pkg in ${artiqPkg}/noarch/artiq*.tar.bz2 ; do
|
||||
${scp "\\$pkg" "artiq.tar.bz2"}
|
||||
${ssh "anaconda\\scripts\\activate ${condaEnv} && conda install artiq.tar.bz2"}
|
||||
done
|
||||
|
||||
# Schedule a timed shutdown against hanging test runs
|
||||
${ssh "shutdown -s -t ${toString testTimeout}"}
|
||||
|
||||
FAIL=n
|
||||
( ${ssh "anaconda\\scripts\\activate ${condaEnv} && ${testCommand}"} ) || FAIL=y
|
||||
|
||||
# Abort timeouted shutdown
|
||||
${ssh "shutdown -a"}
|
||||
# Power off immediately
|
||||
${ssh "shutdown -p -f"}
|
||||
wait
|
||||
|
||||
if [ "\$FAIL" = "y" ]; then
|
||||
exit 1
|
||||
else
|
||||
exit 0
|
||||
fi
|
||||
EOF
|
||||
chmod a+x $out/bin/run.sh
|
||||
'';
|
||||
}
|
||||
# Abort timeouted shutdown
|
||||
${wfvm.utils.win-exec}/bin/win-exec "shutdown -a"
|
||||
'';
|
||||
}
|
||||
|
|
298
artiq-full.nix
298
artiq-full.nix
|
@ -1,97 +1,128 @@
|
|||
{ pkgs ? import <nixpkgs> {}}:
|
||||
{ pkgs ? import <nixpkgs> { overlays = [ (import ./artiq-fast/mozilla-overlay.nix) ]; }
|
||||
, use-generated ? <use-generated>
|
||||
}:
|
||||
|
||||
let
|
||||
sinaraSystemsSrc = <sinaraSystemsSrc>;
|
||||
sinaraSystemsRev = builtins.readFile <artiq-board-generated/sinara-rev.txt>;
|
||||
sinaraSystemsHash = builtins.readFile <artiq-board-generated/sinara-hash.txt>;
|
||||
sinaraSystemsSrc =
|
||||
if use-generated
|
||||
then pkgs.fetchgit {
|
||||
url = "https://git.m-labs.hk/M-Labs/sinara-systems-legacy.git";
|
||||
rev = sinaraSystemsRev;
|
||||
sha256 = sinaraSystemsHash;
|
||||
}
|
||||
else <sinaraSystemsSrc>;
|
||||
artiq-fast =
|
||||
if use-generated
|
||||
then <artiq-board-generated/fast>
|
||||
else <artiq-fast>;
|
||||
artiqVersion = import (artiq-fast + "/pkgs/artiq-version.nix") {
|
||||
inherit (pkgs) stdenv git fetchgit;
|
||||
};
|
||||
targets = import ./artiq-full/artiq-targets.nix {
|
||||
inherit pkgs artiqVersion sinaraSystemsSrc;
|
||||
};
|
||||
kasliVariants = map ({ variant, ... }: variant) (
|
||||
builtins.filter ({ target, ... }: target == "kasli") (
|
||||
builtins.attrValues targets
|
||||
)
|
||||
);
|
||||
standaloneVariants = map ({ variant, ... }: variant) (
|
||||
builtins.filter ({ target, standalone ? false, ... }: target == "kasli" && standalone) (
|
||||
builtins.attrValues targets
|
||||
)
|
||||
);
|
||||
serializedTargets = pkgs.lib.generators.toPretty {} (
|
||||
map (conf:
|
||||
if conf ? buildCommand
|
||||
then conf // {
|
||||
buildCommand = builtins.replaceStrings ["$"] ["\\\\\\$"] conf.buildCommand;
|
||||
}
|
||||
else conf
|
||||
) (builtins.attrValues targets)
|
||||
);
|
||||
|
||||
generatedNix = pkgs.runCommand "generated-nix" { buildInputs = [ pkgs.nix pkgs.git ]; }
|
||||
''
|
||||
mkdir $out
|
||||
|
||||
cp -a ${<artiq-fast>} $out/fast
|
||||
cp ${./artiq-full/conda-artiq-board.nix} $out/conda-artiq-board.nix
|
||||
cp ${./artiq-full/extras.nix} $out/extras.nix
|
||||
${if use-generated
|
||||
then ''
|
||||
cp -a ${<artiq-board-generated>} $out/board-generated
|
||||
ln -s board-generated/fast $out/fast
|
||||
''
|
||||
else "cp -a ${<artiq-fast>} $out/fast"}
|
||||
cp ${./artiq-full}/artiq-board-vivado.nix $out
|
||||
cp ${./artiq-full}/generate-identifier.py $out
|
||||
cp ${./artiq-full}/conda-artiq-board.nix $out
|
||||
cp ${./artiq-full}/extras.nix $out
|
||||
cp ${./artiq-full}/*.patch $out
|
||||
|
||||
REV=`git --git-dir ${sinaraSystemsSrc}/.git rev-parse HEAD`
|
||||
SINARA_SRC_CLEAN=`mktemp -d`
|
||||
cp -a ${sinaraSystemsSrc}/. $SINARA_SRC_CLEAN
|
||||
chmod -R 755 $SINARA_SRC_CLEAN/.git
|
||||
chmod 755 $SINARA_SRC_CLEAN
|
||||
rm -rf $SINARA_SRC_CLEAN/.git
|
||||
HASH=`nix-hash --type sha256 --base32 $SINARA_SRC_CLEAN`
|
||||
${if use-generated
|
||||
then ''
|
||||
REV=${sinaraSystemsRev}
|
||||
HASH=${sinaraSystemsHash}
|
||||
''
|
||||
else ''
|
||||
REV=`git --git-dir ${sinaraSystemsSrc}/.git rev-parse HEAD`
|
||||
SINARA_SRC_CLEAN=`mktemp -d`
|
||||
cp -a ${sinaraSystemsSrc}/. $SINARA_SRC_CLEAN
|
||||
chmod -R 755 $SINARA_SRC_CLEAN/.git
|
||||
chmod 755 $SINARA_SRC_CLEAN
|
||||
rm -rf $SINARA_SRC_CLEAN/.git
|
||||
HASH=`nix-hash --type sha256 --base32 $SINARA_SRC_CLEAN`
|
||||
''}
|
||||
cat > $out/default.nix << EOF
|
||||
{ pkgs ? import <nixpkgs> {}}:
|
||||
{ pkgs ? import <nixpkgs> { overlays = [ (import ./fast/mozilla-overlay.nix) ]; }}:
|
||||
|
||||
let
|
||||
target = "kasli";
|
||||
variants = [
|
||||
"afmaster"
|
||||
"afsatellite"
|
||||
"berkeley"
|
||||
"berkeley2"
|
||||
"duke"
|
||||
"duke2"
|
||||
"duke3"
|
||||
"hub"
|
||||
"hustmaster"
|
||||
"hustsatellite"
|
||||
"indiana"
|
||||
"innsbruck"
|
||||
"ist"
|
||||
"luh"
|
||||
"mitll"
|
||||
"mitll2"
|
||||
"mpik"
|
||||
"mpq"
|
||||
"nrc"
|
||||
"nudt"
|
||||
"npl1"
|
||||
"npl2"
|
||||
"opticlock"
|
||||
"oregon"
|
||||
"ptb"
|
||||
"ptb2"
|
||||
"ptb3"
|
||||
"ptb4"
|
||||
"ptb5"
|
||||
"ptb6"
|
||||
"ptbal"
|
||||
"ptbin"
|
||||
"saymamaster"
|
||||
"siegen"
|
||||
"su"
|
||||
"sysu"
|
||||
"tsinghua"
|
||||
"tsinghua2"
|
||||
"ubirmingham"
|
||||
"ucr"
|
||||
"unsw"
|
||||
"unsw2"
|
||||
"ustc"
|
||||
"vlbaimaster"
|
||||
"vlbaisatellite"
|
||||
"wipm"
|
||||
"wipm2"
|
||||
"wipm3"
|
||||
"wipm4"
|
||||
"wipm5master"
|
||||
"wipm5satellite"
|
||||
artiq-fast = import ${if use-generated then "./board-generated" else "."}/fast { inherit pkgs; };
|
||||
ddbDeps = [
|
||||
artiq-fast.artiq
|
||||
(pkgs.python3.withPackages (ps: [ ps.jsonschema ]))
|
||||
];
|
||||
|
||||
artiq-fast = import ./fast { inherit pkgs; };
|
||||
artiq-board = import ./fast/artiq-board.nix { inherit pkgs; };
|
||||
kasliVariants = [${builtins.concatStringsSep " " (
|
||||
builtins.map (variant: "\"${variant}\"") kasliVariants
|
||||
)}];
|
||||
standaloneVariants = [${builtins.concatStringsSep " " (
|
||||
builtins.map (variant: "\"${variant}\"") standaloneVariants
|
||||
)}];
|
||||
|
||||
vivado = import ${if use-generated then "./board-generated" else "."}/fast/vivado.nix {
|
||||
inherit pkgs;
|
||||
};
|
||||
artiq-board =
|
||||
${if use-generated
|
||||
then ''
|
||||
import ./artiq-board-vivado.nix {
|
||||
inherit pkgs vivado;
|
||||
version = artiq-fast.artiq.version;
|
||||
board-generated = import ./board-generated {
|
||||
inherit pkgs;
|
||||
};
|
||||
}
|
||||
''
|
||||
else ''
|
||||
import ./fast/artiq-board.nix {
|
||||
inherit pkgs vivado;
|
||||
rustPlatform = import ./fast/rust-platform.nix { inherit pkgs; };
|
||||
}
|
||||
''};
|
||||
conda-artiq-board = import ./conda-artiq-board.nix { inherit pkgs; };
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://git.m-labs.hk/M-Labs/sinara-systems.git";
|
||||
url = "https://git.m-labs.hk/M-Labs/sinara-systems-legacy.git";
|
||||
rev = "$REV";
|
||||
sha256 = "$HASH";
|
||||
};
|
||||
generic-kasli = pkgs.lib.lists.foldr (variant: start:
|
||||
artiq-targets = pkgs.lib.lists.foldr (conf: start:
|
||||
let
|
||||
json = builtins.toPath (src + "/\''${variant}.json");
|
||||
boardBinaries = artiq-board {
|
||||
inherit target variant;
|
||||
buildCommand = "python -m artiq.gateware.targets.kasli_generic \''${json}";
|
||||
};
|
||||
inherit (conf) target variant;
|
||||
json = src + "/\''${variant}.json";
|
||||
boardBinaries = artiq-board (conf // {
|
||||
src = json;
|
||||
});
|
||||
in
|
||||
start // {
|
||||
"artiq-board-\''${target}-\''${variant}" = boardBinaries;
|
||||
|
@ -99,10 +130,13 @@ let
|
|||
boardBinaries = boardBinaries;
|
||||
inherit target variant;
|
||||
};
|
||||
} // (pkgs.lib.optionalAttrs ((builtins.fromJSON (builtins.readFile json)).base == "standalone") {
|
||||
} // (pkgs.lib.optionalAttrs (
|
||||
target == "kasli" &&
|
||||
builtins.elem variant standaloneVariants
|
||||
) {
|
||||
"device-db-\''${target}-\''${variant}" = pkgs.stdenv.mkDerivation {
|
||||
name = "device-db-\''${target}-\''${variant}";
|
||||
buildInputs = [ artiq-fast.artiq ];
|
||||
buildInputs = ddbDeps;
|
||||
phases = [ "buildPhase" ];
|
||||
buildPhase = "
|
||||
mkdir \$out
|
||||
|
@ -111,115 +145,43 @@ let
|
|||
echo file device_db_template \$out/device_db.py >> \$out/nix-support/hydra-build-products
|
||||
";
|
||||
};
|
||||
})) {} variants;
|
||||
drtio-systems = {
|
||||
af = {
|
||||
master = "afmaster";
|
||||
satellites = {
|
||||
"1" = "afsatellite";
|
||||
};
|
||||
};
|
||||
hust = {
|
||||
master = "hustmaster";
|
||||
satellites = {
|
||||
"1" = "hustsatellite";
|
||||
};
|
||||
};
|
||||
vlbai = {
|
||||
master = "vlbaimaster";
|
||||
satellites = {
|
||||
"1" = "vlbaisatellite";
|
||||
};
|
||||
};
|
||||
wipm5 = {
|
||||
master = "wipm5master";
|
||||
satellites = {
|
||||
"1" = "wipm5satellite";
|
||||
};
|
||||
};
|
||||
};
|
||||
drtio-ddbs = pkgs.lib.attrsets.mapAttrs'
|
||||
(system: crates: pkgs.lib.attrsets.nameValuePair ("device-db-" + system)
|
||||
(pkgs.stdenv.mkDerivation {
|
||||
name = "device-db-\''${system}";
|
||||
buildInputs = [ artiq-fast.artiq ];
|
||||
phases = [ "buildPhase" ];
|
||||
buildPhase = "
|
||||
mkdir \$out
|
||||
artiq_ddb_template \
|
||||
\''${pkgs.lib.strings.concatStringsSep " " (pkgs.lib.attrsets.mapAttrsToList (dest: desc: "-s " + dest + " " + src + "/" + desc + ".json") crates.satellites) } \
|
||||
\''${src}/\''${crates.master}.json -o \$out/device_db.py
|
||||
mkdir \$out/nix-support
|
||||
echo file device_db_template \$out/device_db.py >> \$out/nix-support/hydra-build-products
|
||||
";
|
||||
})) drtio-systems;
|
||||
extras = import ./extras.nix { inherit pkgs; inherit (artiq-fast) asyncserial artiq; };
|
||||
})
|
||||
) {} ${serializedTargets};
|
||||
extras = import ./extras.nix { inherit pkgs; inherit (artiq-fast) sipyco asyncserial artiq; };
|
||||
in
|
||||
artiq-fast // generic-kasli // drtio-ddbs // extras // rec {
|
||||
artiq-board-sayma-rtm = artiq-board {
|
||||
target = "sayma";
|
||||
variant = "rtm";
|
||||
buildCommand = "python -m artiq.gateware.targets.sayma_rtm";
|
||||
};
|
||||
artiq-board-sayma-satellite = artiq-board {
|
||||
target = "sayma";
|
||||
variant = "satellite";
|
||||
buildCommand = "python -m artiq.gateware.targets.sayma_amc";
|
||||
};
|
||||
artiq-board-metlino-master = artiq-board {
|
||||
target = "metlino";
|
||||
variant = "master";
|
||||
buildCommand = "python -m artiq.gateware.targets.metlino";
|
||||
};
|
||||
artiq-board-kc705-nist_qc2 = artiq-board {
|
||||
target = "kc705";
|
||||
variant = "nist_qc2";
|
||||
};
|
||||
|
||||
conda-artiq-board-sayma-rtm = conda-artiq-board {
|
||||
target = "sayma";
|
||||
variant = "rtm";
|
||||
boardBinaries = artiq-board-sayma-rtm;
|
||||
};
|
||||
conda-artiq-board-sayma-satellite = conda-artiq-board {
|
||||
target = "sayma";
|
||||
variant = "satellite";
|
||||
boardBinaries = artiq-board-sayma-satellite;
|
||||
};
|
||||
conda-artiq-board-metlino-master = conda-artiq-board {
|
||||
target = "metlino";
|
||||
variant = "master";
|
||||
boardBinaries = artiq-board-metlino-master;
|
||||
artiq-fast // artiq-targets // extras // rec {
|
||||
conda-artiq-board-kasli-tester = conda-artiq-board {
|
||||
target = "kasli";
|
||||
variant = "tester";
|
||||
boardBinaries = artiq-fast.artiq-board-kasli-tester;
|
||||
};
|
||||
conda-artiq-board-kc705-nist_clock = conda-artiq-board {
|
||||
target = "kc705";
|
||||
variant = "nist_clock";
|
||||
boardBinaries = artiq-fast.artiq-board-kc705-nist_clock;
|
||||
};
|
||||
conda-artiq-board-kc705-nist_qc2 = conda-artiq-board {
|
||||
target = "kc705";
|
||||
variant = "nist_qc2";
|
||||
boardBinaries = artiq-board-kc705-nist_qc2;
|
||||
};
|
||||
}
|
||||
EOF
|
||||
'';
|
||||
pythonDeps = import ./artiq-full/python-deps.nix { inherit pkgs; };
|
||||
manualPackages = import ./artiq-full/manual.nix {
|
||||
sipycoManualPackages = import ./artiq-full/sipyco-manual.nix {
|
||||
inherit (pkgs) stdenv lib python3Packages texlive texinfo;
|
||||
inherit (import artiq-fast { inherit pkgs; }) sipyco;
|
||||
};
|
||||
artiqManualPackages = import ./artiq-full/artiq-manual.nix {
|
||||
inherit (pkgs) stdenv lib fetchgit git python3Packages texlive texinfo;
|
||||
inherit (pythonDeps) sphinxcontrib-wavedrom;
|
||||
inherit artiq-fast;
|
||||
};
|
||||
jobs = (import generatedNix { inherit pkgs; }) // manualPackages // {
|
||||
# This is in the example in the ARTIQ manual - precompile it to speed up
|
||||
# installation for users.
|
||||
matplotlib-qt = pkgs.lib.hydraJob (pkgs.python3Packages.matplotlib.override { enableQt = true; });
|
||||
};
|
||||
artiq-full = import generatedNix { inherit pkgs; };
|
||||
exampleUserEnv = import ./artiq-full/example-user-env.nix { inherit pkgs artiq-full; };
|
||||
jobs = artiq-full // sipycoManualPackages // artiqManualPackages // exampleUserEnv;
|
||||
in
|
||||
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs // {
|
||||
artiq-full = pkgs.releaseTools.channel {
|
||||
name = "artiq-full";
|
||||
src = generatedNix;
|
||||
constituents = builtins.attrValues jobs;
|
||||
constituents = [];
|
||||
};
|
||||
conda-channel = import ./artiq-full/conda-channel.nix { inherit pkgs; } { inherit jobs; };
|
||||
conda-channel = import ./artiq-full/conda-channel.nix { inherit pkgs artiq-fast; } { inherit jobs; };
|
||||
}
|
||||
|
|
|
@ -0,0 +1,125 @@
|
|||
# Install Vivado in /opt and add to /etc/nixos/configuration.nix:
|
||||
# nix.sandboxPaths = ["/opt"];
|
||||
|
||||
{ pkgs
|
||||
, vivado ? import ./fast/vivado.nix { inherit pkgs; }
|
||||
, board-generated
|
||||
, version
|
||||
}:
|
||||
|
||||
let
|
||||
# Funnelling the source code through a Nix string allows dropping
|
||||
# all dependencies via `unsafeDiscardStringContext`.
|
||||
discardContextFromPath = { name, src }:
|
||||
let
|
||||
packed = pkgs.stdenv.mkDerivation {
|
||||
name = "${name}.nar.base64";
|
||||
buildInputs = [ pkgs.nix ];
|
||||
phases = [ "installPhase" ];
|
||||
installPhase = "nix-store --dump ${src} | base64 -w0 > $out";
|
||||
};
|
||||
unpacked = archive:
|
||||
pkgs.stdenvNoCC.mkDerivation {
|
||||
name = builtins.unsafeDiscardStringContext name;
|
||||
|
||||
phases = [ "installPhase" ];
|
||||
buildInputs = [ pkgs.nix ];
|
||||
installPhase = "base64 -d < ${archive} | nix-store --restore $out";
|
||||
};
|
||||
in
|
||||
unpacked (
|
||||
builtins.toFile "${builtins.unsafeDiscardStringContext name}.nar.base64" (
|
||||
builtins.unsafeDiscardStringContext (
|
||||
builtins.readFile packed
|
||||
))) ;
|
||||
in
|
||||
{ target
|
||||
, variant
|
||||
, extraInstallCommands ? ""
|
||||
, ... }:
|
||||
let
|
||||
name = "artiq-board-${target}-${variant}-${version}";
|
||||
installPath = builtins.unsafeDiscardStringContext "${pkgs.python3Packages.python.sitePackages}/artiq/board-support/${target}-${variant}";
|
||||
|
||||
generated = board-generated."artiq-board-${target}-${variant}";
|
||||
|
||||
identifierStr = "${version};${variant}";
|
||||
identifiers = import (
|
||||
pkgs.runCommandLocal "${name}-identifiers.nix" {
|
||||
buildInputs = [ pkgs.python3 ];
|
||||
} ''python ${./generate-identifier.py} "${identifierStr}" > $out''
|
||||
);
|
||||
|
||||
# Depends on just Vivado and the generated Bitstream source
|
||||
vivadoCheckpoint = pkgs.stdenvNoCC.mkDerivation {
|
||||
name = builtins.unsafeDiscardStringContext "${name}-vivado-checkpoint";
|
||||
|
||||
src = discardContextFromPath {
|
||||
name = "${name}-gateware";
|
||||
src = "${generated}/gateware";
|
||||
};
|
||||
buildInputs = [ vivado pkgs.nix ];
|
||||
buildPhase = ''
|
||||
vivado -mode batch -source top_route.tcl
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out
|
||||
|
||||
chmod a+r top_route.dcp
|
||||
cp top_route.dcp $out
|
||||
cp top_bitstream.tcl $out
|
||||
'';
|
||||
};
|
||||
|
||||
vivadoOutput = pkgs.stdenvNoCC.mkDerivation {
|
||||
name = builtins.unsafeDiscardStringContext "${name}-vivado-output";
|
||||
src = vivadoCheckpoint;
|
||||
buildInputs = [ vivado ];
|
||||
buildPhase =
|
||||
''
|
||||
cat >top.tcl <<EOF
|
||||
open_checkpoint top_route.dcp
|
||||
'' +
|
||||
(pkgs.lib.concatMapStrings ({ cell, init }:
|
||||
''
|
||||
set_property INIT ${init} [get_cell ${cell}]
|
||||
''
|
||||
) identifiers) +
|
||||
''
|
||||
source "top_bitstream.tcl"
|
||||
EOF
|
||||
vivado -mode batch -source top.tcl
|
||||
'';
|
||||
installPhase = ''
|
||||
TARGET_DIR=$out/${installPath}
|
||||
mkdir -p $TARGET_DIR
|
||||
chmod a+r top.bit
|
||||
cp top.bit $TARGET_DIR/
|
||||
'';
|
||||
|
||||
# temporarily disabled because there is currently always at least one Kasli bitstream
|
||||
# that fails timing and blocks the conda channel.
|
||||
doCheck = false;
|
||||
checkPhase = ''
|
||||
# Search for PCREs in the Vivado output to check for errors
|
||||
check_log() {
|
||||
set +e
|
||||
grep -Pe "$1" vivado.log
|
||||
FOUND=$?
|
||||
set -e
|
||||
if [ $FOUND != 1 ]; then
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
check_log "\d+ constraint not met\."
|
||||
check_log "Timing constraints are not met\."
|
||||
'';
|
||||
};
|
||||
in
|
||||
pkgs.python3Packages.toPythonModule (
|
||||
pkgs.buildEnv rec {
|
||||
inherit name;
|
||||
paths = [ generated vivadoOutput ];
|
||||
pathsToLink = [ "/${installPath}" ];
|
||||
})
|
|
@ -1,7 +1,7 @@
|
|||
{ stdenv, lib, fetchgit, git, python3Packages, texlive, texinfo, sphinxcontrib-wavedrom }:
|
||||
{ stdenv, lib, fetchgit, git, python3Packages, texlive, texinfo, sphinxcontrib-wavedrom, artiq-fast }:
|
||||
|
||||
let
|
||||
artiqVersion = import <artiq-fast/pkgs/artiq-version.nix> { inherit stdenv fetchgit git; };
|
||||
artiqVersion = import (artiq-fast + "/pkgs/artiq-version.nix") { inherit stdenv fetchgit git; };
|
||||
|
||||
isLatexPdfTarget = target: builtins.match "latexpdf.*" target != null;
|
||||
|
||||
|
@ -16,7 +16,7 @@ let
|
|||
name = "artiq-manual-${target}-${version}";
|
||||
version = artiqVersion;
|
||||
|
||||
src = import <artiq-fast/pkgs/artiq-src.nix> { inherit fetchgit; };
|
||||
src = import (artiq-fast + "/pkgs/artiq-src.nix") { inherit fetchgit; };
|
||||
buildInputs = [
|
||||
python3Packages.sphinx python3Packages.sphinx_rtd_theme
|
||||
python3Packages.sphinx-argparse sphinxcontrib-wavedrom
|
||||
|
@ -26,7 +26,7 @@ let
|
|||
|
||||
preBuild = ''
|
||||
export VERSIONEER_OVERRIDE=${artiqVersion}
|
||||
export SOURCE_DATE_EPOCH=${import <artiq-fast/pkgs/artiq-timestamp.nix> { inherit stdenv fetchgit git; }}
|
||||
export SOURCE_DATE_EPOCH=${import (artiq-fast + "/pkgs/artiq-timestamp.nix") { inherit stdenv fetchgit git; }}
|
||||
cd doc/manual
|
||||
'';
|
||||
makeFlags = [ target ];
|
|
@ -0,0 +1,66 @@
|
|||
{ pkgs
|
||||
, artiqVersion
|
||||
, sinaraSystemsSrc
|
||||
}:
|
||||
|
||||
let
|
||||
jsons =
|
||||
map (jsonFile: builtins.fromJSON (
|
||||
builtins.readFile (sinaraSystemsSrc + "/${jsonFile}")
|
||||
)) (
|
||||
builtins.attrNames (
|
||||
pkgs.lib.filterAttrs (name: type:
|
||||
type != "directory" &&
|
||||
builtins.match ".+\\.json" name != null
|
||||
) (builtins.readDir sinaraSystemsSrc)
|
||||
)
|
||||
);
|
||||
kasli = builtins.listToAttrs (
|
||||
builtins.map ({ variant, base, ... }: {
|
||||
name = "artiq-board-kasli-${variant}";
|
||||
value = {
|
||||
target = "kasli";
|
||||
inherit variant;
|
||||
src = sinaraSystemsSrc + "/${variant}.json";
|
||||
buildCommand = "python -m artiq.gateware.targets.kasli_generic $src";
|
||||
standalone = base == "standalone";
|
||||
};
|
||||
}) (
|
||||
builtins.filter (json:
|
||||
pkgs.lib.strings.versionAtLeast artiqVersion (
|
||||
if json ? min_artiq_version
|
||||
then json.min_artiq_version
|
||||
else "0"
|
||||
)
|
||||
) jsons
|
||||
)
|
||||
);
|
||||
in
|
||||
kasli // {
|
||||
artiq-board-metlino-master = {
|
||||
target = "metlino";
|
||||
variant = "master";
|
||||
buildCommand = "python -m artiq.gateware.targets.metlino";
|
||||
};
|
||||
artiq-board-kc705-nist_qc2 = {
|
||||
target = "kc705";
|
||||
variant = "nist_qc2";
|
||||
};
|
||||
} // (pkgs.lib.optionalAttrs (pkgs.lib.strings.versionAtLeast artiqVersion "7.0") {
|
||||
artiq-board-kc705-nist_clock_master = {
|
||||
target = "kc705";
|
||||
variant = "nist_clock_master";
|
||||
};
|
||||
artiq-board-kc705-nist_qc2_master = {
|
||||
target = "kc705";
|
||||
variant = "nist_qc2_master";
|
||||
};
|
||||
artiq-board-kc705-nist_clock_satellite = {
|
||||
target = "kc705";
|
||||
variant = "nist_clock_satellite";
|
||||
};
|
||||
artiq-board-kc705-nist_qc2_satellite = {
|
||||
target = "kc705";
|
||||
variant = "nist_qc2_satellite";
|
||||
};
|
||||
})
|
|
@ -28,7 +28,7 @@ let
|
|||
about:
|
||||
home: https://m-labs.hk/artiq
|
||||
license: LGPL
|
||||
summary: 'Bitstream, BIOS and firmware for the ${target}-${variant} board variant'
|
||||
summary: 'Bitstream, bootloader and firmware for the ${target}-${variant} board variant'
|
||||
EOF
|
||||
|
||||
cat << EOF > $out/fake-conda/build.sh
|
||||
|
@ -40,7 +40,7 @@ let
|
|||
EOF
|
||||
chmod 755 $out/fake-conda/build.sh
|
||||
'';
|
||||
conda-artiq-board = import ./fast/conda-build.nix { inherit pkgs; } {
|
||||
conda-artiq-board = import ./fast/conda/build.nix { inherit pkgs; } {
|
||||
name = "conda-artiq-board-${target}-${variant}";
|
||||
src = fakeCondaSource;
|
||||
};
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
{ pkgs }:
|
||||
{ pkgs, artiq-fast }:
|
||||
{ jobs }:
|
||||
|
||||
let
|
||||
condaBuilderEnv = import <artiq-fast/conda-builder-env.nix> { inherit pkgs; };
|
||||
condaBuilderEnv = import (artiq-fast + "/conda/builder-env.nix") { inherit pkgs; };
|
||||
in
|
||||
pkgs.runCommand "conda-channel" { }
|
||||
''
|
||||
mkdir -p $out/noarch
|
||||
mkdir -p $out/noarch $out/linux-64 $out/win-64
|
||||
for storepath in ${pkgs.lib.concatMapStringsSep " " builtins.toString (builtins.attrValues jobs)}; do
|
||||
hydra_build_products=$storepath/nix-support/hydra-build-products
|
||||
if [ -f $hydra_build_products ]; then
|
||||
|
@ -14,7 +14,8 @@ in
|
|||
type=`echo $line | cut -f2 -d " "`
|
||||
if [ $type == "conda" ]; then
|
||||
path=`echo $line | cut -f3 -d " "`
|
||||
ln -s $path $out/noarch
|
||||
arch=`echo $path | cut -f5 -d "/"`
|
||||
ln -s $path $out/$arch
|
||||
fi
|
||||
done < $hydra_build_products
|
||||
fi
|
||||
|
|
|
@ -0,0 +1,38 @@
|
|||
{ pkgs, artiq-full }:
|
||||
let
|
||||
matplotlib-qt = (pkgs.python3Packages.matplotlib.override { enableQt = true; });
|
||||
in
|
||||
{
|
||||
artiq-example-user-env = pkgs.runCommand "artiq-example-user-env" {
|
||||
buildInputs = [
|
||||
(pkgs.python3.withPackages(ps: [
|
||||
artiq-full.artiq
|
||||
artiq-full.artiq-comtools
|
||||
artiq-full.wand
|
||||
artiq-full.flake8-artiq
|
||||
artiq-full.lda
|
||||
artiq-full.korad_ka3005p
|
||||
artiq-full.novatech409b
|
||||
artiq-full.thorlabs_tcube
|
||||
artiq-full.artiq-board-kc705-nist_clock
|
||||
ps.paramiko
|
||||
ps.pandas
|
||||
ps.numpy
|
||||
ps.scipy
|
||||
# our newer llvmlite conflicts with the one in nixpkgs (21.05), reenable after nixpkgs updates llvmlite
|
||||
#ps.numba
|
||||
ps.bokeh
|
||||
matplotlib-qt
|
||||
# cirq is broken and doesn't build (as of 20.09.3281.06b11191834)
|
||||
#(ps.cirq.override { matplotlib = matplotlib-qt; })
|
||||
# qiskit does not work with matplotlib-qt
|
||||
#ps.qiskit
|
||||
]))
|
||||
|
||||
artiq-full.openocd
|
||||
pkgs.gtkwave
|
||||
pkgs.spyder
|
||||
pkgs.R
|
||||
];
|
||||
} "touch $out";
|
||||
}
|
|
@ -1,13 +1,22 @@
|
|||
{ pkgs, asyncserial, artiq }:
|
||||
{ pkgs, sipyco, asyncserial, artiq }:
|
||||
let
|
||||
condaBuild = import ./fast/conda/build.nix { inherit pkgs; };
|
||||
condaFakeSource = import ./fast/conda/fake-source.nix { inherit pkgs; };
|
||||
dualPackage = (
|
||||
{ name, version, src, pythonOptions ? {}, condaOptions ? {}}:
|
||||
{
|
||||
{ name, version, src, pythonOptions ? {}, condaOptions ? {}, enabled ? true, withManual ? true}:
|
||||
pkgs.lib.optionalAttrs enabled ({
|
||||
"${name}" = pkgs.python3Packages.buildPythonPackage ({
|
||||
inherit version;
|
||||
name = "${name}-${version}";
|
||||
inherit src;
|
||||
} // pythonOptions);
|
||||
"conda-${name}" = condaBuild {
|
||||
name = "conda-${name}";
|
||||
src = condaFakeSource ({
|
||||
inherit name version src;
|
||||
} // condaOptions);
|
||||
};
|
||||
} // (pkgs.lib.optionalAttrs withManual {
|
||||
"${name}-manual-html" = pkgs.stdenv.mkDerivation {
|
||||
name = "${name}-manual-html-${version}";
|
||||
inherit version src;
|
||||
|
@ -29,13 +38,7 @@ let
|
|||
echo doc manual ${dest}/html index.html >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
};
|
||||
"conda-${name}" = import ./fast/conda-build.nix { inherit pkgs; } {
|
||||
name = "conda-${name}";
|
||||
src = import ./fast/conda-fake-source.nix { inherit pkgs; } ({
|
||||
inherit name version src;
|
||||
} // condaOptions);
|
||||
};
|
||||
}
|
||||
}))
|
||||
);
|
||||
# https://github.com/m-labs/artiq/issues/23
|
||||
hidapi = pkgs.hidapi.overrideAttrs (oa: {
|
||||
|
@ -49,82 +52,85 @@ let
|
|||
in
|
||||
(dualPackage {
|
||||
name = "korad_ka3005p";
|
||||
version = "1.0";
|
||||
version = "1.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "korad_ka3005p";
|
||||
rev = "e8c02ade175b842972f76a27919a4aaf8190de90";
|
||||
sha256 = "1svgnx52amvy9xl0b2wkz0ii4ycjvjv96ac0g07zkxabdqm5ff65";
|
||||
rev = "a1898409cb188b388ed1cf84e76ca69e9c8a74eb";
|
||||
sha256 = "0h20qss70nssqiagc2fx75mravq1pji7rizhag3nq8xrcz2w20nc";
|
||||
};
|
||||
pythonOptions = { propagatedBuildInputs = [ asyncserial artiq ]; };
|
||||
condaOptions = { dependencies = [ "asyncserial" ]; };
|
||||
pythonOptions = { propagatedBuildInputs = [ sipyco asyncserial ]; };
|
||||
condaOptions = { dependencies = [ "sipyco" "asyncserial" ]; };
|
||||
}) // (dualPackage {
|
||||
name = "novatech409b";
|
||||
version = "1.0";
|
||||
version = "1.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "novatech409b";
|
||||
rev = "442e82e2234c0bf951da2084a77861f8977755c8";
|
||||
sha256 = "032qgg48dy2k31vj0q8bfni0iy2kcyscd32bq60h701wvass6jv7";
|
||||
rev = "3bd559753972f07d881df66b7c6819afc5436053";
|
||||
sha256 = "1g9qv6fn5h7d393mb1v7w8sg6fimqg34blqdj22qnayb4agw1wyg";
|
||||
};
|
||||
pythonOptions = { propagatedBuildInputs = [ asyncserial artiq ]; };
|
||||
condaOptions = { dependencies = [ "asyncserial" ]; };
|
||||
pythonOptions = { propagatedBuildInputs = [ sipyco asyncserial ]; };
|
||||
condaOptions = { dependencies = [ "sipyco" "asyncserial" ]; };
|
||||
}) // (dualPackage {
|
||||
name = "lda";
|
||||
version = "1.0";
|
||||
version = "1.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "lda";
|
||||
rev = "4329da1497f496839ce20beebce0d79ed453941f";
|
||||
sha256 = "00c15a03xy9vbca0j2zfy89l3ghbdmmv5wqfksm6pdwy4z036cwa";
|
||||
rev = "e6bf828b6dfd7fbf59b61b691712736c98c95970";
|
||||
sha256 = "1w4ykzsl3386bz4ggpd6i60b6a3k7rnc6qjw59xm3hk0vs3w2vyn";
|
||||
};
|
||||
pythonOptions = {
|
||||
propagatedBuildInputs = [ artiq ];
|
||||
propagatedBuildInputs = [ sipyco ];
|
||||
postPatch = ''
|
||||
substituteInPlace lda/hidapi.py \
|
||||
--replace "hidapi_lib_path = None"\
|
||||
"hidapi_lib_path = '${hidapi}/lib/libhidapi-libusb.so.0'"
|
||||
'';
|
||||
};
|
||||
condaOptions = { dependencies = [ "sipyco" ]; };
|
||||
}) // (dualPackage {
|
||||
name = "thorlabs_tcube";
|
||||
version = "1.0";
|
||||
version = "1.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "thorlabs_tcube";
|
||||
rev = "b72e7ba7de8355bd93dd20d53b6f15386dff229d";
|
||||
sha256 = "1lqwqflwbfdykmhf6g0pwgiq7i2vf67ybj4l8n3jn16vny21b41s";
|
||||
rev = "0cb0c15fc7e660a150e193245f5338d48f8b97db";
|
||||
sha256 = "1n4zmjcj2kpd97217y602pq6x8s80w39fgyi6qjmal92aicqdg07";
|
||||
};
|
||||
pythonOptions = { propagatedBuildInputs = [ asyncserial artiq ]; };
|
||||
condaOptions = { dependencies = [ "asyncserial" ]; };
|
||||
pythonOptions = { propagatedBuildInputs = [ sipyco asyncserial ]; };
|
||||
condaOptions = { dependencies = [ "sipyco" "asyncserial" ]; };
|
||||
}) // (dualPackage {
|
||||
name = "newfocus8742";
|
||||
version = "0.1";
|
||||
version = "0.2";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "quartiq";
|
||||
repo = "newfocus8742";
|
||||
rev = "31a92595d1cb77d9256b891ec17eed0fbeceb1bc";
|
||||
sha256 = "1dww0y83d4i6nma1q5hnaagih94c32bxlla5p6a5a8zkc4x2pky9";
|
||||
rev = "9f6092b724b33b934aa4d3a1d6a20c295cd1d02d";
|
||||
sha256 = "0qf05ghylnqf3l5vjx5dc748wi84xn6p6lb6f9r8p6f1z7z67fb8";
|
||||
};
|
||||
pythonOptions = {
|
||||
propagatedBuildInputs = [ pkgs.python3Packages.pyusb artiq ];
|
||||
propagatedBuildInputs = [ sipyco pkgs.python3Packages.pyusb ];
|
||||
# no unit tests so do a simple smoke test
|
||||
checkPhase = "python -m newfocus8742.aqctl_newfocus8742 --version";
|
||||
checkPhase = "python -m newfocus8742.aqctl_newfocus8742 -h";
|
||||
};
|
||||
condaOptions = { dependencies = [ "sipyco" ]; };
|
||||
}) // (dualPackage {
|
||||
name = "hut2";
|
||||
version = "0.1";
|
||||
version = "0.2";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "quartiq";
|
||||
repo = "hut2";
|
||||
rev = "acfd62dcd60d37250e2d1b691344c6e65b6e83eb";
|
||||
sha256 = "0dpx3c5aclj7gki6iaybjbx9rqrxnwccpxcvjwp594ccbcswvclr";
|
||||
rev = "68369d5d63d233827840a9a752d90454a4e03baa";
|
||||
sha256 = "0r832c0icz8v3w27ci13024bqfslj1gx6dwhjv11ksw229xdcghd";
|
||||
};
|
||||
pythonOptions = {
|
||||
propagatedBuildInputs = [ artiq ];
|
||||
propagatedBuildInputs = [ sipyco ];
|
||||
# no unit tests without hardware so do a simple smoke test
|
||||
checkPhase = "python -m hut2.aqctl_hut2 --version";
|
||||
checkPhase = "python -m hut2.aqctl_hut2 -h";
|
||||
};
|
||||
condaOptions = { dependencies = [ "sipyco" ]; };
|
||||
}) // rec {
|
||||
toptica-lasersdk = pkgs.python3Packages.buildPythonPackage rec {
|
||||
version = "2.0.0";
|
||||
|
@ -137,13 +143,13 @@ in
|
|||
propagatedBuildInputs = [ pkgs.python3Packages.pyserial ];
|
||||
};
|
||||
toptica-lasersdk-artiq = pkgs.python3Packages.buildPythonPackage rec {
|
||||
version = "0.1";
|
||||
version = "0.2";
|
||||
name = "toptica-lasersdk-artiq-${version}";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "quartiq";
|
||||
repo = "lasersdk-artiq";
|
||||
rev = "d38bb985e7ddffc9ac9d94fe136cac10947bfd72";
|
||||
sha256 = "03a09lc81l2l787yjm0xjpnjvs5x77ndmks3xxh25yyxdhsdf1fl";
|
||||
rev = "901dec13a1bf9429ce7ab49be34b03d1c49b8a9f";
|
||||
sha256 = "0lqxvgvpgrpw1kzhg5axnfb40ils2vdk75r43hqmk2lfz4sydwb2";
|
||||
};
|
||||
postPatch = ''
|
||||
substituteInPlace lasersdk_artiq/aqctl_laser.py \
|
||||
|
@ -153,20 +159,117 @@ in
|
|||
--replace "toptica.lasersdk.async.client" \
|
||||
"toptica.lasersdk.asyncio.client"
|
||||
'';
|
||||
propagatedBuildInputs = [ toptica-lasersdk artiq ];
|
||||
propagatedBuildInputs = [ sipyco toptica-lasersdk ];
|
||||
};
|
||||
conda-toptica-lasersdk-artiq = condaBuild {
|
||||
name = "conda-toptica-lasersdk-artiq";
|
||||
src = condaFakeSource {
|
||||
name = "toptica-lasersdk-artiq";
|
||||
inherit (toptica-lasersdk-artiq) version src;
|
||||
dependencies = [ "sipyco" "lasersdk =1.3.1" ];
|
||||
};
|
||||
};
|
||||
} // (dualPackage {
|
||||
name = "highfinesse-net";
|
||||
version = "0.1";
|
||||
version = "0.2";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "quartiq";
|
||||
repo = "highfinesse-net";
|
||||
rev = "6864ae5da5cbc67953b968010115db951e52a272";
|
||||
sha256 = "1k8xacgam5xghxvljvdzpsdhhq86fra13hkvdy7y301s9nyp30s4";
|
||||
rev = "a9cc049c9846845d2b2d8662266ec11fe770abee";
|
||||
sha256 = "01mk4gf6rk3jqpz4y7m35vawjybvyp26bizz5a4ygkb8dq5l51g4";
|
||||
};
|
||||
pythonOptions = {
|
||||
propagatedBuildInputs = [ artiq ];
|
||||
propagatedBuildInputs = [ sipyco ];
|
||||
# no unit tests without hardware so do a simple smoke test
|
||||
checkPhase = "python -m highfinesse_net.aqctl_highfinesse_net --version";
|
||||
checkPhase = "python -m highfinesse_net.aqctl_highfinesse_net -h";
|
||||
};
|
||||
condaOptions = { dependencies = [ "sipyco" ]; };
|
||||
}) // rec {
|
||||
artiq-comtools = pkgs.python3Packages.buildPythonPackage rec {
|
||||
name = "artiq-comtools-${version}";
|
||||
version = "1.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "m-labs";
|
||||
repo = "artiq-comtools";
|
||||
rev = "v${version}";
|
||||
sha256 = "165j12k9nnrkf2pv0idcv6xhnp1hnsllna4rps2dssnqgjfaw1ss";
|
||||
};
|
||||
propagatedBuildInputs = [ sipyco pkgs.python3Packages.numpy pkgs.python3Packages.aiohttp ];
|
||||
# Modifies PATH to pass the wrapped python environment (i.e. python3.withPackages(...) to subprocesses.
|
||||
# Allows subprocesses using python to find all packages you have installed
|
||||
makeWrapperArgs = [ ''--run 'if [ ! -z "$NIX_PYTHONPREFIX" ]; then export PATH=$NIX_PYTHONPREFIX/bin:$PATH;fi' '' ];
|
||||
};
|
||||
conda-artiq-comtools = condaBuild {
|
||||
name = "conda-artiq-comtools";
|
||||
src = condaFakeSource {
|
||||
name = "artiq-comtools";
|
||||
inherit (artiq-comtools) version src;
|
||||
dependencies = [ "sipyco" "numpy" "aiohttp >=3" ];
|
||||
};
|
||||
};
|
||||
} // {
|
||||
wand = pkgs.python3Packages.buildPythonApplication rec {
|
||||
name = "wand";
|
||||
version = "0.4.dev";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "OxfordIonTrapGroup";
|
||||
repo = "wand";
|
||||
rev = "0bf1cfef4aa37e5761c20ac8702abec125b45e23";
|
||||
sha256 = "0jfw6w6id7qkx2f6rklrmp13b2hsnvii1qbls60ampx399lcb43g";
|
||||
};
|
||||
patches = [ ./wand-fix-config-dir.patch ];
|
||||
nativeBuildInputs = [ pkgs.qt5.wrapQtAppsHook ];
|
||||
dontWrapQtApps = true;
|
||||
postFixup = ''
|
||||
wrapQtApp "$out/bin/wand_gui"
|
||||
'';
|
||||
propagatedBuildInputs = with pkgs.python3Packages; [ artiq quamash numpy scipy influxdb setuptools ];
|
||||
};
|
||||
} // (dualPackage {
|
||||
name = "flake8-artiq";
|
||||
version = "0.1.0";
|
||||
withManual = false;
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://gitlab.com/duke-artiq/flake8-artiq.git";
|
||||
rev = "1216092974140a561850905734fc22fdacdc2cde";
|
||||
sha256 = "0rkab2qdwyzms6nxc44jzb5grvkkbpjwwmfv2zj96cm6cm8d9pdr";
|
||||
};
|
||||
pythonOptions = {
|
||||
propagatedBuildInputs = [ pkgs.python3Packages.flake8 ];
|
||||
checkInputs = [ pkgs.python3Packages.pytestCheckHook ];
|
||||
};
|
||||
condaOptions = { dependencies = [ "flake8" ]; };
|
||||
}) // (dualPackage rec {
|
||||
name = "dax";
|
||||
version = "6.7";
|
||||
enabled = builtins.head (builtins.splitVersion version) == builtins.head (builtins.splitVersion artiq.version);
|
||||
withManual = false;
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://gitlab.com/duke-artiq/dax.git";
|
||||
rev = "v${version}";
|
||||
sha256 = "0rgvqqiypqvxjzrsixn3h7dn93isqw5vc2wrmpkxhzvw9lh5ihm7";
|
||||
};
|
||||
pythonOptions = {
|
||||
VERSIONEER_OVERRIDE = version;
|
||||
inherit (pkgs.python3Packages.pygit2) SSL_CERT_FILE;
|
||||
propagatedBuildInputs = [ artiq sipyco ]
|
||||
++ (with pkgs.python3Packages; [ numpy scipy pyvcd natsort pygit2 matplotlib graphviz h5py networkx sortedcontainers ]);
|
||||
checkInputs = [ pkgs.python3Packages.pytestCheckHook ];
|
||||
};
|
||||
condaOptions = { dependencies = [ "python>=3.7" "artiq" "sipyco" "numpy" "scipy" "pyvcd" "natsort" "pygit2" "matplotlib" "python-graphviz" "h5py" "networkx" "sortedcontainers" ]; };
|
||||
}) // (dualPackage {
|
||||
name = "dax-applets";
|
||||
version = "0.0.0";
|
||||
withManual = false;
|
||||
src = pkgs.fetchgit {
|
||||
url = "https://gitlab.com/duke-artiq/dax-applets.git";
|
||||
rev = "0f0196b6941b0c44a33c85d8c02047ca65466463";
|
||||
sha256 = "0mx6yjvprhdnkdigwns8mg6v5daqxpgbv7mf63fa76i1iv2wvak4";
|
||||
};
|
||||
pythonOptions = {
|
||||
propagatedBuildInputs = [ artiq ]
|
||||
++ (with pkgs.python3Packages; [ numpy pyqt5 pyqtgraph ]);
|
||||
doCheck = false;
|
||||
};
|
||||
condaOptions = { dependencies = [ "python>=3.5" "artiq" "numpy" "pyqt" "pyqtgraph" ]; };
|
||||
})
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
#!/usr/bin/env python
|
||||
#
|
||||
# Encodes data like ARTIQ build_soc.py ReprogrammableIdentifier
|
||||
|
||||
import sys
|
||||
|
||||
if len(sys.argv) != 2:
|
||||
raise ValueError('argument missing')
|
||||
|
||||
identifier_str = sys.argv[1]
|
||||
contents = list(identifier_str.encode())
|
||||
l = len(contents)
|
||||
if l > 255:
|
||||
raise ValueError("Identifier string must be 255 characters or less")
|
||||
contents.insert(0, l)
|
||||
|
||||
f = sys.stdout
|
||||
f.write("[\n");
|
||||
for i in range(7):
|
||||
init = sum(1 << j if c & (1 << i) else 0 for j, c in enumerate(contents))
|
||||
f.write(
|
||||
' {{ cell = "identifier_str{}"; init = "256\'h{:X}"; }}\n'.format(i, init)
|
||||
)
|
||||
f.write("]\n");
|
|
@ -3,18 +3,18 @@
|
|||
rec {
|
||||
wavedrom = pkgs.python3Packages.buildPythonPackage rec {
|
||||
pname = "wavedrom";
|
||||
version = "0.1";
|
||||
version = "2.0.3.post2";
|
||||
|
||||
src = pkgs.python3Packages.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "006w683zlmmwcw5xz1n5dwg34ims5jg3gl2700ql4wr0myjz6710";
|
||||
sha256 = "13a4086417nv836s2wbj3f4r31gwapbyw5smgl00jsqizwsk96r3";
|
||||
};
|
||||
|
||||
buildInputs = [ pkgs.python3Packages.setuptools_scm ];
|
||||
propagatedBuildInputs = with pkgs.python3Packages; [ svgwrite attrdict ];
|
||||
doCheck = false;
|
||||
|
||||
meta = with pkgs.stdenv.lib; {
|
||||
meta = with pkgs.lib; {
|
||||
description = "WaveDrom compatible Python module and command line";
|
||||
homepage = "https://pypi.org/project/wavedrom/";
|
||||
license = licenses.mit;
|
||||
|
@ -23,18 +23,18 @@ rec {
|
|||
|
||||
sphinxcontrib-wavedrom = pkgs.python3Packages.buildPythonPackage rec {
|
||||
pname = "sphinxcontrib-wavedrom";
|
||||
version = "2.0.0";
|
||||
version = "2.1.1";
|
||||
|
||||
src = pkgs.python3Packages.fetchPypi {
|
||||
inherit pname version;
|
||||
sha256 = "0nk36zqq5ipxqx9izz2iazb3iraasanv3nm05bjr21gw42zgkz22";
|
||||
sha256 = "09xq4csdcil2x8mm38yd5k6lfbkazicvm278xnzwbfc9vghkqqs2";
|
||||
};
|
||||
|
||||
buildInputs = [ pkgs.python3Packages.setuptools_scm ];
|
||||
propagatedBuildInputs = [ wavedrom ] ++ (with pkgs.python3Packages; [ sphinx xcffib cairosvg ]);
|
||||
doCheck = false;
|
||||
|
||||
meta = with pkgs.stdenv.lib; {
|
||||
meta = with pkgs.lib; {
|
||||
description = "A Sphinx extension that allows including WaveDrom diagrams";
|
||||
homepage = "https://pypi.org/project/sphinxcontrib-wavedrom/";
|
||||
license = licenses.mit;
|
||||
|
|
|
@ -0,0 +1,56 @@
|
|||
{ stdenv, lib, python3Packages, texlive, texinfo, sipyco }:
|
||||
|
||||
let
|
||||
version = sipyco.version;
|
||||
|
||||
isLatexPdfTarget = target: builtins.match "latexpdf.*" target != null;
|
||||
|
||||
latex = texlive.combine {
|
||||
inherit (texlive)
|
||||
scheme-basic latexmk cmap collection-fontsrecommended fncychap
|
||||
titlesec tabulary varwidth framed fancyvrb float wrapfig parskip
|
||||
upquote capt-of needspace etoolbox;
|
||||
};
|
||||
|
||||
sipyco-manual = target: stdenv.mkDerivation rec {
|
||||
name = "sipyco-manual-${target}-${version}";
|
||||
inherit version;
|
||||
|
||||
src = sipyco.src;
|
||||
buildInputs = [
|
||||
python3Packages.sphinx python3Packages.sphinx_rtd_theme
|
||||
python3Packages.sphinx-argparse sipyco
|
||||
] ++
|
||||
lib.optional (isLatexPdfTarget target) latex ++
|
||||
lib.optional (target == "texinfo") texinfo;
|
||||
|
||||
preBuild = ''
|
||||
export SOURCE_DATE_EPOCH=`cat TIMESTAMP`
|
||||
cd doc
|
||||
'';
|
||||
makeFlags = [ target ];
|
||||
|
||||
installPhase =
|
||||
let
|
||||
dest = "$out/share/doc/sipyco-manual";
|
||||
in
|
||||
if isLatexPdfTarget target
|
||||
then ''
|
||||
mkdir -p ${dest}
|
||||
cp _build/latex/SiPyCo.pdf ${dest}/
|
||||
|
||||
mkdir -p $out/nix-support/
|
||||
echo doc-pdf manual ${dest} SiPyCo.pdf >> $out/nix-support/hydra-build-products
|
||||
''
|
||||
else ''
|
||||
mkdir -p ${dest}
|
||||
cp -r _build/${target} ${dest}/
|
||||
|
||||
mkdir -p $out/nix-support/
|
||||
echo doc manual ${dest}/${target} index.html >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
};
|
||||
|
||||
targets = [ "html" "latexpdf" ];
|
||||
in
|
||||
builtins.listToAttrs (map (target: { name = "sipyco-manual-${target}"; value = sipyco-manual target; }) targets)
|
|
@ -0,0 +1,30 @@
|
|||
diff --git a/wand/tools.py b/wand/tools.py
|
||||
index a51dabd..4d5a9d1 100644
|
||||
--- a/wand/tools.py
|
||||
+++ b/wand/tools.py
|
||||
@@ -6,6 +6,7 @@ import shutil
|
||||
import logging
|
||||
|
||||
from sipyco import pyon
|
||||
+from artiq.appdirs import user_config_dir
|
||||
import wand
|
||||
|
||||
logger = logging.getLogger(__name__)
|
||||
@@ -26,10 +27,15 @@ class LockException(Exception):
|
||||
pass
|
||||
|
||||
|
||||
+def get_user_config_dir():
|
||||
+ dir = user_config_dir("wand", "oitg", "1")
|
||||
+ os.makedirs(dir, exist_ok=True)
|
||||
+ return dir
|
||||
+
|
||||
+
|
||||
def get_config_path(args, name_suffix=""):
|
||||
config_file = "{}{}_config.pyon".format(args.name, name_suffix)
|
||||
- wand_dir = os.path.dirname(wand.__file__)
|
||||
- config_path = os.path.join(wand_dir, config_file)
|
||||
+ config_path = os.path.join(get_user_config_dir(), config_file)
|
||||
|
||||
if args.backup_dir == "":
|
||||
backup_path = ""
|
|
@ -0,0 +1,84 @@
|
|||
let
|
||||
pkgs = import <nixpkgs> { overlays = [ (import ./artiq-fast/mozilla-overlay.nix) ]; };
|
||||
artiq-zynq = import <artiq-zynq>;
|
||||
artiq-fast = import <artiq-fast> { inherit pkgs; };
|
||||
in
|
||||
(
|
||||
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) artiq-zynq
|
||||
) // {
|
||||
gateware-sim = pkgs.lib.hydraJob (pkgs.stdenv.mkDerivation {
|
||||
name = "gateware-sim";
|
||||
buildInputs = [ artiq-fast.migen artiq-fast.migen-axi artiq-fast.artiq ];
|
||||
|
||||
phases = [ "buildPhase" ];
|
||||
|
||||
buildPhase =
|
||||
''
|
||||
python -m unittest discover ${<artiq-zynq>}/src/gateware -v
|
||||
touch $out
|
||||
'';
|
||||
});
|
||||
zc706-hitl-tests = pkgs.lib.hydraJob (pkgs.stdenv.mkDerivation {
|
||||
name = "zc706-hitl-tests";
|
||||
|
||||
__networked = true; # compatibility with old patched Nix
|
||||
# breaks hydra, https://github.com/NixOS/hydra/issues/1216
|
||||
#__impure = true; # Nix 2.8+
|
||||
|
||||
buildInputs = [
|
||||
pkgs.netcat pkgs.openssh pkgs.rsync artiq-fast.artiq artiq-fast.artiq-netboot
|
||||
];
|
||||
phases = [ "buildPhase" ];
|
||||
|
||||
buildPhase =
|
||||
''
|
||||
export NIX_SSHOPTS="-F /dev/null -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null -o LogLevel=ERROR -i /opt/hydra_id_ed25519"
|
||||
LOCKCTL=$(mktemp -d)
|
||||
mkfifo $LOCKCTL/lockctl
|
||||
|
||||
cat $LOCKCTL/lockctl | ${pkgs.openssh}/bin/ssh \
|
||||
$NIX_SSHOPTS \
|
||||
rpi-4 \
|
||||
'mkdir -p /tmp/board_lock && flock /tmp/board_lock/zc706-1 -c "echo Ok; cat"' \
|
||||
| (
|
||||
# End remote flock via FIFO
|
||||
atexit_unlock() {
|
||||
echo > $LOCKCTL/lockctl
|
||||
}
|
||||
trap atexit_unlock EXIT
|
||||
|
||||
# Read "Ok" line when remote successfully locked
|
||||
read LOCK_OK
|
||||
|
||||
echo Power cycling board...
|
||||
(echo b; sleep 5; echo B; sleep 5) | nc -N -w6 192.168.1.31 3131
|
||||
echo Power cycle done.
|
||||
|
||||
export USER=hydra
|
||||
export OPENOCD_ZYNQ=${artiq-zynq.zynq-rs}/openocd
|
||||
export SZL=${(import artiq-zynq.zynq-rs).zc706-szl}/szl.elf
|
||||
pushd ${<artiq-zynq>}
|
||||
bash ${<artiq-zynq>}/remote_run.sh -h rpi-4 -o "$NIX_SSHOPTS" -d ${artiq-zynq.zc706-nist_qc2-jtag}
|
||||
popd
|
||||
|
||||
echo Waiting for the firmware to boot...
|
||||
sleep 15
|
||||
|
||||
echo Running test kernel...
|
||||
artiq_run --device-db ${<artiq-zynq>}/examples/device_db.py ${<artiq-zynq>}/examples/mandelbrot.py
|
||||
|
||||
echo Running ARTIQ unit tests...
|
||||
export ARTIQ_ROOT=${<artiq-zynq>}/examples
|
||||
export ARTIQ_LOW_LATENCY=1
|
||||
python -m unittest discover artiq.test.coredevice -v
|
||||
|
||||
touch $out
|
||||
|
||||
echo Completed
|
||||
|
||||
(echo b; sleep 5) | nc -N -w6 192.168.1.31 3131
|
||||
echo Board powered off
|
||||
)
|
||||
'';
|
||||
});
|
||||
}
|
|
@ -1,6 +1,6 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
let
|
||||
jobs = import ./urukul/default.nix { inherit pkgs; };
|
||||
jobs = import ./gluelogic/default.nix { inherit pkgs; };
|
||||
in
|
||||
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs
|
|
@ -0,0 +1,105 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
let
|
||||
artiqpkgs = import ../artiq-fast/pkgs/python-deps.nix { inherit (pkgs) lib fetchgit fetchFromGitHub python3Packages; misoc-new = true; };
|
||||
ise = import ./ise.nix { inherit pkgs; };
|
||||
vivado = import ../artiq-fast/vivado.nix { inherit pkgs; };
|
||||
buildUrukulCpld = {version, src}: pkgs.stdenv.mkDerivation {
|
||||
pname = "urukul-cpld";
|
||||
inherit src version;
|
||||
buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen]))] ++ (builtins.attrValues ise);
|
||||
phases = ["buildPhase" "installPhase"];
|
||||
buildPhase = "python $src/urukul_impl.py";
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out $out/nix-support
|
||||
cp build/urukul.jed $out
|
||||
echo file binary-dist $out/urukul.jed >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
};
|
||||
buildMirnyCpld = {version, src}: pkgs.stdenv.mkDerivation {
|
||||
pname = "mirny-cpld";
|
||||
inherit src version;
|
||||
buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen]))] ++ (builtins.attrValues ise);
|
||||
phases = ["buildPhase" "installPhase"];
|
||||
buildPhase = "python $src/mirny_impl.py";
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out $out/nix-support
|
||||
cp build/mirny.jed $out
|
||||
echo file binary-dist $out/mirny.jed >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
};
|
||||
in
|
||||
{
|
||||
urukul-cpld-master = buildUrukulCpld {
|
||||
version = "master";
|
||||
src = <urukulSrc>;
|
||||
};
|
||||
urukul-cpld-release = buildUrukulCpld rec {
|
||||
version = "1.4.0";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "quartiq";
|
||||
repo = "urukul";
|
||||
rev = "v${version}";
|
||||
sha256 = "1962jpzqzn22cwkcmfnvwqlj5i89pljhgfk64n6pk73clir9mp0w";
|
||||
};
|
||||
};
|
||||
urukul-cpld-legacy = buildUrukulCpld rec {
|
||||
version = "1.3.1";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "quartiq";
|
||||
repo = "urukul";
|
||||
rev = "v${version}";
|
||||
sha256 = "1nvarspqbf9f7b27j34jkkh4mj6rwrlmccmfpz5nnzk3h2j6zbqc";
|
||||
};
|
||||
};
|
||||
mirny-cpld-master = buildMirnyCpld {
|
||||
version = "master";
|
||||
src = <mirnySrc>;
|
||||
};
|
||||
mirny-cpld-release = buildMirnyCpld rec {
|
||||
version = "0.2.4";
|
||||
src = pkgs.fetchFromGitHub {
|
||||
owner = "quartiq";
|
||||
repo = "mirny";
|
||||
rev = "v${version}";
|
||||
sha256 = "0fyz0g1h1s54zdivkfqhgyhpq7gjkl9kxkcfy3104p2f889l1vgw";
|
||||
};
|
||||
};
|
||||
fastino-fpga = pkgs.stdenv.mkDerivation {
|
||||
name = "fastino-fpga";
|
||||
src = <fastinoSrc>;
|
||||
buildInputs = [(pkgs.python3.withPackages(ps: [artiqpkgs.migen artiqpkgs.misoc]))] ++ [pkgs.yosys pkgs.nextpnr pkgs.icestorm];
|
||||
phases = ["buildPhase" "installPhase"];
|
||||
buildPhase = "python $src/fastino_phy.py";
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out $out/nix-support
|
||||
cp build/fastino.bin $out
|
||||
echo file binary-dist $out/fastino.bin >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
};
|
||||
phaser-fpga = pkgs.stdenv.mkDerivation {
|
||||
name = "phaser-fpga";
|
||||
src = <phaserSrc>;
|
||||
patchPhase = ''
|
||||
substituteInPlace phaser.py \
|
||||
--replace "source ../load.tcl" \
|
||||
""
|
||||
'';
|
||||
|
||||
buildInputs = [ (pkgs.python3.withPackages(ps: [ artiqpkgs.migen artiqpkgs.misoc ])) ] ++ [ vivado ];
|
||||
buildPhase = "python phaser.py";
|
||||
installPhase =
|
||||
''
|
||||
mkdir -p $out $out/nix-support
|
||||
cp build/phaser.bit $out
|
||||
echo file binary-dist $out/phaser.bit >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
dontFixup = true;
|
||||
|
||||
doCheck = true;
|
||||
checkInputs = [ pkgs.python3Packages.pytest ];
|
||||
checkPhase = "pytest";
|
||||
};
|
||||
}
|
228
hydra/artiq.json
228
hydra/artiq.json
|
@ -1,16 +1,218 @@
|
|||
{
|
||||
"enabled": 1,
|
||||
"hidden": true,
|
||||
"description": "js",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "hydra/artiq.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }
|
||||
"main-nac3": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "Main ARTIQ packages (with NAC3)",
|
||||
"flake": "git+https://github.com/m-labs/artiq.git?ref=nac3",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50
|
||||
},
|
||||
"nac3": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "Third generation ARTIQ compiler",
|
||||
"flake": "git+https://git.m-labs.hk/M-Labs/nac3.git",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50
|
||||
},
|
||||
|
||||
"main-beta": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "Main ARTIQ packages (beta version)",
|
||||
"flake": "git+https://github.com/m-labs/artiq.git",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50
|
||||
},
|
||||
"extra-beta": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "Additional ARTIQ packages (beta version)",
|
||||
"flake": "git+https://git.m-labs.hk/m-labs/artiq-extrapkg.git",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50
|
||||
},
|
||||
"zynq-beta": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "ARTIQ on Zynq-7000 (beta version)",
|
||||
"flake": "git+https://git.m-labs.hk/m-labs/artiq-zynq.git",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50
|
||||
},
|
||||
|
||||
"main": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "Main ARTIQ packages (stable version)",
|
||||
"flake": "git+https://github.com/m-labs/artiq.git?ref=release-7",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50
|
||||
},
|
||||
"extra": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "Additional ARTIQ packages (stable version)",
|
||||
"flake": "git+https://git.m-labs.hk/m-labs/artiq-extrapkg.git?ref=release-7",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50
|
||||
},
|
||||
"zynq": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "ARTIQ on Zynq-7000 (stable version)",
|
||||
"flake": "git+https://git.m-labs.hk/m-labs/artiq-zynq.git?ref=release-7",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50
|
||||
},
|
||||
|
||||
"fast-legacy": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "Core ARTIQ packages to build fast for CI purposes (legacy version)",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "artiq-fast.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git nixos-21.05", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"artiqSrc": { "type": "git", "value": "https://github.com/m-labs/artiq.git release-6 1", "emailresponsible": false }
|
||||
}
|
||||
},
|
||||
"board-generated-legacy": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "Generated code for ARTIQ boards (legacy version)",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "artiq-board-generated",
|
||||
"checkinterval": 14400,
|
||||
"schedulingshares": 1,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git nixos-21.05", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems-legacy.git master 1", "emailresponsible": false },
|
||||
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast-legacy:generated-nix", "emailresponsible": false }
|
||||
}
|
||||
},
|
||||
"full-legacy": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "Full set of ARTIQ packages (legacy version)",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "artiq-full.nix",
|
||||
"checkinterval": 86400,
|
||||
"schedulingshares": 1,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git nixos-21.05", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"use-generated": { "type": "boolean", "value": "true" },
|
||||
"artiq-board-generated": { "type": "sysbuild", "value": "artiq:board-generated-legacy:generated-nix", "emailresponsible": false }
|
||||
}
|
||||
},
|
||||
"zynq-legacy": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "ARTIQ on Zynq-7000 (legacy version)",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "artiq-zynq.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 1,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git nixos-21.05", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast-legacy:generated-nix", "emailresponsible": false },
|
||||
"artiq-zynq": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/artiq-zynq.git release-6", "emailresponsible": false }
|
||||
}
|
||||
},
|
||||
|
||||
"gluelogic": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "Glue logic gateware for Sinara devices",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "gluelogic.nix",
|
||||
"checkinterval": 172800,
|
||||
"schedulingshares": 1,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git nixos-21.05", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"urukulSrc": { "type": "git", "value": "https://github.com/quartiq/urukul.git", "emailresponsible": false },
|
||||
"mirnySrc": { "type": "git", "value": "https://github.com/quartiq/mirny.git", "emailresponsible": false },
|
||||
"fastinoSrc": { "type": "git", "value": "https://github.com/quartiq/fastino.git", "emailresponsible": false },
|
||||
"phaserSrc": { "type": "git", "value": "https://github.com/quartiq/phaser.git", "emailresponsible": false }
|
||||
}
|
||||
},
|
||||
|
||||
"sipyco": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "Simple Python Communications",
|
||||
"flake": "github:m-labs/sipyco",
|
||||
"checkinterval": 600,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50
|
||||
},
|
||||
"zynq-rs": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "Bare-metal Rust on Zynq-7000",
|
||||
"flake": "git+https://git.m-labs.hk/m-labs/zynq-rs.git",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 50
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,62 +0,0 @@
|
|||
{ pkgs ? import <nixpkgs> {}}:
|
||||
{
|
||||
jobsets = pkgs.runCommand "spec.json" {}
|
||||
''
|
||||
cat > $out << EOF
|
||||
{
|
||||
"fast": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "Core ARTIQ packages to build fast for CI purposes",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "artiq-fast.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"artiqSrc": { "type": "git", "value": "git://github.com/m-labs/artiq.git master 1", "emailresponsible": false }
|
||||
}
|
||||
},
|
||||
"full": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "Full set of ARTIQ packages",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "artiq-full.nix",
|
||||
"checkinterval": 86400,
|
||||
"schedulingshares": 1,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"sinaraSystemsSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/sinara-systems.git master 1", "emailresponsible": false },
|
||||
"artiq-fast": { "type": "sysbuild", "value": "artiq:fast:generated-nix", "emailresponsible": false }
|
||||
}
|
||||
},
|
||||
"urukul": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "Urukul CPLD gateware",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "urukul.nix",
|
||||
"checkinterval": 172800,
|
||||
"schedulingshares": 1,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"urukulSrc": { "type": "git", "value": "git://github.com/quartiq/urukul", "emailresponsible": false }
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
'';
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"enabled": 1,
|
||||
"hidden": true,
|
||||
"description": "js",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "hydra/fpga.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.03", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }
|
||||
}
|
||||
}
|
|
@ -1,26 +0,0 @@
|
|||
{ pkgs ? import <nixpkgs> {}}:
|
||||
{
|
||||
jobsets = pkgs.runCommand "spec.json" {}
|
||||
''
|
||||
cat > $out << EOF
|
||||
{
|
||||
"heavyx": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "HeavyX SoC toolkit experiment",
|
||||
"nixexprinput": "heavyx",
|
||||
"nixexprpath": "release.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.03", "emailresponsible": false },
|
||||
"heavyx": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/HeavyX.git", "emailresponsible": false }
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
'';
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
{
|
||||
"mcu-contrib": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "Third-party MCU firmware",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "mcu-contrib.nix",
|
||||
"checkinterval": 7200,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git nixos-23.11", "emailresponsible": false },
|
||||
"mozillaOverlay": { "type": "git", "value": "https://github.com/mozilla/nixpkgs-mozilla.git", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"stabilizerSrc": { "type": "git", "value": "https://github.com/quartiq/stabilizer.git", "emailresponsible": false },
|
||||
"saymaMmcSrc": { "type": "git", "value": "https://github.com/sinara-hw/openMMC.git sayma-devel", "emailresponsible": false }
|
||||
}
|
||||
},
|
||||
"thermostat": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "Firmware for the Sinara 8451 Thermostat",
|
||||
"flake": "git+https://git.m-labs.hk/M-Labs/thermostat.git",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10
|
||||
},
|
||||
"humpback-dds": {
|
||||
"enabled": 1,
|
||||
"type": 1,
|
||||
"hidden": false,
|
||||
"description": "Firmware for Humpback-DDS",
|
||||
"flake": "git+https://git.m-labs.hk/M-Labs/humpback-dds.git",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10
|
||||
}
|
||||
}
|
|
@ -1,16 +0,0 @@
|
|||
{
|
||||
"enabled": 1,
|
||||
"hidden": true,
|
||||
"description": "js",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "hydra/stm32.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }
|
||||
}
|
||||
}
|
|
@ -1,29 +0,0 @@
|
|||
{ pkgs ? import <nixpkgs> {}}:
|
||||
{
|
||||
jobsets = pkgs.runCommand "spec.json" {}
|
||||
''
|
||||
cat > $out << EOF
|
||||
{
|
||||
"stm32": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "STM32 firmware",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "stm32.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false },
|
||||
"mozillaOverlay": { "type": "git", "value": "git://github.com/mozilla/nixpkgs-mozilla.git", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"stabilizerSrc": { "type": "git", "value": "git://github.com/quartiq/stabilizer.git", "emailresponsible": false },
|
||||
"thermostatSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/thermostat.git", "emailresponsible": false }
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
'';
|
||||
}
|
|
@ -1,16 +1,20 @@
|
|||
{
|
||||
"enabled": 1,
|
||||
"hidden": true,
|
||||
"description": "js",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "hydra/web.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false }
|
||||
"web": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "Websites",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "web.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "https://github.com/NixOS/nixpkgs.git nixos-23.11", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"webSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/web2019.git", "emailresponsible": false },
|
||||
"nmigenSrc": { "type": "git", "value": "https://gitlab.com/nmigen/nmigen.git", "emailresponsible": false }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,27 +0,0 @@
|
|||
{ pkgs ? import <nixpkgs> {}}:
|
||||
{
|
||||
jobsets = pkgs.runCommand "spec.json" {}
|
||||
''
|
||||
cat > $out << EOF
|
||||
{
|
||||
"web": {
|
||||
"enabled": 1,
|
||||
"hidden": false,
|
||||
"description": "M-Labs website",
|
||||
"nixexprinput": "nixScripts",
|
||||
"nixexprpath": "web.nix",
|
||||
"checkinterval": 300,
|
||||
"schedulingshares": 10,
|
||||
"enableemail": false,
|
||||
"emailoverride": "",
|
||||
"keepnr": 10,
|
||||
"inputs": {
|
||||
"nixpkgs": { "type": "git", "value": "git://github.com/NixOS/nixpkgs-channels nixos-19.09", "emailresponsible": false },
|
||||
"nixScripts": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/nix-scripts.git", "emailresponsible": false },
|
||||
"webSrc": { "type": "git", "value": "https://git.m-labs.hk/M-Labs/web2019.git", "emailresponsible": false }
|
||||
}
|
||||
}
|
||||
}
|
||||
EOF
|
||||
'';
|
||||
}
|
|
@ -0,0 +1,8 @@
|
|||
{ pkgs ? import <nixpkgs> {} }:
|
||||
|
||||
let
|
||||
jobs = import ./mcu-contrib/default.nix {
|
||||
mozillaOverlay = import <mozillaOverlay>;
|
||||
};
|
||||
in
|
||||
builtins.mapAttrs (key: value: pkgs.lib.hydraJob value) jobs
|
|
@ -0,0 +1,104 @@
|
|||
{ # Use master branch of the overlay by default
|
||||
mozillaOverlay ? import (builtins.fetchTarball https://github.com/mozilla/nixpkgs-mozilla/archive/master.tar.gz),
|
||||
}:
|
||||
|
||||
let
|
||||
pkgs = import <nixpkgs> { overlays = [ mozillaOverlay ]; };
|
||||
targets = [
|
||||
"thumbv7em-none-eabihf"
|
||||
];
|
||||
rustManifest = pkgs.fetchurl {
|
||||
url = "https://static.rust-lang.org/dist/2022-11-03/channel-rust-stable.toml";
|
||||
sha256 = "sha256-DzNEaW724O8/B8844tt5AVHmSjSQ3cmzlU4BP90oRlY=";
|
||||
};
|
||||
rustChannelOfTargets = _channel: _date: targets:
|
||||
(pkgs.lib.rustLib.fromManifestFile rustManifest {
|
||||
inherit (pkgs) stdenv lib fetchurl patchelf;
|
||||
}).rust.override {
|
||||
inherit targets;
|
||||
extensions = ["rust-src"];
|
||||
};
|
||||
rust = rustChannelOfTargets "nightly" null targets;
|
||||
rustPlatform = pkgs.recurseIntoAttrs (pkgs.makeRustPlatform {
|
||||
rustc = rust;
|
||||
cargo = rust;
|
||||
});
|
||||
|
||||
buildStm32Firmware = { name, src, cargoDepsName ? name, patchPhase ? "", extraNativeBuildInputs ? [], checkPhase ? "", doCheck ? true, binaryName ? name, extraCargoBuildArgs ? "", outputHashes ? {} }:
|
||||
rustPlatform.buildRustPackage rec {
|
||||
inherit name cargoDepsName;
|
||||
version = "0.0.0";
|
||||
|
||||
inherit src;
|
||||
|
||||
cargoLock = {lockFile = "${src}/Cargo.lock"; inherit outputHashes; };
|
||||
|
||||
inherit patchPhase;
|
||||
nativeBuildInputs = [ pkgs.llvm ] ++ extraNativeBuildInputs;
|
||||
buildPhase = ''
|
||||
export CARGO_HOME=$(mktemp -d cargo-home.XXX)
|
||||
cargo build --release --bin ${binaryName} ${extraCargoBuildArgs}
|
||||
'';
|
||||
|
||||
inherit checkPhase doCheck;
|
||||
# binaryName defaults to the `name` arg (i.e. the Rust package name);
|
||||
# it is used as the Cargo binary filename
|
||||
installPhase = ''
|
||||
mkdir -p $out $out/nix-support
|
||||
cp target/thumbv7em-none-eabihf/release/${binaryName} $out/${name}.elf
|
||||
echo file binary-dist $out/${name}.elf >> $out/nix-support/hydra-build-products
|
||||
llvm-objcopy -O binary target/thumbv7em-none-eabihf/release/${binaryName} $out/${name}.bin
|
||||
echo file binary-dist $out/${name}.bin >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
|
||||
dontFixup = true;
|
||||
auditable = false;
|
||||
};
|
||||
in
|
||||
pkgs.lib.attrsets.mapAttrs'
|
||||
(name: value: pkgs.lib.attrsets.nameValuePair ("stabilizer-" + name)
|
||||
(buildStm32Firmware ({
|
||||
name = "stabilizer-" + name;
|
||||
# If binaryName is not specified, use the attribute name as binaryName by default.
|
||||
binaryName = name;
|
||||
cargoDepsName = "stabilizer";
|
||||
src = <stabilizerSrc>;
|
||||
patchPhase = ''
|
||||
patch -p1 < ${./pounder-725.diff}
|
||||
substituteInPlace src/net/mod.rs \
|
||||
--replace "[10, 34, 16, 10];" \
|
||||
"[192, 168, 1, 10];" # or other default MQTT broker address
|
||||
'';
|
||||
doCheck = false;
|
||||
} // value))) {
|
||||
dual-iir = {};
|
||||
dual-iir-pounder_v1_0 = {
|
||||
binaryName = "dual-iir";
|
||||
extraCargoBuildArgs = "--features pounder_v1_0";
|
||||
};
|
||||
lockin = {};
|
||||
} //
|
||||
{
|
||||
# openMMC build system breaks if host compiler is not available, so do not use stdenvNoCC here
|
||||
sayma-mmc = pkgs.stdenv.mkDerivation {
|
||||
name = "sayma-mmc";
|
||||
src = <saymaMmcSrc>;
|
||||
phases = [ "unpackPhase" "buildPhase" "installPhase" ];
|
||||
nativeBuildInputs = [ pkgs.cmake pkgs.gcc-arm-embedded ];
|
||||
buildPhase =
|
||||
''
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DBOARD=sayma -DBOARD_RTM=sayma -DVERSION= -DTARGET_CONTROLLER=LPC1776 -DCMAKE_BUILD_TYPE=Debug
|
||||
make
|
||||
'';
|
||||
installPhase =
|
||||
''
|
||||
mkdir $out
|
||||
cp out/* $out
|
||||
mkdir -p $out $out/nix-support
|
||||
echo file binary-dist $out/openMMC.axf >> $out/nix-support/hydra-build-products
|
||||
echo file binary-dist $out/openMMC.bin >> $out/nix-support/hydra-build-products
|
||||
'';
|
||||
};
|
||||
}
|
|
@ -0,0 +1,819 @@
|
|||
diff --git a/ad9959/src/lib.rs b/ad9959/src/lib.rs
|
||||
index b15f2a5bd..4e83bcb2f 100644
|
||||
--- a/ad9959/src/lib.rs
|
||||
+++ b/ad9959/src/lib.rs
|
||||
@@ -2,8 +2,24 @@
|
||||
|
||||
use bit_field::BitField;
|
||||
use bitflags::bitflags;
|
||||
+use core::ops::Range;
|
||||
use embedded_hal::{blocking::delay::DelayUs, digital::v2::OutputPin};
|
||||
|
||||
+/// The minimum reference clock input frequency with REFCLK multiplier disabled.
|
||||
+const MIN_REFCLK_FREQUENCY: f32 = 1e6;
|
||||
+/// The minimum reference clock input frequency with REFCLK multiplier enabled.
|
||||
+const MIN_MULTIPLIED_REFCLK_FREQUENCY: f32 = 10e6;
|
||||
+/// The system clock frequency range with high gain configured for the internal VCO.
|
||||
+const HIGH_GAIN_VCO_RANGE: Range<f32> = Range {
|
||||
+ start: 255e6,
|
||||
+ end: 500e6,
|
||||
+};
|
||||
+/// The system clock frequency range with low gain configured for the internal VCO.
|
||||
+const LOW_GAIN_VCO_RANGE: Range<f32> = Range {
|
||||
+ start: 100e6,
|
||||
+ end: 160e6,
|
||||
+};
|
||||
+
|
||||
/// A device driver for the AD9959 direct digital synthesis (DDS) chip.
|
||||
///
|
||||
/// This chip provides four independently controllable digital-to-analog output sinusoids with
|
||||
@@ -216,23 +232,17 @@ impl<I: Interface> Ad9959<I> {
|
||||
reference_clock_frequency: f32,
|
||||
multiplier: u8,
|
||||
) -> Result<f32, Error> {
|
||||
+ let frequency =
|
||||
+ validate_clocking(reference_clock_frequency, multiplier)?;
|
||||
self.reference_clock_frequency = reference_clock_frequency;
|
||||
|
||||
- if multiplier != 1 && !(4..=20).contains(&multiplier) {
|
||||
- return Err(Error::Bounds);
|
||||
- }
|
||||
-
|
||||
- let frequency = multiplier as f32 * self.reference_clock_frequency;
|
||||
- if frequency > 500_000_000.0f32 {
|
||||
- return Err(Error::Frequency);
|
||||
- }
|
||||
-
|
||||
// TODO: Update / disable any enabled channels?
|
||||
let mut fr1: [u8; 3] = [0, 0, 0];
|
||||
self.read(Register::FR1, &mut fr1)?;
|
||||
fr1[0].set_bits(2..=6, multiplier);
|
||||
|
||||
- let vco_range = frequency > 255e6;
|
||||
+ let vco_range = HIGH_GAIN_VCO_RANGE.contains(&frequency)
|
||||
+ || frequency == HIGH_GAIN_VCO_RANGE.end;
|
||||
fr1[0].set_bit(7, vco_range);
|
||||
|
||||
self.write(Register::FR1, &fr1)?;
|
||||
@@ -363,9 +373,7 @@ impl<I: Interface> Ad9959<I> {
|
||||
channel: Channel,
|
||||
phase_turns: f32,
|
||||
) -> Result<f32, Error> {
|
||||
- let phase_offset: u16 =
|
||||
- (phase_turns * (1 << 14) as f32) as u16 & 0x3FFFu16;
|
||||
-
|
||||
+ let phase_offset = phase_to_pow(phase_turns)?;
|
||||
self.modify_channel(
|
||||
channel,
|
||||
Register::CPOW0,
|
||||
@@ -511,6 +519,108 @@ impl<I: Interface> Ad9959<I> {
|
||||
}
|
||||
}
|
||||
|
||||
+/// Validate the internal system clock configuration of the chip.
|
||||
+///
|
||||
+/// Arguments:
|
||||
+/// * `reference_clock_frequency` - The reference clock frequency provided to the AD9959 core.
|
||||
+/// * `multiplier` - The frequency multiplier of the system clock. Must be 1 or 4-20.
|
||||
+///
|
||||
+/// Returns:
|
||||
+/// The system clock frequency to be configured.
|
||||
+pub fn validate_clocking(
|
||||
+ reference_clock_frequency: f32,
|
||||
+ multiplier: u8,
|
||||
+) -> Result<f32, Error> {
|
||||
+ // The REFCLK frequency must be at least 1 MHz with REFCLK multiplier disabled.
|
||||
+ if reference_clock_frequency < MIN_REFCLK_FREQUENCY {
|
||||
+ return Err(Error::Bounds);
|
||||
+ }
|
||||
+ // If the REFCLK multiplier is enabled, the multiplier (FR1[22:18]) must be between 4 to 20.
|
||||
+ // Alternatively, the clock multiplier can be disabled. The multiplication factor is 1.
|
||||
+ if multiplier != 1 && !(4..=20).contains(&multiplier) {
|
||||
+ return Err(Error::Bounds);
|
||||
+ }
|
||||
+ // If the REFCLK multiplier is enabled, the REFCLK frequency must be at least 10 MHz.
|
||||
+ if multiplier != 1
|
||||
+ && reference_clock_frequency < MIN_MULTIPLIED_REFCLK_FREQUENCY
|
||||
+ {
|
||||
+ return Err(Error::Bounds);
|
||||
+ }
|
||||
+ let frequency = multiplier as f32 * reference_clock_frequency;
|
||||
+ // SYSCLK frequency between 255 MHz and 500 MHz (inclusive) is valid with high range VCO
|
||||
+ if HIGH_GAIN_VCO_RANGE.contains(&frequency)
|
||||
+ || frequency == HIGH_GAIN_VCO_RANGE.end
|
||||
+ {
|
||||
+ return Ok(frequency);
|
||||
+ }
|
||||
+
|
||||
+ // SYSCLK frequency between 100 MHz and 160 MHz (inclusive) is valid with low range VCO
|
||||
+ if LOW_GAIN_VCO_RANGE.contains(&frequency)
|
||||
+ || frequency == LOW_GAIN_VCO_RANGE.end
|
||||
+ {
|
||||
+ return Ok(frequency);
|
||||
+ }
|
||||
+
|
||||
+ // When the REFCLK multiplier is disabled, SYSCLK frequency can go below 100 MHz
|
||||
+ if multiplier == 1 && (0.0..=LOW_GAIN_VCO_RANGE.start).contains(&frequency)
|
||||
+ {
|
||||
+ return Ok(frequency);
|
||||
+ }
|
||||
+
|
||||
+ Err(Error::Frequency)
|
||||
+}
|
||||
+
|
||||
+/// Convert and validate frequency into frequency tuning word.
|
||||
+///
|
||||
+/// Arguments:
|
||||
+/// * `dds_frequency` - The DDS frequency to be converted and validated.
|
||||
+/// * `system_clock_frequency` - The system clock frequency of the AD9959 core.
|
||||
+///
|
||||
+/// Returns:
|
||||
+/// The corresponding frequency tuning word.
|
||||
+pub fn frequency_to_ftw(
|
||||
+ dds_frequency: f32,
|
||||
+ system_clock_frequency: f32,
|
||||
+) -> Result<u32, Error> {
|
||||
+ // Output frequency should not exceed the Nyquist's frequency.
|
||||
+ if !(0.0..=(system_clock_frequency / 2.0)).contains(&dds_frequency) {
|
||||
+ return Err(Error::Bounds);
|
||||
+ }
|
||||
+ // The function for channel frequency is `f_out = FTW * f_s / 2^32`, where FTW is the
|
||||
+ // frequency tuning word and f_s is the system clock rate.
|
||||
+ Ok(((dds_frequency / system_clock_frequency) * (1u64 << 32) as f32) as u32)
|
||||
+}
|
||||
+
|
||||
+/// Convert phase into phase offset word.
|
||||
+///
|
||||
+/// Arguments:
|
||||
+/// * `phase_turns` - The normalized number of phase turns of a DDS channel.
|
||||
+///
|
||||
+/// Returns:
|
||||
+/// The corresponding phase offset word.
|
||||
+pub fn phase_to_pow(phase_turns: f32) -> Result<u16, Error> {
|
||||
+ Ok((phase_turns * (1 << 14) as f32) as u16 & 0x3FFFu16)
|
||||
+}
|
||||
+
|
||||
+/// Convert amplitude into amplitude control register values.
|
||||
+///
|
||||
+/// Arguments:
|
||||
+/// * `amplitude` - The normalized amplitude of a DDS channel.
|
||||
+///
|
||||
+/// Returns:
|
||||
+/// The corresponding value in the amplitude control register.
|
||||
+pub fn amplitude_to_acr(amplitude: f32) -> Result<u32, Error> {
|
||||
+ if !(0.0..=1.0).contains(&litude) {
|
||||
+ return Err(Error::Bounds);
|
||||
+ }
|
||||
+
|
||||
+ let acr: u32 = *0u32
|
||||
+ .set_bits(0..=9, ((amplitude * (1 << 10) as f32) as u32) & 0x3FF)
|
||||
+ .set_bit(12, amplitude != 1.0);
|
||||
+
|
||||
+ Ok(acr as u32)
|
||||
+}
|
||||
+
|
||||
/// Represents a means of serializing a DDS profile for writing to a stream.
|
||||
pub struct ProfileSerializer {
|
||||
// heapless::Vec<u8, 32>, especially its extend_from_slice() is slow
|
||||
@@ -566,6 +676,39 @@ impl ProfileSerializer {
|
||||
}
|
||||
}
|
||||
|
||||
+ /// Update the system clock configuration.
|
||||
+ ///
|
||||
+ /// # Args
|
||||
+ /// * `reference_clock_frequency` - The reference clock frequency provided to the AD9959 core.
|
||||
+ /// * `multiplier` - The frequency multiplier of the system clock. Must be 1 or 4-20.
|
||||
+ ///
|
||||
+ /// # Limitations
|
||||
+ /// The correctness of the FR1 register setting code rely on FR1\[0:17\] staying 0.
|
||||
+ pub fn set_system_clock(
|
||||
+ &mut self,
|
||||
+ reference_clock_frequency: f32,
|
||||
+ multiplier: u8,
|
||||
+ ) -> Result<f32, Error> {
|
||||
+ let frequency = reference_clock_frequency * multiplier as f32;
|
||||
+
|
||||
+ // The enabled channel will be updated after clock reconfig
|
||||
+ let mut fr1 = [0u8; 3];
|
||||
+
|
||||
+ // The ad9959 crate does not modify FR1[0:17]. These bits keep their default value.
|
||||
+ // These bits by default are 0.
|
||||
+ // Reading the register then update is not possible to implement in a serializer, where
|
||||
+ // many QSPI writes are performed in burst. Switching between read and write requires
|
||||
+ // breaking the QSPI indirect write mode and switch into the QSPI indirect read mode.
|
||||
+ fr1[0].set_bits(2..=6, multiplier);
|
||||
+
|
||||
+ // Frequencies within the VCO forbidden range (160e6, 255e6) are already rejected.
|
||||
+ let vco_range = HIGH_GAIN_VCO_RANGE.contains(&frequency);
|
||||
+ fr1[0].set_bit(7, vco_range);
|
||||
+
|
||||
+ self.add_write(Register::FR1, &fr1);
|
||||
+ Ok(frequency)
|
||||
+ }
|
||||
+
|
||||
/// Add a register write to the serialization data.
|
||||
fn add_write(&mut self, register: Register, value: &[u8]) {
|
||||
let data = &mut self.data[self.index..];
|
||||
diff --git a/src/bin/dual-iir.rs b/src/bin/dual-iir.rs
|
||||
index c7df3f603..dadd0523c 100644
|
||||
--- a/src/bin/dual-iir.rs
|
||||
+++ b/src/bin/dual-iir.rs
|
||||
@@ -44,6 +44,8 @@ use stabilizer::{
|
||||
afe::Gain,
|
||||
dac::{Dac0Output, Dac1Output, DacCode},
|
||||
hal,
|
||||
+ pounder::{ClockConfig, PounderConfig},
|
||||
+ setup::PounderDevices as Pounder,
|
||||
signal_generator::{self, SignalGenerator},
|
||||
timers::SamplingTimer,
|
||||
DigitalInput0, DigitalInput1, SystemTimer, Systick, AFE0, AFE1,
|
||||
@@ -145,6 +147,16 @@ pub struct Settings {
|
||||
/// See [signal_generator::BasicConfig#miniconf]
|
||||
#[miniconf(defer)]
|
||||
signal_generator: miniconf::Array<signal_generator::BasicConfig, 2>,
|
||||
+
|
||||
+ /// Specifies the config for pounder DDS clock configuration, DDS channels & attenuations
|
||||
+ ///
|
||||
+ /// # Path
|
||||
+ /// `pounder`
|
||||
+ ///
|
||||
+ /// # Value
|
||||
+ /// See [PounderConfig#miniconf]
|
||||
+ #[miniconf(defer)]
|
||||
+ pounder: miniconf::Option<PounderConfig>,
|
||||
}
|
||||
|
||||
impl Default for Settings {
|
||||
@@ -171,6 +183,8 @@ impl Default for Settings {
|
||||
.into(),
|
||||
|
||||
stream_target: StreamTarget::default(),
|
||||
+
|
||||
+ pounder: None.into(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,6 +203,7 @@ mod app {
|
||||
settings: Settings,
|
||||
telemetry: TelemetryBuffer,
|
||||
signal_generator: [SignalGenerator; 2],
|
||||
+ pounder: Option<Pounder>,
|
||||
}
|
||||
|
||||
#[local]
|
||||
@@ -199,6 +214,7 @@ mod app {
|
||||
adcs: (Adc0Input, Adc1Input),
|
||||
dacs: (Dac0Output, Dac1Output),
|
||||
iir_state: [[iir::Vec5<f32>; IIR_CASCADE_LENGTH]; 2],
|
||||
+ dds_clock_state: Option<ClockConfig>,
|
||||
generator: FrameGenerator,
|
||||
cpu_temp_sensor: stabilizer::hardware::cpu_temp_sensor::CpuTempSensor,
|
||||
}
|
||||
@@ -208,7 +224,7 @@ mod app {
|
||||
let clock = SystemTimer::new(|| monotonics::now().ticks() as u32);
|
||||
|
||||
// Configure the microcontroller
|
||||
- let (stabilizer, _pounder) = hardware::setup::setup(
|
||||
+ let (stabilizer, pounder) = hardware::setup::setup(
|
||||
c.core,
|
||||
c.device,
|
||||
clock,
|
||||
@@ -216,6 +232,13 @@ mod app {
|
||||
SAMPLE_TICKS,
|
||||
);
|
||||
|
||||
+ let dds_clock_state = pounder.as_ref().map(|_| ClockConfig::default());
|
||||
+
|
||||
+ let mut settings = Settings::default();
|
||||
+ if pounder.is_some() {
|
||||
+ settings.pounder.replace(PounderConfig::default());
|
||||
+ }
|
||||
+
|
||||
let mut network = NetworkUsers::new(
|
||||
stabilizer.net.stack,
|
||||
stabilizer.net.phy,
|
||||
@@ -226,13 +249,12 @@ mod app {
|
||||
.unwrap_or("10.34.16.1")
|
||||
.parse()
|
||||
.unwrap(),
|
||||
+ settings,
|
||||
);
|
||||
|
||||
let generator = network
|
||||
.configure_streaming(StreamFormat::AdcDacData, BATCH_SIZE as _);
|
||||
|
||||
- let settings = Settings::default();
|
||||
-
|
||||
let shared = Shared {
|
||||
network,
|
||||
settings,
|
||||
@@ -249,6 +271,7 @@ mod app {
|
||||
.unwrap(),
|
||||
),
|
||||
],
|
||||
+ pounder,
|
||||
};
|
||||
|
||||
let mut local = Local {
|
||||
@@ -258,6 +281,7 @@ mod app {
|
||||
adcs: stabilizer.adcs,
|
||||
dacs: stabilizer.dacs,
|
||||
iir_state: [[[0.; 5]; IIR_CASCADE_LENGTH]; 2],
|
||||
+ dds_clock_state,
|
||||
generator,
|
||||
cpu_temp_sensor: stabilizer.temperature_sensor,
|
||||
};
|
||||
@@ -407,7 +431,7 @@ mod app {
|
||||
}
|
||||
}
|
||||
|
||||
- #[task(priority = 1, local=[afes], shared=[network, settings, signal_generator])]
|
||||
+ #[task(priority = 1, local=[afes, dds_clock_state], shared=[network, settings, signal_generator, pounder])]
|
||||
fn settings_update(mut c: settings_update::Context) {
|
||||
let settings = c.shared.network.lock(|net| *net.miniconf.settings());
|
||||
c.shared.settings.lock(|current| *current = settings);
|
||||
@@ -431,15 +455,28 @@ mod app {
|
||||
}
|
||||
}
|
||||
|
||||
+ // Update Pounder configurations
|
||||
+ c.shared.pounder.lock(|pounder| {
|
||||
+ if let Some(pounder) = pounder {
|
||||
+ let pounder_settings = settings.pounder.as_ref().unwrap();
|
||||
+ let mut clocking = c.local.dds_clock_state.unwrap();
|
||||
+ pounder.update_dds(*pounder_settings, &mut clocking);
|
||||
+ }
|
||||
+ });
|
||||
+
|
||||
let target = settings.stream_target.into();
|
||||
c.shared.network.lock(|net| net.direct_stream(target));
|
||||
}
|
||||
|
||||
- #[task(priority = 1, shared=[network, settings, telemetry], local=[cpu_temp_sensor])]
|
||||
+ #[task(priority = 1, shared=[network, settings, telemetry, pounder], local=[cpu_temp_sensor])]
|
||||
fn telemetry(mut c: telemetry::Context) {
|
||||
let telemetry: TelemetryBuffer =
|
||||
c.shared.telemetry.lock(|telemetry| *telemetry);
|
||||
|
||||
+ let pounder_telemetry = c.shared.pounder.lock(|pounder| {
|
||||
+ pounder.as_mut().map(|pounder| pounder.get_telemetry())
|
||||
+ });
|
||||
+
|
||||
let (gains, telemetry_period) = c
|
||||
.shared
|
||||
.settings
|
||||
@@ -450,6 +487,7 @@ mod app {
|
||||
gains[0],
|
||||
gains[1],
|
||||
c.local.cpu_temp_sensor.get_temperature().unwrap(),
|
||||
+ pounder_telemetry,
|
||||
))
|
||||
});
|
||||
|
||||
diff --git a/src/bin/lockin.rs b/src/bin/lockin.rs
|
||||
index 6896df7ff..1e92a0f75 100644
|
||||
--- a/src/bin/lockin.rs
|
||||
+++ b/src/bin/lockin.rs
|
||||
@@ -254,6 +254,8 @@ mod app {
|
||||
SAMPLE_TICKS,
|
||||
);
|
||||
|
||||
+ let settings = Settings::default();
|
||||
+
|
||||
let mut network = NetworkUsers::new(
|
||||
stabilizer.net.stack,
|
||||
stabilizer.net.phy,
|
||||
@@ -264,6 +266,7 @@ mod app {
|
||||
.unwrap_or("10.34.16.1")
|
||||
.parse()
|
||||
.unwrap(),
|
||||
+ settings,
|
||||
);
|
||||
|
||||
let generator = network
|
||||
@@ -272,7 +275,7 @@ mod app {
|
||||
let shared = Shared {
|
||||
network,
|
||||
telemetry: TelemetryBuffer::default(),
|
||||
- settings: Settings::default(),
|
||||
+ settings,
|
||||
};
|
||||
|
||||
let signal_config = signal_generator::Config {
|
||||
@@ -499,6 +502,7 @@ mod app {
|
||||
gains[0],
|
||||
gains[1],
|
||||
c.local.cpu_temp_sensor.get_temperature().unwrap(),
|
||||
+ None,
|
||||
))
|
||||
});
|
||||
|
||||
diff --git a/src/hardware/pounder/attenuators.rs b/src/hardware/pounder/attenuators.rs
|
||||
index ef22814d4..a5d220dfb 100644
|
||||
--- a/src/hardware/pounder/attenuators.rs
|
||||
+++ b/src/hardware/pounder/attenuators.rs
|
||||
@@ -54,10 +54,9 @@ pub trait AttenuatorInterface {
|
||||
fn get_attenuation(&mut self, channel: Channel) -> Result<f32, Error> {
|
||||
let mut channels = [0_u8; 4];
|
||||
|
||||
- // Reading the data always shifts data out of the staging registers, so we perform a
|
||||
- // duplicate write-back to ensure the staging register is always equal to the output
|
||||
- // register.
|
||||
- self.transfer_attenuators(&mut channels)?;
|
||||
+ // Reading the data always shifts data out of the staging registers, so a duplicate
|
||||
+ // write-back will be performed to ensure the staging register is always equal to the
|
||||
+ // output register.
|
||||
self.transfer_attenuators(&mut channels)?;
|
||||
|
||||
// The attenuation code is stored in the upper 6 bits of the register, where each LSB
|
||||
@@ -68,6 +67,9 @@ pub trait AttenuatorInterface {
|
||||
// care) would contain erroneous data.
|
||||
let attenuation_code = (!channels[channel as usize]) >> 2;
|
||||
|
||||
+ // The write-back transfer is performed. Staging register is now restored.
|
||||
+ self.transfer_attenuators(&mut channels)?;
|
||||
+
|
||||
// Convert the desired channel code into dB of attenuation.
|
||||
Ok(attenuation_code as f32 / 2.0)
|
||||
}
|
||||
diff --git a/src/hardware/pounder/dds_output.rs b/src/hardware/pounder/dds_output.rs
|
||||
index 9af23a9aa..559855fcc 100644
|
||||
--- a/src/hardware/pounder/dds_output.rs
|
||||
+++ b/src/hardware/pounder/dds_output.rs
|
||||
@@ -55,7 +55,7 @@
|
||||
use log::warn;
|
||||
use stm32h7xx_hal as hal;
|
||||
|
||||
-use super::{hrtimer::HighResTimerE, QspiInterface};
|
||||
+use super::{hrtimer::HighResTimerE, Profile, QspiInterface};
|
||||
use ad9959::{Channel, Mode, ProfileSerializer};
|
||||
|
||||
/// The DDS profile update stream.
|
||||
@@ -157,6 +157,46 @@ impl<'a> ProfileBuilder<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
+ /// Update a number of channels with fully defined profile settings.
|
||||
+ ///
|
||||
+ /// # Args
|
||||
+ /// * `channels` - A set of channels to apply the configuration to.
|
||||
+ /// * `profile` - The complete DDS profile, which defines the frequency tuning word,
|
||||
+ /// amplitude control register & the phase offset word of the channels.
|
||||
+ /// # Note
|
||||
+ /// The ACR should be stored in the 3 LSB of the word.
|
||||
+ /// If amplitude scaling is to be used, the "Amplitude multiplier enable" bit must be set.
|
||||
+ #[inline]
|
||||
+ pub fn update_channels_with_profile(
|
||||
+ &mut self,
|
||||
+ channels: Channel,
|
||||
+ profile: Profile,
|
||||
+ ) -> &mut Self {
|
||||
+ self.serializer.update_channels(
|
||||
+ channels,
|
||||
+ Some(profile.frequency_tuning_word),
|
||||
+ Some(profile.phase_offset),
|
||||
+ Some(profile.amplitude_control),
|
||||
+ );
|
||||
+ self
|
||||
+ }
|
||||
+
|
||||
+ /// Update the system clock configuration.
|
||||
+ ///
|
||||
+ /// # Args
|
||||
+ /// * `reference_clock_frequency` - The reference clock frequency provided to the AD9959 core.
|
||||
+ /// * `multiplier` - The frequency multiplier of the system clock. Must be 1 or 4-20.
|
||||
+ #[inline]
|
||||
+ pub fn set_system_clock(
|
||||
+ &mut self,
|
||||
+ reference_clock_frequency: f32,
|
||||
+ multiplier: u8,
|
||||
+ ) -> Result<&mut Self, ad9959::Error> {
|
||||
+ self.serializer
|
||||
+ .set_system_clock(reference_clock_frequency, multiplier)?;
|
||||
+ Ok(self)
|
||||
+ }
|
||||
+
|
||||
/// Write the profile to the DDS asynchronously.
|
||||
#[allow(dead_code)]
|
||||
#[inline]
|
||||
diff --git a/src/hardware/pounder/mod.rs b/src/hardware/pounder/mod.rs
|
||||
index d6dd654fc..1e436f785 100644
|
||||
--- a/src/hardware/pounder/mod.rs
|
||||
+++ b/src/hardware/pounder/mod.rs
|
||||
@@ -1,10 +1,17 @@
|
||||
use self::attenuators::AttenuatorInterface;
|
||||
|
||||
use super::hal;
|
||||
-use crate::hardware::{shared_adc::AdcChannel, I2c1Proxy};
|
||||
+use crate::hardware::{setup, shared_adc::AdcChannel, I2c1Proxy};
|
||||
+use crate::net::telemetry::PounderTelemetry;
|
||||
+use ad9959::{
|
||||
+ amplitude_to_acr, frequency_to_ftw, phase_to_pow, validate_clocking,
|
||||
+};
|
||||
use embedded_hal::blocking::spi::Transfer;
|
||||
use enum_iterator::Sequence;
|
||||
+use miniconf::Miniconf;
|
||||
+use rf_power::PowerMeasurementInterface;
|
||||
use serde::{Deserialize, Serialize};
|
||||
+use stm32h7xx_hal::time::MegaHertz;
|
||||
|
||||
pub mod attenuators;
|
||||
pub mod dds_output;
|
||||
@@ -91,40 +98,98 @@ impl From<Channel> for GpioPin {
|
||||
}
|
||||
}
|
||||
|
||||
-#[derive(Serialize, Deserialize, Copy, Clone, Debug)]
|
||||
-pub struct DdsChannelState {
|
||||
- pub phase_offset: f32,
|
||||
+#[derive(Serialize, Deserialize, Copy, Clone, Debug, Miniconf)]
|
||||
+pub struct DdsChannelConfig {
|
||||
pub frequency: f32,
|
||||
+ pub phase_offset: f32,
|
||||
pub amplitude: f32,
|
||||
- pub enabled: bool,
|
||||
}
|
||||
|
||||
-#[derive(Serialize, Deserialize, Copy, Clone, Debug)]
|
||||
-pub struct ChannelState {
|
||||
- pub parameters: DdsChannelState,
|
||||
- pub attenuation: f32,
|
||||
+impl Default for DdsChannelConfig {
|
||||
+ fn default() -> Self {
|
||||
+ Self {
|
||||
+ frequency: 0.0,
|
||||
+ phase_offset: 0.0,
|
||||
+ amplitude: 0.0,
|
||||
+ }
|
||||
+ }
|
||||
}
|
||||
|
||||
-#[derive(Serialize, Deserialize, Copy, Clone, Debug)]
|
||||
-pub struct InputChannelState {
|
||||
- pub attenuation: f32,
|
||||
- pub power: f32,
|
||||
- pub mixer: DdsChannelState,
|
||||
+/// Represents a fully defined DDS profile, with parameters expressed in machine units
|
||||
+pub struct Profile {
|
||||
+ /// A 32-bits representation of DDS frequency in relation to the system clock frequency.
|
||||
+ /// This value corresponds to the AD9959 CFTW0 register, which specifies the frequency
|
||||
+ /// of DDS channels.
|
||||
+ pub frequency_tuning_word: u32,
|
||||
+ /// The DDS phase offset. It corresponds to the AD9959 CPOW0 register, which specifies
|
||||
+ /// the phase offset of DDS channels.
|
||||
+ pub phase_offset: u16,
|
||||
+ /// Control amplitudes of DDS channels. It corresponds to the AD9959 ACR register, which
|
||||
+ /// controls the amplitude scaling factor of DDS channels.
|
||||
+ pub amplitude_control: u32,
|
||||
+}
|
||||
+
|
||||
+impl TryFrom<(ClockConfig, ChannelConfig)> for Profile {
|
||||
+ type Error = ad9959::Error;
|
||||
+
|
||||
+ fn try_from(
|
||||
+ (clocking, channel): (ClockConfig, ChannelConfig),
|
||||
+ ) -> Result<Self, Self::Error> {
|
||||
+ let system_clock_frequency =
|
||||
+ clocking.reference_clock * clocking.multiplier as f32;
|
||||
+ Ok(Profile {
|
||||
+ frequency_tuning_word: frequency_to_ftw(
|
||||
+ channel.dds.frequency,
|
||||
+ system_clock_frequency,
|
||||
+ )?,
|
||||
+ phase_offset: phase_to_pow(channel.dds.phase_offset)?,
|
||||
+ amplitude_control: amplitude_to_acr(channel.dds.amplitude)?,
|
||||
+ })
|
||||
+ }
|
||||
}
|
||||
|
||||
-#[derive(Serialize, Deserialize, Copy, Clone, Debug)]
|
||||
-pub struct OutputChannelState {
|
||||
+#[derive(Serialize, Deserialize, Copy, Clone, Debug, Miniconf)]
|
||||
+pub struct ChannelConfig {
|
||||
+ #[miniconf(defer)]
|
||||
+ pub dds: DdsChannelConfig,
|
||||
pub attenuation: f32,
|
||||
- pub channel: DdsChannelState,
|
||||
}
|
||||
|
||||
-#[derive(Serialize, Deserialize, Copy, Clone, Debug)]
|
||||
-pub struct DdsClockConfig {
|
||||
+impl Default for ChannelConfig {
|
||||
+ fn default() -> Self {
|
||||
+ ChannelConfig {
|
||||
+ dds: DdsChannelConfig::default(),
|
||||
+ attenuation: 31.5,
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#[derive(Serialize, Deserialize, Copy, Clone, Debug, PartialEq, Miniconf)]
|
||||
+pub struct ClockConfig {
|
||||
pub multiplier: u8,
|
||||
pub reference_clock: f32,
|
||||
pub external_clock: bool,
|
||||
}
|
||||
|
||||
+impl Default for ClockConfig {
|
||||
+ fn default() -> Self {
|
||||
+ Self {
|
||||
+ multiplier: 5,
|
||||
+ reference_clock: MegaHertz::MHz(100).to_Hz() as f32,
|
||||
+ external_clock: false,
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+#[derive(Copy, Clone, Debug, Default, Miniconf)]
|
||||
+pub struct PounderConfig {
|
||||
+ pub clock: ClockConfig,
|
||||
+ #[miniconf(defer)]
|
||||
+ pub in_channel: miniconf::Array<ChannelConfig, 2>,
|
||||
+ #[miniconf(defer)]
|
||||
+ pub out_channel: miniconf::Array<ChannelConfig, 2>,
|
||||
+}
|
||||
+
|
||||
impl From<Channel> for ad9959::Channel {
|
||||
/// Translate pounder channels to DDS output channels.
|
||||
fn from(other: Channel) -> Self {
|
||||
@@ -489,3 +554,77 @@ impl rf_power::PowerMeasurementInterface for PounderDevices {
|
||||
Ok(adc_scale * 2.048)
|
||||
}
|
||||
}
|
||||
+
|
||||
+impl setup::PounderDevices {
|
||||
+ pub fn update_dds(
|
||||
+ &mut self,
|
||||
+ settings: PounderConfig,
|
||||
+ clocking: &mut ClockConfig,
|
||||
+ ) {
|
||||
+ if *clocking != settings.clock {
|
||||
+ match validate_clocking(
|
||||
+ settings.clock.reference_clock,
|
||||
+ settings.clock.multiplier,
|
||||
+ ) {
|
||||
+ Ok(_frequency) => {
|
||||
+ self.pounder
|
||||
+ .set_ext_clk(settings.clock.external_clock)
|
||||
+ .unwrap();
|
||||
+
|
||||
+ self.dds_output
|
||||
+ .builder()
|
||||
+ .set_system_clock(
|
||||
+ settings.clock.reference_clock,
|
||||
+ settings.clock.multiplier,
|
||||
+ )
|
||||
+ .unwrap()
|
||||
+ .write();
|
||||
+
|
||||
+ *clocking = settings.clock;
|
||||
+ }
|
||||
+ Err(err) => {
|
||||
+ log::error!("Invalid AD9959 clocking parameters: {:?}", err)
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ for (channel_config, pounder_channel) in settings
|
||||
+ .in_channel
|
||||
+ .iter()
|
||||
+ .chain(settings.out_channel.iter())
|
||||
+ .zip([Channel::In0, Channel::In1, Channel::Out0, Channel::Out1])
|
||||
+ {
|
||||
+ match Profile::try_from((*clocking, *channel_config)) {
|
||||
+ Ok(dds_profile) => {
|
||||
+ self.dds_output
|
||||
+ .builder()
|
||||
+ .update_channels_with_profile(
|
||||
+ pounder_channel.into(),
|
||||
+ dds_profile,
|
||||
+ )
|
||||
+ .write();
|
||||
+
|
||||
+ if let Err(err) = self.pounder.set_attenuation(
|
||||
+ pounder_channel,
|
||||
+ channel_config.attenuation,
|
||||
+ ) {
|
||||
+ log::error!("Invalid attenuation settings: {:?}", err)
|
||||
+ }
|
||||
+ }
|
||||
+ Err(err) => {
|
||||
+ log::error!("Invalid AD9959 profile settings: {:?}", err)
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ pub fn get_telemetry(&mut self) -> PounderTelemetry {
|
||||
+ PounderTelemetry {
|
||||
+ temperature: self.pounder.lm75.read_temperature().unwrap(),
|
||||
+ input_power: [
|
||||
+ self.pounder.measure_power(Channel::In0).unwrap(),
|
||||
+ self.pounder.measure_power(Channel::In1).unwrap(),
|
||||
+ ],
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
diff --git a/src/net/mod.rs b/src/net/mod.rs
|
||||
index f6372381b..9a88008f7 100644
|
||||
--- a/src/net/mod.rs
|
||||
+++ b/src/net/mod.rs
|
||||
@@ -43,7 +43,7 @@ pub enum NetworkState {
|
||||
}
|
||||
|
||||
/// A structure of Stabilizer's default network users.
|
||||
-pub struct NetworkUsers<S: Default + Miniconf + Clone, T: Serialize> {
|
||||
+pub struct NetworkUsers<S: Miniconf + Clone, T: Serialize> {
|
||||
pub miniconf: miniconf::MqttClient<S, NetworkReference, SystemTimer, 512>,
|
||||
pub processor: NetworkProcessor,
|
||||
stream: DataStream,
|
||||
@@ -53,7 +53,7 @@ pub struct NetworkUsers<S: Default + Miniconf + Clone, T: Serialize> {
|
||||
|
||||
impl<S, T> NetworkUsers<S, T>
|
||||
where
|
||||
- S: Default + Miniconf + Clone,
|
||||
+ S: Miniconf + Clone,
|
||||
T: Serialize,
|
||||
{
|
||||
/// Construct Stabilizer's default network users.
|
||||
@@ -65,6 +65,7 @@ where
|
||||
/// * `app` - The name of the application.
|
||||
/// * `mac` - The MAC address of the network.
|
||||
/// * `broker` - The IP address of the MQTT broker to use.
|
||||
+ /// * `settings` - The initial settings value
|
||||
///
|
||||
/// # Returns
|
||||
/// A new struct of network users.
|
||||
@@ -75,6 +76,7 @@ where
|
||||
app: &str,
|
||||
mac: smoltcp_nal::smoltcp::wire::EthernetAddress,
|
||||
broker: IpAddr,
|
||||
+ settings: S,
|
||||
) -> Self {
|
||||
let stack_manager =
|
||||
cortex_m::singleton!(: NetworkManager = NetworkManager::new(stack))
|
||||
@@ -91,7 +93,7 @@ where
|
||||
&prefix,
|
||||
broker,
|
||||
clock,
|
||||
- S::default(),
|
||||
+ settings,
|
||||
)
|
||||
.unwrap();
|
||||
|
||||
diff --git a/src/net/telemetry.rs b/src/net/telemetry.rs
|
||||
index c6e071f17..e35347037 100644
|
||||
--- a/src/net/telemetry.rs
|
||||
+++ b/src/net/telemetry.rs
|
||||
@@ -58,6 +58,23 @@ pub struct Telemetry {
|
||||
|
||||
/// The CPU temperature in degrees Celsius.
|
||||
pub cpu_temp: f32,
|
||||
+
|
||||
+ /// Measurements related to Pounder
|
||||
+ pub pounder: Option<PounderTelemetry>,
|
||||
+}
|
||||
+
|
||||
+/// The structure that holds the telemetry related to Pounder.
|
||||
+///
|
||||
+/// # Note
|
||||
+/// This structure should be generated on-demand by the buffer when required to minimize conversion
|
||||
+/// overhead.
|
||||
+#[derive(Copy, Clone, Serialize)]
|
||||
+pub struct PounderTelemetry {
|
||||
+ /// The Pounder temperature in degrees Celsius
|
||||
+ pub temperature: f32,
|
||||
+
|
||||
+ /// The detected RF power into IN channels
|
||||
+ pub input_power: [f32; 2],
|
||||
}
|
||||
|
||||
impl Default for TelemetryBuffer {
|
||||
@@ -77,10 +94,17 @@ impl TelemetryBuffer {
|
||||
/// * `afe0` - The current AFE configuration for channel 0.
|
||||
/// * `afe1` - The current AFE configuration for channel 1.
|
||||
/// * `cpu_temp` - The current CPU temperature.
|
||||
+ /// * `pounder` - The current Pounder telemetry.
|
||||
///
|
||||
/// # Returns
|
||||
/// The finalized telemetry structure that can be serialized and reported.
|
||||
- pub fn finalize(self, afe0: Gain, afe1: Gain, cpu_temp: f32) -> Telemetry {
|
||||
+ pub fn finalize(
|
||||
+ self,
|
||||
+ afe0: Gain,
|
||||
+ afe1: Gain,
|
||||
+ cpu_temp: f32,
|
||||
+ pounder: Option<PounderTelemetry>,
|
||||
+ ) -> Telemetry {
|
||||
let in0_volts = Into::<f32>::into(self.adcs[0]) / afe0.as_multiplier();
|
||||
let in1_volts = Into::<f32>::into(self.adcs[1]) / afe1.as_multiplier();
|
||||
|
||||
@@ -89,6 +113,7 @@ impl TelemetryBuffer {
|
||||
adcs: [in0_volts, in1_volts],
|
||||
dacs: [self.dacs[0].into(), self.dacs[1].into()],
|
||||
digital_inputs: self.digital_inputs,
|
||||
+ pounder,
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,54 +0,0 @@
|
|||
{ config, pkgs, lib, ... }:
|
||||
with lib;
|
||||
let
|
||||
makeBackup = pkgs.writeScript "make-backup" ''
|
||||
#!${pkgs.bash}/bin/bash
|
||||
|
||||
set -e
|
||||
umask 0077
|
||||
|
||||
DBDUMPDIR=`mktemp -d`
|
||||
pushd $DBDUMPDIR
|
||||
|
||||
${config.services.mysql.package}/bin/mysqldump --single-transaction flarum > flarum.sql
|
||||
${pkgs.sudo}/bin/sudo -u mattermost ${config.services.postgresql.package}/bin/pg_dump mattermost > mattermost.sql
|
||||
|
||||
${pkgs.gnutar}/bin/tar cf - --exclude "/var/lib/gitea/repositories/*/*.git/archives" /etc/nixos /var/lib/gitea flarum.sql mattermost.sql | \
|
||||
${pkgs.bzip2}/bin/bzip2 | \
|
||||
${pkgs.gnupg}/bin/gpg --symmetric --batch --passphrase-file /etc/nixos/secret/backup-passphrase | \
|
||||
${pkgs.rclone}/bin/rclone rcat --config /etc/nixos/secret/rclone.conf dropbox:backup-`date +%F`.tar.bz2.gpg
|
||||
|
||||
popd
|
||||
rm -rf $DBDUMPDIR
|
||||
|
||||
echo Backup done
|
||||
'';
|
||||
cfg = config.services.mlabs-backup;
|
||||
in
|
||||
{
|
||||
options.services.mlabs-backup = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = false;
|
||||
description = "Enable backups";
|
||||
};
|
||||
};
|
||||
|
||||
config = mkIf cfg.enable {
|
||||
systemd.services.mlabs-backup = {
|
||||
description = "M-Labs backup";
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
User = "root";
|
||||
Group = "root";
|
||||
ExecStart = "${makeBackup}";
|
||||
};
|
||||
};
|
||||
|
||||
systemd.timers.mlabs-backup = {
|
||||
description = "M-Labs backup";
|
||||
wantedBy = [ "timers.target" ];
|
||||
timerConfig.OnCalendar = "weekly";
|
||||
};
|
||||
};
|
||||
}
|
|
@ -1,566 +0,0 @@
|
|||
# Edit this configuration file to define what should be installed on
|
||||
# your system. Help is available in the configuration.nix(5) man page
|
||||
# and in the NixOS manual (accessible by running ‘nixos-help’).
|
||||
|
||||
{ config, pkgs, ... }:
|
||||
|
||||
let
|
||||
netifWan = "enp0s31f6";
|
||||
netifLan = "enp3s0";
|
||||
netifWifi = "wlp4s0";
|
||||
netifSit = "henet0";
|
||||
hydraWwwOutputs = "/var/www/hydra-outputs";
|
||||
in
|
||||
{
|
||||
imports =
|
||||
[
|
||||
./hardware-configuration.nix
|
||||
./homu/nixos-module.nix
|
||||
./backup-module.nix
|
||||
(builtins.fetchTarball {
|
||||
url = "https://gitlab.com/simple-nixos-mailserver/nixos-mailserver/-/archive/v2.2.1/nixos-mailserver-v2.2.1.tar.gz";
|
||||
sha256 = "03d49v8qnid9g9rha0wg2z6vic06mhp0b049s3whccn1axvs2zzx";
|
||||
})
|
||||
];
|
||||
|
||||
# Use the systemd-boot EFI boot loader.
|
||||
boot.loader.systemd-boot.enable = true;
|
||||
boot.loader.efi.canTouchEfiVariables = true;
|
||||
|
||||
security.apparmor.enable = true;
|
||||
|
||||
security.pam.yubico = {
|
||||
enable = true;
|
||||
id = "49094";
|
||||
control = "required";
|
||||
};
|
||||
|
||||
networking = {
|
||||
hostName = "nixbld";
|
||||
firewall = {
|
||||
allowedTCPPorts = [ 80 443 ];
|
||||
allowedUDPPorts = [ 53 67 ];
|
||||
trustedInterfaces = [ netifLan ];
|
||||
};
|
||||
interfaces."${netifLan}" = {
|
||||
ipv4.addresses = [{
|
||||
address = "192.168.1.1";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
ipv6.addresses = [{
|
||||
address = "2001:470:f821:1::";
|
||||
prefixLength = 64;
|
||||
}];
|
||||
};
|
||||
interfaces."${netifWifi}" = {
|
||||
ipv4.addresses = [{
|
||||
address = "192.168.12.1";
|
||||
prefixLength = 24;
|
||||
}];
|
||||
ipv6.addresses = [{
|
||||
address = "2001:470:f821:2::";
|
||||
prefixLength = 64;
|
||||
}];
|
||||
};
|
||||
nat = {
|
||||
enable = true;
|
||||
externalInterface = netifWan;
|
||||
internalInterfaces = [ netifLan netifWifi ];
|
||||
extraCommands = ''
|
||||
iptables -w -N block-lan-from-wifi
|
||||
iptables -w -A block-lan-from-wifi -i ${netifLan} -o ${netifWifi} -j DROP
|
||||
iptables -w -A block-lan-from-wifi -i ${netifWifi} -o ${netifLan} -j DROP
|
||||
iptables -w -A FORWARD -j block-lan-from-wifi
|
||||
'';
|
||||
extraStopCommands = ''
|
||||
iptables -w -D FORWARD -j block-lan-from-wifi 2>/dev/null|| true
|
||||
iptables -w -F block-lan-from-wifi 2>/dev/null|| true
|
||||
iptables -w -X block-lan-from-wifi 2>/dev/null|| true
|
||||
'';
|
||||
};
|
||||
sits."${netifSit}" = {
|
||||
dev = netifWan;
|
||||
remote = "216.218.221.6";
|
||||
local = "42.200.147.171";
|
||||
ttl = 255;
|
||||
};
|
||||
interfaces."${netifSit}".ipv6 = {
|
||||
addresses = [{ address = "2001:470:18:629::2"; prefixLength = 64; }];
|
||||
routes = [{ address = "::"; prefixLength = 0; }];
|
||||
};
|
||||
};
|
||||
boot.kernel.sysctl."net.ipv6.conf.all.forwarding" = "1";
|
||||
boot.kernel.sysctl."net.ipv6.conf.default.forwarding" = "1";
|
||||
|
||||
services.hostapd = {
|
||||
enable = true;
|
||||
interface = netifWifi;
|
||||
hwMode = "g";
|
||||
ssid = "M-Labs";
|
||||
wpaPassphrase = (import /etc/nixos/secret/wifi_password.nix);
|
||||
};
|
||||
services.dnsmasq = {
|
||||
enable = true;
|
||||
extraConfig = ''
|
||||
interface=${netifLan}
|
||||
interface=${netifWifi}
|
||||
bind-interfaces
|
||||
dhcp-range=interface:${netifLan},192.168.1.81,192.168.1.254,24h
|
||||
dhcp-range=interface:${netifWifi},192.168.12.10,192.168.12.254,24h
|
||||
enable-ra
|
||||
dhcp-range=interface:${netifLan},::,constructor:${netifLan},ra-names
|
||||
dhcp-range=interface:${netifWifi},::,constructor:${netifWifi},ra-only
|
||||
|
||||
# Default IP addresses for ARTIQ boards
|
||||
address=/thermostat/192.168.1.26
|
||||
address=/kc705/192.168.1.50
|
||||
address=/zc706/192.168.1.51
|
||||
address=/sayma/192.168.1.60
|
||||
address=/kasli/192.168.1.70
|
||||
# uTCA MCH from NAT
|
||||
address=/tschernobyl/192.168.1.80
|
||||
'';
|
||||
};
|
||||
|
||||
# Select internationalisation properties.
|
||||
i18n = {
|
||||
consoleFont = "Lat2-Terminus16";
|
||||
consoleKeyMap = "de";
|
||||
defaultLocale = "en_US.UTF-8";
|
||||
};
|
||||
|
||||
# Set your time zone.
|
||||
time.timeZone = "Asia/Hong_Kong";
|
||||
|
||||
# List packages installed in system profile. To search, run:
|
||||
# $ nix search wget
|
||||
environment.systemPackages = with pkgs; [
|
||||
wget vim git file lm_sensors acpi pciutils psmisc xc3sprog openocd gdb telnet whois zip unzip nixops
|
||||
irssi tmux adoptopenjdk-openj9-bin-11 tigervnc xorg.xauth icewm xterm xorg.xsetroot usbutils imagemagick jq
|
||||
];
|
||||
|
||||
# Some programs need SUID wrappers, can be configured further or are
|
||||
# started in user sessions.
|
||||
# programs.mtr.enable = true;
|
||||
# programs.gnupg.agent = { enable = true; enableSSHSupport = true; };
|
||||
|
||||
# List services that you want to enable:
|
||||
|
||||
services.apcupsd.enable = true;
|
||||
services.apcupsd.configText = ''
|
||||
UPSTYPE usb
|
||||
NISIP 127.0.0.1
|
||||
BATTERYLEVEL 10
|
||||
MINUTES 5
|
||||
'';
|
||||
|
||||
# Enable the OpenSSH daemon.
|
||||
services.openssh.enable = true;
|
||||
services.openssh.forwardX11 = true;
|
||||
programs.mosh.enable = true;
|
||||
|
||||
programs.fish.enable = true;
|
||||
|
||||
# Enable CUPS to print documents.
|
||||
services.avahi.enable = true;
|
||||
services.avahi.interfaces = [ netifLan ];
|
||||
services.avahi.publish.enable = true;
|
||||
services.avahi.publish.userServices = true;
|
||||
nixpkgs.config.allowUnfree = true;
|
||||
services.printing.enable = true;
|
||||
services.printing.drivers = [ pkgs.hplipWithPlugin ];
|
||||
services.printing.browsing = true;
|
||||
services.printing.listenAddresses = [ "*:631" ];
|
||||
services.printing.defaultShared = true;
|
||||
hardware.sane.enable = true;
|
||||
hardware.sane.extraBackends = [ pkgs.hplipWithPlugin ];
|
||||
|
||||
users.extraGroups.plugdev = { };
|
||||
users.extraUsers.sb = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel" "plugdev" "dialout" "lp" "scanner"];
|
||||
shell = pkgs.fish;
|
||||
};
|
||||
users.extraUsers.rj = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["wheel" "plugdev" "dialout"];
|
||||
};
|
||||
users.extraUsers.astro = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["plugdev" "dialout"];
|
||||
};
|
||||
users.extraUsers.whitequark = {
|
||||
isNormalUser = true;
|
||||
extraGroups = ["plugdev" "dialout"];
|
||||
};
|
||||
users.extraUsers.nix = {
|
||||
isNormalUser = true;
|
||||
};
|
||||
security.sudo.wheelNeedsPassword = false;
|
||||
security.hideProcessInformation = true;
|
||||
boot.kernel.sysctl."kernel.dmesg_restrict" = true;
|
||||
services.udev.packages = [ pkgs.openocd pkgs.sane-backends ];
|
||||
services.udev.extraRules = ''
|
||||
ACTION=="add", SUBSYSTEM=="tty", \
|
||||
ENV{ID_SERIAL}=="FTDI_Quad_RS232-HS", \
|
||||
ENV{ID_PATH}=="pci-0000:00:14.0-usb-0:5:1.1", \
|
||||
SYMLINK+="ttyUSB_sayma-1_0"
|
||||
ACTION=="add", SUBSYSTEM=="tty", \
|
||||
ENV{ID_SERIAL}=="FTDI_Quad_RS232-HS", \
|
||||
ENV{ID_PATH}=="pci-0000:00:14.0-usb-0:5:1.2", \
|
||||
SYMLINK+="ttyUSB_sayma-1_1"
|
||||
|
||||
ACTION=="add", SUBSYSTEM=="tty", \
|
||||
ENV{ID_SERIAL}=="FTDI_Quad_RS232-HS", \
|
||||
ENV{ID_PATH}=="pci-0000:00:14.0-usb-0:1:1.2", \
|
||||
SYMLINK+="ttyUSB_kasli-n1"
|
||||
|
||||
'';
|
||||
|
||||
nix.distributedBuilds = true;
|
||||
nix.buildMachines = [
|
||||
{
|
||||
hostName = "localhost";
|
||||
maxJobs = 4;
|
||||
system = "x86_64-linux";
|
||||
supportedFeatures = ["big-parallel"];
|
||||
}
|
||||
{
|
||||
hostName = "rpi-3";
|
||||
sshUser = "nix";
|
||||
sshKey = "/etc/nixos/secret/nix_id_rsa";
|
||||
maxJobs = 1;
|
||||
system = "aarch64-linux";
|
||||
}
|
||||
];
|
||||
services.hydra = {
|
||||
enable = true;
|
||||
useSubstitutes = true;
|
||||
hydraURL = "https://nixbld.m-labs.hk";
|
||||
notificationSender = "hydra@m-labs.hk";
|
||||
minimumDiskFree = 15; # in GB
|
||||
minimumDiskFreeEvaluator = 1;
|
||||
extraConfig =
|
||||
''
|
||||
binary_cache_secret_key_file = /etc/nixos/secret/nixbld.m-labs.hk-1
|
||||
max_output_size = 10000000000
|
||||
|
||||
<runcommand>
|
||||
job = web:web:web
|
||||
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/web
|
||||
</runcommand>
|
||||
<runcommand>
|
||||
job = artiq:full:artiq-manual-html
|
||||
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/artiq-manual-html-beta
|
||||
</runcommand>
|
||||
<runcommand>
|
||||
job = artiq:full:artiq-manual-latexpdf
|
||||
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/artiq-manual-latexpdf-beta
|
||||
</runcommand>
|
||||
<runcommand>
|
||||
job = artiq:full:conda-channel
|
||||
command = [ $(jq '.buildStatus' < $HYDRA_JSON) = 0 ] && ln -sfn $(jq -r '.outputs[0].path' < $HYDRA_JSON) ${hydraWwwOutputs}/artiq-conda-channel-beta
|
||||
</runcommand>
|
||||
'';
|
||||
};
|
||||
systemd.services.hydra-www-outputs-init = {
|
||||
description = "Set up a hydra-owned directory for build outputs";
|
||||
wantedBy = [ "multi-user.target" ];
|
||||
requiredBy = [ "hydra-queue-runner.service" ];
|
||||
before = [ "hydra-queue-runner.service" ];
|
||||
serviceConfig = {
|
||||
Type = "oneshot";
|
||||
ExecStart = [ "${pkgs.coreutils}/bin/mkdir -p ${hydraWwwOutputs}" "${pkgs.coreutils}/bin/chown hydra-queue-runner:hydra ${hydraWwwOutputs}" ];
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
nix.extraOptions = ''
|
||||
secret-key-files = /etc/nixos/secret/nixbld.m-labs.hk-1
|
||||
'';
|
||||
nix.sandboxPaths = ["/opt"];
|
||||
|
||||
services.munin-node.enable = true;
|
||||
services.munin-cron = {
|
||||
enable = true;
|
||||
hosts = ''
|
||||
[${config.networking.hostName}]
|
||||
address localhost
|
||||
'';
|
||||
};
|
||||
services.mlabs-backup.enable = true;
|
||||
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
httpPort = 3001;
|
||||
rootUrl = "https://git.m-labs.hk/";
|
||||
appName = "M-Labs Git";
|
||||
cookieSecure = true;
|
||||
disableRegistration = true;
|
||||
extraConfig =
|
||||
''
|
||||
[attachment]
|
||||
ALLOWED_TYPES = */*
|
||||
'';
|
||||
};
|
||||
|
||||
services.mattermost = {
|
||||
enable = true;
|
||||
siteUrl = "https://chat.m-labs.hk/";
|
||||
mutableConfig = true;
|
||||
};
|
||||
|
||||
services.matterbridge = {
|
||||
enable = true;
|
||||
configPath = "/etc/nixos/secret/matterbridge.toml";
|
||||
};
|
||||
|
||||
nixpkgs.config.packageOverrides = super: let self = super.pkgs; in {
|
||||
hydra = super.hydra.overrideAttrs(oa: {
|
||||
patches = oa.patches or [] ++ [ ./hydra-conda.patch ./hydra-retry.patch ];
|
||||
hydraPath = oa.hydraPath + ":" + super.lib.makeBinPath [ super.jq ];
|
||||
});
|
||||
matterbridge = super.matterbridge.overrideAttrs(oa: {
|
||||
patches = oa.patches or [] ++ [ ./matterbridge-disable-github.patch ];
|
||||
});
|
||||
nixops = super.nixops.overrideAttrs(oa: {
|
||||
patches = oa.patches or [] ++ [ ./nixops-665.patch ];
|
||||
});
|
||||
};
|
||||
|
||||
security.acme.certs = {
|
||||
"nixbld.m-labs.hk" = {
|
||||
webroot = "/var/lib/acme/acme-challenge";
|
||||
extraDomains = {
|
||||
"m-labs.hk" = null;
|
||||
"www.m-labs.hk" = null;
|
||||
"conda.m-labs.hk" = null;
|
||||
"lab.m-labs.hk" = null;
|
||||
"git.m-labs.hk" = null;
|
||||
"chat.m-labs.hk" = null;
|
||||
"hooks.m-labs.hk" = null;
|
||||
"forum.m-labs.hk" = null;
|
||||
"perso.m-labs.hk" = null;
|
||||
|
||||
"openhardware.hk" = null;
|
||||
"git.openhardware.hk" = null;
|
||||
};
|
||||
};
|
||||
};
|
||||
services.nginx = {
|
||||
enable = true;
|
||||
recommendedProxySettings = true;
|
||||
recommendedGzipSettings = true;
|
||||
virtualHosts = let
|
||||
mainWebsite = {
|
||||
addSSL = true;
|
||||
useACMEHost = "nixbld.m-labs.hk";
|
||||
root = "${hydraWwwOutputs}/web";
|
||||
extraConfig = ''
|
||||
error_page 404 /404.html;
|
||||
'';
|
||||
locations."^~ /fonts/".extraConfig = ''
|
||||
expires 60d;
|
||||
'';
|
||||
locations."^~ /js/".extraConfig = ''
|
||||
expires 60d;
|
||||
'';
|
||||
locations."/MathJax/" = {
|
||||
alias = "/var/www/MathJax/";
|
||||
extraConfig = ''
|
||||
expires 60d;
|
||||
'';
|
||||
};
|
||||
|
||||
# legacy URLs, redirect to avoid breaking people's bookmarks
|
||||
locations."/gateware.html".extraConfig = ''
|
||||
return 301 /gateware/migen/;
|
||||
'';
|
||||
locations."/migen".extraConfig = ''
|
||||
return 301 /gateware/migen/;
|
||||
'';
|
||||
locations."/artiq".extraConfig = ''
|
||||
return 301 /experiment-control/artiq/;
|
||||
'';
|
||||
locations."/artiq/resources.html".extraConfig = ''
|
||||
return 301 /experiment-control/resources/;
|
||||
'';
|
||||
|
||||
# autogenerated ARTIQ manuals
|
||||
locations."/artiq/manual-beta/" = {
|
||||
alias = "${hydraWwwOutputs}/artiq-manual-html-beta/share/doc/artiq-manual/html/";
|
||||
};
|
||||
locations."=/artiq/manual-beta.pdf" = {
|
||||
alias = "${hydraWwwOutputs}/artiq-manual-latexpdf-beta/share/doc/artiq-manual/ARTIQ.pdf";
|
||||
};
|
||||
|
||||
# legacy content
|
||||
locations."/migen/manual/" = {
|
||||
alias = "/var/www/m-labs.hk.old/migen/manual/";
|
||||
};
|
||||
locations."/artiq/manual/" = {
|
||||
alias = "/var/www/m-labs.hk.old/artiq/manual-release-4/";
|
||||
};
|
||||
locations."/artiq/manual-release-4/" = {
|
||||
alias = "/var/www/m-labs.hk.old/artiq/manual-release-4/";
|
||||
};
|
||||
locations."/artiq/manual-release-3/" = {
|
||||
alias = "/var/www/m-labs.hk.old/artiq/manual-release-3/";
|
||||
};
|
||||
};
|
||||
in {
|
||||
"m-labs.hk" = mainWebsite;
|
||||
"www.m-labs.hk" = mainWebsite;
|
||||
"lab.m-labs.hk" = {
|
||||
addSSL = true;
|
||||
useACMEHost = "nixbld.m-labs.hk";
|
||||
locations."/munin/".alias = "/var/www/munin/";
|
||||
locations."/munin".extraConfig = ''
|
||||
auth_basic "Munin";
|
||||
auth_basic_user_file /etc/nixos/secret/muninpasswd;
|
||||
'';
|
||||
locations."/homu/".proxyPass = "http://127.0.0.1:54856/";
|
||||
};
|
||||
"nixbld.m-labs.hk" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "nixbld.m-labs.hk";
|
||||
locations."/".proxyPass = "http://127.0.0.1:3000";
|
||||
};
|
||||
"conda.m-labs.hk" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "nixbld.m-labs.hk";
|
||||
locations."/artiq-beta/" = {
|
||||
alias = "${hydraWwwOutputs}/artiq-conda-channel-beta/";
|
||||
extraConfig = ''
|
||||
autoindex on;
|
||||
index bogus_index_file;
|
||||
'';
|
||||
};
|
||||
};
|
||||
"git.m-labs.hk" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "nixbld.m-labs.hk";
|
||||
locations."/".proxyPass = "http://127.0.0.1:3001";
|
||||
extraConfig = ''
|
||||
client_max_body_size 300M;
|
||||
'';
|
||||
};
|
||||
"chat.m-labs.hk" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "nixbld.m-labs.hk";
|
||||
locations."/".proxyPass = "http://127.0.0.1:8065";
|
||||
locations."~ /api/v[0-9]+/(users/)?websocket$".proxyPass = "http://127.0.0.1:8065";
|
||||
locations."~ /api/v[0-9]+/(users/)?websocket$".proxyWebsockets = true;
|
||||
};
|
||||
"hooks.m-labs.hk" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "nixbld.m-labs.hk";
|
||||
locations."/".extraConfig = ''
|
||||
include ${pkgs.nginx}/conf/uwsgi_params;
|
||||
uwsgi_pass unix:${config.services.uwsgi.runDir}/uwsgi.sock;
|
||||
'';
|
||||
};
|
||||
"forum.m-labs.hk" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "nixbld.m-labs.hk";
|
||||
root = "/var/www/flarum/public";
|
||||
locations."~ \.php$".extraConfig = ''
|
||||
fastcgi_pass unix:${config.services.phpfpm.pools.flarum.socket};
|
||||
fastcgi_index index.php;
|
||||
'';
|
||||
extraConfig = ''
|
||||
index index.php;
|
||||
include /var/www/flarum/.nginx.conf;
|
||||
'';
|
||||
};
|
||||
"perso.m-labs.hk" = {
|
||||
addSSL = true;
|
||||
useACMEHost = "nixbld.m-labs.hk";
|
||||
root = "/var/www/perso";
|
||||
};
|
||||
|
||||
"git.openhardware.hk" = {
|
||||
forceSSL = true;
|
||||
useACMEHost = "nixbld.m-labs.hk";
|
||||
locations."/".proxyPass = "http://127.0.0.1:3002";
|
||||
extraConfig = ''
|
||||
client_max_body_size 300M;
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
services.uwsgi = {
|
||||
enable = true;
|
||||
plugins = [ "python3" ];
|
||||
instance = {
|
||||
type = "emperor";
|
||||
vassals = {
|
||||
mattermostgithub = import ./mattermost-github-integration/uwsgi-config.nix { inherit config pkgs; };
|
||||
};
|
||||
};
|
||||
};
|
||||
services.mysql = {
|
||||
enable = true;
|
||||
package = pkgs.mariadb;
|
||||
};
|
||||
services.phpfpm.pools.flarum = {
|
||||
user = "nobody";
|
||||
settings = {
|
||||
"listen.owner" = "nginx";
|
||||
"listen.group" = "nginx";
|
||||
"listen.mode" = "0600";
|
||||
"pm" = "dynamic";
|
||||
"pm.max_children" = 5;
|
||||
"pm.start_servers" = 2;
|
||||
"pm.min_spare_servers" = 1;
|
||||
"pm.max_spare_servers" = 3;
|
||||
"pm.max_requests" = 500;
|
||||
};
|
||||
};
|
||||
|
||||
services.homu = {
|
||||
enable = true;
|
||||
config = "/etc/nixos/secret/homu.toml";
|
||||
};
|
||||
|
||||
mailserver = {
|
||||
enable = true;
|
||||
localDnsResolver = false; # conflicts with dnsmasq
|
||||
# Some mail servers do reverse DNS lookups to filter spam.
|
||||
# Getting a proper reverse DNS record from ISP is difficult, so use whatever already exists.
|
||||
fqdn = "42-200-147-171.static.imsbiz.com";
|
||||
domains = [ "nmigen.org" ];
|
||||
loginAccounts = (import /etc/nixos/secret/email_accounts.nix);
|
||||
certificateScheme = 3;
|
||||
};
|
||||
security.acme.certs."${config.mailserver.fqdn}".extraDomains = {
|
||||
"mail.nmigen.org" = null;
|
||||
};
|
||||
|
||||
containers.openhardwarehk = {
|
||||
autoStart = true;
|
||||
config =
|
||||
{ config, pkgs, ... }:
|
||||
{
|
||||
services.gitea = {
|
||||
enable = true;
|
||||
httpPort = 3002;
|
||||
rootUrl = "https://git.openhardware.hk/";
|
||||
appName = "Open Hardware HK";
|
||||
cookieSecure = true;
|
||||
disableRegistration = true;
|
||||
extraConfig =
|
||||
''
|
||||
[attachment]
|
||||
ALLOWED_TYPES = */*
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
# This value determines the NixOS release with which your system is to be
|
||||
# compatible, in order to avoid breaking some software such as database
|
||||
# servers. You should change this only after NixOS release notes say you
|
||||
# should.
|
||||
system.stateVersion = "18.09"; # Did you read the comment?
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue