Skip to content

Instantly share code, notes, and snippets.

@turtlemonvh
Last active June 10, 2024 15:36
Show Gist options
  • Save turtlemonvh/09a79a810d485f18af19 to your computer and use it in GitHub Desktop.
Save turtlemonvh/09a79a810d485f18af19 to your computer and use it in GitHub Desktop.
Installing duc on OSX
#!/usr/bin/bash
# DUC: http://duc.zevv.nl/
TKC_VERSION=1.4.48
DUC_VERSION=1.4.0
GLFW_VERSION=3.1.2
if ! which brew ; then
echo "ERROR: brew is required"
exit 1
fi
echo "Checking that xcode command line tools are installed"
xcode-select --install
echo "Setting ownership of /usr/local/bin to current user ($USER)"
sudo chown -R $USER /usr/local/bin
echo "Installing wget"
brew install wget
echo "Installing cmake"
brew install cmake
if [ ! -e /usr/local/lib/libtokyocabinet.a ]; then
echo "Downloading and installing requirement tokyocabinet"
wget http://fallabs.com/tokyocabinet/tokyocabinet-$TKC_VERSION.tar.gz
tar xzvf tokyocabinet-$TKC_VERSION.tar.gz
cd tokyocabinet-$TKC_VERSION
./configure
make
sudo make install
cd -
fi
# Skipping since even after installing this, duc can't find opengl library
if [ ! -e /usr/local/include/GLFW/glfw3.h ]; then
wget https://github.com/glfw/glfw/releases/download/$GLFW_VERSION/glfw-$GLFW_VERSION.zip
unzip $GLFW_VERSION.zip
cd glfw-$GLFW_VERSION
cmake .
make
make install
cd -
fi
echo "Downloading and installing graphing requirements cairo and pango"
brew install cairo
brew install pango
echo "Downloading and installing duc"
rm -f duc-$DUC_VERSION.tar.gz*
wget https://github.com/zevv/duc/releases/download/$DUC_VERSION/duc-$DUC_VERSION.tar.gz
tar xzvf duc-$DUC_VERSION.tar.gz
cd duc-$DUC_VERSION
./configure --enable-opengl --disable-x11
make
sudo make install # Throws an error about missing /sbin/ldconfig
cd ..
echo "Testing duc: indexing home directory"
sudo duc index ~
echo "Testing duc: listing largest members of home directory"
duc ls -Fgc ~ | head -n30
echo "Testing duc: graphing home directory"
duc graph ~
open duc.png
@turtlemonvh
Copy link
Author

There is still something wrong with the fonts.

duc

@turtlemonvh
Copy link
Author

@turtlemonvh
Copy link
Author

To use cgi (see docs: https://htmlpreview.github.io/?https://github.com/zevv/duc/blob/master/doc/duc.1.html#CGI-INTERFACING)

cd duc
mkdir cgi-bin
echo '#!/bin/sh' > cgi-bin/duc.cgi
echo '/usr/local/bin/duc cgi -d ~/.duc.db' > cgi-bin/duc.cgi
chmod +x cgi-bin/duc.cgi
python -m CGIHTTPServer

And visit http://localhost:8000/cgi-bin/duc.cgi

It doesn't seem to work very well. I get Requested path not found whenever I navigate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment