dub icon indicating copy to clipboard operation
dub copied to clipboard

platform specific dependencies

Open extrawurst opened this issue 10 years ago • 4 comments

i would like to do this:

   "dependencies": {
        "base": {"version":"~master", "path":"../base"},
        "framework": {"version":"~master", "path":"../framework"}
    },

    "dependencies-osx": {
        "derelict-cf": "~>0.0.1"
    }

but right now even on windows the derelict-cf package is fetched and built...

extrawurst avatar Jul 02 '15 10:07 extrawurst

Currently this requires the use of configurations:

"configurations": [
  {
    "name": "cf",
    "platforms": ["osx"],
    "dependencies": {
      "derelict-cf": "~>0.0.1"
    }
  },
  {
    "name": "win32",
    "platforms": "windows"
  }
]

It should be possible to extend "dependencies" to accept platform specifications in theory, but at least there should be a warning now that the suffix gets ignored...

s-ludwig avatar Jul 03 '15 12:07 s-ludwig

SDL format supports platform specific dependencies, but currently there is still no way to express this in JSON format.

This also leads to problems when trying to convert SDL to JSON with the convert tool when platform specific dependencies are preset:

dependency "mir-linux-kernel" version="~>1.0.0" platform="linux"

... gets translated to:

"dependencies": {
    "mir-linux-kernel": "~>1.0.0"
}

... which is clearly wrong for non-linux platforms.

I propose this should be supported in both formats, not just in SDL.

GoaLitiuM avatar Nov 03 '19 02:11 GoaLitiuM

First steps to add support for this started in https://github.com/dlang/dub/pull/1794.

GoaLitiuM avatar Nov 03 '19 05:11 GoaLitiuM

SDL format supports platform specific dependencies, but currently there is still no way to express this in JSON format.

This also leads to problems when trying to convert SDL to JSON with the convert tool when platform specific dependencies are preset:

dependency "mir-linux-kernel" version="~>1.0.0" platform="linux"

... gets translated to:

"dependencies": {
    "mir-linux-kernel": "~>1.0.0"
}

... which is clearly wrong for non-linux platforms.

I propose this should be supported in both formats, not just in SDL.

this does not apply per docs

FelipeLema avatar Feb 06 '24 18:02 FelipeLema