From nobody Sun Sep 25 05:39:30 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MZvpW0PPzz4dJcK; Sun, 25 Sep 2022 05:39:31 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MZvpV6cZlz3CTk; Sun, 25 Sep 2022 05:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664084370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=msUy9U5kRisvk/7IojrvCJ9E5lTsSzKMTHxAbTyVabs=; b=u5Buo8F1jM53OaCm+GsRg2vjcbjQ1MCTzYSAvkcfyDDruw1RralXeDQfhjPLRz4YjzdOkO Ua0wtID/JzjTUQf4bpYSYiLo8M/ynj7dxKKmZWDfN6v2h4bKpVPpaJeqcXpcIRwjVEDmUl Q3MDPbKNO4U5MUctmFx3XemWtgcy80rdnSxBEViW3yzOTTWKSGZn0SXJmkFAdxf9HB7rUJ t2Cf+32A4ski5h9q3qpuCPaXFPelKnnDCEGwbXNaVGOwiEtw527cFVYNeRAaNyREHTQEe3 CK3dw/fRwcmda529SKQaUchwZaZ9ETiRUupkYShhx1escBV8cCp2zPTUV6I0yQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MZvpV5WS8zKRB; Sun, 25 Sep 2022 05:39:30 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 28P5dU0l012386; Sun, 25 Sep 2022 05:39:30 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 28P5dUFW012385; Sun, 25 Sep 2022 05:39:30 GMT (envelope-from git) Date: Sun, 25 Sep 2022 05:39:30 GMT Message-Id: <202209250539.28P5dUFW012385@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Xin LI Subject: git: dca15813a52d - main - astro/stellarsolver: Upgrade to 2.4 and fix build on -CURRENT with GNU qsort_r. List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: delphij X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: dca15813a52d4a44c7a76ad28a7c1b75a1392334 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1664084370; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=msUy9U5kRisvk/7IojrvCJ9E5lTsSzKMTHxAbTyVabs=; b=ldmmJkSRc5IThQMtq0iQOx05ObiVZ9ocz9zCro5K/ARMnwVKZCcppJlnf4kntLXEDswLni 94JpamiItfUeR/Cz8JJLuPMHr7vR2uCJMbbnVFtXxBVkoUtPxSKtEcTLteBemmZGXsI6Tv INxhyRQkREU71h5zlvAOm3mK3zWzcw3q06xWltfePru29+rEe8mdC/yNpZgx/SPLpmbk7I icrn6QbnDeRU5rxAqX0tldjon7zElGiazd+Lr1k01eC+72FJo10k+y4IrV3kFA686FqbiA UKyrtugEb/Sv99NfuqqoCVaA8IP5WAs/jo+SIHjZPQwzz0W3UduwxXYpD65n2w== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1664084370; a=rsa-sha256; cv=none; b=lLYtOC6FMMdnYsTVU1QCc4UlOAt0vUhfHFGYRz8zAjwQbXmhENSfB7QpAay0uN89JbCnAs IysbcDdZhpf39tCwvzRIWO8QMDLZaxlsNeBOyMZG+blLgfIXOihYjcaCzxZmha0A+PV9Xd aVBgAHmmvIT+cDIB2nOLr6KWHN1O7aKThXBs9hJmtkUT14rxjEZLF2I5cTF1p3Y1cViF6p tKX8euAB9Zl3f2Ir+2IVuRsWlbgfaMOhYHruMYLjVpZWqUCtagy5c8ohKH2Lo3DhUcDwVf 1sADhZmtxhpkeTOjOU3Omq5XObtqnifK55Tiw6kEiB+WSTR6XlePn867y2o81Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by delphij: URL: https://cgit.FreeBSD.org/ports/commit/?id=dca15813a52d4a44c7a76ad28a7c1b75a1392334 commit dca15813a52d4a44c7a76ad28a7c1b75a1392334 Author: Xin LI AuthorDate: 2022-09-25 05:39:15 +0000 Commit: Xin LI CommitDate: 2022-09-25 05:39:16 +0000 astro/stellarsolver: Upgrade to 2.4 and fix build on -CURRENT with GNU qsort_r. PR: ports/266227, ports/266574 Reported by: antoine (via exp-run) Approved by: maintainer (acm@) --- astro/stellarsolver/Makefile | 2 +- astro/stellarsolver/distinfo | 6 +- astro/stellarsolver/files/patch-CMakeLists.txt | 49 ++++++++++++++ .../patch-stellarsolver_astrometry_os-features.h | 11 ++++ ...tellarsolver_astrometry_util_os-features-test.c | 75 ++++++++++++++++++++++ .../files/patch-stellarsolver_stellarsolver.cpp | 4 +- astro/stellarsolver/pkg-plist | 9 +-- 7 files changed, 142 insertions(+), 14 deletions(-) diff --git a/astro/stellarsolver/Makefile b/astro/stellarsolver/Makefile index d510b60f4c24..93434f654700 100644 --- a/astro/stellarsolver/Makefile +++ b/astro/stellarsolver/Makefile @@ -1,5 +1,5 @@ PORTNAME= stellarsolver -DISTVERSION= 2.3 +DISTVERSION= 2.4 CATEGORIES= astro MAINTAINER= acm@FreeBSD.org diff --git a/astro/stellarsolver/distinfo b/astro/stellarsolver/distinfo index b0f9d77b2eca..3e70fb11bd98 100644 --- a/astro/stellarsolver/distinfo +++ b/astro/stellarsolver/distinfo @@ -1,3 +1,3 @@ -TIMESTAMP = 1653202874 -SHA256 (rlancaste-stellarsolver-2.3_GH0.tar.gz) = c2747339af853a1a8147a4b9eba23f0a621912018b30a0b5a9aba9f557d2b9bc -SIZE (rlancaste-stellarsolver-2.3_GH0.tar.gz) = 23403038 +TIMESTAMP = 1663948663 +SHA256 (rlancaste-stellarsolver-2.4_GH0.tar.gz) = e9cf7e73edb96a959f75dbbba16bd5e270f6e95c0d5c3dfa8727dfaf77d0617f +SIZE (rlancaste-stellarsolver-2.4_GH0.tar.gz) = 23402982 diff --git a/astro/stellarsolver/files/patch-CMakeLists.txt b/astro/stellarsolver/files/patch-CMakeLists.txt new file mode 100644 index 000000000000..cc35eb8cca54 --- /dev/null +++ b/astro/stellarsolver/files/patch-CMakeLists.txt @@ -0,0 +1,49 @@ +--- CMakeLists.txt.orig 2022-07-29 16:11:55 UTC ++++ CMakeLists.txt +@@ -58,29 +58,25 @@ else(WIN32) + + else(WIN32) + +-try_run(RUN_RESULT_2 COMPILE_SUCCESS_2 ${CMAKE_CURRENT_BINARY_DIR} ${config_SRCS} COMPILE_DEFINITIONS -DTEST_DECLARE_QSORT_R=ON) +-if(COMPILE_SUCCESS_2 AND (RUN_RESULT_2 EQUAL 0)) +- SET(VAR_2 0) ++try_run(RUN_RESULT_BSD_QSORT_R COMPILE_SUCCESS_BSD_QSORT_R ${CMAKE_CURRENT_BINARY_DIR} ${config_SRCS} COMPILE_DEFINITIONS -DTEST_BSD_QSORT_R=ON) ++try_run(RUN_RESULT_GNU_QSORT_R COMPILE_SUCCESS_GNU_QSORT_R ${CMAKE_CURRENT_BINARY_DIR} ${config_SRCS} COMPILE_DEFINITIONS -DTEST_GNU_QSORT_R=ON) ++if(COMPILE_SUCCESS_GNU_QSORT_R AND (RUN_RESULT_GNU_QSORT_R EQUAL 0)) ++ SET(WANT_DECLARE_QSORT_R 0) ++ SET(WANT_BUNDLED_QSORT_R 0) ++ SET(WANT_SWAP_QSORT_R 1) + else() +- SET(VAR_2 1) ++ SET(WANT_SWAP_QSORT_R 0) ++ if(COMPILE_SUCCESS_BSD_QSORT_R AND (RUN_RESULT_BSD_QSORT_R EQUAL 0)) ++ SET(WANT_DECLARE_QSORT_R 0) ++ SET(WANT_BUNDLED_QSORT_R 0) ++ else() ++ SET(WANT_DECLARE_QSORT_R 1) ++ SET(WANT_BUNDLED_QSORT_R 1) ++ endif() + endif() +-file(APPEND "${config_FN}" "#define NEED_DECLARE_QSORT_R ${VAR_2}\n") +- +-try_run(RUN_RESULT_3 COMPILE_SUCCESS_3 ${CMAKE_CURRENT_BINARY_DIR} ${config_SRCS} COMPILE_DEFINITIONS -DTEST_QSORT_R=ON) +-if(COMPILE_SUCCESS_3 AND (RUN_RESULT_3 EQUAL 0)) +- SET(VAR_3 1) +-else() +- SET(VAR_3 0) +-endif() +-file(APPEND "${config_FN}" "#define NEED_QSORT_R ${VAR_3}\n") +- +-try_run(RUN_RESULT_4 COMPILE_SUCCESS_4 ${CMAKE_CURRENT_BINARY_DIR} ${config_SRCS} COMPILE_DEFINITIONS -DTEST_SWAP_QSORT_R=ON) +-if(COMPILE_SUCCESS_4 AND (RUN_RESULT_4 EQUAL 0)) +- SET(VAR_4 1) +-else() +- SET(VAR_4 0) +-endif() +-file(APPEND "${config_FN}" "#define NEED_SWAP_QSORT_R ${VAR_4}\n") ++file(APPEND "${config_FN}" "#define NEED_DECLARE_QSORT_R ${WANT_DECLARE_QSORT_R}\n") ++file(APPEND "${config_FN}" "#define NEED_SWAP_QSORT_R ${WANT_SWAP_QSORT_R}\n") ++file(APPEND "${config_FN}" "#define NEED_QSORT_R ${WANT_BUNDLED_QSORT_R}\n") + + endif(WIN32) + diff --git a/astro/stellarsolver/files/patch-stellarsolver_astrometry_os-features.h b/astro/stellarsolver/files/patch-stellarsolver_astrometry_os-features.h new file mode 100644 index 000000000000..14f21b96aa81 --- /dev/null +++ b/astro/stellarsolver/files/patch-stellarsolver_astrometry_os-features.h @@ -0,0 +1,11 @@ +--- stellarsolver/astrometry/os-features.h.orig 2022-07-29 16:11:55 UTC ++++ stellarsolver/astrometry/os-features.h +@@ -110,7 +110,7 @@ + + #if NEED_DECLARE_QSORT_R + //// NOTE: this declaration must match os-features-test.c . +-void qsort_r(void *base, size_t nmemb, size_t sz, ++void (qsort_r)(void *base, size_t nmemb, size_t sz, + void *userdata, + int (*compar)(void *, const void *, const void *)); + #endif diff --git a/astro/stellarsolver/files/patch-stellarsolver_astrometry_util_os-features-test.c b/astro/stellarsolver/files/patch-stellarsolver_astrometry_util_os-features-test.c new file mode 100644 index 000000000000..de338b4fc2a9 --- /dev/null +++ b/astro/stellarsolver/files/patch-stellarsolver_astrometry_util_os-features-test.c @@ -0,0 +1,75 @@ +--- stellarsolver/astrometry/util/os-features-test.c.orig 2022-07-29 16:11:55 UTC ++++ stellarsolver/astrometry/util/os-features-test.c +@@ -14,7 +14,11 @@ int main() { + } + #endif + +-#ifdef TEST_QSORT_R ++#ifdef TEST_BSD_QSORT_R ++void (qsort_r)(void *base, size_t nmemb, size_t sz, ++ void *userdata, ++ int (*compar)(void *, const void *, const void *)); ++ + static int cmp(void* u, const void* a, const void* b) { + return 0; + } +@@ -22,51 +26,22 @@ int main() { + int array; + int baton; + qsort_r(&array, 1, sizeof(int), &baton, cmp); +- //printf("#define NEED_QSORT_R 0\n"); + return 0; + } + #endif + +-#ifdef TEST_DECLARE_QSORT_R +-// Test whether just declaring qsort_r as we do causes a compile failure. ++#ifdef TEST_GNU_QSORT_R ++void (qsort_r)(void *base, size_t nmemb, size_t sz, ++ int (*compar)(const void *, const void *, void *), ++ void *userdata); + +-void qsort_r(void *base, size_t nmemb, size_t sz, +- void *userdata, +- int (*compar)(void *, const void *, const void *)); +- +-int main() { +- //printf("#define NEED_DECLARE_QSORT_R 1\n"); ++static int cmp(const void* a, const void* b, void* u) { + return 0; + } +-#endif +- +-#ifdef TEST_SWAP_QSORT_R +-// Use the result of TEST_DECLARE_QSORT_R and TEST_NEED_QSORT_R, or else +-// this test will fail with a warning about undefined qsort_r +-// Include .c rather than .h because we test with: +-// gcc -o (exec) os-features-test.c +-// and if NEED_QSORT_R, os-features.c includes qsort_reentrant.c +-#include "os-features-config.h.tmp" +-#define DONT_INCLUDE_OS_FEATURES_CONFIG_H 1 +-#include "os-features.c" +-#undef DONT_INCLUDE_OS_FEATURES_CONFIG_H +-// Test whether qsort_r works unswapped. (ie, qsort_r matches the definition of +-// QSORT_R defined in the os-features.h documentation.) +-static int sortfunc(void* thunk, const void* v1, const void* v2) { +- const int* i1 = v1; +- const int* i2 = v2; +- if (*i1 < *i2) +- return -1; +- if (*i1 > *i2) +- return 1; +- return 0; +-} + int main() { +- int array[] = { 4, 17, 88, 34, 12, 12, 17 }; +- int N = sizeof(array)/sizeof(int); +- int mythunk = 42; +- qsort_r(array, N, sizeof(int), &mythunk, sortfunc); +- //printf("#define NEED_SWAP_QSORT_R 0\n"); ++ int array; ++ int baton; ++ qsort_r(&array, 1, sizeof(int), cmp, &baton); + return 0; + } + #endif diff --git a/astro/stellarsolver/files/patch-stellarsolver_stellarsolver.cpp b/astro/stellarsolver/files/patch-stellarsolver_stellarsolver.cpp index 0516e3bb9e6c..ea540aa0169f 100644 --- a/astro/stellarsolver/files/patch-stellarsolver_stellarsolver.cpp +++ b/astro/stellarsolver/files/patch-stellarsolver_stellarsolver.cpp @@ -1,4 +1,4 @@ ---- stellarsolver/stellarsolver.cpp.orig 2020-11-15 04:11:58 UTC +--- stellarsolver/stellarsolver.cpp.orig 2022-07-29 16:11:55 UTC +++ stellarsolver/stellarsolver.cpp @@ -7,6 +7,9 @@ */ @@ -10,7 +10,7 @@ #elif defined(_WIN32) #include "windows.h" #else //Linux -@@ -799,8 +802,12 @@ bool StellarSolver::appendStarsRAandDEC(QList