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

New Wrap: cfitsio-4.5.0 #1767

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kjmeagher
Copy link

This is a file wrap with a patch. It is mostly based on the
CMakeLists.txt provided in the source. But there were a few defines
in the autotolls version that werent in the cmake that I also added.

@kjmeagher kjmeagher marked this pull request as ready for review October 30, 2024 22:05
@kjmeagher kjmeagher changed the title cfitsio-4.5.0 New Wrap: cfitsio-4.5.0 Oct 30, 2024
@jpakkane
Copy link
Member

cfitsio| WARNING: Project does not target a minimum version but uses feature introduced in '1.1': meson.options file. Use meson_options.txt instead

You might want to just require a newer version of Meson instead.

@kjmeagher kjmeagher force-pushed the cfitsio-4.5.0 branch 4 times, most recently from 796bc80 to 16a96b3 Compare November 1, 2024 14:03
cc = meson.get_compiler('c')
libm = cc.find_library('m')

if target_machine.system() != 'windows'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target_machine is used when the thing you are creating is a cross compiler that will, when built and installed and run, emit platform specific outputs for a platform that isn't the one it is installed for.

Probably you mean host_machine instead, as that is the machine that libcfitsio is being compiled to run on.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

curl = dependency(
'libcurl',
required: get_option('curl'),
fallback: ['curl', 'libcurl'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fallback is probably not necessary since curl wraps can just [provide] curl = curl_dep.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

zlib = dependency('zlib', fallback: ['zlib', 'zlib_dep'])

if target_machine.system() != 'windows'
bzip2 = dependency(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bzip2 doesn't provide pkg-config files, please detect it with cc.find_library instead.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both the platforms i developed this for (arch linux and macos) have pkg-config files for bzip2. but since they are not provided by up stream i will switch to find_library()


if get_option('sse2')
if cc.has_argument('-msse2')
add_project_arguments('-msse2', language: 'c')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems like an odd thing to have as a project option. Can't users just compile with -msse2 themselves, especially given its often the default for a given -march?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was copying from the autotools/cmake file, but you are right this should be removed


install_headers('fitsio.h', 'fitsio2.h', 'longnam.h')

libcfitsio_la_SOURCES = [
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _la refers to "libtool archive" so I wonder how useful it is to have that in the name.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed

]
endif

libcfitsio = shared_library(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does upstream really not support installing this as a static library e.g. using --enable-static --disable-shared? Usually libtool provides these options for free.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this library is often used as a static library, switched to library()

'fitscopy',
'utilities/fitscopy.c',
dependencies: cfitsio_dep,
install: get_option('utils'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This option should be used in an "if" statement to control whether the executable() is defined -- not whether the install parameter is set.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

changed

option(
'utils',
type: 'boolean',
description: 'Build fpack, funpack, fitscopy, and fitsverify executables',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

... and as we see here the option does indeed claim it will control building, not control installing.

@kjmeagher kjmeagher force-pushed the cfitsio-4.5.0 branch 9 times, most recently from 795c840 to 219ab0b Compare November 1, 2024 17:02
@kjmeagher kjmeagher marked this pull request as draft November 1, 2024 17:12
This is a file wrap with a patch. It is mostly based on the
CMakeLists.txt provided in the source. But there were a few defines
in the autotolls version that werent in the cmake that I also added.
@kjmeagher kjmeagher marked this pull request as ready for review November 11, 2024 21:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants