nim: adding tools.
Building and adding tools 'nimble', 'nimgrep' and 'nimsuggest', which are part of the core nim tree. Added a small test to make sure the basic nimble behavior works. Closes #5922. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
605d3a4507
commit
ebf7dcc087
1 changed files with 20 additions and 0 deletions
|
@ -20,8 +20,19 @@ class Nim < Formula
|
||||||
end
|
end
|
||||||
system "/bin/sh", "install.sh", prefix
|
system "/bin/sh", "install.sh", prefix
|
||||||
|
|
||||||
|
system "bin/nim e install_tools.nims"
|
||||||
|
|
||||||
|
target = prefix/"nim/bin"
|
||||||
|
target.install "bin/nimble"
|
||||||
|
target.install "dist/nimble/src/nimblepkg"
|
||||||
|
target.install "bin/nimgrep"
|
||||||
|
target.install "bin/nimsuggest"
|
||||||
|
|
||||||
bin.install_symlink prefix/"nim/bin/nim"
|
bin.install_symlink prefix/"nim/bin/nim"
|
||||||
bin.install_symlink prefix/"nim/bin/nim" => "nimrod"
|
bin.install_symlink prefix/"nim/bin/nim" => "nimrod"
|
||||||
|
bin.install_symlink prefix/"nim/bin/nimble"
|
||||||
|
bin.install_symlink prefix/"nim/bin/nimgrep"
|
||||||
|
bin.install_symlink prefix/"nim/bin/nimsuggest"
|
||||||
end
|
end
|
||||||
|
|
||||||
test do
|
test do
|
||||||
|
@ -29,5 +40,14 @@ class Nim < Formula
|
||||||
echo("hello")
|
echo("hello")
|
||||||
EOS
|
EOS
|
||||||
assert_equal "hello", shell_output("#{bin}/nim compile --verbosity:0 --run #{testpath}/hello.nim").chomp
|
assert_equal "hello", shell_output("#{bin}/nim compile --verbosity:0 --run #{testpath}/hello.nim").chomp
|
||||||
|
|
||||||
|
(testpath/"hello.nimble").write <<-EOS.undent
|
||||||
|
version = "0.1.0"
|
||||||
|
author = "Author Name"
|
||||||
|
description = "A test nimble package"
|
||||||
|
license = "MIT"
|
||||||
|
requires "nim >= 0.15.0"
|
||||||
|
EOS
|
||||||
|
assert_equal "name: \"hello\"", shell_output("#{bin}/nimble dump").split("\n")[0].chomp
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue