summaryrefslogtreecommitdiff
path: root/system
diff options
context:
space:
mode:
authorDuncan Roe <duncan_roe@optusnet.com.au>2022-03-23 16:11:05 +0000
committerWilly Sudiarto Raharjo <willysr@slackbuilds.org>2022-03-26 01:20:04 +0700
commit9296d4a87d30434afd3c1c426a58519f03c1f341 (patch)
tree34ecb4a11c70980a03b3ef2d4cc8368d2647683c /system
parent231234ede39c1c7f190a9fa2d6b0655a1b301bfe (diff)
downloadslackbuilds-9296d4a87d30434afd3c1c426a58519f03c1f341.tar.gz
system/afdko: Fix downloading during build.
Stop downloading of antlr4, cmake and ninja. Add antlr4 to REQUIRES. Signed-off-by: Dave Woodfall <dave@slackbuilds.org> Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'system')
-rw-r--r--system/afdko/afdko.SlackBuild34
-rw-r--r--system/afdko/afdko.info2
2 files changed, 31 insertions, 5 deletions
diff --git a/system/afdko/afdko.SlackBuild b/system/afdko/afdko.SlackBuild
index 1cd6e7cc81..3087469674 100644
--- a/system/afdko/afdko.SlackBuild
+++ b/system/afdko/afdko.SlackBuild
@@ -26,7 +26,7 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=afdko
VERSION=${VERSION:-3.8.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -79,18 +79,44 @@ find -L . \
\( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \
-o -perm 440 -o -perm 400 \) -exec chmod 644 {} \;
+# These fixes are a bit of a forceful attack on cmake files but seem to
+# work for now.
+#
+# 1 cmake tries to download a few things while building.
+# 2 then ld tries to link to the static library it thinks has
+# been downloaded and built.
+
+# stop trying to git clone antlr4
+sed -i "/include(ExternalAntlr4Cpp)/d
+ /ExternalProject_Add_Step/d" CMakeLists.txt
+
+# add antlr4 include dir
mkdir -p build
cd build
cmake \
- -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS" \
- -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS" \
+ -DCMAKE_C_FLAGS:STRING="$SLKCFLAGS -I/usr/include/antlr4-runtime" \
+ -DCMAKE_CXX_FLAGS:STRING="$SLKCFLAGS -I/usr/include/antlr4-runtime" \
-DCMAKE_INSTALL_PREFIX=/usr \
-DCMAKE_BUILD_TYPE=Release ..
+
+# fix linking #1
+sed -i "s,antlr4_static,antlr4-runtime," \
+ c/makeotf/source/CMakeFiles/makeotfexe.dir/link.txt
+
make
make install/strip DESTDIR=$PKG
cd ..
-python3 setup.py install --root=$PKG
+# don't download cmake or ninja
+sed -i "/'cmake',/d
+ /'ninja'/d" setup.py
+
+# fix linking #2
+sed -i "s,antlr4_static,antlr4-runtime,g" \
+ c/makeotf/lib/hotconv/CMakeLists.txt
+
+CXXFLAGS="$SLKCFLAGS -I/usr/include/antlr4-runtime" \
+ python3 setup.py install --root=$PKG
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
diff --git a/system/afdko/afdko.info b/system/afdko/afdko.info
index 5b01fccef6..e0db54f7f4 100644
--- a/system/afdko/afdko.info
+++ b/system/afdko/afdko.info
@@ -5,6 +5,6 @@ DOWNLOAD="https://github.com/adobe-type-tools/afdko/releases/download/3.8.0/afdk
MD5SUM="b74fd869589bd672e9c50ab73a169e4e"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
-REQUIRES="python-fonttools wheel scikit-build lxml"
+REQUIRES="python-fonttools wheel scikit-build lxml antlr4"
MAINTAINER="Duncan Roe"
EMAIL="duncan_roe@optusnet.com.au"