# Copyright 2023-2024 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=8 CRATES="" # declare -A GIT_CRATES=( # [libwayshot]='https://github.com/waycrate/wayshot;68a5c6ac1ce6373f43abe9703e8c515e840ab4d7;wayshot-%commit%' # #[libwayshot]="https://github.com/waycrate/wayshot?branch=freeze-feat-andreas" # ) declare -A GIT_CRATES=( [libwayshot]='https://github.com/waycrate/wayshot;68a5c6ac1ce6373f43abe9703e8c515e840ab4d7;wayshot-%commit%' ) inherit cargo git-r3 DESCRIPTION="Zoomer application for Wayland inspired by tsoding's boomer" HOMEPAGE="https://github.com/coffeeispower/woomer" EGIT_REPO_URI="https://github.com/coffeeispower/${PN}.git" LICENSE="MPL-2.0" SLOT="0" RDEPEND=" virtual/rust media-libs/raylib[wayland,system-glfw] " QA_FLAGS_IGNORED="usr/bin/${PN}" src_unpack() { git-r3_src_unpack cargo_live_src_unpack } # src_prepare() { default local crate commit crate_uri crate_dir local -a sed_scripts for crate in "${!GIT_CRATES[@]}"; do IFS=';' read -r \ crate_uri commit crate_dir <<< "${GIT_CRATES[${crate}]}" # Taken from dev-util/difftastic::gentoo ebuilds sed_scripts+=( "s|^(${crate}[[:space:]]*=[[:space:]]*[{].*)([[:space:]]*git[[:space:]]*=[[:space:]]*['\"][[:graph:]]+['\"][[:space:]]*)(.*[}])|\1path = '${WORKDIR}/cargo_home/gentoo/libwayshot'\3|;" "s|^(${crate}[[:space:]]*=[[:space:]]*[{].*)([,][[:space:]]*branch[[:space:]]*=[[:space:]]*['\"][[:graph:]]+['\"][[:space:]]*)(.*[}])|\1\3|;" ) done sed -i -E -e "${sed_scripts[*]}" Cargo.toml || die "Failed to override dependencies in Cargo.toml" sed -i '/^\[patch\./{N;d;}' ${WORKDIR}/cargo_home/config.toml } # # src_configure() { # cargo_src_configure --bin woomer # #cargo_src_configure --bin woomer --frozen # } # # src_compile() { # cargo_src_compile # } # # src_install() { # dodoc README.md # # if use debug ; then # cd target/debug || die # else # cd target/release || die # fi # # cargo_src_install --offline # dobin ${PN} # }