90.21. wimlib-1.14.5
Library and wimlib-imagex tool for Windows Imaging (WIM) archives
| Version | 1.14.5, release 1 |
| Shelf | archiver — Compression libraries and archive tools |
| Phase | 41_system (System), 82 of 1047 in build order |
| Licence | GPL-3.0-or-later |
| Homepage | https://wimlib.net/ |
| Build time | 0.3 SBU |
| Installed size | 2.3 MiB in 60 files |
| Recipe | ports/core/archiver/wimlib/kpkgbuild |
About
wimlib reads, writes and mounts Windows Imaging (WIM) archives, the format of the images in a Windows installation medium, as a library and the wimlib-imagex command, with wimapply, wimcapture, wimmount, wimsplit and the other commands that run it. impression, which writes a disk image to a USB drive or memory card, splits a Windows installer with it.
Why it is in KDOS
The comment above it in script/phases/41_system/packages.d/archiver.txt:
Windows Imaging archives: what Impression splits a Windows installer with.
Sources
wimlib-1.14.5.tar.gz(1.0 MiB)
sha25684221a3abd5b91228f15f8e6065c335a336237b5738197b75bf419eea561a194
upstream: https://wimlib.net/downloads/wimlib-1.14.5.tar.gz
archive copy: sources-1/archiver--wimlib-1.14.5.tar.gz
Dependencies
Depends on: pkgconf, fuse, ntfs-3g.
Required by (1): impression.
Patches
build.sh applies these; kpkg applies nothing by itself.
pc-fuse3.patch— correctsconfigureso thatwimlib.pcnamesfuse3inRequires.private, the module configure itself checks for, instead offuse. The fuse port installsfuse3.pcand nofuse.pc, so without the patch the installedwimlib.pcnames a module that does not exist (see the pkg-config rule in What the package lint refuses).
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/41_system/phase.env && kpkg install wimlib'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/archiver/wimlib.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/archiver/wimlib
echo '84221a3abd5b91228f15f8e6065c335a336237b5738197b75bf419eea561a194 wimlib-1.14.5.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/wimlib
SRC=$SRC_ROOT/wimlib-1.14.5
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf wimlib-1.14.5.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
patch -p1 -i "$PORT_SRC/pc-fuse3.patch"
./configure --prefix=/usr --disable-static \
--with-ntfs-3g --with-fuse
make
make DESTDIR=$PKG install
PKG_CONFIG_PATH="$PKG/usr/lib/pkgconfig" pkg-config --exists --print-errors --static wimlib
The switches, and why each is set:
--with-ntfs-3g— capture an NTFS volume into a WIM image and apply an image to one directly, with NTFS security descriptors and named data streams, through ntfs-3g. On Linux it is configure’s default, named.--with-fuse—wimmountandwimmountrw, which mount an image through FUSE 3, from the fuse port. On Linux it too is configure’s default, named. With either switch on, a library that is missing stops configure with an error rather than building without the feature.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/wimlib, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf wimlib-1.14.5-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/wimlib, and runs the triggers its paths call for.
Contents
Installed programs: mkwinpeimg, wimappend, wimapply, wimcapture, wimdelete, wimdir, wimexport, wimextract, wiminfo, wimjoin, wimlib-imagex, wimmount, wimmountrw, wimoptimize, wimsplit, wimunmount, wimupdate, wimverify.
Installed libraries: libwim.so.
Installed directories: /usr/share/licenses/wimlib.
Short descriptions
mkwinpeimg |
Make a customized bootable image of Windows PE |
wimapply |
Apply a WIM image |
wimcapture |
Capture or append a WIM image |
wimdelete |
Delete an image from a WIM archive |
wimdir |
List the files contained in a WIM image |
wimexport |
Export image(s) from a WIM archive |
wimextract |
Extract files from a WIM image |
wiminfo |
Display or change information about a WIM file or image |
wimlib-imagex |
Extract, create, modify, or mount a WIM archive |
wimmount |
Mount or unmount a WIM image |
wimoptimize |
Optimize a WIM archive |
wimsplit |
Split a WIM archive into multiple parts |
wimupdate |
Update a WIM image |
wimverify |
Verify a WIM archive |
wimlib.pc |
Library to extract, create, modify, and mount Windows Imaging (WIM) files |
Notes
The last line of build.sh runs pkg-config --static wimlib against the staged wimlib.pc, which reads Requires.private. A configure that writes a module name the tree does not have fails the build there, naming the module, rather than at a consumer’s build.