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
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
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

2 thoughts on “Compiling nano with UTF-8 support for Synology

  1. Larry Chan

    tar xvfz line failed until I cut the z
    the configure line give error no acceptable cc found in $PATH
    cannot continue


Leave a Reply to patters Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s