Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 10 additions & 20 deletions recipes/recipes_emscripten/less/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,42 +7,32 @@ echo $NCURSES_CFLAGS
echo $NCURSES_LDFLAGS
ls -l $XTERM_256COLOR

export CONFIG_CFLAGS="\
$NCURSES_CFLAGS \
-Os \
-Wno-incompatible-function-pointer-types \
"
export EMCC_CFLAGS="$EMCC_CFLAGS -Os"

export CFLAGS="$CFLAGS $NCURSES_CFLAGS"

export CONFIG_LDFLAGS="\
export LDFLAGS="\
$LDFLAGS \
$NCURSES_LDFLAGS \
-Os \
--minify=0 \
-sALLOW_MEMORY_GROWTH=1 \
-sEXIT_RUNTIME=1 \
-sEXPORTED_RUNTIME_METHODS=FS,ENV,getEnvStrings,TTY \
-sEXPORTED_RUNTIME_METHODS=FS,ENV,PROXYFS,TTY \
-sFORCE_FILESYSTEM=1 \
-sMODULARIZE=1 \
-sLZ4 \
-lproxyfs.js \
"

# Use same return type for signals that is used in ncurses.
sed -i -e 's/#define RETSIGTYPE void/#define RETSIGTYPE int/g' defines.h.in

# Use ncurses' winch not local copy.
sed -i -e 's/RETSIGTYPE winch/RETSIGTYPE notwinch/g' signal.c
emmake make -f Makefile.aut distfiles

emconfigure ./configure \
--host=wasm32-unknown-emscripten \
CFLAGS="$CFLAGS $CONFIG_CFLAGS" \
LDFLAGS="$LDFLAGS $CONFIG_LDFLAGS" \
ac_cv_func__setjmp=no \
ac_cv_func_popen=no \
ac_cv_func_sigprocmask=no
--with-regex=pcre2

# Build less but not lessecho and lesskey.
emmake make less.js EXEEXT=.js -j${CPU_COUNT} LDFLAGS=" \
emmake make less.js EXEEXT=.js -j${CPU_COUNT} LDFLAGS="
$LDFLAGS \
$CONFIG_LDFLAGS \
--preload-file $XTERM_256COLOR@/usr/local/share/terminfo/x/xterm-256color \
"

Expand Down
9 changes: 5 additions & 4 deletions recipes/recipes_emscripten/less/recipe.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
context:
name: less
version: 668
version: 692

package:
name: ${{ name }}
version: ${{ version }}

source:
url: https://ftp.gnu.org/gnu/${{ name }}/${{ name }}-${{ version }}.tar.gz
sha256: 2819f55564d86d542abbecafd82ff61e819a3eec967faa36cd3e68f1596a44b8
url: https://github.com/gwsw/less/archive/refs/tags/v${{ version }}.tar.gz
sha256: 5e2ba1936f9d19d903d8b224c3af39c8693bf3add8de42fef3a18b2cde964b35

build:
number: 0
Expand All @@ -20,6 +20,7 @@ requirements:
- autoconf
host:
- ncurses <6.5
- pcre2

tests:
- script:
Expand All @@ -28,7 +29,7 @@ tests:
- test -f $PREFIX/bin/less.wasm
- script: |
OUTPUT=$(run_modularized $PREFIX/bin/less.js --version | head -1 | cut -c -9)
if [[ "$OUTPUT" != "less 668 " ]]; then
if [[ "$OUTPUT" != "less ${{ version }} " ]]; then
echo "Unexpected output: $OUTPUT"
exit 1
fi
Expand Down