Sigbjorn's latest patches for HDirect seem to get rid of the
stdcall/_stdcall/__stdcall confusion, but the installation is still
overly complicated, see e.g. the attached hdirect.spec. It would be
nice if every FOO \elem {ghc,happy,green-card,hdirect} could be built
and installed generically via:

   autoheader
   autoconf
   ./configure
   make ProjectsToBuild="glafp-utils FOO" boot
   make ProjectsToBuild="glafp-utils FOO" all
   make ProjectsToInstall=FOO install

Happy almost manages this, except for the documentation. Perhaps one
should add a doc target?

   make ProjectsToBuild="glafp-utils FOO" doc

Another point is the automatic extraction of version numbers from
the sub-packages. Green Card and HDirect currently don't define a
ProjectVersion in their mk/version.mk. This would be quite handy for
the automatic construction of source tar files from CVS sources,
see e.g. my ugly hack for this attached to this mail.

Perhaps one day we can simply type "make ghc-rpm"...  *sigh*   :-)

Cheers,
   Sven
-- 
Sven Panne                                        Tel.: +49/89/2178-2235
LMU, Institut fuer Informatik                     FAX : +49/89/2178-2211
LFE Programmier- und Modellierungssprachen              Oettingenstr. 67
mailto:[EMAIL PROTECTED]            D-80538 Muenchen
http://www.informatik.uni-muenchen.de/~Sven.Panne
Vendor:       Z101-Solutions, Munich, Germany
Distribution: Softies
Name:         hdirect
Version:      0.15
Release:      2
Copyright:    GPL
Group:        Development/Languages/Haskell
Packager:     [EMAIL PROTECTED]
URL:          http://www.dcs.gla.ac.uk/fp/software/hdirect/
Source:       
ftp://ftp.dcs.gla.ac.uk/pub/haskell/glasgow/hdirect/hdirect-0.15-src.tar.gz
Requires:     haskell
Summary:      An IDL Compiler for Haskell
%description
HaskellDirect is an IDL compiler for Haskell, helping the Haskell
programmer to better interact with and reuse external code.

Interfacing Haskell code to external code involves the conversion of
values between the Haskell world and the outside, as data representations
and details of how memory is managed, are worlds apart at times. Manually
writing the boilerplate code that takes care of this conversion is about
as exciting as watching grass grow and, as a result, error prone.

Using an Interface Definition Language (IDL) as basis, HaskellDirect
automates the generation of such impedance matching code, generating the
necessary marshaling code to interface to external functions (and vice
versa.)

With IDL, the functionality provided by a programming interface is
specified in a programming language neutral framework. The HaskellDirect
IDL compiler converts this specification into a set of method stubs.
Depending on how the compiler is invoked, these stubs can be used to:

   * Call upon external functions from within Haskell,
   * Let external code call upon Haskell functions,
   * Call COM (Microsoft's Component Object Model) methods from Haskell,
   * Create COM method wrappers,

The HaskellDirect IDL compiler currently groks both the OSF DCE
dialect of IDL (including the various extensions introduced by the
Microsoft IDL compiler) and the OMG IIOP/CORBA dialect. (Only the
former can be used for describing COM interfaces.)

Author:
-------
    Sigbjorn Finne <[EMAIL PROTECTED]>

%prep
%setup -n fptools

%build
test -z "${HC}" && HC="ghc -O -H90m"
autoheader
autoconf
./configure

make ProjectsToBuild=glafp-utils boot
make ProjectsToBuild=glafp-utils all

make -C hdirect/src mkVersion
make -C hdirect/src HC="$HC" boot
make -C hdirect/src HC="$HC" all

make -C hdirect/lib HC="$HC" boot
make -C hdirect/lib HC="$HC" all

make -C hdirect/doc {hdirect,primitive,user}.{dvi,ps,html}

%install
cd hdirect
install -s src/ihc /usr/bin
install lib/libhdirect.a /usr/lib
install -d /usr/lib/hdirect
install -m 0644 lib/HDirect.hi lib/HDirect.lhs lib/Pointer.hi lib/Pointer.lhs 
lib/PointerPrim.hi lib/PointerPrim.hs lib/PointerPrim.hs lib/PointerSrc.c 
lib/PointerSrc.h /usr/lib/hdirect
cd ..

%files
%doc hdirect/distrib/ANNOUNCE
%doc hdirect/distrib/INSTALL
%doc hdirect/distrib/LICENSE
%doc hdirect/distrib/README
%doc hdirect/NEWS
%doc hdirect/Notes
%doc hdirect/ToDo
%doc hdirect/doc/
%doc hdirect/examples/
/usr/bin/ihc
/usr/lib/libhdirect.a
/usr/lib/hdirect
#!/bin/bash

buildtar () {
    SUBDIR="$1"
    PREFIX="$2"
    VERSION="$3"
    VMK="fptools/${SUBDIR}/mk/version.mk"
    if test -z "${VERSION}" -a -r ${VMK} ; then
        VERSION="$(grep '^ProjectVersion[ \t]*=[ \t]*[0-9.]*$' ${VMK} | \
                   sed 's/^[^0-9]*\([0-9.]*\).*$/\1/')"
    fi
    if test -z "${VERSION}" ; then
        echo "***** ERROR: No version found for ${SUBDIR} *****"
        exit 1
    fi
    TARFILE="${PREFIX}-${VERSION}-src.tar.gz"
    echo "***** Building ${TARFILE} for ${SUBDIR} *****"
    TAR="tar -c -z --exclude=CVS --exclude=.cvsignore"
    for EXCLUDE in CONTRIB common-rts ghc green-card haggis \
                   happy hdirect hslibs literate nofib ; do
        test ${EXCLUDE} != ${SUBDIR} && TAR="${TAR} --exclude=fptools/${EXCLUDE}"
    done
    rm -f ${TARFILE}
    ${TAR} -f ${TARFILE} fptools
}

exec < /dev/null > LOG-fptools-`date '+%d%m%y'`-`date '+%X'` 2>&1

cvs -d :ext:${USER}@glass.cse.ogi.edu:/home/cvs/root checkout fptools

buildtar ghc        ghc     ""
buildtar green-card gc      2.0
buildtar happy      happy   ""
buildtar hdirect    hdirect 0.15

Reply via email to