Skip to content
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
15 changes: 13 additions & 2 deletions L/Libcerf/build_tarballs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,28 @@
using BinaryBuilder, Pkg

name = "Libcerf"
version = v"1.17"
version = v"2.5"

# Collection of sources required to complete build
sources = [
ArchiveSource("https://jugit.fz-juelich.de/mlz/libcerf/-/archive/v$(version.major).$(version.minor)/libcerf-v$(version.major).$(version.minor).tar.gz",
"b1916b292cb37f2d0d0b699fbcf0fe260cca97ec7266ea20ff0c5cd8ef2eaab4")
"b3a5e68a30bdbd3a58e9e7c038bd0aa2586b90bbb1c809f76665e176b2d42cdc"),
DirectorySource("./bundled"),
]

# Bash recipe for building across all platforms
script = raw"""
cd $WORKSPACE/srcdir/libcerf-*/
if [[ "${target}" == *-mingw* ]]; then
# ref: https://github.com/msys2/MINGW-packages/commit/b3e9553aa603dc446af4a0610187c23ac8c9d97f
# fix wrong dll install path
atomic_patch -p1 ../patches/001-fix-install-dest.patch

# fix windows export symbols
LDFLAGS+=" -Wl,--export-all-symbols"
atomic_patch -p1 ../patches/002-fix-win-export.patch
fi

mkdir build && cd build
cmake .. -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release
make -j${nproc}
Expand Down
11 changes: 11 additions & 0 deletions L/Libcerf/bundled/patches/001-fix-install-dest.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/lib/CMakeLists.txt
+++ b/lib/CMakeLists.txt
@@ -38,7 +38,7 @@
install(
TARGETS ${lib}
EXPORT ${intf}
- RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR}
+ RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT Libraries)
12 changes: 12 additions & 0 deletions L/Libcerf/bundled/patches/002-fix-win-export.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
@@ -0,0 +1,11 @@
--- a/lib/err_fcts.c
+++ b/lib/err_fcts.c
@@ -54,7 +54,7 @@
#include "defs.h" // defines _cerf_cmplx, NaN, C, cexp, ...

// for analysing the algorithm:
-IMPORT extern int faddeeva_algorithm;
+extern int faddeeva_algorithm;

const double spi2 = 0.8862269254527580136490837416705725913990; // sqrt(pi)/2
const double s2pi = 2.5066282746310005024157652848110; // sqrt(2*pi)