Accepting request 912799 from home:badshah400:branches:science

Add gnuastro-cfitsio-version-format-change.patch -- accounts for 3 number version string for CFITSIO; patch taken from upstream commit.

OBS-URL: https://build.opensuse.org/request/show/912799
OBS-URL: https://build.opensuse.org/package/show/science/gnuastro?expand=0&rev=17
This commit is contained in:
Dirk Stoecker 2021-08-18 08:42:22 +00:00 committed by Git OBS Bridge
parent bf8df21e20
commit fa131590a1
3 changed files with 36 additions and 1 deletions

View File

@ -0,0 +1,26 @@
diff --git a/lib/fits.c b/lib/fits.c
index ef559759..5fe11bd6 100644
--- a/lib/fits.c
+++ b/lib/fits.c
@@ -2138,8 +2138,19 @@ gal_fits_key_write_version_in_ptr(gal_fits_list_key_t **keylist, char *title,
/* Print 'Versions and date' title. */
gal_fits_key_write_title_in_ptr("Versions and date", fptr);
- /* Set the version of CFITSIO as a string. */
- sprintf(cfitsioversion, "%-.2f", CFITSIO_VERSION);
+ /* Set the version of CFITSIO as a string: before version 4.0.0 of
+ CFITSIO, there were only two numbers in the version (for example
+ '3.49' and '3.48'), but from the 4th major release, there are three
+ numbers in the version string. The third number corresponds to a new
+ 'CFITSIO_MICRO' macro. So if it doesn't exist, we'll just print two
+ numbers, otherwise, we'll print the three. */
+#ifdef CFITSIO_MICRO
+ sprintf(cfitsioversion, "%d.%d.%d", CFITSIO_MAJOR,
+ CFITSIO_MINOR, CFITSIO_MICRO);
+#else
+ sprintf(cfitsioversion, "%d.%d", CFITSIO_MAJOR,
+ CFITSIO_MINOR);
+#endif
/* Write all the information: */
fits_write_date(fptr, &status);

View File

@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed Aug 18 02:39:19 UTC 2021 - Atri Bhattacharya <badshah400@gmail.com>
- Add gnuastro-cfitsio-version-format-change.patch -- accounts for
3 number version string for CFITSIO; patch taken from upstream
commit.
-------------------------------------------------------------------
Wed Jun 2 07:37:06 UTC 2021 - Andreas Stieger <andreas.stieger@gmx.de>

View File

@ -27,6 +27,8 @@ URL: https://www.gnu.org/software/gnuastro/
Source: https://ftp.gnu.org/pub/gnu/gnuastro/%{name}-%{version}.tar.gz
Source2: https://ftp.gnu.org/pub/gnu/gnuastro/%{name}-%{version}.tar.gz.sig
Source3: https://akhlaghi.org/public-pgp-key.txt#/%{name}.keyring
# PATCH-FIX-UPSTREAM gnuastro-cfitsio-version-format-change.patch badshah400@gmail.com -- accounts for 3 number version string for CFITSIO; patch taken from upstream commit
Patch0: gnuastro-cfitsio-version-format-change.patch
BuildRequires: libtool
BuildRequires: pkgconfig
BuildRequires: pkgconfig(cfitsio)
@ -81,7 +83,7 @@ BuildArch: noarch
Bash command line completion support for %{name}
%prep
%setup -q
%autosetup -p1
%build
%configure \