summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakub 'Eremiell' Marek2022-06-14 09:16:17 +0200
committerJakub 'Eremiell' Marek2022-06-14 09:16:17 +0200
commitf7a34fb75e37a3a9ec86cd98a28164446a72b2e5 (patch)
treea2a4c62d3f35d2cb5dab6877d7f3fb585ce59c7d
downloadaur-f7a34fb75e37a3a9ec86cd98a28164446a72b2e5.tar.gz
🎉 Add package to AUR, version 10.0.10-1
* Initial build * Cmake semibroken (upstream) * Can't check PGP signature (upstream) * Tests turned off as one is failing (upstream) * Embedded fmt and nlohmann/json replaced by packages * Attempted repro, can't get it right
-rw-r--r--.SRCINFO20
-rw-r--r--PKGBUILD47
-rw-r--r--dpp.changelog24
-rw-r--r--dpp.install12
4 files changed, 103 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..14ed7259881a
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,20 @@
+pkgbase = dpp
+ pkgdesc = Lightweight and Scalable C++ Discord API Bot Library
+ pkgver = 10.0.10
+ pkgrel = 1
+ url = https://dpp.dev/
+ install = dpp.install
+ changelog = dpp.changelog
+ arch = x86_64
+ license = Apache
+ makedepends = cmake
+ depends = openssl
+ depends = zlib
+ depends = opus
+ depends = libsodium
+ depends = fmt
+ depends = nlohmann-json
+ source = dpp-10.0.10.tar.gz::https://github.com/brainboxdotcc/DPP/archive/refs/tags/v10.0.10.tar.gz
+ sha256sums = 2a1c26f606298e5b683d1e140219c434e61c4b22e8510fa2a2d5f7b6758dff95
+
+pkgname = dpp
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b7c479761c3e
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,47 @@
+# Maintainer: Jakub 'Eremiell' Marek <eremiell at eremiell dot net>
+# See also https://github.com/eremiell-aur/dpp
+pkgname=dpp
+_pkgname=DPP
+pkgver=10.0.10
+pkgrel=1
+pkgdesc="Lightweight and Scalable C++ Discord API Bot Library"
+arch=('x86_64')
+url="https://dpp.dev/"
+license=('Apache')
+depends=('openssl' 'zlib' 'opus' 'libsodium' 'fmt' 'nlohmann-json')
+makedepends=('cmake')
+install="${pkgname}.install"
+changelog="${pkgname}.changelog"
+source=("${pkgname}-${pkgver}.tar.gz::https://github.com/brainboxdotcc/${_pkgname}/archive/refs/tags/v${pkgver}.tar.gz")
+sha256sums=('2a1c26f606298e5b683d1e140219c434e61c4b22e8510fa2a2d5f7b6758dff95')
+
+prepare() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ find . \( -iname "*.h" -o -iname "*.cpp" \) -exec sed -i -E "s/dpp\/(nlohmann|fmt)\//\1\//" '{}' \+
+ sed -i -E "s/install\(TARGETS dpp LIBRARY DESTINATION (.*)\)/install\(TARGETS dpp EXPORT dpp-targets LIBRARY DESTINATION \1\)\ninstall\(EXPORT dpp-targets DESTINATION \1\)/" "CMakeLists.txt"
+ sed -i -E "s/libdpp/dpp/" "CMakeLists.txt" "cmake/libdpp-config.cmake"
+ sed -i -E "s/libdpp-config/dpp-config/" "cmake/CPackSetup.cmake"
+ mv "cmake/libdpp-config.cmake" "cmake/dpp-config.cmake"
+}
+
+build() {
+ cd "${srcdir}/${_pkgname}-${pkgver}"
+ mkdir -p build
+ cd build
+ cmake -DDPP_BUILD_TEST=OFF -DRUN_LDCONFIG=OFF -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_INSTALL_MESSAGE=NEVER -Wno-dev ..
+ make
+}
+
+package() {
+ cd "${srcdir}/${_pkgname}-${pkgver}/build"
+ make DESTDIR="${pkgdir}/" install
+ rm -rf "${pkgdir}/usr/include/dpp/fmt"
+ rm -rf "${pkgdir}/usr/include/dpp/nlohmann"
+ rm -rf "${pkgdir}/usr/include/dpp-${pkgver%.*}"
+ install -dm755 "${pkgdir}/usr/lib/cmake/${pkgname}/"
+ find "${pkgdir}" -iname "*.cmake" -exec mv -t "${pkgdir}/usr/lib/cmake/${pkgname}" '{}' \+
+ rm -rf "${pkgdir}/usr/lib/dpp-${pkgver%.*}/"
+ find "${pkgdir}" -iname "*.cmake" -exec sed -i -E "s/\/dpp-${pkgver%.*}//g" '{}' \+
+ sed -i -E "s/if\(_realCurr STREQUAL _realOrig\)/if\(1\)/" "${pkgdir}/usr/lib/cmake/dpp/dpp.cmake" "${pkgdir}/usr/lib/cmake/dpp/dpp-targets.cmake"
+ sed -i -E "s/([ \(_]dpp)/\1::dpp/" "${pkgdir}/usr/lib/cmake/dpp/dpp-targets-noconfig.cmake"
+}
diff --git a/dpp.changelog b/dpp.changelog
new file mode 100644
index 000000000000..23fdf97807cb
--- /dev/null
+++ b/dpp.changelog
@@ -0,0 +1,24 @@
+# 10.0.10-1 / 2022-06-14
+
+* first build on the AUR
+ * preceeded by a bunch of test builds and finetuning
+ * consulted and collaborated with upstream
+* cmake integration is semibroken as mentioned in .install
+ * attempts were made to narrow it down a bit
+ * it at least doesn't outright fail after the patches
+ * reported to upstream, may hopefully be eventually fixed
+ * not high priority to upstream
+ * officially recommended to just -ldpp
+* tarballs are not currently signed
+ * commits are but pubkey is not available (on purpose)
+ * may or may not change in the future
+* tests currently turned off as one is failing
+ * shouldn't affect deployments on UTC bound servers
+ * also reported and in investigation
+* embedded fmt and nlohmann/json replaced by packaged versions
+ * other packages follow the fashion, may become cmake flag
+ * mind that when looking up online tutorials
+* attempts have been made to reprobuild
+ * while build should be reproducible, observing discrepancies
+ * likely stemming from slight difference between chroot setup
+ * to be further researched \ No newline at end of file
diff --git a/dpp.install b/dpp.install
new file mode 100644
index 000000000000..ec53654af812
--- /dev/null
+++ b/dpp.install
@@ -0,0 +1,12 @@
+post_install() {
+ echo -e "\e[31mNotice cmake find_package() doesn't currently work all the way.\e[0m"
+ echo -e "\e[31mThis is a known upstream issue and will hopefully get fixed eventually.\e[0m"
+ echo -e "\e[31mYou may want to use pkg-config to integrate into your cmake for now.\e[0m"
+ echo ""
+ echo -e "\e[1;33mAlso be aware one of the time conversion tests fail on devices not set to UTC.\e[0m"
+ echo -e "\e[1;33mThis shouldn't affect your server deploys but may play role on your dev machine.\e[0m"
+ echo ""
+ echo -e "\e[32mTo keep things lean and clean, embedded fmt and nlohmann/json\e[0m"
+ echo -e "\e[32mhave been replaced by packaged versions.\e[0m"
+ echo -e "\e[32mMind that when looking up online tutorials.\e[0m"
+} \ No newline at end of file