pantry/projects/gnu.org/libunistring/package.yml
2023-04-16 02:13:37 -04:00

38 lines
871 B
YAML

distributable:
url: https://ftp.gnu.org/gnu/libunistring/libunistring-{{version.raw}}.tar.gz
strip-components: 1
versions:
- 1.1
build:
dependencies:
tea.xyz/gx/cc: c99
tea.xyz/gx/make: '*'
gnu.org/gmp: '*'
gnu.org/m4: '*'
script: |
./configure --prefix={{ prefix }}
make --jobs {{ hw.concurrency }} install
test:
dependencies:
tea.xyz/gx/cc: c99
script: |
mv $FIXTURE test.c
cc -lunistring -o test test.c
test "$(./test)" = "🫖\n"
fixture: |
#include <uniname.h>
#include <unistdio.h>
#include <unistr.h>
#include <stdlib.h>
int main (void) {
uint32_t s[2] = {};
uint8_t buff[12] = {};
if (u32_uctomb (s, unicode_name_character ("TEAPOT"), sizeof s) != 1) abort();
if (u8_sprintf (buff, "%llU", s) != 4) abort();
printf ("%s\\n", buff);
return 0;
}