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

PortSystem          1.0
PortGroup           github 1.0
PortGroup           legacysupport 1.1

github.setup        plougher squashfs-tools 4.5
# Change github.tarball_from to 'releases' or 'archive' next update
github.tarball_from tarball
revision            1
checksums           rmd160  6543c75ac3313dd72aef9d951cdfb0211d299a1c \
                    sha256  e3bc4d23fc8e5f1ede58ea6a438fc3454ffb8dc715a60b6e78b6a10e4dfbc19a \
                    size    250518

categories          sysutils
license             GPL-2+
maintainers         {mit.edu:quentin @quentinmit} \
                    openmaintainer

description         Tools to create and extract Squashfs filesystems
long_description \
    Squashfs is a highly compressed read-only filesystem for Linux. \
    It uses zlib compression to compress both files, inodes and directories. \
    Inodes in the system are very small and all blocks are packed to minimise \
    data overhead. Block sizes greater than 4K are supported up to a maximum of \
    64K.\
    \
    Squashfs is intended for general read-only filesystem use, for archival \
    use (i.e. in cases where a .tar.gz file may be used), and in constrained \
    block device/memory systems (e.g. embedded systems) where low overhead is \
    needed.

legacysupport.newest_darwin_requires_legacy 16

depends_lib-append  port:zlib \
                    port:xz \
                    port:lzo2 \
                    port:lz4 \
                    port:zstd

worksrcdir          ${distname}/${name}

patchfiles          darwin.patch
patch.pre_args-replace  -p0 -p2

use_configure       no

build.pre_args-append \
                    EXTRA_CFLAGS="${configure.cppflags}" \
                    EXTRA_LDFLAGS="${configure.ldflags}"

build.args-append   XZ_SUPPORT=1 \
                    LZO_SUPPORT=1 \
                    LZ4_SUPPORT=1 \
                    ZSTD_SUPPORT=1

destroot.destdir    DESTDIR=${destroot} \
                    INSTALL_DIR=${prefix}/bin
