stages: 2/02-squashfs: apply a patch to fix FTBFS against glibc 2.28 or major
[dragora.git] / stages / 2 / 02-squashfs
blob83d6a3df1a54c95d47ee6e4f3db9a6c1d837f1aa
1 # Build script for squashfs4.3+.
3 # Copyright (c) 2018-2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 #    http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 # From http://github.com/plougher/squashfs-tools
18 # commit 6e242dc
19 version=master
21 cd -- "$TMPDIR"
22 rm -rf squashfs-tools-${version} \
23        "${rootdir}/squashfs-tools_lzip"
24 unpack "${worktree}/sources/squashfs-tools-${version}.zip"
26 # Build instructions
27 cd squashfs-tools-${version}
29 # Note:
30 # The build environment for cross-compilation is not imported,
31 # the squashfs-tools installation must work from the host system,
32 # this will produce the compressed squash-image
34 # Apply a patch to include LZIP support
35 patch -p1 < "${worktree}/patches/squashfs-tools/squashfs-tools-20180628_lzip-0.diff"
37 # Fix compilation against glibc 2.28+ (patch coming from Debian)
38 patch -p1 < "${worktree}/patches/squashfs-tools/0010-fix_FTBFS_with_glibc_2.28.patch"
40 cd squashfs-tools
42 make -j${jobs} \
43  CC=cc LDFLAGS="" all INSTALL_DIR="${rootdir}/squashfs-tools_lzip"
45 make -j${jobs} \
46  CC=cc LDFLAGS="" install INSTALL_DIR="${rootdir}/squashfs-tools_lzip"
48 cleanup()
50     cd -- "$TMPDIR" && rm -rf squashfs-tools-${version}