; 5.9.2 supports PCRE2 and keeps the /bin/zsh and /etc/zsh layout used by Vinix. defpkgbuild(zsh, #:pkgname, "zsh", #:pkgver, "5.9.2", #:pkgrel, 1, #:pkgdesc, "Interactive shell with line editing, completions and loadable modules", #:arch, [#:x86-64], #:url, "https://www.zsh.org/", #:license, "MIT-Modern-Variant AND GPL-2.0-only", #:depends, ["musl", "ncurses", "pcre2", "libcap"], #:makedepends, ["linux-headers"], #:backup, ["etc/zsh/zshenv", "etc/zsh/zprofile", "etc/zsh/zshrc"], #:source, ["https://distfiles.alpinelinux.org/distfiles/edge/zsh-5.9.2.tar.xz", "zprofile", "zshenv", "zshrc"], #:sha256sums, ["36fa734374b44783582cec09bcd67822e2f992c779ec1624ab5596df078d2f81", "5b7382c22b140b2d1027d2c1cc1805498bcd12ea508b1b76c333b952da52599a", "798b8e41ed0ed2ffdc4a2d6fabf3099063e40b74b51fe03631305edeb7607e07", "75fb7b825e3f7a3d63257c98ef5d55819179902585a3ec6459c2b4fbb20ed38f"], #:build, fn() { root := get-environment-variable("VINIX_SYSROOT") run("test", "-e", string-append(root, "/usr/lib/libncursesw.so")) ; Define ELF symbol properties that configure cannot test by executing ; a target program on the build host. The package phase loads the modules. run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", "-C", "zsh-5.9.2", "PKG_CONFIG_PATH=", string-append("PKG_CONFIG_SYSROOT_DIR=", root), string-append("PKG_CONFIG_LIBDIR=", root, "/usr/lib/pkgconfig"), string-append("PCRE_CONFIG=", root, "/usr/bin/pcre2-config"), "CC=vinix-cc", "CFLAGS=-O2", "zsh_cv_shared_environ=yes", "zsh_cv_shared_tgetent=yes", "zsh_cv_shared_tigetstr=yes", "zsh_cv_sys_dynamic_execsyms=yes", "zsh_cv_sys_dynamic_rtld_global=yes", "zsh_cv_sys_dynamic_clash_ok=yes", "./configure", "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl", "--prefix=/usr", "--bindir=/bin", "--sysconfdir=/etc", "--enable-etcdir=/etc/zsh", "--with-term-lib=ncursesw", "--enable-multibyte", "--enable-function-subdirs", "--enable-pcre", "--enable-cap", "--enable-zsh-secure-free", "--with-tcsetpgrp") run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", "make", "-C", "zsh-5.9.2") }, #:package, fn() { root := get-environment-variable("VINIX_SYSROOT") run("make", "-j1", "-C", "zsh-5.9.2", string-append("DESTDIR=", pkgdir()), "install") for-each(fn(file) { run("install", "-Dm644", file, string-append(pkgdir(), "/etc/zsh/", file)) }, list("zprofile", "zshenv", "zshrc")) run("install", "-d", string-append(pkgdir(), "/etc/zsh/zshrc.d"), string-append(pkgdir(), "/usr/share/zsh/plugins")) run("install", "-Dm644", "zsh-5.9.2/LICENCE", string-append(pkgdir(), "/usr/share/licenses/zsh/LICENCE")) run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path", string-append(root, "/usr/lib:", root, "/lib"), string-append(pkgdir(), "/bin/zsh"), "-fc", "module_path=($1); zmodload zsh/zle && zmodload zsh/complete && zmodload zsh/terminfo && zmodload zsh/pcre && zmodload zsh/cap && setopt RE_MATCH_PCRE && [[ ab =~ '^(?=a)a' ]]", "zsh", string-append(pkgdir(), "/usr/lib/zsh/5.9.2")) })