Files
MINGW-packages/mingw-w64-plplot/PKGBUILD
Dalan94 f387002684 Fixed plplot qhull link and install dir (#4564)
* Fixed plplot qhull link and install dir

* Fixed indenting and version in plplot
2018-10-21 17:02:45 +03:00

159 lines
7.1 KiB
Bash

# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Contributor: Jürgen Pfeifer <juergen@familiepfeifer.de>
# Contributor: Tim S. <stahta01@gmail.com>
# Note: Added "ENABLE_itk=OFF" because of random build errors;
# It appeared to think it found the itk library; but, it then errored out.
# Set "ENABLE_qt=OFF" and "DEFAULT_NO_CAIRO_DEVICES=ON" to reduce warnings.
# Had to define PLD_png and etc to ON to get libGD to be searched.
_realname=plplot
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=5.13.0
pkgrel=4
arch=('any')
pkgdesc="Scientific plotting software (mingw-w64)"
depends=("${MINGW_PACKAGE_PREFIX}-cairo"
"${MINGW_PACKAGE_PREFIX}-gcc-libs"
"${MINGW_PACKAGE_PREFIX}-gcc-libgfortran"
"${MINGW_PACKAGE_PREFIX}-freetype"
"${MINGW_PACKAGE_PREFIX}-libharu"
"${MINGW_PACKAGE_PREFIX}-lua"
"${MINGW_PACKAGE_PREFIX}-python2"
"${MINGW_PACKAGE_PREFIX}-python2-numpy"
"${MINGW_PACKAGE_PREFIX}-shapelib"
"${MINGW_PACKAGE_PREFIX}-tk"
"${MINGW_PACKAGE_PREFIX}-wxWidgets"
)
makedepends=("${MINGW_PACKAGE_PREFIX}-libgd"
"${MINGW_PACKAGE_PREFIX}-gcc-fortran"
"${MINGW_PACKAGE_PREFIX}-gcc-ada"
"${MINGW_PACKAGE_PREFIX}-swig"
"${MINGW_PACKAGE_PREFIX}-pkg-config"
"${MINGW_PACKAGE_PREFIX}-qhull"
"make"
"patch"
"perl"
"bsdtar>=3.3"
"${MINGW_PACKAGE_PREFIX}-cmake>=3.6.2")
optdepends=("${MINGW_PACKAGE_PREFIX}-swig: connects Plplot C library to Python and Lua"
"${MINGW_PACKAGE_PREFIX}-libgd: ability to output png, jpeg and gif files")
options=('strip' 'staticlibs')
license=('LGPL')
url="https://plplot.sourceforge.io/"
source=(https://downloads.sourceforge.net/sourceforge/plplot/${_realname}-${pkgver}.tar.gz
find-gd.patch
Include-wx-msw-wrapwin.h-instead-of-Windows.h.patch
pdf-linking-libharu.patch
fix-pkgconfig.patch
fix-qhull-lib.patch
fix-install-dir.patch)
sha256sums=('ec36bbee8b03d9d1c98f8fd88f7dc3415560e559b53eb1aa991c2dcf61b25d2b'
'57ad3a43d5ad467b89889a42d0b033e35cf322b9b83f2f41a62fe5d74a5d01b8'
'9c81879ade97eb15bdefc04c476e986e5996ac52fff2428f90c136e16d54f275'
'abf5ee33dad2108220d0973de4279ce04007b9fb429184d194a6cf951005c8be'
'fe7a7c0e888187a00c2df8e42c54ed964845de2aa5e8fc2fdf94868c0cfb148c'
'f8fc77b0a89ce9f89a3e1c9df2f1e07c7c1cebf90e0d7e7791247270e090171e'
'c11a37adea8134f9497fd45f24cd153cce18855ddff66ea5ba6ef8875da022fc')
prepare() {
cd ${srcdir}/${_realname}-${pkgver}
patch -p1 -i ${srcdir}/find-gd.patch
patch -p1 -i ${srcdir}/Include-wx-msw-wrapwin.h-instead-of-Windows.h.patch
patch -p1 -i ${srcdir}/pdf-linking-libharu.patch
patch -p1 -i ${srcdir}/fix-pkgconfig.patch
patch -p1 -i ${srcdir}/fix-qhull-lib.patch
patch -p1 -i ${srcdir}/fix-install-dir.patch
}
build() {
# cmake may be confused if there is a Windows installation
# of the official Python MSI. Please do the Python-enabled
# build only, if no official Python is installed.
[[ -d ${srcdir}/build-${MINGW_CHOST} ]] && rm -rf ${srcdir}/build-${MINGW_CHOST}
mkdir -p ${srcdir}/build-${MINGW_CHOST} && cd ${srcdir}/build-${MINGW_CHOST}
local pyexe="${MINGW_PREFIX}/bin/python2.exe"
local pyver=$(${pyexe} -c "import sys;sys.stdout.write('.'.join(map(str, sys.version_info[:2])))")
local pylib="${MINGW_PREFIX}/lib/libpython${pyver}.dll.a"
if [[ ${pyver:0:1} != "2" ]] ; then
pylib="${MINGW_PREFIX}/lib/libpython${pyver}m.dll.a"
fi
MSYS2_ARG_CONV_EXCL="-DCMAKE_INSTALL_PREFIX=" \
${MINGW_PREFIX}/bin/cmake \
-G"MSYS Makefiles" \
-DCMAKE_INSTALL_PREFIX=${MINGW_PREFIX} \
-DCMAKE_Fortran_COMPILER=${MINGW_PREFIX}/bin/gfortran.exe \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_SHARED_LIBS=ON \
-DBUILD_TEST=OFF \
-DPYTHON_VERSION=${pyver} \
-DPYTHON_EXECUTABLE=${pyexe} \
-DPYTHON_LIBRARY=${pylib} \
-DPYTHON_INCLUDE_DIRS=${MINGW_PREFIX}/include/python${pyver} \
-DQHULL_INCLUDE_DIRS=${MINGW_PREFIX}/include \
-DQHULL_LIBRARY_DIRS=${MINGW_PREFIX}/lib \
-DQHULL_LIBRARIES=qhullstatic \
-DGD_INCLUDE_DIR=${MINGW_PREFIX}/include \
-DDEFAULT_NO_BINDINGS=ON \
-DENABLE_ada=ON \
-DENABLE_cxx=ON \
-DENABLE_fortran=ON \
-DENABLE_lua=ON \
-DENABLE_python=ON \
-DENABLE_tcl=ON \
-DENABLE_tk=ON \
-DENABLE_DYNDRIVERS=OFF \
-DENABLE_wxwidgets=ON \
-DENABLE_itk=OFF \
-DENABLE_qt=OFF \
-DPLD_png=ON \
-DPLD_jpeg=ON \
-DPLD_gif==ON \
../${_realname}-${pkgver}
make V=1
}
package() {
cd "${srcdir}/build-${MINGW_CHOST}"
make DESTDIR="${pkgdir}" install
local MINGW_PREFIX_WIN=$(cygpath -am ${MINGW_PREFIX})
local MSYS2_USR_WIN=$(cygpath -am /usr)
# Fix paths in pkgconfig files
find "${pkgdir}${MINGW_PREFIX}/lib/pkgconfig" -type f -name '*.pc' \
-exec sed -i -e "s|${MINGW_PREFIX_WIN}|${MINGW_PREFIX}|g" {} \;
# Fix paths in example files
find "${pkgdir}${MINGW_PREFIX}/share/plplot5.13.0/examples" -type f -name '*.sh' \
-exec sed -i -e "s|${MINGW_PREFIX_WIN}|${MINGW_PREFIX}|g" {} \;
find "${pkgdir}${MINGW_PREFIX}/share/plplot5.13.0/examples" -type f -name 'Makefile' \
-exec sed -i -e "s|${MINGW_PREFIX_WIN}|${MINGW_PREFIX}|g" {} \;
find "${pkgdir}${MINGW_PREFIX}/share/plplot5.13.0/examples" -type f -name '*.sh' \
-exec sed -i -e "s|${MSYS2_USR_WIN}|/usr|g" {} \;
find "${pkgdir}${MINGW_PREFIX}/share/plplot5.13.0/examples" -type f -name 'Makefile' \
-exec sed -i -e "s|${MSYS2_USR_WIN}|/usr|g" {} \;
# Fix paths in the remaing odd files
sed -s "s|${MINGW_PREFIX_WIN}|\${MINGW_PREFIX}|g" -i "${pkgdir}"${MINGW_PREFIX}/share/plplot5.13.0/examples/tk/wish_runAllDemos
sed -s "s|${MINGW_PREFIX_WIN}|\${MINGW_PREFIX}|g" -i "${pkgdir}"${MINGW_PREFIX}/share/plplot5.13.0/examples/tk/wish_standard_examples
sed -s "s|${MINGW_PREFIX_WIN}|\${MINGW_PREFIX}|g" -i "${pkgdir}"${MINGW_PREFIX}/lib/cmake/plplot/export_plplot.cmake
sed -s "s|${MINGW_PREFIX_WIN}|\${MINGW_PREFIX}|g" -i "${pkgdir}"${MINGW_PREFIX}/share/plplot5.13.0/examples/cmake/modules/plplot_configure.cmake
sed -s "s|${MSYS2_USR_WIN}|/usr|g" -i "${pkgdir}"${MINGW_PREFIX}/share/plplot5.13.0/examples/cmake/modules/plplot_configure.cmake
sed -s "s|${MSYS2_USR_WIN}|/usr|g" -i "${pkgdir}"${MINGW_PREFIX}/share/plplot5.13.0/examples/tk/plserver_runAllDemos
sed -s "s|${MSYS2_USR_WIN}|/usr|g" -i "${pkgdir}"${MINGW_PREFIX}/share/plplot5.13.0/examples/tk/plserver_standard_examples
sed -s "s|${MSYS2_USR_WIN}|/usr|g" -i "${pkgdir}"${MINGW_PREFIX}/share/plplot5.13.0/examples/tk/wish_runAllDemos
sed -s "s|${MSYS2_USR_WIN}|/usr|g" -i "${pkgdir}"${MINGW_PREFIX}/share/plplot5.13.0/examples/tk/wish_standard_examples
mkdir -p ${pkgdir}${MINGW_PREFIX}/share/licenses/$_realname
cp -pf ${srcdir}/${_realname}-${pkgver}/Copyright \
${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}
cp -pf ${srcdir}/${_realname}-${pkgver}/COPYING* \
${pkgdir}${MINGW_PREFIX}/share/licenses/${_realname}
}