mirror of
https://github.com/gentoo-mirror/guru.git
synced 2026-10-12 17:51:11 -04:00
as per the coding style guide: https://projects.gentoo.org/qa/policy-guide/ebuild-format.html#pg0101 if it previously used [ ${PV} ... ] it uses [[ ${PV} ... ]] now if it previously used [[ ${PV} = b ]] or [ ${PV} = b ], it uses [[ ${PV} == b ]] now the changes were generated using these two commands: ``` find -name '*.ebuild' -exec sed -i -E \ 's|([^[])\[+(\s+)(\S*\$\S*PV\S*)(\s+)(\S+)(\s+)(\S+)(\s+)\]+([^]])|\1\[\[\2\3\4\5\6\7\8\]\]\9|g' \ {} \+ find -name '*.ebuild' -exec sed -i -E \ 's|\[(\s+)(\S*\$\S*PV\S*)(\s+)==?(\s+)(\S+)(\s+)\]|\[\1\2\3==\4\5\6\]|g' \ {} \+ ``` this is aimed to be a series of commits meant to replace all instance of POSIX [ ... ] to bash's [[ ... ]], to make guru up to date with the coding style guide this process is divided up into a series of commits in order to make review and testing more easy Signed-off-by: ingenarel (NeoJesus) <ingenarel_neojesus@disroot.org> Part-of: https://codeberg.org/gentoo/guru/pulls/6 Signed-off-by: Michał Górny <mgorny@gentoo.org>
204 lines
6.0 KiB
Bash
204 lines
6.0 KiB
Bash
# Copyright 2024-2026 Gentoo Authors
|
|
# Distributed under the terms of the GNU General Public License v2
|
|
|
|
EAPI=8
|
|
|
|
DESCRIPTION="Chat client for https://twitch.tv"
|
|
HOMEPAGE="https://chatterino.com/"
|
|
|
|
CERTIFY_COMMIT="a448a3915ddac716ce76e4b8cbf0e7f4153ed1e2"
|
|
EXPECTED_COMMIT="df5814711f5f9111a2515a181bde67f22f2fe716"
|
|
LIBCOMMUNI_COMMIT="9dc0de7c91d362abc431f680dd94e81eadf41622"
|
|
LUA_COMMIT="1ab3208a1fceb12fca8f24ba57d6e13c5bff15e3"
|
|
MAGIC_COMMIT="1384769c66bd16ec9bb1353f45fe8ec8ccc12dbd"
|
|
MINIAUDIO_COMMIT="9634bedb5b5a2ca38c1ee7108a9358a4e233f14d"
|
|
RAPIDJSON_COMMIT="24b5e7a8b27f42fa16b96fc70aade9106cf7102f"
|
|
SERIALIZE_COMMIT="a3103cdf29f66da243c150b0962a3c20e7d059eb"
|
|
SETTINGS_COMMIT="d9246de5677f369054231ddb4d663be6b1eaf45d"
|
|
SIGNALS_COMMIT="d5fdf0e823a6cd3153e5982ec9aa40f737f59b21"
|
|
SOL2_COMMIT="2b0d2fe8ba0074e16b499940c4f3126b9c7d3471"
|
|
DATE_COMMIT="179a6b921ccd6179b5b04dce812a89f71a51b4df"
|
|
FMT_COMMIT="123913715afeb8a437e6388b4473fcc4753e1c9a"
|
|
|
|
SRC_URI="
|
|
https://github.com/Chatterino/certify/archive/${CERTIFY_COMMIT}.tar.gz
|
|
-> ${PN}-certify-${CERTIFY_COMMIT}.tar.gz
|
|
https://github.com/HowardHinnant/date/archive/${DATE_COMMIT}.tar.gz
|
|
-> ${PN}-date-${DATE_COMMIT}.tar.gz
|
|
https://github.com/nonstd-lite/expected-lite/archive/${EXPECTED_COMMIT}.tar.gz
|
|
-> ${PN}-expected-${EXPECTED_COMMIT}.tar.gz
|
|
https://github.com/fmtlib/fmt/archive/${FMT_COMMIT}.tar.gz
|
|
-> ${PN}-fmt-${FMT_COMMIT}.tar.gz
|
|
https://github.com/Chatterino/libcommuni/archive/${LIBCOMMUNI_COMMIT}.tar.gz
|
|
-> ${PN}-libcommuni-${LIBCOMMUNI_COMMIT}.tar.gz
|
|
https://github.com/lua/lua/archive/${LUA_COMMIT}.tar.gz
|
|
-> ${PN}-lua-${LUA_COMMIT}.tar.gz
|
|
https://github.com/Neargye/magic_enum/archive/${MAGIC_COMMIT}.tar.gz
|
|
-> ${PN}-magic-${MAGIC_COMMIT}.tar.gz
|
|
https://github.com/mackron/miniaudio/archive/${MINIAUDIO_COMMIT}.tar.gz
|
|
-> ${PN}-miniaudio-${MINIAUDIO_COMMIT}.tar.gz
|
|
https://github.com/Tencent/rapidjson/archive/${RAPIDJSON_COMMIT}.tar.gz
|
|
-> ${PN}-rapidjson-${RAPIDJSON_COMMIT}.tar.gz
|
|
https://github.com/pajlada/serialize/archive/${SERIALIZE_COMMIT}.tar.gz
|
|
-> ${PN}-serialize-${SERIALIZE_COMMIT}.tar.gz
|
|
https://github.com/pajlada/settings/archive/${SETTINGS_COMMIT}.tar.gz
|
|
-> ${PN}-settings-${SETTINGS_COMMIT}.tar.gz
|
|
https://github.com/pajlada/signals/archive/${SIGNALS_COMMIT}.tar.gz
|
|
-> ${PN}-signals-${SIGNALS_COMMIT}.tar.gz
|
|
https://github.com/ThePhD/sol2/archive/${SOL2_COMMIT}.tar.gz
|
|
-> ${PN}-sol2-${SOL2_COMMIT}.tar.gz
|
|
"
|
|
|
|
if [[ "${PV}" == "9999" ]]; then
|
|
EGIT_REPO_URI="https://github.com/Chatterino/chatterino2.git/"
|
|
EGIT_BRANCH="master"
|
|
EGIT_SUBMODULES=() # disable submodules
|
|
|
|
inherit git-r3
|
|
else
|
|
SRC_URI+="https://github.com/Chatterino/chatterino2/archive/v${PV}.tar.gz -> ${P}.tar.gz"
|
|
S="${WORKDIR}/chatterino2-${PV}"
|
|
|
|
KEYWORDS="~amd64"
|
|
fi
|
|
|
|
inherit cmake flag-o-matic optfeature xdg
|
|
|
|
LICENSE="MIT"
|
|
# bundled dependencies
|
|
LICENSE+=" Boost-1.0 MIT Unlicense"
|
|
SLOT="0"
|
|
IUSE="debug libnotify +plugins spell"
|
|
|
|
RESTRICT="mirror"
|
|
|
|
RDEPEND="
|
|
dev-libs/openssl:=
|
|
dev-qt/qtbase:6[concurrent,gui,network,widgets]
|
|
dev-qt/qtsvg:6
|
|
dev-qt/qtimageformats:6
|
|
libnotify? (
|
|
dev-libs/glib:2
|
|
x11-libs/gdk-pixbuf:2
|
|
x11-libs/libnotify
|
|
)
|
|
spell? ( app-text/hunspell )
|
|
"
|
|
DEPEND="
|
|
${RDEPEND}
|
|
dev-libs/boost:=
|
|
"
|
|
BDEPEND="dev-qt/qttools:6[linguist]"
|
|
|
|
pkg_pretend() {
|
|
if ! test-flag-CXX -std=c++23; then
|
|
eerror "${P} requires C++23-capable C++ compiler. Your current compiler"
|
|
eerror "does not seem to support -std=c++23 option. Please upgrade your compiler"
|
|
eerror "to gcc-11 or an equivalent version supporting C++23."
|
|
die "Currently active compiler does not support -std=c++23"
|
|
fi
|
|
}
|
|
|
|
if [[ "${PV}" == "9999" ]]; then
|
|
src_unpack() {
|
|
local pkg
|
|
local -a pkgs=(
|
|
certify-${CERTIFY_COMMIT}
|
|
date-${DATE_COMMIT}
|
|
expected-${EXPECTED_COMMIT}
|
|
fmt-${FMT_COMMIT}
|
|
libcommuni-${LIBCOMMUNI_COMMIT}
|
|
lua-${LUA_COMMIT}
|
|
magic-${MAGIC_COMMIT}
|
|
miniaudio-${MINIAUDIO_COMMIT}
|
|
rapidjson-${RAPIDJSON_COMMIT}
|
|
serialize-${SERIALIZE_COMMIT}
|
|
settings-${SETTINGS_COMMIT}
|
|
signals-${SIGNALS_COMMIT}
|
|
sol2-${SOL2_COMMIT}
|
|
)
|
|
|
|
for pkg in "${pkgs[@]}"; do
|
|
unpack ${PN}-${pkg}.tar.gz
|
|
done
|
|
|
|
git-r3_src_unpack
|
|
}
|
|
fi
|
|
|
|
src_prepare() {
|
|
local lib sublib
|
|
local -a libs=(
|
|
certify
|
|
expected-lite
|
|
libcommuni
|
|
magic_enum
|
|
miniaudio
|
|
rapidjson
|
|
serialize
|
|
settings
|
|
signals
|
|
sol2
|
|
)
|
|
|
|
for lib in "${libs[@]}"; do
|
|
rmdir lib/"${lib}" || die "can't remove stubbed libdir: ${lib}"
|
|
ln -sr ../"${lib}"-* ./lib/"${lib}" || die "failed to create symlink for ${lib}"
|
|
done
|
|
|
|
# bundled sublibs for twitch-eventsub-ws lib
|
|
libs=(
|
|
date
|
|
fmt
|
|
)
|
|
|
|
for lib in "${libs[@]}"; do
|
|
sublib=lib/twitch-eventsub-ws/lib/"${lib}"
|
|
rmdir "${sublib}" || die "can't remove stubbed libdir: ${lib}"
|
|
ln -sr ../"${lib}"-* ./"${sublib}" || die "failed to create symlink for ${lib}"
|
|
done
|
|
# --
|
|
|
|
# bundled lua -- see chatterino2/pull/6495
|
|
rmdir lib/lua/src || die
|
|
ln -sr ../lua-* lib/lua/src || die
|
|
|
|
# delete ccache detection - already handled by portage
|
|
sed -i -e '/CCACHE_PROGRAM ccache/,+6d' CMakeLists.txt || die "Sed ccache1 broke !"
|
|
sed -i -e '/CCACHE_FOUND ccache/,+8d' lib/rapidjson/CMakeLists.txt || "Sed ccache2 broke !"
|
|
|
|
# disable doxygen automagic detection
|
|
# doyxgen doc generation seems anyway broken for now
|
|
sed -i -e '/find_package(Doxygen)/d' CMakeLists.txt || die "Sed doxygen1 broke !"
|
|
sed -i -e 's/Build rapidjson documentation." ON/Build rapidjson documentation." OFF/g' \
|
|
lib/rapidjson/CMakeLists.txt || die "Sed doxygen2 broke !"
|
|
|
|
# bug 936966
|
|
sed 's/-Werror[^[:space:])"]*//' -i --follow-symlinks \
|
|
{src,lib/{magic_enum/test,rapidjson,serialize,settings}}/CMakeLists.txt || \
|
|
die "Sed Werror broke !"
|
|
|
|
cmake_src_prepare
|
|
}
|
|
|
|
src_configure() {
|
|
local CMAKE_BUILD_TYPE=$(usex debug Debug Release)
|
|
|
|
local mycmakeargs=(
|
|
-DBUILD_WITH_QT6=ON
|
|
-DBUILD_WITH_LIBNOTIFY=$(usex libnotify)
|
|
-DCHATTERINO_PLUGINS=$(usex plugins)
|
|
-DCHATTERINO_SPELLCHECK=$(usex spell)
|
|
-DCHATTERINO_UPDATER=OFF
|
|
)
|
|
|
|
use debug || append-cxxflags -DNDEBUG
|
|
|
|
cmake_src_configure
|
|
}
|
|
|
|
pkg_postinst() {
|
|
xdg_pkg_postinst
|
|
optfeature "for opening streams in a local video player" net-misc/streamlink
|
|
}
|