[arch-commits] Commit in mlton/trunk (PKGBUILD)

Alexander Rødseth arodseth at archlinux.org
Mon Aug 7 12:58:28 UTC 2017


    Date: Monday, August 7, 2017 @ 12:58:27
  Author: arodseth
Revision: 249439

Compiling with smlnj for x86_64

Modified:
  mlton/trunk/PKGBUILD

----------+
 PKGBUILD |   31 +++++++++++++++++++------------
 1 file changed, 19 insertions(+), 12 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2017-08-07 12:56:36 UTC (rev 249438)
+++ PKGBUILD	2017-08-07 12:58:27 UTC (rev 249439)
@@ -1,5 +1,6 @@
 # $Id$
 # Maintainer: Alexander F Rødseth <xyproto at archlinux.org>
+# Contributor: mkoloberdin <my at aprisobal.by>
 # Contributor: tochiro at no.spam.mail.berlios.de
 # Contributor: Andreas W. Hauser <andy-aur at splashground.de>
 # Contributor: Brian De Wolf <arch at bldewolf.com>
@@ -6,7 +7,7 @@
 
 pkgname=mlton
 pkgver=20170725
-pkgrel=1
+pkgrel=2
 pkgdesc='Whole-program, optimizing Standard ML compiler'
 arch=('x86_64' 'i686')
 url='http://mlton.org/'
@@ -13,29 +14,35 @@
 license=('BSD' 'MIT' 'LGPL')
 depends=('gmp')
 makedepends=('git' 'setconf' 'mlton')
+makedepends_x86_64=('smlnj')
 options=('staticlibs')
 source=("git+https://github.com/MLton/mlton#commit=159190284e1268fded189104705939fe3b691b12")
 md5sums=('SKIP')
 
 prepare() {
-  sed 's/_BSD_SOURCE/_DEFAULT_SOURCE/g' -i mlton/runtime/cenv.h
-  find mlton -name Makefile -type f -exec setconf {} CFLAGS "$CFLAGS -fPIC" \;
+  cd "$pkgname"
+
+  sed 's/_BSD_SOURCE/_DEFAULT_SOURCE/g' -i runtime/cenv.h
+  find . -name Makefile -type f -exec setconf {} CFLAGS "$CFLAGS -fPIC" \;
 }
 
 build() {
-  # Latest master does not build on x86_64. Older releases does not build on x86_64. WIP
+  export CFLAGS="$CFLAGS -fPIC"
+  export COMPILE_ARGS="-codegen c -cc-opt '-fPIC'" 
 
-  export CFLAGS="$CFLAGS -fPIC"
-  make -C mlton COMPILE_ARGS="-codegen c -cc-opt '-fPIC'" -j1 all-no-docs
-  #make -C mlton COMPILE_ARGS="-codegen c" all-no-docs
+  if [ $arch = 'x86_64' ]; then
+    # Bootstrap with SML-NJ on x86_64
+    make -C "$pkgname" -j1 smlnj-mlton all-no-docs
+  else
+    make -C "$pkgname" -j1 all-no-docs
+  fi
 }
 
 package() {
-  make -C mlton DESTDIR="$pkgdir" -j1 install-no-docs
-
-  # Copy over the handful of licenses and the README as explanation
-  install -d "$pkgdir/usr/share/licenses/$pkgname"
-  cp "mlton/doc/license/"* "$pkgdir/usr/share/licenses/$pkgname/"
+  make -C "$pkgname" DESTDIR="$pkgdir" install-no-docs
+  for f in "$pkgname"/doc/license/*-LICENSE; do
+    install -Dm644 "$f" "$pkgdir/usr/share/licenses/$pkgname/$f"
+  done
 }
 
 # vim: ts=2 sw=2 et:



More information about the arch-commits mailing list