dash/depends/packages/expat.mk
merge-script e016ffada1
Merge bitcoin/bitcoin#29878: depends: build expat with CMake
a517029646ac86f9d72fcea204ff45db41702e37 depends: switch to building expat with CMake (fanquake)

Pull request description:

  Switch to building Expat with CMake, instead of Autotools.

ACKs for top commit:
  hebasto:
    re-ACK a517029646ac86f9d72fcea204ff45db41702e37.

Tree-SHA512: ca040545dd83fb81a8b209aa24cae6e22eaeff04f44bdabc4454adf6ea63d34f4ae27bd5980c65db2d2542e23eb2712102719023c262ab63a933c90b5999c11e
2024-10-26 19:14:06 -05:00

38 lines
1.2 KiB
Makefile

package=expat
$(package)_version=2.4.8
$(package)_download_path=https://github.com/libexpat/libexpat/releases/download/R_$(subst .,_,$($(package)_version))/
$(package)_file_name=$(package)-$($(package)_version).tar.xz
$(package)_sha256_hash=f79b8f904b749e3e0d20afeadecf8249c55b2e32d4ebb089ae378df479dcaf25
$(package)_build_subdir=build
$(package)_patches += cmake_minimum.patch
# -D_DEFAULT_SOURCE defines __USE_MISC, which exposes additional
# definitions in endian.h, which are required for a working
# endianess check in configure when building with -flto.
define $(package)_set_vars
$(package)_config_opts := -DCMAKE_BUILD_TYPE=None -DEXPAT_BUILD_TOOLS=OFF
$(package)_config_opts += -DEXPAT_BUILD_EXAMPLES=OFF -DEXPAT_BUILD_TESTS=OFF
$(package)_config_opts += -DBUILD_SHARED_LIBS=OFF
$(package)_cppflags += -D_DEFAULT_SOURCE
endef
define $(package)_preprocess_cmds
patch -p1 < $($(package)_patch_dir)/cmake_minimum.patch
endef
define $(package)_config_cmds
$($(package)_cmake) -S .. -B .
endef
define $(package)_build_cmds
$(MAKE)
endef
define $(package)_stage_cmds
$(MAKE) DESTDIR=$($(package)_staging_dir) install
endef
define $(package)_postprocess_cmds
rm -rf share lib/cmake
endef