pkgname = "jasper"
pkgver = "4.0.0"
pkgrel = 0
build_style = "cmake"
make_dir = "jbuild" # build is taken
hostmakedepends = ["cmake", "ninja", "pkgconf"]
makedepends = ["libjpeg-turbo-devel"]
pkgdesc = "Reference implementation of the JPEG-2000 codec"
maintainer = "q66 <q66@chimera-linux.org>"
license = "JasPer-2.0"
url = "https://ece.engr.uvic.ca/~frodo/jasper"
source = f"https://github.com/jasper-software/{pkgname}/releases/download/version-{pkgver}/{pkgname}-{pkgver}.tar.gz"
sha256 = "39514e1b53a5333fcff817e19565371f016ea536c36fd2d13a9c4d8da8f0be0c"

def post_install(self):
    self.install_license("LICENSE.txt")

@subpackage("jasper-devel")
def _devel(self):
    self.depends += ["libjpeg-turbo-devel"]

    return self.default_devel()

@subpackage("jasper-progs")
def _progs(self):
    return self.default_progs()
