Skip to content

Commit

Permalink
miniserve 0.5.0
Browse files Browse the repository at this point in the history
Closes Homebrew#41304.

Signed-off-by: Thierry Moisan <thierry.moisan@gmail.com>
  • Loading branch information
chenrui333 authored and Moisan committed Aug 27, 2019
1 parent 3a535d1 commit f2a78cb
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions Formula/miniserve.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
class Miniserve < Formula
desc "High performance static file server"
homepage "https://github.com/svenstaro/miniserve"
url "https://github.com/svenstaro/miniserve/archive/v0.3.0.tar.gz"
sha256 "80ee5d661730ddad14671f961b560467f3b3a9f0544b9b11dec65098eb4a1f7e"
url "https://github.com/svenstaro/miniserve/archive/v0.5.0.tar.gz"
sha256 "5b7c91bdf35e1a17ca006efa0354712301886c5c50952a2162401aef77faced0"

bottle do
cellar :any_skip_relocation
Expand All @@ -11,9 +11,19 @@ class Miniserve < Formula
sha256 "a00b82cfce9fecd067b62ec3135a0e9cc59d3133f97ed3c0e7b815e4921c32d0" => :sierra
end

depends_on "rust" => :build
depends_on "openssl"

# Miniserve requires a known-good Rust nightly release to use.
resource "rust-nightly" do
url "https://static.rust-lang.org/dist/2019-08-24/rust-nightly-x86_64-apple-darwin.tar.xz"
sha256 "104ddea51b758f4962960097e9e0f3cabf2c671ec3148bc745344431bb93605d"
end

def install
resource("rust-nightly").stage do
system "./install.sh", "--prefix=#{buildpath}/rust-nightly"
ENV.prepend_path "PATH", "#{buildpath}/rust-nightly/bin"
end
system "cargo", "install", "--root", prefix, "--path", "."
end

Expand All @@ -25,7 +35,7 @@ def install
server.close

pid = fork do
exec "#{bin}/miniserve", "#{bin}/miniserve", "--if", "127.0.0.1", "--port", port.to_s
exec "#{bin}/miniserve", "#{bin}/miniserve", "-i", "127.0.0.1", "--port", port.to_s
end

sleep 2
Expand Down

0 comments on commit f2a78cb

Please sign in to comment.