From 8707af962574d8737d3feb2cf4e8981f914888fb Mon Sep 17 00:00:00 2001 From: Mazin Fadl Date: Mon, 16 Oct 2023 18:48:53 -0400 Subject: [PATCH] New package: abaddon-0.1.12 --- srcpkgs/abaddon/files/abaddon.desktop | 8 ++++ srcpkgs/abaddon/patches/build_number.patch | 40 ++++++++++++++++ srcpkgs/abaddon/patches/cmake.patch | 14 ++++++ srcpkgs/abaddon/template | 54 ++++++++++++++++++++++ 4 files changed, 116 insertions(+) create mode 100644 srcpkgs/abaddon/files/abaddon.desktop create mode 100644 srcpkgs/abaddon/patches/build_number.patch create mode 100644 srcpkgs/abaddon/patches/cmake.patch create mode 100644 srcpkgs/abaddon/template diff --git a/srcpkgs/abaddon/files/abaddon.desktop b/srcpkgs/abaddon/files/abaddon.desktop new file mode 100644 index 0000000000000..7515311284c34 --- /dev/null +++ b/srcpkgs/abaddon/files/abaddon.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Name=abaddon +Type=Application +Comment=Alternative Discord client using GTK +Exec=/usr/bin/abaddon +TryExec=/usr/bin/abaddon +Icon=abaddon +Categories=Network;InstantMessaging; diff --git a/srcpkgs/abaddon/patches/build_number.patch b/srcpkgs/abaddon/patches/build_number.patch new file mode 100644 index 0000000000000..5e2640e78aa86 --- /dev/null +++ b/srcpkgs/abaddon/patches/build_number.patch @@ -0,0 +1,40 @@ +fix fetching build number, based on upstream commits 'cdc4a30' and '2d9988b' +Author: ouwou <26526779+ouwou@users.noreply.github.com> + +--- a/src/startup.cpp ++++ b/src/startup.cpp +@@ -29,10 +29,22 @@ std::optional> ParseCookie(const Glib::ustri + } + + std::optional GetJavascriptFileFromAppPage(const Glib::ustring &contents) { +- auto regex = Glib::Regex::create(R"(app-mount.*(/assets/[\w\d]*.js).*/assets/[\w\d]*.js)"); ++ auto regex = Glib::Regex::create(R"(/assets/\w{20}.js)"); ++ std::vector matches; ++ ++ // regex->match_all doesnt work for some reason ++ int start_position = 0; + Glib::MatchInfo match; +- if (regex->match(contents, match)) { +- return match.fetch(1); ++ while (regex->match(contents, start_position, match)) { ++ const auto str = match.fetch(0); ++ matches.push_back(str); ++ int foo; ++ match.fetch_pos(0, start_position, foo); ++ start_position += str.size(); ++ } ++ ++ if (matches.size() >= 7) { ++ return matches[matches.size() - 7]; + } + + return {}; +@@ -52,7 +64,7 @@ std::optional GetBuildNumberFromJSURL(const Glib::ustring &url, const + auto res = req.execute(); + if (res.error) return {}; + +- auto regex = Glib::Regex::create(R"("buildNumber",null!==\(t="(\d+)\"\))"); ++ auto regex = Glib::Regex::create("buildNumber:\"(\\d+)\""); + Glib::MatchInfo match; + Glib::ustring string = res.text; + if (regex->match(string, match)) { diff --git a/srcpkgs/abaddon/patches/cmake.patch b/srcpkgs/abaddon/patches/cmake.patch new file mode 100644 index 0000000000000..c42868a25ae5c --- /dev/null +++ b/srcpkgs/abaddon/patches/cmake.patch @@ -0,0 +1,14 @@ +fix cross-build + +--- a/CMakeLists.txt 2023-08-29 00:30:45.000000000 -0400 ++++ b/CMakeLists.txt 2023-10-17 12:40:08.372798709 -0400 +@@ -212,7 +212,8 @@ + NAMES miniaudio.h + HINTS subprojects + PATH_SUFFIXES miniaudio +- REQUIRED) ++ REQUIRED ++ NO_CMAKE_FIND_ROOT_PATH) + + if (APPLE) + target_link_libraries(abaddon "-framework CoreFoundation") diff --git a/srcpkgs/abaddon/template b/srcpkgs/abaddon/template new file mode 100644 index 0000000000000..15bf5bae204f2 --- /dev/null +++ b/srcpkgs/abaddon/template @@ -0,0 +1,54 @@ +# Template file for 'abaddon' +pkgname=abaddon +version=0.1.12 +revision=1 +_ixwebsocket_commit="bc765e73a31ea5372e36d1b1add036af3218cb17" +_keychain_commit="502312f59fdc44fa1103e67f8f17cec3affb82d9" +_miniaudio_commit="7384bde3725412523871f0fcf60efe5c47fbbfc6" +_qrcodegen_commit="22fac31bdf81da68730c177c0e931c93234d2a30" +build_style=cmake +hostmakedepends="pkg-config" +makedepends="gtkmm-devel libcurl-devel sqlite-devel openssl-devel + json-c++ libsecret-devel libhandy1-devel opus-devel spdlog + libsodium-devel rnnoise-devel" +depends="gtkmm libcurl openssl libsecret libhandy1 libsodium libspdlog" +short_desc="Alternative Discord client with voice support made with C++ and GTK3" +maintainer="Mazin Fadl " +license="GPL-3.0-only" +homepage="https://github.com/uowuo/abaddon" +distfiles="https://github.com/uowuo/abaddon/archive/refs/tags/v${version}.tar.gz + https://github.com/machinezone/IXWebSocket/archive/${_ixwebsocket_commit}.tar.gz + https://github.com/hrantzsch/keychain/archive/${_keychain_commit}.tar.gz + https://github.com/mackron/miniaudio/archive/${_miniaudio_commit}.tar.gz + https://github.com/nayuki/QR-Code-generator/archive/${_qrcodegen_commit}.tar.gz" +checksum="1372ab9d3fb8c6fd6a3f8b6a900df1028d09d9407b12645aa682135711071113 + 9dea909d05e882a540526b15fbdc9764a39deb53810eb86ad797fd8135a02275 + 3c57d272a06419ed58068d9fe14c16807041bf9b9b372b80950b9b09d08cf441 + 4b3648bf227f2373af773c6769f9c147e38d99edd74cd0736f4df1eff224e6c6 + 218e3e96ded7880d05f47c668aad6541a08e63303ac4d783720389087da6f4ed" +skip_extraction=" + ${_ixwebsocket_commit}.tar.gz + ${_keychain_commit}.tar.gz + ${_miniaudio_commit}.tar.gz + ${_qrcodegen_commit}.tar.gz + " + +post_extract() { + vsrcextract -C subprojects/ixwebsocket ${_ixwebsocket_commit}.tar.gz + vsrcextract -C subprojects/keychain ${_keychain_commit}.tar.gz + vsrcextract -C subprojects/miniaudio ${_miniaudio_commit}.tar.gz + vsrcextract -C subprojects/qrcodegen ${_qrcodegen_commit}.tar.gz +} + +do_install() { + vmkdir usr/bin + vmkdir usr/share/abaddon + vmkdir usr/share/applications + vcopy build/abaddon usr/bin + vcopy res/css usr/share/abaddon + vcopy res/res usr/share/abaddon + + vdoc README.md + + vinstall "${FILESDIR}/abaddon.desktop" 644 usr/share/applications +}