From: ii8 <ii8@users.noreply.github.com>
To: ml@inbox.vuxu.org
Subject: Re: [PR PATCH] [Updated] New package: mlton-20210117
Date: Wed, 08 Nov 2023 14:40:10 +0100 [thread overview]
Message-ID: <20231108134010.tGQHXPe996q9ieU7tSBBc4rXeNYpAnAhO3U-gYXC5aI@z> (raw)
In-Reply-To: <gh-mailinglist-notifications-41a7ca26-5023-4802-975b-f1789d68868e-void-packages-46951@inbox.vuxu.org>
[-- Attachment #1: Type: text/plain, Size: 630 bytes --]
There is an updated pull request by ii8 against master on the void-packages repository
https://github.com/ii8/void-packages mlton
https://github.com/void-linux/void-packages/pull/46951
New package: mlton-20210117
- I tested the changes in this PR: **YES**
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**
#### Local build testing
- I built this PR locally for my native architecture, x86_64-musl
A patch file from https://github.com/void-linux/void-packages/pull/46951.patch is attached
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-mlton-46951.patch --]
[-- Type: text/x-diff, Size: 9175 bytes --]
From 1e2e6dd83da470dd6018af15f92ba868df3e801a Mon Sep 17 00:00:00 2001
From: murray <murray.calavera@protonmail.com>
Date: Sat, 28 Oct 2023 19:27:11 +0100
Subject: [PATCH] New package: mlton-20210117
---
srcpkgs/mlton/patches/20-polyml.patch | 48 +++++++++++++++++
srcpkgs/mlton/patches/30-mlbdeps.patch | 60 +++++++++++++++++++++
srcpkgs/mlton/patches/40-mlton.patch | 20 +++++++
srcpkgs/mlton/patches/50-mlton-stubs.patch | 19 +++++++
srcpkgs/mlton/patches/60-clean-polyml.patch | 10 ++++
srcpkgs/mlton/template | 31 +++++++++++
6 files changed, 188 insertions(+)
create mode 100644 srcpkgs/mlton/patches/20-polyml.patch
create mode 100644 srcpkgs/mlton/patches/30-mlbdeps.patch
create mode 100644 srcpkgs/mlton/patches/40-mlton.patch
create mode 100644 srcpkgs/mlton/patches/50-mlton-stubs.patch
create mode 100644 srcpkgs/mlton/patches/60-clean-polyml.patch
create mode 100644 srcpkgs/mlton/template
diff --git a/srcpkgs/mlton/patches/20-polyml.patch b/srcpkgs/mlton/patches/20-polyml.patch
new file mode 100644
index 0000000000000..62ad34c342875
--- /dev/null
+++ b/srcpkgs/mlton/patches/20-polyml.patch
@@ -0,0 +1,48 @@
+--- a/mlton/Makefile
++++ b/mlton/Makefile
+@@ -187,31 +208,31 @@ smlnj-mlton: mlton-smlnj.cm control/version.sml $(FRONT_END_SOURCES)
+ # MLton.
+ #
+ POLYML := poly
++CAT := cat
+
+ .PHONY: polyml-mlton
+-polyml-mlton: mlton-polyml.use $(shell [ -e mlton-polyml.use ] && cat mlton-polyml.use | $(SED) 's/use "\(.*\)";/\1/') control/version.sml $(FRONT_END_SOURCES)
+- ( \
+- echo 'use "mlton-polyml.use";'; \
+- echo 'PolyML.export("$(MLTON_OUTPUT)-polyml", Main.mainWrapped);'; \
+- ) | "$(POLYML)"
+- $(CC) -o $(MLTON_OUTPUT)-polyml $(MLTON_OUTPUT)-polyml.o -lpolymain -lpolyml
+- $(RM) $(MLTON_OUTPUT)-polyml.o
++polyml-mlton: $(MLTON_OUTPUT)-polyml
++
++$(MLTON_OUTPUT)-polyml: mlton-polyml.sml $(shell [ -e mlton-polyml.sml ] && $(CAT) mlton-polyml.sml | $(GREP) 'use ".*";' | $(SED) 's/use "\(.*\)";/\1/') control/version.sml $(FRONT_END_SOURCES)
++ polyc -o $@ mlton-polyml.sml
+
+-mlton-polyml.use: ../lib/stubs/basis-stubs-for-polyml/sources.use ../lib/stubs/mlton-stubs-for-polyml/sources.use $(shell "$(RUN_MLTON_DEPS)" -stop f ../lib/stubs/mlton-stubs/sources.mlb | $(GREP) 'mlb$$') $(shell "$(RUN_MLTON_DEPS)" -stop f mlton.mlb | $(GREP) 'mlb$$')
++mlton-polyml.sml: ../lib/stubs/basis-stubs-for-polyml/sources.use ../lib/stubs/mlton-stubs-for-polyml/sources.use $(shell "$(RUN_MLTON_DEPS)" -stop f ../lib/stubs/mlton-stubs/sources.mlb | $(GREP) 'mlb$$') $(shell "$(RUN_MLTON_DEPS)" -stop f mlton.mlb | $(GREP) 'mlb$$')
++ chmod +x $(SRC)/bin/mlbdeps
+ ( \
+- cat ../lib/stubs/basis-stubs-for-polyml/sources.use | \
++ $(CAT) ../lib/stubs/basis-stubs-for-polyml/sources.use | \
+ $(SED) 's|use "\(.*\)";|../lib/stubs/basis-stubs-for-polyml/\1|'; \
+- "$(RUN_MLTON)" -stop f mlton.mlb | $(GREP) -v 'mlb$$' | $(GREP) 'mlyacc'; \
+- cat ../lib/stubs/mlton-stubs-for-polyml/sources.use | \
++ $(SRC)/bin/mlbdeps mlton.mlb | $(GREP) -v 'mlb$$' | $(GREP) 'mlyacc'; \
++ $(CAT) ../lib/stubs/mlton-stubs-for-polyml/sources.use | \
+ $(SED) 's|use "\(.*\)";|../lib/stubs/mlton-stubs-for-polyml/\1|'; \
+- "$(RUN_MLTON)" -stop f ../lib/stubs/mlton-stubs/sources.mlb | \
++ $(SRC)/bin/mlbdeps ../lib/stubs/mlton-stubs/sources.mlb | \
+ $(GREP) -v 'mlb$$' | \
+ $(GREP) 'mlton-stubs'; \
+- "$(RUN_MLTON)" -stop f mlton.mlb | \
++ $(SRC)/bin/mlbdeps mlton.mlb | \
+ $(GREP) -v 'mlb$$' | \
+ $(GREP) -v 'sml/basis' | \
+ $(GREP) -v 'targets' | \
+ $(GREP) -v 'mlton-stubs' | \
+ $(GREP) -v 'mlyacc' | \
+ $(GREP) -v 'call-main.sml'; \
+- ) | $(SED) 's|\(.*\)|use "\1";|' > mlton-polyml.use
++ ) | $(SED) 's|\(.*\)|use "\1";|' > $@
++ echo "val main = Main.mainWrapped;" >> $@
diff --git a/srcpkgs/mlton/patches/30-mlbdeps.patch b/srcpkgs/mlton/patches/30-mlbdeps.patch
new file mode 100644
index 0000000000000..03a6ad7188d30
--- /dev/null
+++ b/srcpkgs/mlton/patches/30-mlbdeps.patch
@@ -0,0 +1,60 @@
+--- /dev/null
++++ b/bin/mlbdeps
+@@ -0,0 +1,57 @@
++#!/usr/bin/env bash
++
++set -e
++
++SED=${SED:-sed}
++
++name=$(basename "$0")
++
++function normalize_path () {
++ local path="$1"
++ local opath=""
++ while [ "$opath" != "$path" ]; do
++ opath="$path"
++ path="$(echo "$path" | ${SED} -e 's;^\./;;')"
++ done
++ local opath=""
++ while [ "$opath" != "$path" ]; do
++ opath="$path"
++ path="$(echo "$path" | ${SED} -e 's;/\./;/;')"
++ done
++ opath=""
++ while [ "$opath" != "$path" ]; do
++ opath="$path"
++ path="$(echo "$path" | ${SED} -e 's;[^/][^/]*/\.\./;;')"
++ done
++ path="$(echo "$path" | ${SED} -e 's;^\./;;')"
++ echo "$path"
++}
++
++declare -a seen
++
++function doit() {
++ local mlb="$1"
++ for s in "${seen[@]}"; do
++ if [ "$mlb" == "$s" ]; then
++ return 0
++ fi
++ done
++ seen+=("$mlb");
++ echo "$mlb"
++ if [ -e "$mlb" ]; then
++ local dir="$(dirname $mlb)"
++ for f in $(cat "$mlb" | ${SED} -n -e 's/^[ ]*\([^ ]*\.\(sml\|sig\|fun\|mlb\)\).*/\1/p'); do
++ case "$f" in
++ /*) ;;
++ \$\(*\)*) ;;
++ *) f="$(normalize_path "$dir"/"$f")" ;;
++ esac
++ case "$f" in
++ *.mlb) doit "$f";;
++ *) echo "$f";;
++ esac
++ done
++ fi
++}
++
++doit "$(normalize_path "$1")"
diff --git a/srcpkgs/mlton/patches/40-mlton.patch b/srcpkgs/mlton/patches/40-mlton.patch
new file mode 100644
index 0000000000000..0056419b29359
--- /dev/null
+++ b/srcpkgs/mlton/patches/40-mlton.patch
@@ -0,0 +1,20 @@
+--- a/Makefile
++++ b/Makefile
+@@ -308,7 +308,7 @@ smlnj-mlton-x16:
+ bootstrap-polyml:
+ $(MAKE) polyml-mlton
+ $(RM) "$(BIN)/$(MLTON)"
+- $(MAKE) BOOTSTRAP_MLTON=$(MLTON).polyml all
++ $(MAKE) OLD_MLTON="$(BIN)/$(MLTON).polyml" all
+ $(RM) "$(LIB)/$(MLTON)-polyml$(EXE)"
+ $(RM) "$(BIN)/$(MLTON).polyml"
+
+@@ -317,7 +317,7 @@ polyml-mlton:
+ $(MAKE) dirs
+ $(MAKE) runtime
+ $(MAKE) -C "$(SRC)/mlton" polyml-mlton
+- $(CP) "$(SRC)/mlton/mlton-polyml$(EXE)" "$(LIB)/"
++ $(CP) "$(SRC)/mlton/$(MLTON_OUTPUT)-polyml$(EXE)" "$(LIB)/"
+ $(MAKE) script
+ $(MAKE) basis-no-check
+ $(MAKE) libraries-no-check
diff --git a/srcpkgs/mlton/patches/50-mlton-stubs.patch b/srcpkgs/mlton/patches/50-mlton-stubs.patch
new file mode 100644
index 0000000000000..2100195398282
--- /dev/null
+++ b/srcpkgs/mlton/patches/50-mlton-stubs.patch
@@ -0,0 +1,19 @@
+--- a/mlton/Makefile
++++ b/mlton/Makefile
+@@ -136,13 +136,13 @@ mlton-stubs.mlb: $(shell "$(RUN_MLTON_DEPS)" -stop f ../lib/stubs/mlton-stubs/so
+ echo '$$(SML_LIB)/basis/sml-nj.mlb'; \
+ echo '$$(SML_LIB)/basis/mlton.mlb'; \
+ echo '$$(SML_LIB)/basis/basis.mlb'; \
+- $(RUN_MLTON) -stop f mlton.mlb | \
++ $(SRC)/bin/mlbdeps mlton.mlb | \
+ $(GREP) -v 'mlb$$' | \
+ $(GREP) 'mlyacc'; \
+- $(RUN_MLTON) -stop f ../lib/stubs/mlton-stubs/sources.mlb | \
++ $(SRC)/bin/mlbdeps ../lib/stubs/mlton-stubs/sources.mlb | \
+ $(GREP) -v 'mlb$$' | \
+ $(GREP) 'mlton-stubs'; \
+- $(RUN_MLTON) -stop f mlton.mlb | \
++ $(SRC)/bin/mlbdeps mlton.mlb | \
+ $(GREP) -v 'mlb$$' | \
+ $(GREP) -v 'sml/basis' | \
+ $(GREP) -v 'targets' | \
diff --git a/srcpkgs/mlton/patches/60-clean-polyml.patch b/srcpkgs/mlton/patches/60-clean-polyml.patch
new file mode 100644
index 0000000000000..8cd33967efa31
--- /dev/null
+++ b/srcpkgs/mlton/patches/60-clean-polyml.patch
@@ -0,0 +1,10 @@
+--- a/Makefile
++++ b/Makefile
+@@ -310,6 +310,7 @@ bootstrap-polyml:
+ $(RM) "$(BIN)/$(MLTON)"
+ $(MAKE) OLD_MLTON="$(BIN)/$(MLTON).polyml" all
+ $(RM) "$(LIB)/$(MLTON)-polyml$(EXE)"
++ $(RM) "$(LIB)/$(MLTON_OUTPUT)-polyml$(EXE)"
+ $(RM) "$(BIN)/$(MLTON).polyml"
+
+ .PHONY: polyml-mlton
diff --git a/srcpkgs/mlton/template b/srcpkgs/mlton/template
new file mode 100644
index 0000000000000..ac86588d05ae3
--- /dev/null
+++ b/srcpkgs/mlton/template
@@ -0,0 +1,31 @@
+# Template file for 'mlton'
+pkgname=mlton
+version=20210117
+revision=1
+build_style=gnu-makefile
+make_build_target=bootstrap-polyml
+hostmakedepends="polyml tar"
+makedepends="gmp-devel"
+depends="bash gcc gmp-devel"
+short_desc="MLton Standard ML (SML) compiler"
+maintainer="ii8 <murray.calavera@protonmail.com>"
+license="HPND"
+homepage="http://mlton.org/"
+distfiles="https://github.com/MLton/mlton/releases/download/on-${version}-release/mlton-${version}.src.tgz
+ https://github.com/MLton/mlton/commit/f074a9a41b5338303271cd50f17078595fef35ff.patch>mllex.patch"
+checksum="ec7a5a54deb39c7c0fa746d17767752154e9cb94dbcf3d15b795083b3f0f154b
+ da73a393384ac8e1094dc59b1a19cf73f506d0481354ced814cd894a83216272"
+skip_extraction="mllex.patch"
+nocross=yes
+
+post_extract() {
+ cp "${XBPS_SRCDISTDIR}/${pkgname}-${version}/mllex.patch" .
+}
+
+pre_patch() {
+ patch -Np1 -i mllex.patch
+}
+
+case "$XBPS_TARGET_MACHINE" in
+ i686*) broken="The 2nd bootstrap mlton(built by the polyml-mlton) segfaults in parseAndElaborate" ;;
+esac
next prev parent reply other threads:[~2023-11-08 13:40 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-28 19:09 [PR PATCH] " ii8
2023-10-28 20:36 ` [PR PATCH] [Updated] " ii8
2023-10-29 8:04 ` Bnyro
2023-11-07 16:40 ` leahneukirchen
2023-11-07 17:14 ` ii8
2023-11-07 17:17 ` leahneukirchen
2023-11-07 17:17 ` leahneukirchen
2023-11-07 17:28 ` ii8
2023-11-07 17:35 ` ii8
2023-11-07 17:40 ` leahneukirchen
2023-11-07 23:40 ` [PR PATCH] [Updated] " ii8
2023-11-08 0:33 ` ii8
2023-11-08 12:15 ` leahneukirchen
2023-11-08 12:16 ` leahneukirchen
2023-11-08 12:26 ` ii8
2023-11-08 12:30 ` leahneukirchen
2023-11-08 13:40 ` ii8 [this message]
2023-12-01 13:10 ` [PR PATCH] [Merged]: " leahneukirchen
2023-12-01 14:54 ` leahneukirchen
2023-12-01 21:26 ` ii8
2023-12-02 17:58 ` leahneukirchen
-- strict thread matches above, loose matches on Subject: below --
2023-06-24 22:59 [PR PATCH] New Package: mlton-20210117 CabrioletDiskette
2023-06-24 23:09 ` [PR PATCH] [Updated] " CabrioletDiskette
2023-06-24 23:11 ` CabrioletDiskette
2023-06-25 3:29 ` CabrioletDiskette
2023-06-25 3:30 ` CabrioletDiskette
2023-06-25 22:47 ` CabrioletDiskette
2023-06-26 3:51 ` CabrioletDiskette
2023-06-26 3:56 ` CabrioletDiskette
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20231108134010.tGQHXPe996q9ieU7tSBBc4rXeNYpAnAhO3U-gYXC5aI@z \
--to=ii8@users.noreply.github.com \
--cc=ml@inbox.vuxu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).