This repository has been archived by the owner on Aug 28, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 142
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
182a178
commit b32dc1b
Showing
4 changed files
with
45 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
#!/usr/bin/env bash | ||
|
||
# We need only binary wkhtmltox files in lambda layer, so we delete all the others | ||
rm -rf /tgt/wkhtmltox/{include,share,lib} | ||
|
||
# We need to copy dependencies which are not presented in amazonlinux2 image | ||
libs="libjpeg libpng15 libXrender libfontconfig libfreetype libXext libX11 libxcb libXau libexpat libuuid libbz2" | ||
mkdir -p /tgt/wkhtmltox/lib | ||
for lib in $(echo $libs); do | ||
echo ".*${lib}\.so\.[0-9]{1,2}" | xargs find /usr/lib64 -regextype posix-awk -regex | xargs cp -t /tgt/wkhtmltox/lib/ | ||
done | ||
|
||
# To be able to create pdf files we need a font. | ||
# There is one (dejavu) in the docker image used for compilation. | ||
cp -r /usr/share/fonts /tgt/wkhtmltox/ | ||
cat >/tgt/wkhtmltox/fonts/fonts.conf <<EOL | ||
<?xml version="1.0"?> | ||
<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> | ||
<fontconfig> | ||
<dir>/var/task/fonts</dir> | ||
<dir>/opt/fonts</dir> | ||
<cachedir>/tmp/fonts-cache</cachedir> | ||
<config></config> | ||
</fontconfig> | ||
EOL |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters