From 2f4afbe572c4e934e111a32d2aa7dff740b10b04 Mon Sep 17 00:00:00 2001 From: Alexpux Date: Sun, 5 Apr 2015 23:39:38 +0300 Subject: [PATCH] ocaml: Simplifying PKGBUILD. --- ...e-Makefile.mingw-to-Makefile.mingw32.patch | 381 ------------------ mingw-w64-ocaml/PKGBUILD | 67 ++- 2 files changed, 25 insertions(+), 423 deletions(-) delete mode 100644 mingw-w64-ocaml/0001-Rename-Makefile.mingw-to-Makefile.mingw32.patch diff --git a/mingw-w64-ocaml/0001-Rename-Makefile.mingw-to-Makefile.mingw32.patch b/mingw-w64-ocaml/0001-Rename-Makefile.mingw-to-Makefile.mingw32.patch deleted file mode 100644 index 70dc975394..0000000000 --- a/mingw-w64-ocaml/0001-Rename-Makefile.mingw-to-Makefile.mingw32.patch +++ /dev/null @@ -1,381 +0,0 @@ -From 360ad82fa708c1d4456d09ba8f76d10962ea55d6 Mon Sep 17 00:00:00 2001 -From: Junjie Mao -Date: Wed, 1 Apr 2015 08:47:09 +0800 -Subject: [PATCH] Rename Makefile.mingw to Makefile.mingw32 - -Signed-off-by: Junjie Mao ---- - config/Makefile.mingw | 177 ------------------------------------------------ - config/Makefile.mingw32 | 177 ++++++++++++++++++++++++++++++++++++++++++++++++ - 2 files changed, 177 insertions(+), 177 deletions(-) - delete mode 100644 config/Makefile.mingw - create mode 100644 config/Makefile.mingw32 - -diff --git a/config/Makefile.mingw b/config/Makefile.mingw -deleted file mode 100644 -index c204980..0000000 ---- a/config/Makefile.mingw -+++ /dev/null -@@ -1,177 +0,0 @@ --######################################################################### --# # --# OCaml # --# # --# Xavier Leroy, projet Cristal, INRIA Rocquencourt # --# # --# Copyright 1999 Institut National de Recherche en Informatique et # --# en Automatique. All rights reserved. This file is distributed # --# under the terms of the GNU Library General Public License, with # --# the special exception on linking described in file ../LICENSE. # --# # --######################################################################### -- --# Configuration for Windows, Mingw compiler -- --######### General configuration -- --PREFIX=C:/ocamlmgw -- --### Remove this to disable compiling ocamldebug --WITH_DEBUGGER=ocamldebugger -- --### Remove this to disable compiling ocamlbuild --WITH_OCAMLBUILD=ocamlbuild -- --### Remove this to disable compiling ocamldoc --WITH_OCAMLDOC=ocamldoc -- --### Where to install the binaries --BINDIR=$(PREFIX)/bin -- --### Where to install the standard library --LIBDIR=$(PREFIX)/lib -- --### Where to install the stub DLLs --STUBLIBDIR=$(LIBDIR)/stublibs -- --### Where to install the info files --DISTRIB=$(PREFIX) -- --### Where to install the man pages --MANDIR=$(PREFIX)/man -- --########## Toolchain and OS dependencies -- --TOOLCHAIN=mingw -- --### Toolchain prefix --TARGET=i686-w64-mingw32 --HOST=i686-w64-mingw32 -- --TOOLPREF=$(TARGET)- -- --CCOMPTYPE=cc --O=o --A=a --S=s --SO=s.o --EXE=.exe --EXT_DLL=.dll --EXT_OBJ=.$(O) --EXT_LIB=.$(A) --EXT_ASM=.$(S) --MANEXT=1 --SHARPBANGSCRIPTS=false --PTHREAD_LINK= --X11_INCLUDES= --X11_LINK= --BYTECCRPATH= --SUPPORTS_SHARED_LIBRARIES=true --SHAREDCCCOMPOPTS= --MKSHAREDLIBRPATH= --NATIVECCPROFOPTS= --NATIVECCRPATH= --ASM=$(TOOLPREF)as --ASPP=$(TOOLPREF)gcc -c --ASPPPROFFLAGS= --PROFILING=noprof --DYNLINKOPTS= --CC_PROFILE= --SYSTHREAD_SUPPORT=true --EXTRALIBS= --NATDYNLINK=true --CMXS=cmxs --RUNTIMED=noruntimed --ASM_CFI_SUPPORTED=false --UNIXLIB=win32unix --GRAPHLIB=win32graph -- --########## Configuration for the bytecode compiler -- --### Which C compiler to use for the bytecode interpreter. --BYTECC=$(TOOLPREF)gcc -- --### Additional compile-time options for $(BYTECC). (For static linking.) --BYTECCCOMPOPTS=-O -mms-bitfields -Wall -Wno-unused -- --### Additional link-time options for $(BYTECC). (For static linking.) --BYTECCLINKOPTS= -- --### Additional compile-time options for $(BYTECC). (For building a DLL.) --DLLCCCOMPOPTS=-O -mms-bitfields -Wall -Wno-unused -DCAML_DLL -- --### Libraries needed --BYTECCLIBS=-lws2_32 --NATIVECCLIBS=-lws2_32 -- --### How to invoke the C preprocessor --CPP=$(BYTECC) -E -- --### Flexlink --FLEXLINK=flexlink -chain mingw -stack 16777216 -link -static-libgcc --FLEXDIR:=$(shell $(FLEXLINK) -where) --IFLEXDIR=-I"$(FLEXDIR)" --MKDLL=$(FLEXLINK) --MKEXE=$(FLEXLINK) -exe --MKMAINDLL=$(FLEXLINK) -maindll -- --### How to build a static library --MKLIB=rm -f $(1); $(TOOLPREF)ar rc $(1) $(2); $(RANLIB) $(1) --#ml let mklib out files opts = Printf.sprintf "rm -f %s && %sar rcs %s %s %s" out toolpref opts out files;; -- --### Canonicalize the name of a system library --SYSLIB=-l$(1) --#ml let syslib x = "-l"^x;; -- --### The ranlib command --RANLIB=$(TOOLPREF)ranlib --RANLIBCMD=$(TOOLPREF)ranlib -- --### The ar command --ARCMD=$(TOOLPREF)ar -- --############# Configuration for the native-code compiler -- --### Name of architecture for the native-code compiler --ARCH=i386 -- --### Name of architecture model for the native-code compiler. --MODEL=default -- --### Name of operating system family for the native-code compiler. --SYSTEM=mingw -- --### Which C compiler to use for the native-code compiler. --NATIVECC=$(BYTECC) -- --### Additional compile-time options for $(NATIVECC). --NATIVECCCOMPOPTS=-O -mms-bitfields -Wall -Wno-unused -- --### Additional link-time options for $(NATIVECC) --NATIVECCLINKOPTS= -- --### Build partially-linked object file --PACKLD=$(TOOLPREF)ld -r $(NATIVECCLINKOPTS) -o # must have a space after '-o' -- --############# Configuration for the contributed libraries -- --OTHERLIBRARIES=win32unix str num win32graph dynlink bigarray systhreads -- --### Name of the target architecture for the "num" library --BNG_ARCH=ia32 --BNG_ASM_LEVEL=1 -- --############# Aliases for common commands -- --MAKEREC=$(MAKE) -f Makefile.nt --MAKECMD=$(MAKE) -- --############# for the testsuite makefiles --#ml let topdir = "" and wintopdir = "";; --OTOPDIR=$(WINTOPDIR) --CTOPDIR=$(TOPDIR) --CYGPATH=cygpath -m --DIFF=diff -q --strip-trailing-cr --CANKILL=false --SET_LD_PATH=PATH="$(PATH):$(LD_PATH)" -diff --git a/config/Makefile.mingw32 b/config/Makefile.mingw32 -new file mode 100644 -index 0000000..c204980 ---- /dev/null -+++ b/config/Makefile.mingw32 -@@ -0,0 +1,177 @@ -+######################################################################### -+# # -+# OCaml # -+# # -+# Xavier Leroy, projet Cristal, INRIA Rocquencourt # -+# # -+# Copyright 1999 Institut National de Recherche en Informatique et # -+# en Automatique. All rights reserved. This file is distributed # -+# under the terms of the GNU Library General Public License, with # -+# the special exception on linking described in file ../LICENSE. # -+# # -+######################################################################### -+ -+# Configuration for Windows, Mingw compiler -+ -+######### General configuration -+ -+PREFIX=C:/ocamlmgw -+ -+### Remove this to disable compiling ocamldebug -+WITH_DEBUGGER=ocamldebugger -+ -+### Remove this to disable compiling ocamlbuild -+WITH_OCAMLBUILD=ocamlbuild -+ -+### Remove this to disable compiling ocamldoc -+WITH_OCAMLDOC=ocamldoc -+ -+### Where to install the binaries -+BINDIR=$(PREFIX)/bin -+ -+### Where to install the standard library -+LIBDIR=$(PREFIX)/lib -+ -+### Where to install the stub DLLs -+STUBLIBDIR=$(LIBDIR)/stublibs -+ -+### Where to install the info files -+DISTRIB=$(PREFIX) -+ -+### Where to install the man pages -+MANDIR=$(PREFIX)/man -+ -+########## Toolchain and OS dependencies -+ -+TOOLCHAIN=mingw -+ -+### Toolchain prefix -+TARGET=i686-w64-mingw32 -+HOST=i686-w64-mingw32 -+ -+TOOLPREF=$(TARGET)- -+ -+CCOMPTYPE=cc -+O=o -+A=a -+S=s -+SO=s.o -+EXE=.exe -+EXT_DLL=.dll -+EXT_OBJ=.$(O) -+EXT_LIB=.$(A) -+EXT_ASM=.$(S) -+MANEXT=1 -+SHARPBANGSCRIPTS=false -+PTHREAD_LINK= -+X11_INCLUDES= -+X11_LINK= -+BYTECCRPATH= -+SUPPORTS_SHARED_LIBRARIES=true -+SHAREDCCCOMPOPTS= -+MKSHAREDLIBRPATH= -+NATIVECCPROFOPTS= -+NATIVECCRPATH= -+ASM=$(TOOLPREF)as -+ASPP=$(TOOLPREF)gcc -c -+ASPPPROFFLAGS= -+PROFILING=noprof -+DYNLINKOPTS= -+CC_PROFILE= -+SYSTHREAD_SUPPORT=true -+EXTRALIBS= -+NATDYNLINK=true -+CMXS=cmxs -+RUNTIMED=noruntimed -+ASM_CFI_SUPPORTED=false -+UNIXLIB=win32unix -+GRAPHLIB=win32graph -+ -+########## Configuration for the bytecode compiler -+ -+### Which C compiler to use for the bytecode interpreter. -+BYTECC=$(TOOLPREF)gcc -+ -+### Additional compile-time options for $(BYTECC). (For static linking.) -+BYTECCCOMPOPTS=-O -mms-bitfields -Wall -Wno-unused -+ -+### Additional link-time options for $(BYTECC). (For static linking.) -+BYTECCLINKOPTS= -+ -+### Additional compile-time options for $(BYTECC). (For building a DLL.) -+DLLCCCOMPOPTS=-O -mms-bitfields -Wall -Wno-unused -DCAML_DLL -+ -+### Libraries needed -+BYTECCLIBS=-lws2_32 -+NATIVECCLIBS=-lws2_32 -+ -+### How to invoke the C preprocessor -+CPP=$(BYTECC) -E -+ -+### Flexlink -+FLEXLINK=flexlink -chain mingw -stack 16777216 -link -static-libgcc -+FLEXDIR:=$(shell $(FLEXLINK) -where) -+IFLEXDIR=-I"$(FLEXDIR)" -+MKDLL=$(FLEXLINK) -+MKEXE=$(FLEXLINK) -exe -+MKMAINDLL=$(FLEXLINK) -maindll -+ -+### How to build a static library -+MKLIB=rm -f $(1); $(TOOLPREF)ar rc $(1) $(2); $(RANLIB) $(1) -+#ml let mklib out files opts = Printf.sprintf "rm -f %s && %sar rcs %s %s %s" out toolpref opts out files;; -+ -+### Canonicalize the name of a system library -+SYSLIB=-l$(1) -+#ml let syslib x = "-l"^x;; -+ -+### The ranlib command -+RANLIB=$(TOOLPREF)ranlib -+RANLIBCMD=$(TOOLPREF)ranlib -+ -+### The ar command -+ARCMD=$(TOOLPREF)ar -+ -+############# Configuration for the native-code compiler -+ -+### Name of architecture for the native-code compiler -+ARCH=i386 -+ -+### Name of architecture model for the native-code compiler. -+MODEL=default -+ -+### Name of operating system family for the native-code compiler. -+SYSTEM=mingw -+ -+### Which C compiler to use for the native-code compiler. -+NATIVECC=$(BYTECC) -+ -+### Additional compile-time options for $(NATIVECC). -+NATIVECCCOMPOPTS=-O -mms-bitfields -Wall -Wno-unused -+ -+### Additional link-time options for $(NATIVECC) -+NATIVECCLINKOPTS= -+ -+### Build partially-linked object file -+PACKLD=$(TOOLPREF)ld -r $(NATIVECCLINKOPTS) -o # must have a space after '-o' -+ -+############# Configuration for the contributed libraries -+ -+OTHERLIBRARIES=win32unix str num win32graph dynlink bigarray systhreads -+ -+### Name of the target architecture for the "num" library -+BNG_ARCH=ia32 -+BNG_ASM_LEVEL=1 -+ -+############# Aliases for common commands -+ -+MAKEREC=$(MAKE) -f Makefile.nt -+MAKECMD=$(MAKE) -+ -+############# for the testsuite makefiles -+#ml let topdir = "" and wintopdir = "";; -+OTOPDIR=$(WINTOPDIR) -+CTOPDIR=$(TOPDIR) -+CYGPATH=cygpath -m -+DIFF=diff -q --strip-trailing-cr -+CANKILL=false -+SET_LD_PATH=PATH="$(PATH):$(LD_PATH)" --- -2.3.4 diff --git a/mingw-w64-ocaml/PKGBUILD b/mingw-w64-ocaml/PKGBUILD index 14c6226782..ef4b5788c0 100644 --- a/mingw-w64-ocaml/PKGBUILD +++ b/mingw-w64-ocaml/PKGBUILD @@ -4,65 +4,48 @@ _realname=ocaml pkgname=("${MINGW_PACKAGE_PREFIX}-${_realname}") pkgver=4.02.1 pkgrel=1 -pkgdesc='An industrial strength programming language supporting functional, imperative and object-oriented styles.' -groups=("${MINGW_PACKAGE_PREFIX}") +pkgdesc="An industrial strength programming language supporting functional, imperative and object-oriented styles (mingw-w64)" arch=('any') url='http://ocaml.org/' license=('Q Public Licence 1.0' 'GPL2') depends=("${MINGW_PACKAGE_PREFIX}-flexdll") -makedepends=("diffutils") +makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" + "diffutils") source=("http://caml.inria.fr/pub/distrib/ocaml-4.02/ocaml-4.02.1.tar.gz" - "0001-Rename-Makefile.mingw-to-Makefile.mingw32.patch" - "0002-Adapt-to-msys2-directory-layout.patch" - "0003-Install-manuals-in-msys2.patch" - "0004-camlheader-has-the-extension-.exe-in-msys2.patch" - "0005-Install-libraries-to-lib-ocaml-instead-of-lib.patch") + "0002-Adapt-to-msys2-directory-layout.patch" + "0003-Install-manuals-in-msys2.patch" + "0004-camlheader-has-the-extension-.exe-in-msys2.patch" + "0005-Install-libraries-to-lib-ocaml-instead-of-lib.patch") sha1sums=('6af8c67f2badece81d8e1d1ce70568a16e42313e' - '5b56a2ecff40d53158578d5a41e1eb992f3dcdc6' 'ee16e23932922f6f9fcc48072d564b90a3b66246' 'a780a6c94aaedcd0d19a7fbc26e09776b581a8af' 'e1f6b201c25b61d39404406c82684f6c8d70d23a' '17010515bd9715ed36300165643d8f3ad01288cf') -env=${MINGW_PREFIX#/} -_pkg="${_realname}-${pkgver}" -_pkgsrc="${env}-${_pkg}" -noextract=(${_pkg}.tar.gz) prepare() { - for prog in ar as ld ranlib; do - no_prefix=${MINGW_PREFIX}/bin/${prog}.exe - with_prefix=${MINGW_PREFIX}/bin/${CARCH}-w64-mingw32-${prog}.exe - if [ -f "${no_prefix}" ] && [ ! -f "${with_prefix}" ]; then - cp ${no_prefix} ${with_prefix} - echo ${no_prefix}, ${with_prefix} - fi - done + cd ${srcdir}/${_realname}-${pkgver} - cd $startdir/ - [ -d ${srcdir}/${_pkgsrc} ] && rm -rf ${srcdir}/${_pkgsrc} - tar -xzf ${startdir}/${_pkg}.tar.gz -C ${srcdir} + mv config/Makefile.mingw{,32} + cp config/m-nt.h config/m.h + cp config/s-nt.h config/s.h - cd ${srcdir} - mv ${_pkg} ${_pkgsrc} - cd ${_pkgsrc} - - patch -p1 -i ${srcdir}/0001-Rename-Makefile.mingw-to-Makefile.mingw32.patch patch -p1 -i ${srcdir}/0002-Adapt-to-msys2-directory-layout.patch - patch -p1 -i ${srcdir}/0003-Install-manuals.patch + patch -p1 -i ${srcdir}/0003-Install-manuals-in-msys2.patch patch -p1 -i ${srcdir}/0004-camlheader-has-the-extension-.exe-in-msys2.patch patch -p1 -i ${srcdir}/0005-Install-libraries-to-lib-ocaml-instead-of-lib.patch } build() { - cd ${srcdir}/${_pkgsrc} - cp config/m-nt.h config/m.h - cp config/s-nt.h config/s.h - cp config/Makefile.${env} config/Makefile + [[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST} + cp -rf ${_realname}-${pkgver} build-${MINGW_CHOST} + + cd ${srcdir}/build-${MINGW_CHOST} + cp config/Makefile.${MINGW_PREFIX#/} config/Makefile - make -f Makefile.nt world PREFIX="$(cygpath -m ${MINGW_PREFIX})" -j1 - make -f Makefile.nt bootstrap PREFIX="$(cygpath -m ${MINGW_PREFIX})" -j1 - make -f Makefile.nt opt PREFIX="$(cygpath -m ${MINGW_PREFIX})" -j1 - make -f Makefile.nt opt.opt PREFIX="$(cygpath -m ${MINGW_PREFIX})" -j1 + make -f Makefile.nt world PREFIX="${MINGW_PREFIX}" TOOLPREF= -j1 + make -f Makefile.nt bootstrap PREFIX="${MINGW_PREFIX}" TOOLPREF= -j1 + make -f Makefile.nt opt PREFIX="${MINGW_PREFIX}" TOOLPREF= -j1 + make -f Makefile.nt opt.opt PREFIX="${MINGW_PREFIX}" TOOLPREF= -j1 } check() { @@ -71,10 +54,10 @@ check() { } package() { - cd ${srcdir}/${_pkgsrc} - make -f Makefile.nt install PREFIX="${pkgdir}${MINGW_PREFIX}" -j1 + cd ${srcdir}/build-${MINGW_CHOST} + make -f Makefile.nt install TOOLPREF= PREFIX="${pkgdir}${MINGW_PREFIX}" -j1 [ -f LICENSE ] && install -Dm644 LICENSE ${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE - mkdir -p ${pkgdir}/etc/profile.d - echo '[ "$MSYSTEM" = "'$(echo ${env} | tr "[:lower:]" "[:upper:]")'" ] && export OCAMLLIB='${MINGW_PREFIX}'/lib/ocaml' > ${pkgdir}/etc/profile.d/ocaml.${env}.sh + mkdir -p ${pkgdir}${MINGW_PREFIX}/etc/profile.d + echo '[ "$MSYSTEM" = "'$(echo ${MINGW_PREFIX#/} | tr "[:lower:]" "[:upper:]")'" ] && export OCAMLLIB='${MINGW_PREFIX}'/lib/ocaml' > ${pkgdir}${MINGW_PREFIX}/etc/profile.d/ocaml.sh }