# -*- coding: utf-8; mode: tcl; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- vim:fenc=utf-8:et:sw=4:ts=4:sts=4

PortSystem          1.0
PortGroup           octave 1.0

octave.setup        github PREDICT-EPFL piqp 0.6.2 v
#github.tarball_from releases
revision            1
license             BSD
maintainers         {mps @Schamschula} openmaintainer
description         PIQP is a Proximal Interior Point Quadratic Programming solver.
long_description    {*}${description}

# unversioned distfile
distname            piqp-octave
distfiles           ${distname}-${version}${extract.suffix}
master_sites        https://github.com/PREDICT-EPFL/piqp/releases/download/v${version}/${distname}${extract.suffix}?dummy=

checksums           rmd160  ca4a4adf3b92a05ebda6ad1a3073d3d1644b7816 \
                    sha256  7139ece1332417123d8003229b7198adb758780619b40a5861d0914697cf3e89 \
                    size    3451369

# Remove -march=native, we do not want this for distribution.
# Also notice, that on PowerPC it is unsupported and -mtune=native is to be used.
patchfiles-append   patch-fix-build.diff

# This should be dropped once bundled Eigen is updated past 3.4.0.
# The bug is fixed in upstream.
patchfiles-append   patch-unbreak-eigen3.diff

post-patch {
    reinplace "s|@PREFIX@|${prefix}|g" ${worksrcpath}/make_piqp.m ${worksrcpath}/src/piqp/interfaces/octave/make_piqp.m
}
