Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

app-misc/meilisearch Replace Python autogen with YAML-based generator… #243

Merged
merged 1 commit into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 0 additions & 61 deletions core-server-kit/curated/app-misc/meilisearch/autogen.py

This file was deleted.

8 changes: 8 additions & 0 deletions core-server-kit/curated/app-misc/meilisearch/autogen.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
meilisearch_rule:
generator: github-1
packages:
- meilisearch:
github:
query: releases
extensions:
- rust
Original file line number Diff line number Diff line change
Expand Up @@ -21,37 +21,21 @@ BDEPEND="

S="${WORKDIR}/{{ github_user }}-{{ github_repo }}-{{ sha[:7] }}"

RESTRICT="network-sandbox"
geaaru marked this conversation as resolved.
Show resolved Hide resolved

MEILI_DATA_DIR="/var/lib/${PN}"

pkg_setup() {
enewgroup "${PN}"
enewuser "${PN}" -1 -1 "${MEILI_DATA_DIR}" "${PN}"
}

src_prepare() {
default

# Patch lindera-unidic to use the unidic-mecab src downloaded by the ebuild
local lindera_unidic_build=$(find "${WORKDIR}"/cargo_home/gentoo/lindera-unidic-* -iname build.rs)

# Replace the input/unpacked folder with our version
sed -i 's|\(let input_dir =.*\)\("unidic-mecab.*"\)\(.*\)|\1"{{ unidic.final_name.rsplit(".", 1)[0] }}"\3|' "${lindera_unidic_build}"

# Replace the path to the source with the one downloaded by the ebuild
sed -i "s|\(let source_path_for_build =\).*$|\1 Path::new("'"'"${DISTDIR}/{{ unidic.final_name }}"'"'");|" "${lindera_unidic_build}"

if use mini-dashboard; then
# Inject path to downloaded mini-dashboard build
sed -i "s|{{ dashboard_url }}|${DISTDIR}/{{ artifacts["mini-dashboard"][0].final_name }}|g" "${S}"/meilisearch/Cargo.toml

# Replace HTTP fetch with direct file read
sed -i -r 's|(let dashboard_assets_bytes =)(.*)$|\1 std::fs::read(url)?;|' "${S}"/meilisearch/build.rs
fi
src_unpack() {
cargo_src_unpack
}

src_configure() {
CARGO_FEATURES=(
"analytics"
"meilisearch-types/all-tokenizations"
"$(usex mini-dashboard mini-dashboard '')"
)
Expand All @@ -68,7 +52,7 @@ src_compile() {
}

src_install() {
cargo_src_install --path meilisearch --frozen \
cargo_src_install --path crates/meilisearch --frozen \
--no-default-features ${CARGO_FEATURES:+--features "${CARGO_FEATURES[*]}"}

mkdir -p "${ED}"/"${MEILI_DATA_DIR}"
Expand Down