summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
author Bloyburt <alexpen@startmail.com>2023-11-12 09:57:40 +0700
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2023-11-12 13:40:31 +0700
commitd25a8c355bfa103ea3dd54885df13adc1c4c8300 (patch)
treec31bfeb1c512e3d9773ef816dca63e85dc354b07
parent4c3bb304ceeb53bac78bffaf93d68f00924bd275 (diff)
downloadslackbuilds-d25a8c355bfa103ea3dd54885df13adc1c4c8300.tar.gz
slackbuilds-d25a8c355bfa103ea3dd54885df13adc1c4c8300.tar.xz
libraries/zxing-cpp: Moved to libraries and build offline.
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
-rw-r--r--libraries/zxing-cpp/README (renamed from network/zxing-cpp/README)4
-rw-r--r--libraries/zxing-cpp/slack-desc (renamed from network/zxing-cpp/slack-desc)0
-rw-r--r--libraries/zxing-cpp/zxing-cpp.SlackBuild (renamed from network/zxing-cpp/zxing-cpp.SlackBuild)10
-rw-r--r--libraries/zxing-cpp/zxing-cpp.info (renamed from network/zxing-cpp/zxing-cpp.info)4
-rw-r--r--libraries/zxing-cpp/zxing.cmake.patch15
5 files changed, 26 insertions, 7 deletions
diff --git a/network/zxing-cpp/README b/libraries/zxing-cpp/README
index 869519f389..7e7c2ad1d0 100644
--- a/network/zxing-cpp/README
+++ b/libraries/zxing-cpp/README
@@ -18,7 +18,3 @@ Features:
- WebAssembly
- WinRT
- Flutter (external project)
-
-Warning: This SlackBuild requires network access when it runs, meaning
-it downloads files from the Internet with root access. You should
-decide for yourself whether or not you think this is a good idea.
diff --git a/network/zxing-cpp/slack-desc b/libraries/zxing-cpp/slack-desc
index 2211be0a13..2211be0a13 100644
--- a/network/zxing-cpp/slack-desc
+++ b/libraries/zxing-cpp/slack-desc
diff --git a/network/zxing-cpp/zxing-cpp.SlackBuild b/libraries/zxing-cpp/zxing-cpp.SlackBuild
index ff32446124..fd404d7ae7 100644
--- a/network/zxing-cpp/zxing-cpp.SlackBuild
+++ b/libraries/zxing-cpp/zxing-cpp.SlackBuild
@@ -26,9 +26,10 @@ cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=zxing-cpp
VERSION=${VERSION:-2.1.0}
-BUILD=${BUILD:-1}
+BUILD=${BUILD:-2}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
+STBVER=${STBVER:-beebb24b945efdea3b9bba23affb8eb3ba8982e7}
if [ -z "$ARCH" ]; then
case "$( uname -m )" in
@@ -72,6 +73,13 @@ cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
+
+# Use a local version of the stb image library
+patch zxing.cmake $CWD/zxing.cmake.patch
+cp -a $CWD/stb-$STBVER.tar.gz .
+tar xvf stb-$STBVER.tar.gz
+mv stb-$STBVER stb-src
+
chown -R root:root .
find -L . \
\( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \
diff --git a/network/zxing-cpp/zxing-cpp.info b/libraries/zxing-cpp/zxing-cpp.info
index 341b6474d7..8aa3111738 100644
--- a/network/zxing-cpp/zxing-cpp.info
+++ b/libraries/zxing-cpp/zxing-cpp.info
@@ -1,8 +1,8 @@
PRGNAM="zxing-cpp"
VERSION="2.1.0"
HOMEPAGE="https://github.com/zxing-cpp/zxing-cpp"
-DOWNLOAD="https://github.com/zxing-cpp/zxing-cpp/archive/v2.1.0/zxing-cpp-2.1.0.tar.gz"
-MD5SUM="17289e8cd489cda9d72b30f05e6f007d"
+DOWNLOAD="https://github.com/zxing-cpp/zxing-cpp/archive/v2.1.0/zxing-cpp-2.1.0.tar.gz https://github.com/nothings/stb/archive/beebb24/stb-beebb24b945efdea3b9bba23affb8eb3ba8982e7.tar.gz"
+MD5SUM="17289e8cd489cda9d72b30f05e6f007d 7621601c97e2f200d027c2ee86431da7"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""
diff --git a/libraries/zxing-cpp/zxing.cmake.patch b/libraries/zxing-cpp/zxing.cmake.patch
new file mode 100644
index 0000000000..c7fc316223
--- /dev/null
+++ b/libraries/zxing-cpp/zxing.cmake.patch
@@ -0,0 +1,15 @@
+--- zxing.cmake.orig 2023-11-10 19:38:55.601450169 +0000
++++ zxing.cmake 2023-11-10 19:39:15.889449494 +0000
+@@ -12,11 +12,8 @@
+
+ if (NOT STB_FOUND)
+ include(FetchContent)
+- FetchContent_Declare (stb
+- GIT_REPOSITORY https://github.com/nothings/stb.git)
+- FetchContent_MakeAvailable (stb)
+ add_library(stb::stb INTERFACE IMPORTED)
+- target_include_directories(stb::stb INTERFACE ${stb_SOURCE_DIR})
++ target_include_directories(stb::stb INTERFACE ../stb-src)
+ else()
+ add_library(stb::stb ALIAS PkgConfig::STB)
+ endif()