|
| 1 | +# Note that this script can accept some limited command-line arguments, run |
| 2 | +# `julia build_tarballs.jl --help` to see a usage message. |
| 3 | +using BinaryBuilder, Pkg |
| 4 | + |
| 5 | +name = "GMAT" |
| 6 | +version = v"2020.0.0" |
| 7 | + |
| 8 | +# Collection of sources required to complete build |
| 9 | +sources = [ |
| 10 | + ArchiveSource("https://downloads.sourceforge.net/project/gmat/GMAT/GMAT-R2020a/GMAT-src-R2020a.zip", "943f403ac04d958b313b1d99d64fd09e3fa8e4c65363809d5bb88dd8c66e43e4"), |
| 11 | + DirectorySource("./bundled"), |
| 12 | +] |
| 13 | + |
| 14 | +# Bash recipe for building across all platforms |
| 15 | +script = raw""" |
| 16 | +cd $WORKSPACE/srcdir |
| 17 | +apk add --upgrade cmake --repository=http://dl-cdn.alpinelinux.org/alpine/edge/main |
| 18 | +cd GMAT-R2020a/ |
| 19 | +cp -r $WORKSPACE/srcdir/patches/cmake . |
| 20 | +dos2unix plugins/EstimationPlugin/src/base/measurement/Ionosphere/Ionosphere.hpp |
| 21 | +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0001-Remove-hard-coded-CSPICE-paths.patch" |
| 22 | +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0002-Remove-MSVC-flags.patch" |
| 23 | +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0003-Fix-non-portable-cast.patch" |
| 24 | +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0004-Use-std-chrono-on-all-platforms.patch" |
| 25 | +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0005-Use-Linux-typedefs-for-cross-compile.patch" |
| 26 | +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0006-Use-standard-CMake-boost-module.patch" |
| 27 | +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0007-Remove-explicit-Ws2_32-linking.patch" |
| 28 | +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0008-Use-standard-install-locations.patch" |
| 29 | +atomic_patch -p1 "${WORKSPACE}/srcdir/patches/0009-FreeBSD-compat.patch" |
| 30 | +mkdir builddir |
| 31 | +cd builddir/ |
| 32 | +cmake -DCMAKE_INSTALL_PREFIX=$prefix -DCMAKE_TOOLCHAIN_FILE=${CMAKE_TARGET_TOOLCHAIN} -DCMAKE_BUILD_TYPE=Release \ |
| 33 | + -DGMAT_INCLUDE_GUI=OFF \ |
| 34 | + -DCSPICE_LIB=${libdir}/libcspice.${dlext} -DCSPICE_DIR=${prefix} -DCSPICE_INCLUDE_DIR=${includedir} \ |
| 35 | + -DF2C_DIR=${includedir} \ |
| 36 | + .. |
| 37 | +make -j${nproc} |
| 38 | +make install |
| 39 | +""" |
| 40 | + |
| 41 | +# These are the platforms we will build for by default, unless further |
| 42 | +# platforms are passed in on the command line |
| 43 | +platforms = expand_cxxstring_abis(supported_platforms()) |
| 44 | + |
| 45 | +# The products that we will ensure are always built |
| 46 | +products = [ |
| 47 | + LibraryProduct("libGmatFunction", :libgmatfunction, "plugins"), |
| 48 | + LibraryProduct("libGmatUtil", :libgmatutil), |
| 49 | + LibraryProduct("libScriptTools", :libgmatscripttools, "plugins"), |
| 50 | + LibraryProduct("libCInterface", :libgmatcinterface), |
| 51 | + LibraryProduct("libGmatBase", :libgmatbase), |
| 52 | + # FIXME: Enable once Python_jll is available for Windows |
| 53 | + # LibraryProduct("libPythonInterface", :libgmatpythoninterface, "plugins"), |
| 54 | + LibraryProduct("libGmatEstimation", :libgmatestimation, "plugins"), |
| 55 | + LibraryProduct("libDataInterface", :libgmatdatainterface, "plugins"), |
| 56 | + LibraryProduct("libYukonOptimizer", :libgmatyukonoptimizer, "plugins"), |
| 57 | + LibraryProduct("libThrustFile", :libgmatthrustfile, "plugins"), |
| 58 | + LibraryProduct("libEphemPropagator", :libgmatephempropagator, "plugins"), |
| 59 | + LibraryProduct("libExtraPropagators", :libgmatextrapropagators, "plugins"), |
| 60 | + LibraryProduct("libNewParameters", :libgmatnewparameters, "plugins"), |
| 61 | + LibraryProduct("libFormation", :libgmatformation, "plugins"), |
| 62 | + LibraryProduct("libPolyhedronGravity", :libgmatpolyhedrongravity, "plugins"), |
| 63 | + LibraryProduct("libStation", :libgmatstation, "plugins"), |
| 64 | + LibraryProduct("libSaveCommand", :libgmatsavecommand, "plugins"), |
| 65 | + LibraryProduct("libEventLocator", :libgmateventlocator, "plugins"), |
| 66 | + LibraryProduct("libProductionPropagators", :libgmatproductionpropagators, "plugins"), |
| 67 | + LibraryProduct("libEKF", :libgmatekf, "plugins"), |
| 68 | + ExecutableProduct("GmatConsole", :gmatconsole) |
| 69 | +] |
| 70 | + |
| 71 | +# Dependencies that must be installed before this package can be built |
| 72 | +dependencies = [ |
| 73 | + Dependency(PackageSpec(name="CSPICE_jll", uuid="07f52509-e9d9-513c-a20d-3b911885bf96")) |
| 74 | + Dependency(PackageSpec(name="Python_jll", uuid="93d3a430-8e7c-50da-8e8d-3dfcfb3baf05")) |
| 75 | + Dependency(PackageSpec(name="Xerces_jll", uuid="637d83c4-b86a-5d90-b82d-5cf0573a8cfc")) |
| 76 | + BuildDependency(PackageSpec(name="boost_jll", uuid="28df3c45-c428-5900-9ff8-a3135698ca75")) |
| 77 | +] |
| 78 | + |
| 79 | +# Build the tarballs, and possibly a `build.jl` as well. |
| 80 | +build_tarballs(ARGS, name, version, sources, script, platforms, products, dependencies; preferred_gcc_version = v"7.1.0") |
0 commit comments