tepl: fix glib2 linking in static library

This commit is contained in:
Biswapriyo Nath
2023-10-05 08:36:46 +00:00
parent d149ecd43c
commit 813e781ff1

View File

@@ -34,32 +34,60 @@ sha256sums=('46e6e5f1bfdbc52e5956f06add575e9c7697c673d53d3803dfe768f490b560f0')
msys2_repository_url="https://gitlab.gnome.org/swilmet/tepl"
build() {
mkdir -p "${srcdir}/build-${MSYSTEM}" && cd "${srcdir}/build-${MSYSTEM}"
local -a _static_flags=(
-DCAIRO_WIN32_STATIC_BUILD
-DGIO_STATIC_COMPILATION
-DGLIB_STATIC_COMPILATION
-DGMODULE_STATIC_COMPILATION
-DGOBJECT_STATIC_COMPILATION
)
local -a _meson_options=(
--prefix="${MINGW_PREFIX}"
--wrap-mode=nodownload
--auto-features=enabled
--buildtype=plain
)
CFLAGS+=" ${_static_flags[@]}" \
CXXFLAGS+=" ${_static_flags[@]}" \
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/meson.exe setup \
"${_meson_options[@]}" \
--default-library=static \
-Dgtk_doc=false \
-Dgobject_introspection=false \
"${_realname}-${pkgver}" \
"build-${MSYSTEM}-static"
${MINGW_PREFIX}/bin/meson.exe compile -C "build-${MSYSTEM}-static"
MSYS2_ARG_CONV_EXCL="--prefix=" \
${MINGW_PREFIX}/bin/meson.exe setup \
--prefix="${MINGW_PREFIX}" \
--wrap-mode=nodownload \
--default-library=both \
--buildtype=plain \
-D gtk_doc=true \
"../${_realname}-${pkgver}"
"${_meson_options[@]}" \
--default-library=shared \
-Dgtk_doc=true \
-Dgobject_introspection=true \
"${_realname}-${pkgver}" \
"build-${MSYSTEM}-shared"
${MINGW_PREFIX}/bin/meson.exe compile
${MINGW_PREFIX}/bin/meson.exe compile -C "build-${MSYSTEM}-shared"
}
check() {
cd "${srcdir}/build-${MSYSTEM}"
${MINGW_PREFIX}/bin/meson.exe test --print-errorlogs || true
${MINGW_PREFIX}/bin/meson.exe test -C "build-${MSYSTEM}-static" || warning "Tests failed"
${MINGW_PREFIX}/bin/meson.exe test -C "build-${MSYSTEM}-shared" || warning "Tests failed"
}
package_tepl() {
${MINGW_PREFIX}/bin/meson.exe install -C "${srcdir}/build-${MSYSTEM}" --destdir "${pkgdir}"
${MINGW_PREFIX}/bin/meson.exe install -C "build-${MSYSTEM}-static" --destdir "${pkgdir}"
${MINGW_PREFIX}/bin/meson.exe install -C "build-${MSYSTEM}-shared" --destdir "${pkgdir}"
install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSES/LGPL-3.0-or-later.txt" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LICENSE"
# split docs
mkdir -p dest${MINGW_PREFIX}/share
mv "${pkgdir}${MINGW_PREFIX}"/share/gtk-doc dest${MINGW_PREFIX}/share/gtk-doc
install -Dm644 "${srcdir}/${_realname}-${pkgver}/LICENSES/LGPL-3.0-or-later.txt" "${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}/LGPL-3.0-or-later.txt"
}
package_tepl-docs() {