simple_progressbar icon indicating copy to clipboard operation
simple_progressbar copied to clipboard

Checking for Windows support

Open vermluh opened this issue 12 years ago • 13 comments

Hi,

I'm using SimpleProgressbar in an Windows Environment. Therefor I'm checking whether 'win32console' gem was installed, because otherwise the console output will be kind of strange ;-)

consoleoutput

Regards

vermluh avatar Jun 05 '13 13:06 vermluh

Thanks for this!

Can you add the windows gem into the dependencies of the Gemspec? Maybe something like this will work:

spec.add_dependency 'eventmachine-win32', '0.12.10' if spec.platform.to_s == 'x86-mswin32'

please try it before pushing, I don't have a windows machine and this is just a wild guess :wink:

bitboxer avatar Jun 05 '13 15:06 bitboxer

Ok, I'll try to have a look at it next weekend.

Regards

vermluh avatar Jun 07 '13 08:06 vermluh

Perfect. Thanks again!

bitboxer avatar Jun 07 '13 08:06 bitboxer

Just a quick note: I am moving to Berlin in the next few days. Maybe I won't be able to answer as quickly as I usually do. But I am really looking forward to this patch.

bitboxer avatar Jun 13 '13 09:06 bitboxer

Finally I found the time to add Windows specific reference gems to jeweler task in Rakefile. I tried the resulting gem on Ubuntu12.04 and Win7. On Windows win32console gem was installed, whereas on Ubuntu it was left out. I had no chance to test any Mac environments, but I think it should work there too.

Regards

vermluh avatar Jun 25 '13 06:06 vermluh

Have you tried the version I mentioned in my comment? Did you have problems with that?

bitboxer avatar Jun 25 '13 07:06 bitboxer

No problem with your version, but it will result in two different gems: one windows specific and one for all other environments. That is because 'spec.add_dependency' will be evaluated at gem build time and in order to make it work you need to set 'spec.platform' to a value different than Gem::Platform::Ruby, which will result in a special gem version for this particular 'platform' string (http://docs.rubygems.org/read/chapter/20#platform). By using the native extensions mechanism you can still keep one single gem file for all platforms. Therefor I chose this approach.

Regards

vermluh avatar Jun 27 '13 07:06 vermluh

Does your approach work with bundler? Do you see the win32console in the Gemfile.lock of projects using that gem? Sorry for all the questions, but my gut has problems with your solution.

bitboxer avatar Jun 27 '13 07:06 bitboxer

No problem ;-) I'll try it next weekend.

vermluh avatar Jun 28 '13 03:06 vermluh

@vermluh have you found time to test the bundler gemfile?

bitboxer avatar Jan 23 '14 14:01 bitboxer

I'm sorry, but I totally missed it due to lots of other projects going on. I'll try to test bundler on windows and Linux next weekend.

Apologizing once more vermluh

vermluh avatar Jan 30 '14 07:01 vermluh

No worries.

bitboxer avatar Jan 30 '14 08:01 bitboxer

You were right. Bundler somehow seems to ignore gem extensions, whereas using simple gem install... will install the defined extensions on windows and leave them out on other systems. I will revert the changes regarding mkrf_conf.rb

Regards

vermluh avatar Feb 04 '14 07:02 vermluh