Well, because of this reason, I completely left D and started
writing my shared library in pure C. As much as I miss the syntax
of D, I needed to do this (Where are you betterC? Are you there
yet?). Since it is not a big library, that wouldn't be a big
problem.
Anyway, I think instead of installing DMD to target OS just to
get libphobos, I think you can just copy it from development OS.
That should solve the problem. But make sure to name the library
correctly. If my experience is accurate, it should be with the
name libphobos2.so.0.66. If still doesn't work (tells that
libphobos is not found), create a link to library with the name
libphobos2.so as well.
About your problem solving part, the thing is that Phobos
includes druntime inside it, and druntime is what makes most
features of D tick like GC, arrays, etc. Also there are things
like compile time regular expression, etc. Thus, neither leaving
nor keeping the system in its current state is making everybody
happy. I am still looking forward for "betterC" though. Which
would allow me to write in D instead of C when I am not looking
for D's libraries.
On Saturday, 15 November 2014 at 11:21:49 UTC, GreatEmerald wrote:
I'm currently attempting to package my D project
(https://github.com/GreatEmerald/libarcomage/) as a shared
library for openSUSE and whatnot, but I'm running into some
policy problems.
First, in order to build a shared library, it has to link
against libphobos2.so. libphobos2.so is provided by the DMD
package. Which means... The users of my library have to have
DMD installed at runtime. Even though they don't intend to
compile anything.
Ideally, this problem would be solved by splitting
libphobos2.so into its own package. After all, even the
licenses of DMD and Phobos2 are different. This can be done
downstream, but for instance for openSUSE, there's not much of
a downstream to begin with. And this is needed for each
distribution.
While I'm at it, in the DMD RPM it's also set as Provides
"libphobos2.so.0.66" instead of the expected
"libphobos2.so.0.66()(64bit)" on openSUSE. I'm not too sure if
this is distribution-specific or a standard practice, though.
Second, what's the suggested method of providing includes? Put
all the source of the library into includes? Make .di files?
What about templates? Is there a suggested directory structure?