| 1 | ; 5.9.2 supports PCRE2 and keeps the /bin/zsh and /etc/zsh layout used by Vinix. |
| 2 | defpkgbuild(zsh, |
| 3 | #:pkgname, "zsh", |
| 4 | #:pkgver, "5.9.2", |
| 5 | #:pkgrel, 2, |
| 6 | #:pkgdesc, "Interactive shell with line editing, completions and loadable modules", |
| 7 | #:arch, [#:x86-64, #:aarch64], |
| 8 | #:url, "https://www.zsh.org/", |
| 9 | #:license, "MIT-Modern-Variant AND GPL-2.0-only", |
| 10 | #:depends, ["musl", "ncurses", "pcre2", "libcap"], |
| 11 | #:makedepends, ["linux-headers"], |
| 12 | #:backup, ["etc/zsh/zshenv", "etc/zsh/zprofile", "etc/zsh/zshrc"], |
| 13 | #:source, ["https://distfiles.alpinelinux.org/distfiles/edge/zsh-5.9.2.tar.xz", |
| 14 | "zprofile", "zshenv", "zshrc"], |
| 15 | #:sha256sums, ["36fa734374b44783582cec09bcd67822e2f992c779ec1624ab5596df078d2f81", |
| 16 | "5b7382c22b140b2d1027d2c1cc1805498bcd12ea508b1b76c333b952da52599a", |
| 17 | "798b8e41ed0ed2ffdc4a2d6fabf3099063e40b74b51fe03631305edeb7607e07", |
| 18 | "75fb7b825e3f7a3d63257c98ef5d55819179902585a3ec6459c2b4fbb20ed38f"], |
| 19 | #:build, fn() { |
| 20 | root := get-environment-variable("VPAC_MAKEPKG_ROOT") |
| 21 | run("test", "-e", string-append(root, "/usr/lib/libncursesw.so")) |
| 22 | ; Define ELF symbol properties that configure cannot test by executing |
| 23 | ; a target program on the build host. The package phase loads the modules. |
| 24 | run("env", "-C", "zsh-5.9.2", |
| 25 | string-append("PCRE_CONFIG=", root, "/usr/bin/pcre2-config"), |
| 26 | "CFLAGS=-O2", "zsh_cv_shared_environ=yes", "zsh_cv_shared_tgetent=yes", |
| 27 | "zsh_cv_shared_tigetstr=yes", "zsh_cv_sys_dynamic_execsyms=yes", |
| 28 | "zsh_cv_sys_dynamic_rtld_global=yes", "zsh_cv_sys_dynamic_clash_ok=yes", |
| 29 | "vinix-configure", "./configure", "--bindir=/bin", "--enable-etcdir=/etc/zsh", |
| 30 | "--with-term-lib=ncursesw", "--enable-multibyte", "--enable-function-subdirs", |
| 31 | "--enable-pcre", "--enable-cap", "--enable-zsh-secure-free", "--with-tcsetpgrp") |
| 32 | run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", "make", "-C", "zsh-5.9.2") |
| 33 | }, |
| 34 | #:package, fn() { |
| 35 | run("make", "-j1", "-C", "zsh-5.9.2", string-append("DESTDIR=", pkgdir()), "install") |
| 36 | for-each(fn(file) { |
| 37 | run("install", "-Dm644", file, string-append(pkgdir(), "/etc/zsh/", file)) |
| 38 | }, list("zprofile", "zshenv", "zshrc")) |
| 39 | run("install", "-d", string-append(pkgdir(), "/etc/zsh/zshrc.d"), string-append(pkgdir(), "/usr/share/zsh/plugins")) |
| 40 | run("install", "-Dm644", "zsh-5.9.2/LICENCE", string-append(pkgdir(), "/usr/share/licenses/zsh/LICENCE")) |
| 41 | run("vinix-run", string-append(pkgdir(), "/bin/zsh"), |
| 42 | "-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' ]]", |
| 43 | "zsh", string-append(pkgdir(), "/usr/lib/zsh/5.9.2")) |
| 44 | }) |
| 45 | |