-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
75 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
# Contributor: https://github.com/taozuhong | ||
|
||
_realname=excelize | ||
pkgbase=mingw-w64-${_realname} | ||
pkgname="${MINGW_PACKAGE_PREFIX}-lib${_realname}" | ||
pkgver=2.9.0 | ||
pkgrel=1 | ||
_commit="23424611f9fde1825d403d4254267a38f149c19b" | ||
pkgdesc='Library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets in Go. (mingw-w64)' | ||
arch=('any') | ||
mingw_arch=('mingw64' 'ucrt64' 'clang64' 'clangarm64') | ||
url='https://github.com/qax-os/excelize' | ||
license=('spdx:BSD-3-Clause') | ||
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs") | ||
makedepends=(${MINGW_PACKAGE_PREFIX}-cmake | ||
${MINGW_PACKAGE_PREFIX}-go | ||
${MINGW_PACKAGE_PREFIX}-cc | ||
${MINGW_PACKAGE_PREFIX}-ninja | ||
git) | ||
options=('!strip') | ||
source=("git+https://github.com/xuri/excelize-py.git#commit=${_commit}" | ||
"excelize.pc.in") | ||
sha256sums=('SKIP' | ||
'aeb19680632e6a7bf15293a9fe013afc628e7360124f5ece5b38aa771be3fb69') | ||
|
||
prepare() { | ||
cd "${srcdir}/excelize-py" | ||
} | ||
|
||
build() { | ||
cd "${srcdir}" | ||
[[ -d build-${MINGW_CHOST} ]] && rm -rf build-${MINGW_CHOST} | ||
mkdir -p build-${MINGW_CHOST} | ||
cp -f "${srcdir}/excelize-py/go.mod" "${srcdir}/build-${MINGW_CHOST}" | ||
cp -f "${srcdir}/excelize-py/go.sum" "${srcdir}/build-${MINGW_CHOST}" | ||
cp -f "${srcdir}/excelize.pc.in" "${srcdir}/build-${MINGW_CHOST}/excelize.pc" | ||
sed -i "s#MSYSTEM_PREFIX#$MSYSTEM_PREFIX#" "${srcdir}/build-${MINGW_CHOST}/excelize.pc" | ||
sed -i "s#VERSION#$pkgver#" "${srcdir}/build-${MINGW_CHOST}/excelize.pc" | ||
cd build-${MINGW_CHOST} | ||
|
||
export GOPROXY=direct | ||
export GOOS=windows | ||
export GOROOT=${MINGW_PREFIX}/lib/go | ||
export CGO_CPPFLAGS="${CPPFLAGS}" | ||
export CGO_CFLAGS="${CFLAGS}" | ||
export CGO_CXXFLAGS="${CXXFLAGS}" | ||
export CGO_LDFLAGS="${LDFLAGS}" | ||
export GO_LDFLAGS="-s -w" | ||
# export GOFLAGS="-trimpath -mod=readonly -modcacherw -ldflags=-linkmode=external" | ||
|
||
go build -buildmode=c-archive -o excelize.a ${srcdir}/excelize-py/main.go | ||
go build -buildmode=c-shared -o excelize.dll ${srcdir}/excelize-py/main.go | ||
} | ||
|
||
package() { | ||
cd "build-${MINGW_CHOST}" | ||
install -Dm755 "excelize.dll" "${pkgdir}${MINGW_PREFIX}/bin/excelize.dll" | ||
install -Dm755 "excelize.a" "${pkgdir}${MINGW_PREFIX}/lib/excelize.a" | ||
install -Dm755 "excelize.pc" "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig/excelize.pc" | ||
install -Dm755 "excelize.h" "${pkgdir}${MINGW_PREFIX}/include/excelize/excelize.h" | ||
install -Dm755 "${srcdir}/excelize-py/types_c.h" "${pkgdir}${MINGW_PREFIX}/include/excelize/types_c.h" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
# Package Information for pkg-config | ||
|
||
prefix=MSYSTEM_PREFIX | ||
exec_prefix=${prefix} | ||
includedir=${prefix}/include | ||
libdir=${exec_prefix}/lib | ||
|
||
Name: excelize | ||
Description: Library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets in Go | ||
Version: VERSION | ||
Libs: -L${libdir} -lexcelize | ||
Libs.private: -lpthread | ||
Cflags: -I${includedir}/excelize |