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
make
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
make install
Advertisements

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

    Reply

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s