msys2 / MINGW-packages

Package scripts for MinGW-w64 targets to build under MSYS2.
https://packages.msys2.org
BSD 3-Clause "New" or "Revised" License
2.22k stars 1.19k forks source link

mingw-w64-nim on msys32: wrong library path #3209

Open orthoxerox opened 6 years ago

orthoxerox commented 6 years ago

Simulation steps:

Expected behavior:

Actual behavior:

Hint: system [Processing]
Error: cannot open 'C:\...\msys32\mingw32\lib\system.nim'

system.nim is present, but at C:\...\msys32\mingw32\lib\nim

PS: I will test it on msys64 later.

orthoxerox commented 6 years ago

Looks like the following procedure should be patched before nim is built: https://github.com/nim-lang/Nim/blob/c7ba4d91a34882e94969595ba70763f9f642423c/compiler/options.nim#L228

revelator commented 6 years ago

something like this ?

proc setDefaultLibpath*() =
  # set default value (can be overwritten):
  if libpath == "":
    # choose default libpath:
    var prefix = getPrefixDir()
    when defined(posix):
      if prefix == "/usr": libpath = "/usr/lib/nim"
      elif prefix == "/usr/local": libpath = "/usr/local/lib/nim"
      else: libpath = joinPath(prefix, "lib/nim") -> this change might not be nessesary
    else: libpath = joinPath(prefix, "lib/nim") -> this change however might
revelator commented 6 years ago

Ah no breaks building it, forget about that one. Tried a few way's all end up breaking the build so that seems a nogo.

orthoxerox commented 6 years ago

The easiest way would be to get rid of lib/nim and chuck everything into lib during installation, but I suspect that subfolder is there for a reason.

revelator commented 6 years ago

probably to not pollute mingw's lib dir with nim's api files. Does not matter that much but it does look better, so if there is a way to coerce it to accept this then it would be nice.