; Alpine 3.21 source snapshot. The host tic builds architecture-independent ; terminfo while the staged musl toolchain builds the guest executables. selected := get-environment-variable("VPAC_TARGET_ARCH") arm := if string?(selected) { string=?("aarch64", selected) } else { memq(string->symbol("aarch64"), features()) } cross-prefix := get-environment-variable("CROSS_COMPILE") strip-program := if string?(cross-prefix) { string-append(cross-prefix, "strip") } else { "strip" } defpkgbuild(ncurses, #:pkgname, "ncurses", #:pkgver, "6.5_p20241006", #:pkgrel, if arm { 3 } else { 2 }, #:pkgdesc, "Wide-character terminal libraries, tools and terminfo database", #:arch, [#:x86-64, #:aarch64], #:license, "X11", #:url, "https://invisible-island.net/ncurses/", #:depends, ["musl"], #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/ncurses-6.5-20241006.tgz"], #:sha256sums, ["fefd7f516ba7a236239d3213f698fa9736c394bece176671411e94dac83eadfd"], #:build, fn() { run("env", "CFLAGS=-O2 -D_GNU_SOURCE", "vinix-configure", "ncurses-6.5-20241006/configure", "--mandir=/usr/share/man", "--without-ada", "--without-tests", "--without-cxx-binding", "--without-cxx", "--without-debug", "--disable-termcap", "--disable-root-access", "--disable-rpath-hack", "--disable-setuid-environ", "--with-build-cc=gcc", "--with-tic-path=/usr/bin/tic", "--with-shared", "--enable-widec", "--enable-overwrite", string-append("--with-strip-program=", strip-program), "--with-pkg-config-libdir=/usr/lib/pkgconfig", "--enable-pc-files", "--enable-symlinks", "--with-terminfo-dirs=/etc/terminfo:/usr/share/terminfo:/lib/terminfo:/usr/lib/terminfo") run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", "make") }, #:package, fn() { run("make", "-j1", string-append("DESTDIR=", pkgdir()), "install") lib := string-append(pkgdir(), "/usr/lib/") pc := string-append(lib, "pkgconfig/") for-each(fn(name) { run("ln", "-sf", string-append("lib", name, "w.so"), string-append(lib, "lib", name, ".so")) run("ln", "-sf", string-append("lib", name, "w.a"), string-append(lib, "lib", name, ".a")) run("ln", "-sf", string-append(name, "w.pc"), string-append(pc, name, ".pc")) }, list("ncurses", "panel", "menu", "form")) for-each(fn(name) { run("ln", "-sf", "libncursesw.so", string-append(lib, "lib", name, ".so")) run("ln", "-sf", "libncursesw.a", string-append(lib, "lib", name, ".a")) run("ln", "-sf", "ncursesw.pc", string-append(pc, name, ".pc")) }, list("curses", "tic", "tinfo")) run("test", "-s", string-append(pkgdir(), "/usr/share/terminfo/x/xterm-256color")) run("env", string-append("TERMINFO=", pkgdir(), "/usr/share/terminfo"), "vinix-run", "--library-path", lib, string-append(pkgdir(), "/usr/bin/infocmp"), "xterm-256color") run("install", "-Dm644", "ncurses-6.5-20241006/COPYING", string-append(pkgdir(), "/usr/share/licenses/ncurses/COPYING")) })