Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detect shared-mime-info being installed in mingw32/mingw64 environments #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

ziggythehamster
Copy link

Windows users can pacman -S mingw-w64-x86_64-shared-mime-info if they're running MSYS2 and then this gem will require no manual configuration. Should I add that to the README too?

@jellybob
Copy link
Member

I've honestly not developed anything on Windows in so long I'm not sure how common MSYS2 is... if this is likely to be a solution for a good proportion of Windows users then sounds reasonable to add this and a note in the readme.

@haines
Copy link
Contributor

haines commented Mar 26, 2021

I think MSYS2 is quite common because it's used by https://rubyinstaller.org/, so this seems like a sensible inclusion to me!

@jellybob
Copy link
Member

Ahh cool, @ziggythehamster do you want to update the readme as well then? I'll get this merged later today, and probably another release out since there's a few other PRs that have gone in.

@ahorek
Copy link

ahorek commented Mar 26, 2021

good idea @ziggythehamster,
yes, MSYS2 is the most common solution on Windows.

however, it doesn't work for me. Path locations are ok, but they're executed outside of the msys2 environment, so ruby can't find these files.

ridk enable
ls /mingw64/share/mime/packages/freedesktop.org.xml
/mingw64/share/mime/packages/freedesktop.org.xml

File.exist?("/mingw64/share/mime/packages/freedesktop.org.xml")
=> false

@ziggythehamster
Copy link
Author

It hadn't occurred to me that Ruby is enough Windows-aware that it wouldn't go through the MSYS2 path redirection subsystem.

Can you run this and let me know if it returns true? If so, I'll adjust my patch.

ruby -e 'require "pathname"; puts Pathname.new(RbConfig.ruby).parent.parent.join("share", "mime", "packages", "freedesktop.org.xml").exist?'

@ahorek
Copy link

ahorek commented Mar 27, 2021

@ziggythehamster nope, but this path works

File.join(ENV['RI_DEVKIT'].to_s, "/mingw64/share/mime/packages/freedesktop.org.xml")

where RI_DEVKIT is C:\Ruby27-x64\msys64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants