# -*- 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

name                libelf
version             0.8.13
revision            4
categories          devel
license             LGPL-2+
maintainers         nomaintainer

description         ELF object file access library
long_description    'Libelf' lets you read, modify or create ELF files in an \
                    architecture-independent way. The library takes care of \
                    size and endian issues, e.g. you can process a file for \
                    SPARC processors on an Intel-based system.

homepage            https://web.archive.org/web/20190223180146/http://www.mr511.de/software/english.html
master_sites        macports_distfiles

checksums           rmd160  06962fbbcd91da25f02b964ad9513b9536f67baa \
                    sha256  591a9b4ec81c1f2042a97aa60564e0cb79d041c52faa7416acb38bc95bd2c76d \
                    size    148529

patchfiles          elf_repl.diff \
                    implicit.patch

use_autoreconf      yes

configure.args			    --disable-compat
build.pre_args-append		instroot=${destroot}
destroot.pre_args-append	instroot=${destroot}

platform darwin arm {
    depends_build-append    port:automake

    post-patch {
        # Use newer config.guess and config.sub to support Apple Silicon.
        set automake_dirs [glob -directory ${prefix}/share automake-*]
        set automake_dir [lindex [lsort -command vercmp $automake_dirs] end]
        copy -force ${automake_dir}/config.guess ${automake_dir}/config.sub \
            ${worksrcpath}
    }
}

livecheck.type      none
