#TODO Promote [source] git = "https://github.com/willnode/htop" branch = "redox" script = """ autotools_recursive_regenerate """ [build] template = "custom" dependencies = [ "ncursesw", ] script = """ python3 - <<'PY' import os from pathlib import Path source = Path(os.environ["COOKBOOK_SOURCE"]) rich = source / "RichString.c" text = rich.read_text() text = text.replace('mbstate_t ps = { 0 };', 'mbstate_t ps;\\n memset(&ps, 0, sizeof(ps));') rich.write_text(text) process = source / "Process.c" text = process.read_text() text = text.replace('#else\\n return true;', '#else\\n (void)this;\\n (void)priority;\\n return true;') process.write_text(text) redox = source / "redox/RedoxProcessTable.c" text = redox.read_text() text = text.replace('char state = map_redox_state(stat);', 'ProcessState state = (ProcessState) map_redox_state(stat);') redox.write_text(text) PY export CFLAGS="${CFLAGS} -fno-finite-math-only" export CFLAGS_FOR_BUILD="${CFLAGS_FOR_BUILD} -fno-finite-math-only" sed -i 's/flag_finite_math_only=yes/flag_finite_math_only=no/g' "${COOKBOOK_SOURCE}/configure" COOKBOOK_CONFIGURE_FLAGS=( --host="${GNU_TARGET}" --prefix="/usr" ) COOKBOOK_CONFIGURE_FLAGS+=( --enable-unicode --disable-hwloc --disable-sensors --disable-capabilities ) cookbook_configure """ [package] dependencies = [ "terminfo" ]