From 639e620c2de1727ac5180106ece050787a6dd8cd Mon Sep 17 00:00:00 2001 From: Mario Haustein Date: Sun, 28 Apr 2024 14:31:39 +0200 Subject: [PATCH] sci-astronomy/siril: fix one definition rule violation Closes: https://bugs.gentoo.org/927345 Signed-off-by: Mario Haustein --- .../siril/files/siril-1.2.1-options.patch | 101 ++++++++++++++++++ sci-astronomy/siril/siril-1.2.1-r1.ebuild | 93 ++++++++++++++++ 2 files changed, 194 insertions(+) create mode 100644 sci-astronomy/siril/files/siril-1.2.1-options.patch create mode 100644 sci-astronomy/siril/siril-1.2.1-r1.ebuild diff --git a/sci-astronomy/siril/files/siril-1.2.1-options.patch b/sci-astronomy/siril/files/siril-1.2.1-options.patch new file mode 100644 index 0000000000000..11a8bdeeef0ca --- /dev/null +++ b/sci-astronomy/siril/files/siril-1.2.1-options.patch @@ -0,0 +1,101 @@ +From 241b4b17d83285eb4bf4151dd77198427ac9fde4 Mon Sep 17 00:00:00 2001 +From: Mario Haustein +Date: Sun, 28 Apr 2024 14:09:19 +0200 +Subject: [PATCH] Fix multiple definition of struct options +Upstream: https://gitlab.com/free-astro/siril/-/merge_requests/668 +Bug: https://bugs.gentoo.org/927345 + +--- a/src/filters/deconvolution/estimate_kernel.cpp ++++ b/src/filters/deconvolution/estimate_kernel.cpp +@@ -33,7 +33,7 @@ extern "C" float *estimate_kernel(estk_data *args, int max_threads) { + if (!cppfftwmultithreaded) + max_threads = 1; + img_t::use_threading(max_threads); +- options opts; ++ estimate_kernel_options opts; + opts.ks = args->ks; + opts.lambda = args->lambda; + opts.lambda_ratio = args->lambda_ratio; +--- a/src/filters/deconvolution/estimate_kernel.hpp ++++ b/src/filters/deconvolution/estimate_kernel.hpp +@@ -56,7 +56,7 @@ void gaussian_downsample(img_t& out, const img_t& _in, float facto + } + } + +-struct options { ++struct estimate_kernel_options { + bool verbose; + int ks; + float lambda; +@@ -81,7 +81,7 @@ template + class ImagePredictor { + public: + virtual void solve(img_t& u, const img_t& K, T lambda, T beta_init, T beta_rate, T beta_max, +- const options& opts) = 0; ++ const estimate_kernel_options& opts) = 0; + virtual ~ImagePredictor() {} + }; + +@@ -114,7 +114,7 @@ public: + } + + void solve(img_t& u, const img_t& K, +- T lambda, T beta_init, T beta_rate, T beta_max, const options& opts) { ++ T lambda, T beta_init, T beta_rate, T beta_max, const estimate_kernel_options& opts) { + assert(K.w % 2); + assert(K.h % 2); + +@@ -177,7 +177,7 @@ public: + template + class KernelEstimator { + public: +- virtual void solve(img_t& k, const img_t& u, const struct options& opts) = 0; ++ virtual void solve(img_t& k, const img_t& u, const struct estimate_kernel_options& opts) = 0; + virtual ~KernelEstimator() {} + }; + +@@ -198,7 +198,7 @@ public: + } + + // implements Algorithm 3 +- void solve(img_t& k, const img_t& u, const struct options& opts) { ++ void solve(img_t& k, const img_t& u, const struct estimate_kernel_options& opts) { + k.resize(ks, ks); + + // solves the Equation (28) +@@ -313,7 +313,7 @@ public: + fv = fft::r2c(v); + } + +- void solve(img_t& k, const img_t& u, const struct options& opts) { ++ void solve(img_t& k, const img_t& u, const struct estimate_kernel_options& opts) { + if (k.w != ks || k.h != ks) + k.resize(ks, ks); + +@@ -407,7 +407,7 @@ public: + // estimates the sharp image and the kernel from a blurry image and an initialization of u + template + void l0_kernel_estimation(img_t& k, img_t& u, const img_t& v, +- const img_t& initu, struct options& opts) { ++ const img_t& initu, struct estimate_kernel_options& opts) { + // static int it = 0; + ImagePredictor* sharp_predictor = nullptr; + sharp_predictor = new L0ImagePredictor(v); +@@ -463,7 +463,7 @@ void l0_kernel_estimation(img_t& k, img_t& u, const img_t& v, + // it assumes that the image was previously processed by preprocess_image + // the inner loop is implemented in l0_kernel_estimation + template +-void multiscale_l0_kernel_estimation(img_t& k, img_t& u, const img_t& v, struct options& opts) { ++void multiscale_l0_kernel_estimation(img_t& k, img_t& u, const img_t& v, struct estimate_kernel_options& opts) { + std::vector> vs; + std::vector kernelSizes; + printf("Multiscale kernel estimation...\n"); +@@ -511,7 +511,7 @@ void multiscale_l0_kernel_estimation(img_t& k, img_t& u, const img_t& v + + // preprocess the input blurry image as describe in Section 2.1 + template +-void preprocess_image(img_t& out, const img_t& _v, struct options& opts) { ++void preprocess_image(img_t& out, const img_t& _v, struct estimate_kernel_options& opts) { + img_t v(_v.w, _v.h); + + // convert to grayscale diff --git a/sci-astronomy/siril/siril-1.2.1-r1.ebuild b/sci-astronomy/siril/siril-1.2.1-r1.ebuild new file mode 100644 index 0000000000000..8b3fc3865d24d --- /dev/null +++ b/sci-astronomy/siril/siril-1.2.1-r1.ebuild @@ -0,0 +1,93 @@ +# Copyright 1999-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +inherit meson optfeature toolchain-funcs xdg + +DESCRIPTION="A free astronomical image processing software" +HOMEPAGE="https://siril.org/" + +if [[ ${PV} == "9999" ]]; then + inherit git-r3 + EGIT_REPO_URI="https://gitlab.com/free-astro/${PN}.git" +else + SRC_URI="https://gitlab.com/free-astro/siril/-/archive/${PV/_/-}/${PN}-${PV/_/-}.tar.bz2" + KEYWORDS="~amd64 ~x86" + S="${WORKDIR}/${PN}-${PV/_/-}" +fi + +LICENSE="GPL-3+ Boost-1.0" +SLOT="0" +IUSE="curl exif ffmpeg heif jpeg libconfig openmp png raw tiff wcs" + +DEPEND=" + >=dev-libs/glib-2.56.0:2 + >=dev-libs/json-glib-1.2.6 + media-libs/librtprocess + >=media-libs/opencv-4.4.0:= + sci-libs/cfitsio:= + sci-libs/fftw:3.0= + sci-libs/gsl:= + x11-libs/gdk-pixbuf:2 + x11-libs/cairo + x11-libs/pango + >=x11-libs/gtk+-3.20.0:3 + curl? ( net-misc/curl ) + exif? ( >=media-gfx/exiv2-0.25:= ) + ffmpeg? ( media-video/ffmpeg:= ) + heif? ( media-libs/libheif:= ) + jpeg? ( media-libs/libjpeg-turbo:= ) + libconfig? ( >=dev-libs/libconfig-1.4:=[cxx] ) + png? ( >=media-libs/libpng-1.6.0:= ) + raw? ( media-libs/libraw:= ) + tiff? ( media-libs/tiff:= ) + wcs? ( >=sci-astronomy/wcslib-7.7:= ) +" +RDEPEND=" + ${DEPEND} +" +BDEPEND="dev-build/cmake + x11-base/xorg-proto" + +PATCHES=( + "${FILESDIR}/${PN}-docfiles.patch" + "${FILESDIR}/${PN}-1.2-fseek64-musl.patch" + "${FILESDIR}/${PN}-1.2.1-options.patch" +) + +DOCS=( README.md NEWS ChangeLog AUTHORS ) + +pkg_pretend() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp +} + +pkg_setup() { + [[ ${MERGE_TYPE} != binary ]] && use openmp && tc-check-openmp +} + +src_configure() { + local emesonargs=( + -Dffms2=false + -Dcriterion=false + $(meson_use exif exiv2) + $(meson_use ffmpeg) + $(meson_use heif libheif) + $(meson_use jpeg libjpeg) + $(meson_use libconfig) + $(meson_use openmp) + $(meson_use png libpng) + $(meson_use raw libraw) + $(meson_use tiff libtiff) + $(meson_use wcs wcslib) + $(usex curl -Denable-libcurl=yes -Denable-libcurl=no) + ) + meson_src_configure +} + +pkg_postinst() { + xdg_desktop_database_update + xdg_icon_cache_update + xdg_mimeinfo_database_update + optfeature "gnuplot support" sci-visualization/gnuplot +}