From Fedora Project Wiki

Revision as of 00:53, 28 July 2010 by Bioinfornatics (talk | contribs) (Created page with ''''Revision:''' 0.1<BR> '''Last Revised:''' Wednesday Jul 28, 2010<BR> == Packaging Tips == === File Locations === ==== Libraries ==== D packages should install assemblies to ...')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Revision: 0.1
Last Revised: Wednesday Jul 28, 2010

Packaging Tips

File Locations

Libraries

D packages should install assemblies to %{_libdir} rather than /usr/lib or %{_datadir}.

Header

D package should install header file like .d or .di to %{_d_includedir}/%{name}

Libraries

At this time in D programming only OS X support shared lirbraries. So wait this feature or help ldc project. Feel free.
For build static librarie in D you need use ar and ranlib tools. ldc compiler support GNU strip.
short example from makefile:

DC=ldc
HD=-Hd $(IMPORT_DEST)
DFLAGS_REQ=-c -I ../DerelictUtil
AL_SRC= \
    derelict/openal/al.d \
    derelict/openal/alfuncs.d \
    derelict/openal/altypes.d   
    
PACKAGE_PATH=derelict/openal

all : DerelictAL

$(LIB_PRE)DerelictAL.$(LIB_EXT) :
	$(DC) $(DFLAGS) $(DFLAGS_REQ) $(AL_SRC) $(HD)/$(PACKAGE_PATH)
	$(AR) rcs $@ $^
	$(RANLIB) $@
	$(CP) $@ $(LIB_DEST)
	$(RM) $@

Macros

%{_d_includedir} need be used for devel file
%{_d_optflags} need be used for ldc options