Skip to content

Commit 2bafbb6

Browse files
committed
racket
1 parent e6c9a5b commit 2bafbb6

File tree

3 files changed

+100
-0
lines changed

3 files changed

+100
-0
lines changed

.travis.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
language: generic
2+
3+
matrix:
4+
include:
5+
- os: linux
6+
services:
7+
- docker
8+
script:
9+
- |
10+
bash -c "while true; do echo \$(date) - travis building ...; sleep 540; done" &
11+
export PING_LOOP_PID=$!
12+
- |
13+
cat <<-EOF | docker run -i ubuntu bash -
14+
set -e
15+
export DEBIAN_FRONTEND=noninteractive
16+
apt-get update -qq && apt-get install -qq git curl build-essential unzip m4
17+
git clone https://github.com/asdf-vm/asdf.git
18+
. asdf/asdf.sh
19+
asdf plugin-test racket https://github.com/vic/asdf-racket.git 'racket --help'
20+
EOF
21+
after_script:
22+
- kill -9 $PING_LOOP_PID
23+
24+
- os: osx
25+
before_script:
26+
- git clone https://github.com/asdf-vm/asdf.git
27+
- . asdf/asdf.sh
28+
script:
29+
- |
30+
bash -c "while true; do echo \$(date) - travis building ...; sleep 540; done" &
31+
export PING_LOOP_PID=$!
32+
- asdf plugin-test racket https://github.com/vic/asdf-racket.git 'racket --help'
33+
after_script:
34+
- kill -9 $PING_LOOP_PID

bin/install

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env bash
2+
3+
racket_pkg() {
4+
local version=$1
5+
local platform="src-builtpkgs"
6+
if [ "${ASDF_RACKET_MINIMAL}" == "true" ]; then
7+
platform="src"
8+
fi
9+
echo "https://mirror.racket-lang.org/installers/${version}/racket-${version}-${platform}.tgz"
10+
}
11+
12+
racket_install() {
13+
local install_type=$1
14+
local release=$2
15+
local install_path=$3
16+
17+
local tmp_dir=$(mktemp -d -t racket_XXXXXXX)
18+
19+
local current_script_path=$(dirname ${BASH_SOURCE[0]})
20+
local plugin_path=$(dirname $current_script_path)
21+
22+
# running this in a subshell
23+
# we don't want to disturb current working dir
24+
(
25+
set -e
26+
cd $tmp_dir
27+
28+
ASDF_RACKET_CONFIG_FLAGS="${ASDF_RACKET_CONFIG_FLAGS} --prefix ${install_path}"
29+
30+
if [ "$(uname -s)" == "Darwin" ]; then
31+
ASDF_RACKET_CONFIG_FLAGS="${ASDF_RACKET_CONFIG_FLAGS} --enable-macprefix"
32+
fi
33+
34+
if [ "$install_type" != "version" ]; then
35+
echo "asdf-racket supports release installs only."
36+
exit 1
37+
fi
38+
39+
echo ${racket_pkg}
40+
curl -L "$(racket_pkg $release)" > racket-${release}.tgz
41+
tar -xf racket-${release}.tgz
42+
cd racket-${release}/src/
43+
./configure ${ASDF_RACKET_CONFIG_FLAGS}
44+
make
45+
make install
46+
47+
if [ "${ASDF_RACKET_MINIMAL}" != "true" ]; then
48+
$install_path/bin/raco pkg install --auto -i main-distribution
49+
fi
50+
51+
echo "Installed Racket ${release}"
52+
53+
) || (rm -rf $install_path; exit 1)
54+
}
55+
56+
racket_install $ASDF_INSTALL_TYPE $ASDF_INSTALL_VERSION $ASDF_INSTALL_PATH

bin/list-all

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/usr/bin/env bash
2+
3+
# stolen from https://github.com/rbenv/ruby-build/pull/631/files#diff-fdcfb8a18714b33b07529b7d02b54f1dR942
4+
function sort_versions() {
5+
sed 'h; s/[+-]/./g; s/.p\([[:digit:]]\)/.z\1/; s/$/.z/; G; s/\n/ /' | \
6+
LC_ALL=C sort -t. -k 1,1 -k 2,2n -k 3,3n -k 4,4n -k 5,5n | awk '{print $2}'
7+
}
8+
9+
curl -s https://download.racket-lang.org/all-versions.html | grep -E -o 'Version [0-9.]+' | cut -d' ' -f 2 | sort_versions
10+

0 commit comments

Comments
 (0)