Installing ldc beta on macOS
Serg Gini
kornburn at yandex.ru
Tue Sep 23 08:31:52 UTC 2025
On Monday, 22 September 2025 at 22:34:18 UTC, Joel wrote:
> On Monday, 22 September 2025 at 10:28:42 UTC, kinke wrote:
>> On Monday, 22 September 2025 at 09:40:45 UTC, Joel wrote:
>>> (see title)
>>> https://github.com/ldc-developers/ldc/releases/tag/v1.41.0-beta1
>>>
>>> I tried homebrew, and that compiles, but doesn't run. (I've
>>> uninstalled it from there).
>>>
>
> I don't think home brew has the latest version. How do I
> install ldc with out home brew?
There are a plethora of options!
1) Just download archive from GitHub Releases.
Extract it to your favorite folder.
Add this folder to the PATH.
(unlock externally downloaded binary files - specific macOS
protection)
Done.
2) This is the script from macOS D maintainer - which is
installing LDC with some common tools into /opt/SDKs. Better to
remove /opt/SDKs first.
```bash
# Setup SDK Root
if [[ ! -d /opt/SDKs ]]; then
sudo mkdir -p /opt/SDKs/
sudo chmod -R 777 /opt/SDKs
curl -o /opt/SDKs/init.sh
https://gist.githubusercontent.com/LunaTheFoxgirl/60cda49e9fd9b95c837f2d4c09706523/raw/7e9fee07357459dcc55df8de5ae4f40a6d5a34a4/init.sh
chmod +x /opt/SDKs/init.sh
echo "source /opt/SDKs/init.sh" | sudo tee -a /etc/profile
fi
echo "Setting up .buildtmp..."
mkdir .buildtmp;
cd .buildtmp
# 1. Install LDC into our new SDK Root
if [[ ! -d /opt/SDKs/ldc2 ]]; then
echo "Downloading LDC2..."
mkdir -p /opt/SDKs/ldc2
curl -L
https://github.com/ldc-developers/ldc/releases/download/v1.41.0/ldc2-1.41.0-osx-universal.tar.xz -o ldc2.tar.xz
echo "Extracting LDC2..."
tar xf ldc2.tar.xz
echo "Installing LDC2...."
mv ldc2-1.41.0-osx-universal/* /opt/SDKs/ldc2
export PATH=/opt/SDKs/ldc2/bin:$PATH
rm -r ldc2*
# 2. Install new DUB
echo "Building latest dub from source..."
git clone https://github.com/dlang/dub
dub build --root=dub/ --build=release
echo "Staging dub into /opt/SDKs/ldc2/bin..."
cp dub/bin/dub /opt/SDKs/ldc2/bin/
fi
# 3. Build serve-d and DCD from latest source.
echo "Rebuilding serve-d and dcd..."
if [[ ! -d "/opt/SDKs/serve-d" ]]; then
echo "Install directory not found, creating..."
mkdir -p /opt/SDKs/serve-d/bin
mkdir -p /opt/SDKs/dcd/bin
fi
git clone https://github.com/Pure-D/serve-d
git clone https://github.com/dlang-community/DCD
dub build --root=dcd --dest=/opt/SDKs/ --build=release
--config=client
dub build --root=dcd --dest=/opt/SDKs/ --build=release
--config=server
dub build --root=serve-d --build=release
cp serve-d/serve-d /opt/SDKs/serve-d/bin/
echo "Cleaning up..."
cd ..
rm -rf .buildtmp
echo "Done!"
```
3) There is also this project
https://code.dlang.org/packages/ldcup
More information about the digitalmars-d-ldc
mailing list