| 1 | ; Alpine 3.21 source snapshot. The host tic builds architecture-independent |
| 2 | ; terminfo while the staged musl toolchain builds the guest executables. |
| 3 | defpkgbuild(ncurses, |
| 4 | #:pkgname, "ncurses", |
| 5 | #:pkgver, "6.5_p20241006", |
| 6 | #:pkgrel, 2, |
| 7 | #:pkgdesc, "Wide-character terminal libraries, tools and terminfo database", |
| 8 | #:arch, [#:x86-64, #:aarch64], |
| 9 | #:license, "X11", |
| 10 | #:url, "https://invisible-island.net/ncurses/", |
| 11 | #:depends, ["musl"], |
| 12 | #:source, ["https://distfiles.alpinelinux.org/distfiles/v3.21/ncurses-6.5-20241006.tgz"], |
| 13 | #:sha256sums, ["fefd7f516ba7a236239d3213f698fa9736c394bece176671411e94dac83eadfd"], |
| 14 | #:build, fn() { |
| 15 | run("env", "CFLAGS=-O2 -D_GNU_SOURCE", "vinix-configure", "ncurses-6.5-20241006/configure", |
| 16 | "--mandir=/usr/share/man", "--without-ada", "--without-tests", "--without-cxx-binding", |
| 17 | "--without-cxx", "--without-debug", "--disable-termcap", "--disable-root-access", |
| 18 | "--disable-rpath-hack", "--disable-setuid-environ", "--with-build-cc=gcc", |
| 19 | "--with-tic-path=/usr/bin/tic", "--with-shared", "--enable-widec", "--enable-overwrite", |
| 20 | "--with-pkg-config-libdir=/usr/lib/pkgconfig", "--enable-pc-files", "--enable-symlinks", |
| 21 | "--with-terminfo-dirs=/etc/terminfo:/usr/share/terminfo:/lib/terminfo:/usr/lib/terminfo") |
| 22 | run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", "make") |
| 23 | }, |
| 24 | #:package, fn() { |
| 25 | run("make", "-j1", string-append("DESTDIR=", pkgdir()), "install") |
| 26 | lib := string-append(pkgdir(), "/usr/lib/") |
| 27 | pc := string-append(lib, "pkgconfig/") |
| 28 | for-each(fn(name) { |
| 29 | run("ln", "-sf", string-append("lib", name, "w.so"), string-append(lib, "lib", name, ".so")) |
| 30 | run("ln", "-sf", string-append("lib", name, "w.a"), string-append(lib, "lib", name, ".a")) |
| 31 | run("ln", "-sf", string-append(name, "w.pc"), string-append(pc, name, ".pc")) |
| 32 | }, list("ncurses", "panel", "menu", "form")) |
| 33 | for-each(fn(name) { |
| 34 | run("ln", "-sf", "libncursesw.so", string-append(lib, "lib", name, ".so")) |
| 35 | run("ln", "-sf", "libncursesw.a", string-append(lib, "lib", name, ".a")) |
| 36 | run("ln", "-sf", "ncursesw.pc", string-append(pc, name, ".pc")) |
| 37 | }, list("curses", "tic", "tinfo")) |
| 38 | run("test", "-s", string-append(pkgdir(), "/usr/share/terminfo/x/xterm-256color")) |
| 39 | run("env", string-append("TERMINFO=", pkgdir(), "/usr/share/terminfo"), "vinix-run", |
| 40 | "--library-path", lib, string-append(pkgdir(), "/usr/bin/infocmp"), "xterm-256color") |
| 41 | run("install", "-Dm644", "ncurses-6.5-20241006/COPYING", string-append(pkgdir(), "/usr/share/licenses/ncurses/COPYING")) |
| 42 | }) |
| 43 | |