diff --git a/C/cif_api/build_tarballs.jl b/C/cif_api/build_tarballs.jl new file mode 100644 index 00000000000..3aa92d732c8 --- /dev/null +++ b/C/cif_api/build_tarballs.jl @@ -0,0 +1,58 @@ +# 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 = "cif_api" +version = v"0.4.2" + +# Collection of sources required to complete build +sources = [ + ArchiveSource("https://github.com/COMCIFS/cif_api/archive/refs/tags/v0.4.2.tar.gz", "803fa1d0525bb51407754fa63b9439ba350178f45372103e84773ed4871b3924"), + DirectorySource("./bundled") +] + +# Bash recipe for building across all platforms +script = raw""" +cd $WORKSPACE/srcdir/cif_api-* + +update_configure_scripts + +if [[ ${target} == *mingw* ]]; then + #remove win32 if branch to prevent file not found errors on make install? + atomic_patch -p1 ${WORKSPACE}/srcdir/patches/mingw-remove-install-hook.patch + autoreconf -vi +fi + +#CPP flags needed to help *-musl-* builds configure scripts find sqlite3.h, unsure exactly why? +export CPPFLAGS="-I${includedir}" + +./configure \ + --prefix=${prefix} \ + --libdir=${libdir} \ + --includedir=${includedir} \ + --build=${MACHTYPE} \ + --host=${target} \ + --with-docs=no \ + +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 = expand_cxxstring_abis(supported_platforms()) + + +# The products that we will ensure are always built +products = [ + LibraryProduct("libcif", :libcif) +] + +# Dependencies that must be installed before this package can be built +dependencies = [ + Dependency("ICU_jll"; compat="69.1") + Dependency(PackageSpec(name="SQLite_jll", uuid="76ed43ae-9a5d-5a62-8c75-30186b810ce8")) +] + +# Build the tarballs, and possibly a `build.jl` as well. +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies;preferred_gcc_version=v"7", julia_compat="1.6") diff --git a/C/cif_api/bundled/patches/mingw-remove-install-hook.patch b/C/cif_api/bundled/patches/mingw-remove-install-hook.patch new file mode 100644 index 00000000000..760f8b59f6d --- /dev/null +++ b/C/cif_api/bundled/patches/mingw-remove-install-hook.patch @@ -0,0 +1,26 @@ +diff --git a/src/Makefile.am b/src/Makefile.am +index 3f9794b..9ffde74 100644 +--- a/src/Makefile.am ++++ b/src/Makefile.am +@@ -57,17 +57,10 @@ LIB_CURRENT = 2 + LIB_REVISION = 0 + LIB_AGE = 1 + +-if win32 +- LIB_VERSION_FLAGS = -avoid-version +- INSTALL_HOOKS = install_import_lib +- UNINSTALL_HOOKS = uninstall_import_lib +- CLEANFILES = libcif.def +-else +- LIB_VERSION_FLAGS = -version-info $(LIB_CURRENT):$(LIB_REVISION):$(LIB_AGE) +- INSTALL_HOOKS = +- UNINSTALL_HOOKS = +- CLEANFILES = +-endif ++LIB_VERSION_FLAGS = -version-info $(LIB_CURRENT):$(LIB_REVISION):$(LIB_AGE) ++INSTALL_HOOKS = ++UNINSTALL_HOOKS = ++CLEANFILES = + + BUILT_SOURCES = internal/schema.h internal/version.h + EXTRA_DIST = notes.txt style.txt