The package rpms/mlton.git has added or updated architecture specific content in its
spec file (ExclusiveArch/ExcludeArch or %ifarch/%ifnarch) in commit(s):
https://src.fedoraproject.org/cgit/rpms/mlton.git/commit/?id=cc27c986df9d....
Change:
-%ifarch ppc64
Thanks.
Full change:
============
commit cc27c986df9d1ae10d1e8d8d686caf9411259408
Author: Adam Goode <adam(a)spicenitz.org>
Date: Sat Mar 31 00:15:11 2018 -0400
Fix broken release
diff --git a/0001-Lift-customized-variables-to-top-of-.-bin-mlton-scri.patch
b/0001-Lift-customized-variables-to-top-of-.-bin-mlton-scri.patch
new file mode 100644
index 0000000..f5b1a03
--- /dev/null
+++ b/0001-Lift-customized-variables-to-top-of-.-bin-mlton-scri.patch
@@ -0,0 +1,59 @@
+From e60e48c21d5680d03e7d42bf03b9468548e08265 Mon Sep 17 00:00:00 2001
+From: Matthew Fluet <matthew.fluet(a)gmail.com>
+Date: Thu, 15 Feb 2018 14:28:03 -0500
+Subject: [PATCH 1/5] Lift customized variables to top of `./bin/mlton-script`
+
+---
+ bin/mlton-script | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/bin/mlton-script b/bin/mlton-script
+index de5846f2f..146b9efba 100644
+--- a/bin/mlton-script
++++ b/bin/mlton-script
+@@ -2,6 +2,17 @@
+
+ # This script calls MLton.
+
++
++EXE=
++
++CC="gcc"
++
++# You may need to set 'GMP_INC_DIR' so the C compiler can find gmp.h.
++GMP_INC_DIR=
++# You may need to set 'GMP_LIB_DIR' so the C compiler can find libgmp.
++GMP_LIB_DIR=
++
++
+ set -e
+
+ dir=`dirname "$0"`
+@@ -24,8 +35,6 @@ case "$1" in
+ ;;
+ esac
+
+-EXE=
+-
+ doitMLton () {
+ mlton_mlton="$lib/mlton-compile$EXE"
+ if [ -x "$mlton_mlton" ]; then
+@@ -57,15 +66,9 @@ doit () {
+ exit 1
+ }
+
+-CC="gcc"
+-
+-# You may need to set 'GMP_INC_DIR' so the C compiler can find gmp.h.
+-GMP_INC_DIR=
+ if [ -n "$GMP_INC_DIR" ]; then
+ gmpCCOpts="-cc-opt -I$GMP_INC_DIR"
+ fi
+-# You may need to set 'GMP_LIB_DIR' so the C compiler can find libgmp.
+-GMP_LIB_DIR=
+ if [ -n "$GMP_LIB_DIR" ]; then
+ gmpLinkOpts="-link-opt -L$GMP_LIB_DIR -target-link-opt netbsd
-Wl,-R$GMP_LIB_DIR"
+ fi
+--
+2.14.3
+
diff --git a/0002-Add-LIB_REL_BIN-customizable-variable-to-.-bin-mlton.patch
b/0002-Add-LIB_REL_BIN-customizable-variable-to-.-bin-mlton.patch
new file mode 100644
index 0000000..928af99
--- /dev/null
+++ b/0002-Add-LIB_REL_BIN-customizable-variable-to-.-bin-mlton.patch
@@ -0,0 +1,35 @@
+From f62f6bfa6c4427f47bf819d6dcf575c23d075114 Mon Sep 17 00:00:00 2001
+From: Matthew Fluet <matthew.fluet(a)gmail.com>
+Date: Thu, 15 Feb 2018 14:28:40 -0500
+Subject: [PATCH 2/5] Add `LIB_REL_BIN` customizable variable to
+ `./bin/mlton-script`
+
+---
+ bin/mlton-script | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/bin/mlton-script b/bin/mlton-script
+index 146b9efba..c51febaed 100644
+--- a/bin/mlton-script
++++ b/bin/mlton-script
+@@ -3,6 +3,8 @@
+ # This script calls MLton.
+
+
++LIB_REL_BIN="../lib/mlton"
++
+ EXE=
+
+ CC="gcc"
+@@ -16,7 +18,7 @@ GMP_LIB_DIR=
+ set -e
+
+ dir=`dirname "$0"`
+-lib=`cd "$dir/../lib/mlton" && pwd`
++lib=`cd "$dir/$LIB_REL_BIN" && pwd`
+
+ declare -a rargs
+ case "$1" in
+--
+2.14.3
+
diff --git a/0003-Set-LIB_REL_BIN-in-mlton-script-when-installing.patch
b/0003-Set-LIB_REL_BIN-in-mlton-script-when-installing.patch
new file mode 100644
index 0000000..2d5651e
--- /dev/null
+++ b/0003-Set-LIB_REL_BIN-in-mlton-script-when-installing.patch
@@ -0,0 +1,67 @@
+From a3cccd81e1f77bb5b3c45361681ec4b232596068 Mon Sep 17 00:00:00 2001
+From: Matthew Fluet <matthew.fluet(a)gmail.com>
+Date: Thu, 15 Feb 2018 14:34:49 -0500
+Subject: [PATCH 3/5] Set `LIB_REL_BIN` in `mlton` script when installing
+
+Some systems (e.g., x86_64 Fedora) will set `libdir` to `/usr/lib64`, so it is
+necessary to compute and set the relative path from `TBIN` to `TLIB` when
+installing `$(TBIN)/mlton`. (For robustness, also compute and set the relative
+path from `BIN` to `LIB` when installing `$(BIN)/mlton`.)
+
+While GNU `realpath` would suffice, it does not exist on MacOS (and
+other *BSD?). A small, probably not entirely robust, shell command is
+constructed to compute relative paths.
+---
+ Makefile | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/Makefile b/Makefile
+index a6d5474af..f3f12d46d 100644
+--- a/Makefile
++++ b/Makefile
+@@ -55,11 +55,14 @@ XARGS := xargs
+ ######################################################################
+ ######################################################################
+
++TGT_REL_SRC = ref="$(1)" pos="$(2)" down=;
ref="$${ref%%/}" pos="$${pos%%/}"; while :; do test "$$pos"
= '/' && break ; case "$$ref" in "$$pos"/*) break;;
esac; down="../$$down"; pos="$${pos%/*}"; done; echo
"$$down$${ref\#\#$$pos/}"
++
+ SRC := $(shell pwd)
+ BUILD := $(SRC)/build
+ BIN := $(BUILD)/bin
+ LIB := $(BUILD)/lib/mlton
+ INC := $(LIB)/include
++LIB_REL_BIN := $(shell $(call TGT_REL_SRC,$(LIB),$(BIN)))
+
+ PATH := $(BIN):$(shell echo $$PATH)
+
+@@ -306,6 +309,7 @@ runtime:
+ .PHONY: script
+ script:
+ $(SED) \
++ -e "s;^LIB_REL_BIN=.*;LIB_REL_BIN=\"$(LIB_REL_BIN)\";" \
+ -e "s;^EXE=.*;EXE=\"$(EXE)\";" \
+ -e "s;^CC=.*;CC=\"$(CC)\";" \
+ -e "s;^GMP_INC_DIR=.*;GMP_INC_DIR=\"$(WITH_GMP_INC_DIR)\";" \
+@@ -419,6 +423,8 @@ TMAN := $(DESTDIR)$(man1dir)
+ TDOC := $(DESTDIR)$(docdir)
+ TEXM := $(TDOC)/examples
+
++TLIB_REL_TBIN := $(shell $(call TGT_REL_SRC,$(TLIB),$(TBIN)))
++
+ GZIP_MAN := true
+ ifeq ($(findstring $(TARGET_OS), openbsd solaris), $(TARGET_OS))
+ GZIP_MAN := false
+@@ -438,6 +444,10 @@ MAN_PAGES := \
+ install-no-strip:
+ $(MKDIR) "$(TBIN)" "$(TLIB)" "$(TMAN)"
+ $(CP) "$(BIN)/." "$(TBIN)/"
++ $(SED) \
++ -e "s;^LIB_REL_BIN=.*;LIB_REL_BIN=\"$(TLIB_REL_TBIN)\";" \
++ < "$(BIN)/mlton" > "$(TBIN)/mlton"
++ chmod a+x "$(TBIN)/mlton"
+ $(CP) "$(LIB)/." "$(TLIB)/"
+ cd "$(SRC)/man" && $(CP) $(MAN_PAGES) "$(TMAN)/"
+ ifeq (true, $(GZIP_MAN))
+--
+2.14.3
+
diff --git a/0004-Fix-use-of-MKDIR-and-RM-variables-in-.-Makefile.bina.patch
b/0004-Fix-use-of-MKDIR-and-RM-variables-in-.-Makefile.bina.patch
new file mode 100644
index 0000000..8f279c4
--- /dev/null
+++ b/0004-Fix-use-of-MKDIR-and-RM-variables-in-.-Makefile.bina.patch
@@ -0,0 +1,40 @@
+From fac53ab9f478ad0d6a655b523d2d67929321fad3 Mon Sep 17 00:00:00 2001
+From: Matthew Fluet <matthew.fluet(a)gmail.com>
+Date: Thu, 15 Feb 2018 14:51:12 -0500
+Subject: [PATCH 4/5] Fix use of `MKDIR` and `RM` variables in
+ `./Makefile.binary`
+
+---
+ Makefile.binary | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+diff --git a/Makefile.binary b/Makefile.binary
+index 8baf3e7a3..0f5e78522 100644
+--- a/Makefile.binary
++++ b/Makefile.binary
+@@ -21,6 +21,7 @@ ROOT := $(shell pwd)
+
+ CP := cp -fpR
+ MKDIR := mkdir -p
++RM := rm -rf
+
+ ######################################################################
+
+@@ -46,7 +47,7 @@ TEXM := $(TDOC)/examples
+
+ .PHONY: install
+ install:
+- mkdir -p "$(TBIN)" "$(TLIB)" "$(TMAN)"
"$(TDOC)"
++ $(MKDIR) "$(TBIN)" "$(TLIB)" "$(TMAN)"
"$(TDOC)"
+ $(CP) "$(SBIN)/." "$(TBIN)/"
+ $(CP) "$(SLIB)/." "$(TLIB)/"
+ $(CP) "$(SMAN)/." "$(TMAN)/"
+@@ -61,4 +62,4 @@ update:
+ -e "s;^GMP_LIB_DIR=.*;GMP_LIB_DIR=\"$(WITH_GMP_LIB_DIR)\";" \
+ < "$(SBIN)/mlton.bak" > "$(SBIN)/mlton"
+ chmod a+x "$(SBIN)/mlton"
+- $(RM) "$(SBIN)/mlton.bak"
++ rm "$(SBIN)/mlton.bak"
+--
+2.14.3
+
diff --git a/0005-Set-LIB_REL_BIN-in-mlton-script-when-installing.patch
b/0005-Set-LIB_REL_BIN-in-mlton-script-when-installing.patch
new file mode 100644
index 0000000..f754f92
--- /dev/null
+++ b/0005-Set-LIB_REL_BIN-in-mlton-script-when-installing.patch
@@ -0,0 +1,58 @@
+From c652a62d1cce1b17b2d98d82a10da71dc8be9501 Mon Sep 17 00:00:00 2001
+From: Matthew Fluet <matthew.fluet(a)gmail.com>
+Date: Thu, 15 Feb 2018 14:54:25 -0500
+Subject: [PATCH 5/5] Set `LIB_REL_BIN` in `mlton` script when installing
+
+See a3cccd81e.
+
+Some systems (e.g., x86_64 Fedora) will set `libdir` to `/usr/lib64`, so it is
+necessary to compute and set the relative path from `TBIN` to `TLIB` when
+installing `$(TBIN)/mlton`.
+
+While GNU `realpath` would suffice, it does not exist on MacOS (and
+other *BSD?). A small, probably not entirely robust, shell command is
+constructed to compute relative paths.
+---
+ Makefile.binary | 10 ++++++++++
+ 1 file changed, 10 insertions(+)
+
+diff --git a/Makefile.binary b/Makefile.binary
+index 0f5e78522..bb65999a8 100644
+--- a/Makefile.binary
++++ b/Makefile.binary
+@@ -25,11 +25,15 @@ RM := rm -rf
+
+ ######################################################################
+
++TGT_REL_SRC = ref="$(1)" pos="$(2)" down=;
ref="$${ref%%/}" pos="$${pos%%/}"; while :; do test "$$pos"
= '/' && break ; case "$$ref" in "$$pos"/*) break;;
esac; down="../$$down"; pos="$${pos%/*}"; done; echo
"$$down$${ref\#\#$$pos/}"
++
+ SBIN := $(ROOT)/bin
+ SLIB := $(ROOT)/lib/mlton
+ SMAN := $(ROOT)/share/man/man1
+ SDOC := $(ROOT)/share/doc/mlton
+
++SLIB_REL_SBIN := $(shell $(call TGT_REL_SRC,$(SLIB),$(SBIN)))
++
+ prefix := $(PREFIX)
+ exec_prefix := $(prefix)
+ bindir := $(exec_prefix)/bin
+@@ -45,10 +49,16 @@ TMAN := $(man1dir)
+ TDOC := $(docdir)
+ TEXM := $(TDOC)/examples
+
++TLIB_REL_TBIN := $(shell $(call TGT_REL_SRC,$(TLIB),$(TBIN)))
++
+ .PHONY: install
+ install:
+ $(MKDIR) "$(TBIN)" "$(TLIB)" "$(TMAN)"
"$(TDOC)"
+ $(CP) "$(SBIN)/." "$(TBIN)/"
++ $(SED) \
++ -e "s;^LIB_REL_BIN=.*;LIB_REL_BIN=\"$(TLIB_REL_TBIN)\";" \
++ < "$(SBIN)/mlton" > "$(TBIN)/mlton"
++ chmod a+x "$(TBIN)/mlton"
+ $(CP) "$(SLIB)/." "$(TLIB)/"
+ $(CP) "$(SMAN)/." "$(TMAN)/"
+ if [ -d "$(SDOC)" ]; then $(CP) "$(SDOC)/." "$(TDOC)/";
fi
+--
+2.14.3
+
diff --git a/mlton.spec b/mlton.spec
index f874430..1eaae4a 100644
--- a/mlton.spec
+++ b/mlton.spec
@@ -1,8 +1,6 @@
-%global mlton_bootstrap 0
-
Name: mlton
Version: 20180207
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Optimizing compiler for Standard ML
License: MIT
@@ -12,20 +10,17 @@ Source0:
http://downloads.sourceforge.net/%{name}/%{name}-%{version}.src.tgz
BuildRequires: gmp-devel tex(latex)
# Needs bootstrap on these arches
-ExcludeArch: aarch64 %{power64} s390x
-%if !%{mlton_bootstrap}
+ExcludeArch: aarch64 %{power64} s390x
BuildRequires: mlton
-%endif
Requires: gmp-devel gcc
-# bootstrap sources
-%if %{mlton_bootstrap}
-Source100: %{name}-%{version}.ppc.tar.xz
-Source101: %{name}-%{version}.ppc64.tar.xz
-Source102: %{name}-%{version}.arm.tar.xz
-Source103: %{name}-%{version}.armhfp.tar.xz
-%endif
+#
https://github.com/MLton/mlton/pull/250
+Patch1: 0001-Lift-customized-variables-to-top-of-.-bin-mlton-scri.patch
+Patch2: 0002-Add-LIB_REL_BIN-customizable-variable-to-.-bin-mlton.patch
+Patch3: 0003-Set-LIB_REL_BIN-in-mlton-script-when-installing.patch
+Patch4: 0004-Fix-use-of-MKDIR-and-RM-variables-in-.-Makefile.bina.patch
+Patch5: 0005-Set-LIB_REL_BIN-in-mlton-script-when-installing.patch
# filter out false dependencies
@@ -48,39 +43,21 @@ multiprecision library, and lots of useful libraries.
%prep
-%autosetup
-
-%if %{mlton_bootstrap}
-# unpack the architecture specific bootstrap binary
-
-%ifarch ppc
-%setup -T -D -q -a 100
-%endif
-
-%ifarch ppc64
-%setup -T -D -q -a 101
-%endif
+%autosetup -p1
-%if %{_target_cpu} == armv5tel
-%setup -T -D -q -a 102
-%endif
-
-%if %{_target_cpu} == armv7hl
-%setup -T -D -q -a 103
-%endif
-
-# replace lib variable with correct path
-sed -i 's/\(^lib=\).*$/\1\$MLTON_BOOTSTRAP_DIR\/%{_lib}\/mlton/g' \
- usr/bin/mlton
-%endif
+# mlton-20180207-1 built a bad /usr/bin/mlton. Fortunately it is a script
+# that we can generate and patch up.
+if ! mlton; then
+ make dirs script
+ sed -i -e "s;^lib=.*;lib=%{_libdir}/mlton;" build/bin/mlton
+ mkdir zz-bin
+ mv build/bin/mlton zz-bin/
+ make clean
+fi
%build
-%if %{mlton_bootstrap}
-export MLTON_BOOTSTRAP_DIR=$(pwd)/usr
-export PATH="${PATH}":$MLTON_BOOTSTRAP_DIR/bin
-%endif
-
+export PATH=$(pwd)/zz-bin:"${PATH}"
make all docs PREFIX=%{_prefix} libdir=%{_libdir} CFLAGS="$RPM_OPT_FLAGS"
@@ -100,6 +77,10 @@ rm -rf $RPM_BUILD_ROOT%{_libdir}/mlton/sml/ckit-lib/regression
%changelog
+* Sat Mar 31 2018 Adam Goode <adam(a)spicenitz.org> - 20180207-2
+- Fix busted 20180207-1 release
+- Remove bootstrap stuff for now
+
* Mon Mar 19 2018 Adam Goode <adam(a)spicenitz.org> - 20180207-1
- New upstream release