Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Macos subtree fix #1194

Draft
wants to merge 23 commits into
base: ide
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 41 additions & 7 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ die() {

usage() {
local gambit_config_help="$(cd src/gambit && ./configure --help | tail -n +63)"

cat <<EOF
This script configures the Gerbil and integrated Gambit build.

Usage: $0 [option] ... [var=value]...

Options controlling integrated Gambit configuration:
${gambit_config_help}

Options understood and processed by Gerbil:
--prefix=PREFIX where to install Gerbil; default prefix is /opt/gerbil
--dist[=no|maybe|yes] conform with the Filesystem Hierarchy Standard (FHS) for installation.
If \${prefix}/bin exists as a directory this is likely not a Gerbil-only installation and "maybe" tests for that.
defaults to "maybe".

--with-gambit=TAG integrated gambit git tag to check out for the build;
defaults to ${default_gambit_tag}
--enable-march=ARCH specify the machine architecture; it can be empty.
Expand All @@ -43,7 +43,13 @@ Gerbil Standard Library features:
--disable-sqlite

Default integrated Gambit configuration: ${default_gambit_config}

Options controlling integrated Gambit configuration:
${gambit_config_help}


EOF

}


Expand All @@ -65,14 +71,23 @@ package_out_of_tree() {
echo "It is now available as an external package: github.com/mighty-gerbils/gerbil-${pkg}"
}

gerbil_dist="maybe"
gerbil_maybe_in_dist () {
if [ -d "${prefix}/bin" ] && [ ! -L "${prefix}/bin" ]; then
gerbil_dist="yes"
else
gerbil_dist="no"
fi
}

if [ -f MANIFEST ] ; then
. ./MANIFEST
readonly gerbil_version="$gerbil_stamp_version"
else
readonly gerbil_version="$(git describe --tags --always)"
fi
readonly gerbil_targets=""
readonly default_gambit_tag=6d1a9a9b11e9c184834f4d6cdc0651aeaf71dcd1
readonly default_gambit_tag=8b18ab69504c2d41301f7fec16a5350db717a20e
drewc marked this conversation as resolved.
Show resolved Hide resolved
readonly default_gambit_config="--enable-targets=${gerbil_targets} --enable-single-host --enable-dynamic-clib --enable-default-runtime-options=tE8,f8,-8 --enable-trust-c-tco"
prefix="/opt/gerbil"
readonly cflags_opt="-foptimize-sibling-calls"
Expand Down Expand Up @@ -111,6 +126,16 @@ while [ $# -gt 0 ]; do
shift
;;

--enable-dist)
gerbil_dist=yes
shift
;;

--enable-dist=*)
gerbil_dist=$(echo "$1" | cut -d = -f 2-)
shift
;;

--with-gambit=*)
gambit_tag=$(echo "$1" | cut -d = -f 2-)
shift
Expand Down Expand Up @@ -208,8 +233,15 @@ while [ $# -gt 0 ]; do
;;
esac
done
if [ "${gerbil_dist}" = "maybe" ] ; then
gerbil_maybe_in_dist
fi

gerbil_prefix="${prefix}/${gerbil_version}"
if [ "${gerbil_dist}" = "no" ] ; then
gerbil_prefix="${prefix}/${gerbil_version}"
else
gerbil_prefix="${prefix}/libexec/gerbil/${gerbil_version}"
fi

if [ -z "${CFLAGS}" ]; then
CFLAGS="${cflags_opt}"
Expand Down Expand Up @@ -257,8 +289,10 @@ fi
rm -f build-env.sh
cat > build-env.sh <<EOF
GERBIL_PREFIX=${gerbil_prefix}
GERBIL_DIST=${gerbil_dist}
GERBIL_FHS=${prefix}
GERBIL_VERSION=${gerbil_version}
export GERBIL_PREFIX GERBIL_VERSION
export GERBIL_PREFIX GERBIL_VERSION GERBIL_DIST GERBIL_FHS
EOF

exit 0
58 changes: 58 additions & 0 deletions macos/README.org
Original file line number Diff line number Diff line change
Expand Up @@ -216,3 +216,61 @@ lrwxr-xr-x 1 root wheel 11 5 Mar 17:31 src -> current/src
drwxr-xr-x 7 root wheel 224 5 Mar 17:31 v0.18.1-51-gd9c691b1
#+end_src

* MacPorts

The easy way.

#+begin_src sh
cd ~/src/gerbil/macos/ports

prefix=/opt/local
SRC_CONF="${prefix}/etc/macports/sources.conf"

add_source () {
SRC="${1:-`pwd`}"
TMP="$(mktemp)"

echo "file://$SRC" > $TMP
cat ${SRC_CONF} >> $TMP
sudo mv -v $TMP $SRC_CONF
}

maybe_add_source () {
SRC="${1:-`pwd`}"
grep -e "$SRC" "$SRC_CONF" || add_source $SRC
}

maybe_add_source
portindex

#+end_src



#+begin_src tcl :tangle ./ports/lang/gerbil-scheme/Portfile :mkdirp #t
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0

name gerbil-scheme
version 0.18.1
categories lang
platforms darwin
license {LGPL-2.1+ Apache-2}
maintainers nomaintainer
description Gerbil Scheme
long_description Gerbil Scheme: A LISP for the 21st Century
homepage https://cons.io

fetch.type git
git.url https://github.com/mighty-gerbils/gerbil.git
git.branch v0.18.1

depends_lib port:openssl3 \
port:zlib

depends_build port:autoconf

configure.args --enable-march=

#+end_src
24 changes: 24 additions & 0 deletions macos/ports/lang/gerbil-scheme/Portfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:ft=tcl:et:sw=4:ts=4:sts=4

PortSystem 1.0

name gerbil-scheme
version 0.18.1
categories lang
platforms darwin
license {LGPL-2.1+ Apache-2}
maintainers nomaintainer
description Gerbil Scheme
long_description Gerbil Scheme: A LISP for the 21st Century
homepage https://cons.io

fetch.type git
git.url https://github.com/mighty-gerbils/gerbil.git
git.branch v0.18.1

depends_lib port:openssl3 \
port:zlib

depends_build port:autoconf

configure.args --enable-march=
Loading