X-Git-Url: http://git.annexia.org/?a=blobdiff_plain;f=ocaml%2Fmingw32-ocaml.spec;h=4f4b42f58bcf67d9caa7cb66a24a31127beb0f50;hb=7d1516cd3616f013653da2e98abc9bbed0b544f2;hp=f83678629a6165659a338785d428ddfef95c693b;hpb=4e01565ca0f958c38409170b6435e8bb31f667a3;p=fedora-mingw.git diff --git a/ocaml/mingw32-ocaml.spec b/ocaml/mingw32-ocaml.spec index f836786..4f4b42f 100644 --- a/ocaml/mingw32-ocaml.spec +++ b/ocaml/mingw32-ocaml.spec @@ -4,9 +4,13 @@ %define __find_requires %{_mingw32_findrequires} %define __find_provides %{_mingw32_findprovides} +%define debug_package %{nil} + +%define otherlibraries win32unix str num dynlink bigarray systhreads win32graph + Name: mingw32-ocaml Version: 3.11.0+beta1 -Release: 1%{?dist} +Release: 7%{?dist} Summary: Objective Caml MinGW cross-compiler and programming environment License: QPL and (LGPLv2+ with exceptions) @@ -39,6 +43,21 @@ BuildRequires: mingw32-gcc BuildRequires: mingw32-binutils BuildRequires: mingw32-flexdll +# While we still ship bytecode, this requires a /usr/bin/ocamlrun from +# the _identical_ native package. We don't have that at the moment, +# which is why this is commented out. +#Requires: ocaml-runtime = %{version} + +# The built program will try to run the cross-compiler and flexdll, so +# these must be runtime requires. +Requires: mingw32-gcc +Requires: mingw32-binutils +Requires: mingw32-flexdll + +# i686-pc-mingw32-ocamlmklib tries to run ocamlopt which is probably a +# bug, but requires this (XXX). +Requires: ocaml + %description Objective Caml is a high-level, strongly-typed, functional and @@ -61,6 +80,9 @@ and produces Windows native executables. %build +# Don't run out of memory. +ulimit -s unlimited + # Build native ocamlrun and ocamlc which contain the filename-win32-dirsep # patch. ./configure \ @@ -93,6 +115,8 @@ sed \ -e 's,@prefix@,%{_prefix},g' \ -e 's,@bindir@,%{_bindir},g' \ -e 's,@libdir@,%{_libdir},g' \ + -e 's,@target@,%{_mingw32_target},g' \ + -e 's,@otherlibraries@,%{otherlibraries},g' \ < %{SOURCE1000} > Makefile popd @@ -125,19 +149,45 @@ make opt %install rm -rf $RPM_BUILD_ROOT -# Only want to install ocamlopt and libraries. mkdir -p $RPM_BUILD_ROOT%{_bindir} -mkdir -p $RPM_BUILD_ROOT%{_libdir}/i686-pc-mingw32-ocaml -mkdir -p $RPM_BUILD_ROOT%{_libdir}/i686-pc-mingw32-ocaml/threads - -make installopt \ - BINDIR=$RPM_BUILD_ROOT%{_bindir} \ - LIBDIR=$RPM_BUILD_ROOT%{_libdir}/i686-pc-mingw32-ocaml +mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml +mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/threads +mkdir -p $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/stublibs + +# This is the equivalent of 'make install installopt', but +# we only want to install the parts which are really necessary +# for the cross-compiler. eg. We don't need any of the native +# tools like ocamllex or ocamldoc. +%define makevars BINDIR=$RPM_BUILD_ROOT%{_bindir} LIBDIR=$RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml +make %{makevars} -C byterun install +make %{makevars} -C stdlib install +for i in %{otherlibraries}; do + make %{makevars} -C otherlibs/$i install +done +make %{makevars} -C tools install +make %{makevars} installopt + +cp config/Makefile \ + $RPM_BUILD_ROOT%{_libdir}/%{_mingw32_target}-ocaml/Makefile.config + +# For bytecode binaries, change the bang-path to point to the locally +# installed ocamlrun. +pushd $RPM_BUILD_ROOT%{_bindir} +for f in ocamlcp ocamldep ocamlmklib ocamlopt ocamlprof; do + mv $f $f.old + echo '#!%{_bindir}/%{_mingw32_target}-ocamlrun' > $f + tail -n +2 $f.old >> $f + chmod +x $f + rm $f.old +done +popd -# ocamlopt is a cross-compiler, so rename the binary. -# XXX This should probably use %{_mingw32_target} macro. -mv $RPM_BUILD_ROOT%{_bindir}/ocamlopt \ - $RPM_BUILD_ROOT%{_bindir}/i686-pc-mingw32-ocamlopt +# Rename all the binaries to target-binary. +pushd $RPM_BUILD_ROOT%{_bindir} +for f in ocamlcp ocamldep ocamlmklib ocamlmktop ocamlopt ocamlprof ocamlrun; do + mv $f %{_mingw32_target}-$f +done +popd %clean @@ -146,10 +196,25 @@ rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) -%{_bindir}/i686-pc-mingw32-ocamlopt -%{_libdir}/i686-pc-mingw32-ocaml/ +%{_bindir}/%{_mingw32_target}-ocamlcp +%{_bindir}/%{_mingw32_target}-ocamldep +%{_bindir}/%{_mingw32_target}-ocamlmklib +%{_bindir}/%{_mingw32_target}-ocamlmktop +%{_bindir}/%{_mingw32_target}-ocamlprof +%{_bindir}/%{_mingw32_target}-ocamlopt +%{_bindir}/%{_mingw32_target}-ocamlrun +%{_libdir}/%{_mingw32_target}-ocaml/ %changelog -* Sat Nov 15 2008 Richard W.M. Jones - 3.11.0+beta1-1 +* Sat Nov 15 2008 Richard W.M. Jones - 3.11.0+beta1-7 +- Further requirements. + +* Sat Nov 15 2008 Richard W.M. Jones - 3.11.0+beta1-6 +- Install tools, particularly ocamlmklib. + +* Sat Nov 15 2008 Richard W.M. Jones - 3.11.0+beta1-5 +- +Requires mingw32-flexdll and the cross-compiler. + +* Sat Nov 15 2008 Richard W.M. Jones - 3.11.0+beta1-4 - Initial RPM release.