libidn2 is a package designed for internationalized string handling based on standards from the Internet Engineering Task Force (IETF)'s IDN working group, designed for internationalized domain names.
Create the PKGBUILD for the libidn2 package with the following commands:
mkdir /sources/libidn2
cd /sources/libidn2
cat > PKGBUILD << "REALEOF"
# Maintainer: Linux From Scratch <lfs-dev@lists.linuxfromscratch.org>
pkgname="libidn2"
pkgver="2.3.8"
pkgrel="1"
pkgdesc="A library for internationalized string handling based on standards from the IETF IDN working group"
arch=('x86'
'x86_64')
url="https://www.gnu.org/software/libidn2/"
groups=('core')
license=('GPLv2'
'LGPLv3')
depends=('libunistring'
'glibc'
'rootfs')
makedepends=('bash'
'binutils'
'coreutils'
'diffutils'
'gawk'
'gcc'
'grep'
'make'
'sed')
source=('https://ftp.gnu.org/gnu/libidn/libidn2-2.3.8.tar.gz')
md5sums=('a8e113e040d57a523684e141970eea7a')
build() {
cd "${pkgname}-${pkgver}"
./configure --prefix=/usr --disable-static
make
}
package(){
cd "${pkgname}-${pkgver}"
make DESTDIR="${pkgdir}" install
}
REALEOF
Prepare the build directory for the pacman user and build the package:
chown -R root:pacman . chmod 2775 . chmod 664 PKGBUILD su pacman -c 'makepkg -L --nodeps'
Add the newly created package to the central package repository:
cp libidn2-2.3.8-1-$(uname -m).pkg.tar.xz \
/srv/pacman/repos/LFS/
repo-add /srv/pacman/repos/LFS/LFS.db.tar.xz \
/srv/pacman/repos/LFS/libidn2-2.3.8-1-$(uname -m).pkg.tar.xz
Update the local cache and install the libidn2 package:
pacman -Syu pacman -S libidn2 --overwrite \* -dd --noconfirm
Finally, copy the source files into the source repository and clean up the build directory:
mkdir /srv/pacman/source/LFS/libidn2 cp PKGBUILD /srv/pacman/source/LFS/libidn2 cd /sources rm -rf libidn2