larsch / ocra

One-Click Ruby Application Builder
http://ocra.rubyforge.org/
833 stars 84 forks source link

Windows/cygwin support #150

Closed avengerx closed 4 years ago

avengerx commented 4 years ago

This seems not really a demanded matter, but, as cygwin runs on top of windows, it might be reasonably feasible to add support to.

It currently breaks the same way linux does, according to #96, and #98. Perhaps a test at that point it breaks could be used to throw a more helpful exception saying ocra is not supported in OS'es not windows; as it is installable in any system it seems.

To reproduce the issue, just install cygwin with ruby packages (including 'gem'), and them gem install ocra; when trying to build the executable for any gem you may have installed, it will break with:

/home/avenger/.gem/ruby/2.3.0/gems/ocra-1.3.10/bin/ocra:42:in `relative_path_from': undefined method `path' for "/home/avenger/.gem/ruby/2.3.0":String (NoMethodError)
        from /home/avenger/.gem/ruby/2.3.0/gems/ocra-1.3.10/bin/ocra:787:in `block in build_exe'
        from /home/avenger/.gem/ruby/2.3.0/gems/ocra-1.3.10/bin/ocra:770:in `each'
        from /home/avenger/.gem/ruby/2.3.0/gems/ocra-1.3.10/bin/ocra:770:in `build_exe'
        from /home/avenger/.gem/ruby/2.3.0/gems/ocra-1.3.10/bin/ocra:1203:in `block in <top (required)>'

Albeit the paths reads exactly like they would on linux, there are good means to detect cygwin environment, and commandline tools to convert between linux and windows path syntax.

That's just a suggestion, as we didn't have this issue down to now, probably not many people care about it. :)

larsch commented 4 years ago

Thanks for the suggestions. I'm not going to work on it, but if someone is willing, I'd accept resonable patches that aren't complete rewrite if they make life on Cygwin/Linux easier. Note though all autodetection (like DLL's, .so's) wont work when not being able to run the script on native Windows won't work. Adding all dependencies would be manual work.