vinix-ports / zsh / PKGBUILD.vile
49 lines · 49 sloc · 3.18 KB · 9c4dd9da7931f80e43c6f5300f9821305c11d3c7
Raw
1; 5.9.2 supports PCRE2 and keeps the /bin/zsh and /etc/zsh layout used by Vinix.
2defpkgbuild(zsh,
3 #:pkgname, "zsh",
4 #:pkgver, "5.9.2",
5 #:pkgrel, 1,
6 #:pkgdesc, "Interactive shell with line editing, completions and loadable modules",
7 #:arch, [#:x86-64],
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("VINIX_SYSROOT")
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", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH",
25 "-C", "zsh-5.9.2", "PKG_CONFIG_PATH=", string-append("PKG_CONFIG_SYSROOT_DIR=", root),
26 string-append("PKG_CONFIG_LIBDIR=", root, "/usr/lib/pkgconfig"),
27 string-append("PCRE_CONFIG=", root, "/usr/bin/pcre2-config"),
28 "CC=vinix-cc", "CFLAGS=-O2", "zsh_cv_shared_environ=yes", "zsh_cv_shared_tgetent=yes",
29 "zsh_cv_shared_tigetstr=yes", "zsh_cv_sys_dynamic_execsyms=yes",
30 "zsh_cv_sys_dynamic_rtld_global=yes", "zsh_cv_sys_dynamic_clash_ok=yes",
31 "./configure", "--build=x86_64-pc-linux-gnu", "--host=x86_64-linux-musl",
32 "--prefix=/usr", "--bindir=/bin", "--sysconfdir=/etc", "--enable-etcdir=/etc/zsh",
33 "--with-term-lib=ncursesw", "--enable-multibyte", "--enable-function-subdirs",
34 "--enable-pcre", "--enable-cap", "--enable-zsh-secure-free", "--with-tcsetpgrp")
35 run("env", "-u", "CPATH", "-u", "C_INCLUDE_PATH", "-u", "LIBRARY_PATH", "make", "-C", "zsh-5.9.2")
36 },
37 #:package, fn() {
38 root := get-environment-variable("VINIX_SYSROOT")
39 run("make", "-j1", "-C", "zsh-5.9.2", string-append("DESTDIR=", pkgdir()), "install")
40 for-each(fn(file) {
41 run("install", "-Dm644", file, string-append(pkgdir(), "/etc/zsh/", file))
42 }, list("zprofile", "zshenv", "zshrc"))
43 run("install", "-d", string-append(pkgdir(), "/etc/zsh/zshrc.d"), string-append(pkgdir(), "/usr/share/zsh/plugins"))
44 run("install", "-Dm644", "zsh-5.9.2/LICENCE", string-append(pkgdir(), "/usr/share/licenses/zsh/LICENCE"))
45 run(string-append(root, "/lib/ld-musl-x86_64.so.1"), "--library-path",
46 string-append(root, "/usr/lib:", root, "/lib"), string-append(pkgdir(), "/bin/zsh"),
47 "-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' ]]",
48 "zsh", string-append(pkgdir(), "/usr/lib/zsh/5.9.2"))
49 })
50