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