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
cd
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 &&
 wget https://ftpmirror.gnu.org/gnu/libidn/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 https://ftpmirror.gnu.org/gnu/libidn/libidn2-2.0.5.tar.lz.sig &&
  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
make

# Become root to install it
su

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

# Install it
make install
ldconfig

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

# Become yourself again
exit

# Save the source for later
cd
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:
cd
su
test -d src/libidn2-* && ( cd src/libidn2-* ; make uninstall )
rm -f /usr/bin/idn2 \
/usr/include/idn2.h \
/usr/info/libidn2.info \
/usr/lib*/libidn2.* \
/usr/lib64/pkgconfig/libidn2.pc \
/usr/man/man1/idn2.1 \
/usr/man/man3/idn2_*.3
ldconfig
exit
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>