Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

New Formula: websockify 0.6.0 #36643

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions Library/Formula/websockify.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
class Websockify < Formula
desc "Websockify allows the tunnelling of TCP traffic over WebSockets"
homepage "https://github.com/kanaka/websockify"
url "https://github.com/kanaka/websockify/archive/v0.6.0.tar.gz"
sha256 "aeb1bb0079696611045d2f188f38b68c8a4cc50e3c229db9156806c0078d608e"

if MacOS.version <= :snow_leopard
depends_on :python
depends_on "numpy" => :python
end
depends_on "openssl"

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No Python resources required?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apparently not, but I'm not a Python brew expert...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Check the upstream Git for either a requirements.txt file or if that doesn't exist open the setup.py file and see if any other Python modules are listed as required. I'd be surprised if there was nothing as a resource needed here.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tdsmith may be able to help with anything Python-esque if you have any questions on the way Brew handles Python formulae. He's the Python expert around Brew :)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, will explore

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's no requirements.txt but there does seem to be a install_requires=['numpy'] in setup.py. However, that seems to already be part of Mavericks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it part of the other OS X versions as well? If it isn't you may need to create a conditional resource, along the lines of:

resource "numpy" do
  url "blah"
  sha1 "blah"
end

and then:

def install
   if MacOS.version =< :lion
      resource("numpy").stage do
        python.blah
      end
   end

Or similar. Tim will probably be able to tell you how widely available numpy is on the OS X versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will investigate. Ta for the code snippet.
On 8 Feb 2015 12:12, "Dominyk Tiller" notifications@github.com wrote:

In Library/Formula/websockify.rb
#36643 (comment):

@@ -0,0 +1,70 @@
+require "FileUtils"
+
+class Websockify < Formula

  • depends_on :python if MacOS.version <= :snow_leopard

Is it part of the other OS X versions as well? If it isn't you may need to
create a conditional resource, along the lines of:

resource "numpy" do
url "blah"
sha1 "blah"
end

and then:

def install
if MacOS.version =< :lion
resource("numpy").stage do
python.blah
end
end

Or similar. Tim will probably be able to tell you how widely available
numpy is on the OS X versions.


Reply to this email directly or view it on GitHub
https://github.com/Homebrew/homebrew/pull/36643/files#r24296324.

def install
system "make"
system "make", "-C", "other"

ENV.prepend_create_path "PYTHONPATH", libexec/"lib/python2.7/site-packages"
system "python", *Language::Python.setup_install_args(libexec)
bin.install Dir["#{libexec}/bin/*"]
bin.env_script_all_files(libexec/"bin", :PYTHONPATH => ENV["PYTHONPATH"])

# Install C version of websockify
bin.install "other/websockify" => "websockify-c"

man1.install "docs/websockify.1" => "websockify.1"

(doc+"websockify").install "docs"

# Upstream Bug: Not named ".dylib"
# Issue: https://github.com/kanaka/websockify/issues/156
lib.install "rebind.so" => "rebind.dylib"

# rmdir, not rm_r, as this is genuinely empty and we want to fail if the tarball
# ever changes in a new release
rmdir "include/web-socket-js-project"

(share+"websockify"+"client").install "wsirc.html", "wstelnet.html", "include"

(share+"websockify").install "other/js" => "node-js"

(share+"websockify"+"ruby").install "other/websocket.rb", "other/websockify.rb"

(share+"websockify"+"clojure").install "other/project.clj", "other/websockify.clj"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the spacing between all the .installs that don't have comments above them, thanks!


# Binaries not installed in bin (as bin.install ):-
# - rebind: coding of discovery of rebind.so needs re-writing
# - other/wswrap: dependency wswrapper.so seems to be missing
# - other/launch.sh: coding of path discovery of dependencies is just too weird to work
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If these are useless/unfixable/etc you can just rm them, probably.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copied into share for now as rebind is used occasionally. However, it would need a complete re-write to actually be FHS friendly...

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you elaborate there a bit? Sounds like a good reason to remove them.

(share+"websockify"+"scripts").install "rebind", "other/wswrap" => "wswrap", "other/launch.sh" => "launch.sh"
end

# This test will fail if either of the ports 50000 or 500001 are in use
test do
system "websockify", "--timeout=1", "127.0.0.1:50000", "127.0.0.1:50001"
end
end