1 %define __strip %{_mingw32_strip}
2 %define __objdump %{_mingw32_objdump}
3 %define _use_internal_dependency_generator 0
4 %define __find_requires %{_mingw32_findrequires}
5 %define __find_provides %{_mingw32_findprovides}
10 Summary: Objective Caml MinGW cross-compiler and programming environment
12 License: QPL and (LGPLv2+ with exceptions)
13 Group: Development/Libraries
15 URL: http://caml.inria.fr/
16 Source0: http://caml.inria.fr/pub/distrib/ocaml-3.11/ocaml-%{version}.tar.bz2
18 # This is installed as config/Makefile when we cross-compile.
19 Source1000: Makefile-fedora-mingw.in
21 # XXX We should apply any Fedora native patches here.
23 # For patch description, see the top of each patch file.
24 # Start numbering at 1000 since these are MinGW-specific patches.
25 Patch1000: mingw32-ocaml-3.11.0+beta1-combined-Makefile.patch
26 Patch1001: mingw32-ocaml-3.11.0+beta1-disable-cmxs.patch
27 Patch1002: mingw32-ocaml-3.11.0+beta1-filename-win32-dirsep.patch
28 Patch1003: mingw32-ocaml-3.11.0+beta1-i386-profiling.patch
29 Patch1004: mingw32-ocaml-3.11.0+beta1-no-stdlib-dir.patch
30 Patch1005: mingw32-ocaml-3.11.0+beta1-win32-fixes.patch
31 Patch1006: mingw32-ocaml-3.11.0+beta1-win32unix-path.patch
33 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
37 BuildRequires: mingw32-filesystem >= 30
38 BuildRequires: mingw32-gcc
39 BuildRequires: mingw32-binutils
40 BuildRequires: mingw32-flexdll
44 Objective Caml is a high-level, strongly-typed, functional and
45 object-oriented programming language from the ML family of languages.
47 This package is an OCaml cross-compiler which runs natively on Fedora
48 and produces Windows native executables.
52 %setup -q -n ocaml-%{version}
64 # Build native ocamlrun and ocamlc which contain the filename-win32-dirsep
69 -libdir %{_libdir}/ocaml \
70 -mandir %{_mandir}/man1
73 # Now move the working ocamlrun, ocamlc into the boot/ directory,
74 # overwriting the binary versions which ship with the compiler with
75 # ones that contain the above filename-win32-dirsep patch.
78 # Now replace the compiler configuration (config/{s.h,m.h,Makefile})
79 # with ones as they would be on a 32 bit Windows system.
82 # config/m.h can just be copied from config/m-nt.h which ships.
86 # config/s.h can just be copied from config/s-nt.h which ships.
90 # config/Makefile is a custom one which we supply.
93 -e 's,@prefix@,%{_prefix},g' \
94 -e 's,@bindir@,%{_bindir},g' \
95 -e 's,@libdir@,%{_libdir},g' \
96 < %{SOURCE1000} > Makefile
100 # We're going to build in otherlibs/win32unix and otherlibs/win32graph
101 # directories, but since they would normally only be built under
102 # Windows, they only have the Makefile.nt files. Just symlink
103 # Makefile -> Makefile.nt for these cases.
104 for d in otherlibs/win32unix otherlibs/win32graph; do
105 ln -s Makefile.nt $d/Makefile
108 # Now clean the temporary files from the previous build. This
109 # will also cause asmcomp/arch.ml (etc) to be linked to the 32 bit
110 # i386 versions, essentially causing ocamlopt to use the Win/i386 code
114 # Just rebuild some small bits that we need for the following
115 # 'make opt' to work. Note that 'make all' fails here.
116 make -C byterun libcamlrun.a
119 make -C tools ocamlmklib
126 rm -rf $RPM_BUILD_ROOT
128 # Only want to install ocamlopt and libraries.
129 mkdir -p $RPM_BUILD_ROOT%{_bindir}
130 mkdir -p $RPM_BUILD_ROOT%{_libdir}/i686-pc-mingw32-ocaml
131 mkdir -p $RPM_BUILD_ROOT%{_libdir}/i686-pc-mingw32-ocaml/threads
134 BINDIR=$RPM_BUILD_ROOT%{_bindir} \
135 LIBDIR=$RPM_BUILD_ROOT%{_libdir}/i686-pc-mingw32-ocaml
137 # ocamlopt is a cross-compiler, so rename the binary.
138 # XXX This should probably use %{_mingw32_target} macro.
139 mv $RPM_BUILD_ROOT%{_bindir}/ocamlopt \
140 $RPM_BUILD_ROOT%{_bindir}/i686-pc-mingw32-ocamlopt
144 rm -rf $RPM_BUILD_ROOT
148 %defattr(-,root,root)
149 %{_bindir}/i686-pc-mingw32-ocamlopt
150 %{_libdir}/i686-pc-mingw32-ocaml/
154 * Sat Nov 15 2008 Richard W.M. Jones <rjones@redhat.com> - 3.11.0+beta1-1
155 - Initial RPM release.