Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] giac: fix `#include <giac/giac.h>` in musl
@ 2023-08-23 22:51 tornaria
  2023-08-23 22:58 ` tornaria
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: tornaria @ 2023-08-23 22:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1717 bytes --]

There is a new pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages giac
https://github.com/void-linux/void-packages/pull/45735

giac: fix `#include <giac/giac.h>` in musl
As reported in https://github.com/void-linux/void-packages/pull/45708#issuecomment-1688333569, including <giac/giac.h> fails in musl because the HAVE_TGAMMAF macro from autotools is not available at this time.

Here we include a patch adapted from https://github.com/geogebra/giac/commit/618a5de3349f8def5bdb909fea42fb447b6aad4a which is the solution upstream will include in next release of giac.

We need to fix this now so we can build sagemath in musl!

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/45735.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-giac-45735.patch --]
[-- Type: text/x-diff, Size: 3240 bytes --]

From 46fd35d01f3e24f2632d331112c952bbdc7925c4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 23 Aug 2023 09:46:02 -0300
Subject: [PATCH] giac: fix `#include <giac/giac.h>` in musl

As reported in #45708, including <giac/giac.h> fails in musl because the
HAVE_TGAMMAF macro from autotools is not available at this time.

Here we include a patch adapted from
https://github.com/geogebra/giac/commit/618a5de3349f8def5bdb909fea42fb447b6aad4a
which is the solution upstream will include in next release of giac.

We need to fix this now so we can build sagemath in musl!
---
 srcpkgs/giac/patches/fix-fgamma.patch | 40 +++++++++++++++++++++++++++
 srcpkgs/giac/template                 |  6 +++-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/giac/patches/fix-fgamma.patch

diff --git a/srcpkgs/giac/patches/fix-fgamma.patch b/srcpkgs/giac/patches/fix-fgamma.patch
new file mode 100644
index 0000000000000..05101e310d1be
--- /dev/null
+++ b/srcpkgs/giac/patches/fix-fgamma.patch
@@ -0,0 +1,40 @@
+Adapted from
+https://github.com/geogebra/giac/commit/618a5de3349f8def5bdb909fea42fb447b6aad4a
+
+--- a/src/usual.cc
++++ b/src/usual.cc
+@@ -81,6 +81,16 @@ using namespace std;
+ #define sprintf256 sprintf
+ #endif
+ 
++#if defined HAVE_TGAMMAF || defined __APPLE__ || defined EMCC || defined EMCC2 || defined NO_BSD 
++inline float fgamma(float f1){ return tgammaf(f1); }
++#else
++#if defined(__MINGW_H) || defined(VISUALC) || defined(FXCG)// FIXME gamma, not used
++inline float fgamma(float f1){ return f1; }
++#else
++inline float fgamma(float f1){ return gammaf(f1); } // or tgammaf(f1) on some versions of emscripten
++#endif
++#endif
++
+ #ifndef NO_NAMESPACE_GIAC
+ namespace giac {
+ #endif // ndef NO_NAMESPACE_GIAC
+--- a/src/first.h
++++ b/src/first.h
+@@ -578,15 +578,6 @@ inline float ffloor(float f1){
+ #endif
+ }
+ inline float finv(float f1){ return 1/f1; }
+-#if defined HAVE_TGAMMAF || defined __APPLE__ || defined EMCC || defined EMCC2 || defined NO_BSD 
+-inline float fgamma(float f1){ return tgammaf(f1); }
+-#else
+-#if defined(__MINGW_H) || defined(VISUALC) || defined(FXCG)// FIXME gamma, not used
+-inline float fgamma(float f1){ return f1; }
+-#else
+-inline float fgamma(float f1){ return gammaf(f1); } // or tgammaf(f1) on some versions of emscripten
+-#endif
+-#endif
+ #ifdef FXCG
+ inline float atan2f(float f1,float f2,int rad){ if (rad) return std::atan2(f1,f2); else return std::atan2(f1,f2)*180/3.14159265358979323846;}
+ #else
diff --git a/srcpkgs/giac/template b/srcpkgs/giac/template
index 6ba75e6372fdc..95fd2046917f9 100644
--- a/srcpkgs/giac/template
+++ b/srcpkgs/giac/template
@@ -1,7 +1,7 @@
 # Template file for 'giac'
 pkgname=giac
 version=1.9.0.57
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-micropy --disable-quickjs"
 hostmakedepends="automake gettext-devel libtool"
@@ -56,6 +56,10 @@ pre_configure() {
 post_install() {
 	# remove duplicates
 	rm -r ${DESTDIR}/usr/share/doc
+
+	echo "giac: check that '#include <giac/giac.h>' works (see #45708)"
+	echo '#include <giac/giac.h>' |
+		gcc -c -isystem "${DESTDIR}/usr/include" -xc++ - -o /dev/null
 }
 
 libgiac_package() {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: giac: fix `#include <giac/giac.h>` in musl
  2023-08-23 22:51 [PR PATCH] giac: fix `#include <giac/giac.h>` in musl tornaria
@ 2023-08-23 22:58 ` tornaria
  2023-08-24  1:47 ` [PR PATCH] [Updated] " tornaria
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-08-23 22:58 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 427 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/45735#issuecomment-1690751328

Comment:
Note all the added patch does is moving the definition of `inline float fgamma()` verbatim from `first.h` to `usual.cc` which is the only place where it is used.

In the template I added a simple test in `post_install()` that compiles `#include <giac/giac.h>` to make sure it works.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Updated] giac: fix `#include <giac/giac.h>` in musl
  2023-08-23 22:51 [PR PATCH] giac: fix `#include <giac/giac.h>` in musl tornaria
  2023-08-23 22:58 ` tornaria
@ 2023-08-24  1:47 ` tornaria
  2023-08-24  1:47 ` tornaria
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-08-24  1:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1722 bytes --]

There is an updated pull request by tornaria against master on the void-packages repository

https://github.com/tornaria/void-packages giac
https://github.com/void-linux/void-packages/pull/45735

giac: fix `#include <giac/giac.h>` in musl
As reported in https://github.com/void-linux/void-packages/pull/45708#issuecomment-1688333569, including <giac/giac.h> fails in musl because the HAVE_TGAMMAF macro from autotools is not available at this time.

Here we include a patch adapted from https://github.com/geogebra/giac/commit/618a5de3349f8def5bdb909fea42fb447b6aad4a which is the solution upstream will include in next release of giac.

We need to fix this now so we can build sagemath in musl!

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


A patch file from https://github.com/void-linux/void-packages/pull/45735.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-giac-45735.patch --]
[-- Type: text/x-diff, Size: 3242 bytes --]

From 7bafbdda9475be560cf6cf86a54b6d65af2091d6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gonzalo=20Tornar=C3=ADa?= <tornaria@cmat.edu.uy>
Date: Wed, 23 Aug 2023 09:46:02 -0300
Subject: [PATCH] giac: fix `#include <giac/giac.h>` in musl

As reported in #45708, including <giac/giac.h> fails in musl because the
HAVE_TGAMMAF macro from autotools is not available at this time.

Here we include a patch adapted from
https://github.com/geogebra/giac/commit/618a5de3349f8def5bdb909fea42fb447b6aad4a
which is the solution upstream will include in next release of giac.

We need to fix this now so we can build sagemath in musl!
---
 srcpkgs/giac/patches/fix-fgamma.patch | 40 +++++++++++++++++++++++++++
 srcpkgs/giac/template                 |  6 +++-
 2 files changed, 45 insertions(+), 1 deletion(-)
 create mode 100644 srcpkgs/giac/patches/fix-fgamma.patch

diff --git a/srcpkgs/giac/patches/fix-fgamma.patch b/srcpkgs/giac/patches/fix-fgamma.patch
new file mode 100644
index 0000000000000..05101e310d1be
--- /dev/null
+++ b/srcpkgs/giac/patches/fix-fgamma.patch
@@ -0,0 +1,40 @@
+Adapted from
+https://github.com/geogebra/giac/commit/618a5de3349f8def5bdb909fea42fb447b6aad4a
+
+--- a/src/usual.cc
++++ b/src/usual.cc
+@@ -81,6 +81,16 @@ using namespace std;
+ #define sprintf256 sprintf
+ #endif
+ 
++#if defined HAVE_TGAMMAF || defined __APPLE__ || defined EMCC || defined EMCC2 || defined NO_BSD 
++inline float fgamma(float f1){ return tgammaf(f1); }
++#else
++#if defined(__MINGW_H) || defined(VISUALC) || defined(FXCG)// FIXME gamma, not used
++inline float fgamma(float f1){ return f1; }
++#else
++inline float fgamma(float f1){ return gammaf(f1); } // or tgammaf(f1) on some versions of emscripten
++#endif
++#endif
++
+ #ifndef NO_NAMESPACE_GIAC
+ namespace giac {
+ #endif // ndef NO_NAMESPACE_GIAC
+--- a/src/first.h
++++ b/src/first.h
+@@ -578,15 +578,6 @@ inline float ffloor(float f1){
+ #endif
+ }
+ inline float finv(float f1){ return 1/f1; }
+-#if defined HAVE_TGAMMAF || defined __APPLE__ || defined EMCC || defined EMCC2 || defined NO_BSD 
+-inline float fgamma(float f1){ return tgammaf(f1); }
+-#else
+-#if defined(__MINGW_H) || defined(VISUALC) || defined(FXCG)// FIXME gamma, not used
+-inline float fgamma(float f1){ return f1; }
+-#else
+-inline float fgamma(float f1){ return gammaf(f1); } // or tgammaf(f1) on some versions of emscripten
+-#endif
+-#endif
+ #ifdef FXCG
+ inline float atan2f(float f1,float f2,int rad){ if (rad) return std::atan2(f1,f2); else return std::atan2(f1,f2)*180/3.14159265358979323846;}
+ #else
diff --git a/srcpkgs/giac/template b/srcpkgs/giac/template
index 6ba75e6372fdc..2bf270458e53a 100644
--- a/srcpkgs/giac/template
+++ b/srcpkgs/giac/template
@@ -1,7 +1,7 @@
 # Template file for 'giac'
 pkgname=giac
 version=1.9.0.57
-revision=1
+revision=2
 build_style=gnu-configure
 configure_args="--disable-micropy --disable-quickjs"
 hostmakedepends="automake gettext-devel libtool"
@@ -56,6 +56,10 @@ pre_configure() {
 post_install() {
 	# remove duplicates
 	rm -r ${DESTDIR}/usr/share/doc
+
+	echo "giac: check that '#include <giac/giac.h>' works (see #45708)"
+	echo '#include <giac/giac.h>' |
+		${CC} -c -isystem "${DESTDIR}/usr/include" -xc++ - -o /dev/null
 }
 
 libgiac_package() {

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: giac: fix `#include <giac/giac.h>` in musl
  2023-08-23 22:51 [PR PATCH] giac: fix `#include <giac/giac.h>` in musl tornaria
  2023-08-23 22:58 ` tornaria
  2023-08-24  1:47 ` [PR PATCH] [Updated] " tornaria
@ 2023-08-24  1:47 ` tornaria
  2023-08-24  1:48 ` tornaria
  2023-08-26 20:12 ` [PR PATCH] [Merged]: " leahneukirchen
  4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-08-24  1:47 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 289 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/45735#issuecomment-1690866809

Comment:
My bad, I'm using `gcc` to test compilation using `#include <giac/giac.h>` but that doesn't work in cross. Fixing it now by using `${CC}` instead.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: giac: fix `#include <giac/giac.h>` in musl
  2023-08-23 22:51 [PR PATCH] giac: fix `#include <giac/giac.h>` in musl tornaria
                   ` (2 preceding siblings ...)
  2023-08-24  1:47 ` tornaria
@ 2023-08-24  1:48 ` tornaria
  2023-08-26 20:12 ` [PR PATCH] [Merged]: " leahneukirchen
  4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-08-24  1:48 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 291 bytes --]

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/pull/45735#issuecomment-1690866809

Comment:
My bad, I was using `gcc` to test compilation using `#include <giac/giac.h>` but that doesn't work in cross. Fixing it now by using `${CC}` instead.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PR PATCH] [Merged]: giac: fix `#include <giac/giac.h>` in musl
  2023-08-23 22:51 [PR PATCH] giac: fix `#include <giac/giac.h>` in musl tornaria
                   ` (3 preceding siblings ...)
  2023-08-24  1:48 ` tornaria
@ 2023-08-26 20:12 ` leahneukirchen
  4 siblings, 0 replies; 6+ messages in thread
From: leahneukirchen @ 2023-08-26 20:12 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 1567 bytes --]

There's a merged pull request on the void-packages repository

giac: fix `#include <giac/giac.h>` in musl
https://github.com/void-linux/void-packages/pull/45735

Description:
As reported in https://github.com/void-linux/void-packages/pull/45708#issuecomment-1688333569, including <giac/giac.h> fails in musl because the HAVE_TGAMMAF macro from autotools is not available at this time.

Here we include a patch adapted from https://github.com/geogebra/giac/commit/618a5de3349f8def5bdb909fea42fb447b6aad4a which is the solution upstream will include in next release of giac.

We need to fix this now so we can build sagemath in musl!

<!-- Uncomment relevant sections and delete options which are not applicable -->

#### Testing the changes
- I tested the changes in this PR: **YES**

<!--
#### New package
- This new package conforms to the [package requirements](https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#package-requirements): **YES**|**NO**
-->

<!-- Note: If the build is likely to take more than 2 hours, please add ci skip tag as described in
https://github.com/void-linux/void-packages/blob/master/CONTRIBUTING.md#continuous-integration
and test at least one native build and, if supported, at least one cross build.
Ignore this section if this PR is not skipping CI.
-->
<!--
#### Local build testing
- I built this PR locally for my native architecture, (ARCH-LIBC)
- I built this PR locally for these architectures (if supported. mark crossbuilds):
  - aarch64-musl
  - armv7l
  - armv6l-musl
-->


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-08-26 20:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-23 22:51 [PR PATCH] giac: fix `#include <giac/giac.h>` in musl tornaria
2023-08-23 22:58 ` tornaria
2023-08-24  1:47 ` [PR PATCH] [Updated] " tornaria
2023-08-24  1:47 ` tornaria
2023-08-24  1:48 ` tornaria
2023-08-26 20:12 ` [PR PATCH] [Merged]: " leahneukirchen

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).