<commit_before>#!/bin/sh
set -e

LIBS=`pkg-config --libs libcurl 2>/dev/null || echo "-lcurl"`
LIBS=`echo "$LIBS" | sed 's/^-L/-L-L/; s/ -L/ -L-L/g; s/^-l/-L-l/; s/ -l/ -L-l/g'`

# HACK to work around (r)dmd placing -lcurl before the object files - which is wrong if --as-needed is used
# On newer Ubuntu versions this is the default, though
uname -a | grep "Ubuntu" > /dev/null && LIBS="-L--no-as-needed $LIBS"

rdmd --build-only -ofbin/dub -g -debug -w -property -Isource $* $LIBS source/app.d
echo DUB has been built as bin/dub<commit_msg>Redo build script to directly call the compiler + limited compiler auto-detection.<commit_after>#!/bin/sh
set -e

if [ "$DC" == "" ]; then
	command -v gdmd >/dev/null 2>&1 && DC=gdmd || true
	command -v ldmd2 >/dev/null 2>&1 && DC=ldmd2 || true
	command -v dmd >/dev/null 2>&1 && DC=dmd || true
fi

if [ "$DC" == "" ]; then
	echo >&2 "Failed to detect D compiler. Use DC=... to set a dmd compatible binary manually."
	exit 1
fi

LIBS=`pkg-config --libs libcurl 2>/dev/null || echo "-lcurl"`
LIBS=`echo "$LIBS" | sed 's/^-L/-L-L/; s/ -L/ -L-L/g; s/^-l/-L-l/; s/ -l/ -L-l/g'`

# HACK to work around (r)dmd placing -lcurl before the object files - which is wrong if --as-needed is used
# On newer Ubuntu versions this is the default, though
if [ -f /etc/lsb-release ]; then
	lsb_release -i | grep "Ubuntu" 2> /dev/null && LIBS="-L--no-as-needed $LIBS"
fi

echo Running $DC...
$DC -ofbin/dub -g -debug -w -property -Isource $* $LIBS @build-files.txt
echo DUB has been built as bin/dub.
echo
echo You may want to run
echo sudo ln -s $(pwd)/bin/dub /usr/local/bin
echo now.

{'fraction_non_alphanumeric': 0.18322981366459629, 'fraction_numerical': 0.008074534161490683, 'mean_word_length': 2.8725961538461537, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 14, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2285673', 'n_tokens_mistral': 683, 'n_tokens_neox': 633, 'n_words': 221}