defpkgbuild(libedit, #:pkgname, "libedit", #:pkgver, "20240808.3.1", #:pkgrel, 1, #:pkgdesc, "NetBSD command-line editing and history library", #:arch, [#:x86-64, #:aarch64], #:url, "https://www.thrysoee.dk/editline/", #:license, "BSD-3-Clause", #:depends, ["musl", "ncurses"], #:source, ["https://www.thrysoee.dk/editline/libedit-20240808-3.1.tar.gz", "history.c", "wchar.c"], #:sha256sums, ["5f0573349d77c4a48967191cdd6634dd7aa5f6398c6a57fe037cc02696d6099f", "a0fdb40f4681d9c4ff14e576c99eaf2c45d98c2e9869e91a9f3b992bc3ab3f3f", "1ab07b1d432adad891ffe252bd62459ef05f4453fa1984fd46292eab7eb39a1b"], #:build, fn() { run("vinix-cc", "wchar.c", "-o", "check-wchar") run("vinix-run", "./check-wchar") run("env", "CPPFLAGS=-D__STDC_ISO_10646__=201103L", "vinix-configure", "libedit-20240808-3.1/configure") run("make") }, #:check, fn() { run("make", "install", string-append("DESTDIR=", srcdir(), "/checked")) run("vinix-cc", "history.c", "-Ichecked/usr/include", "-Lchecked/usr/lib", "-o", "history-check", "-ledit") run("vinix-run", "--library-path", "checked/usr/lib", "./history-check") }, #:package, fn() { run("make", "install", string-append("DESTDIR=", pkgdir())) run("find", pkgdir(), "-name", "*.la", "-delete") run("install", "-Dm644", "libedit-20240808-3.1/COPYING", string-append(pkgdir(), "/usr/share/licenses/libedit/COPYING")) })