Linux HOWTOs

About | Home | Search

HOWTO: libidn2
Description: Implementation of the IDNA2008 + TR46 specifications
Click here for ChangeLog
NOTE: I use GNU tar >= 1.13.25 so it's -j for .tar.bz2 files,
it's safe to assume that make, gcc, binutils, fileutils/coreutils, gawk, sed, and grep are prerequisites for almost everything

# GNU Libidn 2.0.5
# ================
# IDN = Internationalized Domain Names

# There is currently no libidn2 Slackware package, but there is one
# in slackware-current

# There is also a libidn, which is libidn x.x  Here we have libidn2 x.x.x

# Libidn2 2.0.5 released

# Prerequisites:
# lzip (for tar to be able to decompress tar.lz)
# gettext (if you do not use --disable-nls)
# Valgrind (optional)
# libc's iconv or libiconv
# pkg-config
# gtk-doc (Slackware includes this in the sgml-tools/linuxdoc-tools)
# Ronn (optional; ruby-based, builds manuals)

# Get it
test -f installed/libidn2-2.0.5.tar.lz &&
 mv -f installed/libidn2-2.0.5.tar.lz .
test ! -f libidn2-2.0.5.tar.lz &&

# Verify tarball w/ sha1sum:
# (this came from my gpg-verified tarball)
echo "45e89e8942c3a56dcb0ebef49fccd39e9727d76c  libidn2-2.0.5.tar.lz" | \
sha1sum -c

# Verify tarball w/ gpg:
( gpg --list-keys A2670428 > /dev/null 2>&1 || gpg --recv-keys A2670428 ) &&
 wget -nc &&
  gpg --verify libidn2-2.0.5.tar.lz.sig && rm libidn2-2.0.5.tar.lz.sig

# Extract the source
mkdir -p -m 0700 ~/src
cd ~/src
find -maxdepth 1 -type d -name "libidn2-*" -exec rm -r {} \;
tar xvf ~/libidn2-2.0.5.tar.lz
cd libidn2-2.0.5
test $UID = 0 && chown -R root:root .

# I use --disable-nls because I only read/write English (well)
# Seems kind of odd to use for a library that handles internationalization,
# so you may want to leave that off

# Configure the build for 64-bit
test $(uname -m) = 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info --libdir=/usr/lib64 \
--mandir=/usr/man --disable-static --disable-nls

# Configure the build for anything else
test $(uname -m) != 'x86_64' &&
./configure --prefix=/usr --infodir=/usr/info --mandir=/usr/man \
--disable-static --disable-nls

# Build it

# Become root to install it

# Remove the Slackware package, if there is one
# You will still have* after this because it is also
# part of the aaa_elflibs package
test -x /sbin/removepkg && /sbin/removepkg libidn2

# Install it
make install

# Make sure your non-root user can remove the source later
chown -R $(logname) .
chmod -R u+w .

# Become yourself again

# Save the source for later
mkdir -p -m 0700 src
rm -f installed/libidn2-*.tar.*
mv libidn2-2.0.5.tar.lz installed/

# If you ever want to uninstall Libidn2, this should do it:
test -d src/libidn2-* && ( cd src/libidn2-* ; make uninstall )
rm -f /usr/bin/idn2 \
/usr/include/idn2.h \
/usr/info/ \
/usr/lib*/libidn2.* \
/usr/lib64/pkgconfig/libidn2.pc \
/usr/man/man1/idn2.1 \
find ~/src -maxdepth 1 -type d -name "libidn2-*" -exec rm -r {} \;
rm -f ~/installed/libidn2-*.tar.*

Back to the list

Last updated: Wed, 29 Apr 2020 22:04:50 -0400
Jason Englander <jason at englanders dot us>