Tag Archives: UTF8

Compiling nano with UTF-8 support for Synology

The version of nano in Optware doesn’t have UTF-8 support for some reason. This took me ages to get working – hopefully it’ll help someone else.
I have made a compiled binary for Marvell Kirkwood CPU available here.

These are the steps taken to compile your own from source (you will need to have bootstrapped your NAS and have the development tools installed):

#-----compile ncurses static library - neither DSM nor ipkg provide headers
cd /volume1/@tmp
wget http://ftp.gnu.org/pub/gnu/ncurses/ncurses-5.9.tar.gz
tar xvfz ncurses-5.9.tar.gz
cd ncurses-5.9
./configure --prefix=/opt --enable-widec
mkdir /tmp/lib
cp lib/libncursesw.a /tmp/lib
cd ..
#-----compile nano
wget http://www.nano-editor.org/dist/v2.2/nano-2.2.6.tar.gz
tar xvfz nano-2.2.6.tar.gz
cd nano-2.2.6
./configure --prefix=/opt --includedir=/volume1/@tmp/ncurses-5.9/include --libdir=/tmp/lib --enable-utf8 --disable-nls --enable-color --enable-extra --enable-multibuffer --enable-nanorc
sed -i -e 's/^CPPFLAGS = -I\/usr\/include\/ncursesw/CPPFLAGS = -I\/volume1\/@tmp\/ncurses-5.9\/include -L\/tmp\/lib/' Makefile
sed -i -e 's/^CPPFLAGS = -I\/usr\/include\/ncursesw/CPPFLAGS = -I\/volume1\/@tmp\/ncurses-5.9\/include -L\/tmp\/lib/' src/Makefile
sed -i -e 's/^LDFLAGS.*$/LDFLAGS = -L\/tmp\/lib/' Makefile
sed -i -e 's/^LDFLAGS.*$/LDFLAGS = -L\/tmp\/lib/' src/Makefile
make install