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

Wizard recipe: Chemfiles-v0.9.2 #366

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions C/Chemfiles/build_tarballs.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Note that this script can accept some limited command-line arguments, run
# `julia build_tarballs.jl --help` to see a usage message.
using BinaryBuilder, Pkg

name = "Chemfiles"
version = v"0.9.2"

# Collection of sources required to complete build
sources = [
"https://github.com/chemfiles/chemfiles/archive/$version.tar.gz" =>
"f0a40c8934cffdc8321bed79ded4cb4de5d5366d1f503a95467e294384521e82",
"./bundled",
]

# Bash recipe for building across all platforms
script = raw"""
cd ${WORKSPACE}/srcdir/chemfiles-*/
mkdir build && cd build
cmake -DCMAKE_INSTALL_PREFIX=${prefix} -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=ON ..
atomic_patch -p1 ../../patches/fileno_posix.patch
make -j${nproc}
make install
"""

# These are the platforms we will build for by default, unless further
# platforms are passed in on the command line
platforms = supported_platforms()


# The products that we will ensure are always built
products = [
LibraryProduct("libchemfiles", :libchemfiles)
]

# Dependencies that must be installed before this package can be built
dependencies = [
]

# Build the tarballs, and possibly a `build.jl` as well.
build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies)
24 changes: 24 additions & 0 deletions C/Chemfiles/bundled/patches/fileno_posix.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
--- a/external/netcdf/libdispatch/dfile.c
+++ b/external/netcdf/libdispatch/dfile.c
@@ -32,7 +32,9 @@
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
+#ifdef __USE_POSIX
Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks for taking the time to do this! Can I incorporate this patch directly in our fork of netcdf? https://github.com/chemfiles/netcdf-c

Copy link
Member

Choose a reason for hiding this comment

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

Sure!

extern int fileno(FILE*);
+#endif

#include "ncdispatch.h"
#include "netcdf_mem.h"
--- a/external/netcdf/libdispatch/dparallel.c
+++ b/external/netcdf/libdispatch/dparallel.c
@@ -10,7 +10,9 @@
#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif
+#ifdef __USE_POSIX
extern int fileno(FILE*);
+#endif

/**
Create a netCDF file for parallel I/O.