Skip to content
This repository was archived by the owner on Jun 25, 2020. It is now read-only.

Checking for Windows support#4

Open
vermluh wants to merge 7 commits into
bitboxer:masterfrom
vermluh:master
Open

Checking for Windows support#4
vermluh wants to merge 7 commits into
bitboxer:masterfrom
vermluh:master

Conversation

@vermluh
Copy link
Copy Markdown

@vermluh vermluh commented Jun 5, 2013

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

@bitboxer
Copy link
Copy Markdown
Owner

bitboxer commented Jun 5, 2013

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 😉

@vermluh
Copy link
Copy Markdown
Author

vermluh commented Jun 7, 2013

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

Regards

@bitboxer
Copy link
Copy Markdown
Owner

bitboxer commented Jun 7, 2013

Perfect. Thanks again!

@bitboxer
Copy link
Copy Markdown
Owner

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.

@vermluh
Copy link
Copy Markdown
Author

vermluh commented Jun 25, 2013

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

@bitboxer
Copy link
Copy Markdown
Owner

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

@vermluh
Copy link
Copy Markdown
Author

vermluh commented Jun 27, 2013

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

@bitboxer
Copy link
Copy Markdown
Owner

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.

@vermluh
Copy link
Copy Markdown
Author

vermluh commented Jun 28, 2013

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

@bitboxer
Copy link
Copy Markdown
Owner

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

@vermluh
Copy link
Copy Markdown
Author

vermluh commented Jan 30, 2014

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

@bitboxer
Copy link
Copy Markdown
Owner

No worries.

@vermluh
Copy link
Copy Markdown
Author

vermluh commented Feb 4, 2014

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants