On Mon, 21 Oct 2013 08:55:53 +0200, Sönke Ludwig wrote:

But what you can do, assuming that you only have files that need not
be compiled, is to set "targetType": "sourceLibrary" and then put all
files in an "import" folder instead of "source", or manually set
"sourcePaths": [] to avoid compiling them.

If you have a mixture of files, just put those into an "import" folder
which don't need to be compiled up front. The target type in this case
can be the default "library".

OK, all the library files are now in import/dgraph and I've tweaked package.json to the following:

{
    "name": "dgraph",
    "version": "~master",
    "description": "A library for creating, analysing and manipulating graphs (networks).  It aims to be fast and memory-efficient while also being easy to use and extend.",
    "authors": ["Joseph Rushton Wakeling"],
    "copyright": "Copyright © 2013 Joseph Rushton Wakeling",
    "homepage": "https://github.com/WebDrake/Dgraph",
    "license": "GPL-3.0 or later",
    "targetType": "sourceLibrary",
}

I symlinked the package dir into .dub/packages and dub list-installed recognizes its presence. I then created a separate project containing just source/app.d and the following package.json:

{
    "name": "dgraph-test",
    "version": "~master",
    "targetType": "executable",
    "dependencies": { "dgraph": "~master" }
}

Issuing dub build in that project results in the following error:

$ dub build
Checking dependencies in '/home/joseph/code/D/dgtest'
Building configuration "application", build type debug
Compiling...
source/app.d(24): Error: module graph is in file 'dgraph/graph.d' which cannot be read
import path[0] = source
import path[1] = ../../../.dub/packages/dgraph/source
import path[2] = /opt/dmd/include/d2
Error: DMD compile run failed with exit code 1

Run 'dub help' for usage information.

I see you've since replied in greater depth (and updated DUB, thank you!) as I was writing this, so I'm just posting this for information, will follow up if your later suggestions don't work.