2017-02-19 18:57:16 -05:00
|
|
|
;; -*- no-byte-compile: t; -*-
|
|
|
|
;;; lang/rust/packages.el
|
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(package! racer)
|
|
|
|
(package! rust-mode)
|
2017-02-19 18:57:16 -05:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(when (featurep! :feature syntax-checker)
|
|
|
|
(package! flycheck-rust))
|
2017-03-19 22:47:50 -04:00
|
|
|
|
2017-02-23 00:06:12 -05:00
|
|
|
(when (featurep! :completion company)
|
|
|
|
(package! company-racer))
|
2017-03-20 15:55:58 -04:00
|
|
|
|
|
|
|
;;
|
|
|
|
(def-bootstrap! rust
|
|
|
|
(pcase (doom-system-os)
|
|
|
|
('arch
|
|
|
|
(let (pkgs)
|
|
|
|
(unless (executable-find "rustc") (push "rust" pkgs))
|
|
|
|
(unless (executable-find "cargo") (push "cargo" pkgs))
|
|
|
|
(when pkgs
|
|
|
|
(sudo "pacman --noconfirm -S %s" (string-join pkgs " ")))))
|
|
|
|
('debian) ;; TODO
|
|
|
|
('macos
|
|
|
|
(unless (executable-find "rustc")
|
|
|
|
(sh "brew install rust"))))
|
|
|
|
|
|
|
|
(dolist (bin '("rustc" "cargo"))
|
|
|
|
(unless (executable-find bin)
|
|
|
|
(error "Failed to install %s" bin)))
|
|
|
|
|
|
|
|
(require! :lang rust t)
|
|
|
|
(require 'racer)
|
|
|
|
(and (unless (file-directory-p racer-rust-src-path)
|
|
|
|
(fetch :github "rust-lang/rust" (expand-file-name "rust" +rust-ext-dir))
|
|
|
|
t)
|
|
|
|
(unless (file-executable-p racer-cmd)
|
|
|
|
(let ((racer-dir (expand-file-name "racer" +rust-ext-dir)))
|
|
|
|
(fetch :github "phildawes/racer" racer-dir)
|
|
|
|
(let ((default-directory racer-dir))
|
|
|
|
(sh "cargo build --release"))
|
|
|
|
t))))
|