PortSystem      1.0

name            wmcpuload

# NB: see below before updating
version         1.0.1
revision        4
categories      sysutils x11
license         GPL-2+
maintainers     nomaintainer
description     An "lcd" dockapp that displays the current cpuload
homepage        http://www.sh.rim.or.jp/~ssato/dockapp/

use_bzip2       yes

long_description WMCPULoad is a program to monitor CPU usage. It is a \
dockapp that is supported by X window managers such as Window Maker, \
AfterStep, BlackBox, and Enlightenment.

platforms       darwin freebsd
master_sites    http://distfiles.gentoo.org/distfiles/

checksums       rmd160  1ff01f09464dc8628acd7d375adcd106ea7ce317 \
                sha256  c05fffcf5b4aeb29280ac7e7762b937bddb9ac14283cf8e6110135009c6dd6f0 \
                size    92457

patchfiles      patch-hoststatistics.diff

depends_lib     port:xorg-libXext \
                port:xpm

configure.args  --x-include=${prefix}/include \
                --x-lib=${prefix}/lib \
                --mandir=${prefix}/share/man

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}
    }
}

# a newer version of this port exists, however it does not actually work to show CPU load
# tested on 20230108 on MacOSX 13.1 / arm64

# version         1.1.1
# revision        0
# does not use bzip2
# homepage        https://www.dockapps.net/
# master_sites    https://www.dockapps.net/download/

# checksums       rmd160  ad1a20cac86fcc2089a11fcf5dd9634b2982940f \
#                 sha256  8f08b2b937db105b677a9e4df2a67259d2580071e28456c0e6cd77db15f0648c \
#                 size    167751