mirror of
https://github.com/ivabus/pantry
synced 2024-11-10 02:25:18 +03:00
new file: projects/rockdaboot.github.io/libpsl/package.yml
new file: projects/rockdaboot.github.io/libpsl/test.c
This commit is contained in:
parent
e128d80d29
commit
2281d05cba
36
projects/rockdaboot.github.io/libpsl/package.yml
Normal file
36
projects/rockdaboot.github.io/libpsl/package.yml
Normal file
|
@ -0,0 +1,36 @@
|
||||||
|
distributable:
|
||||||
|
url: https://github.com/rockdaboot/libpsl/releases/download/{{version}}/libpsl-{{version}}.tar.gz
|
||||||
|
strip-components: 1
|
||||||
|
versions:
|
||||||
|
github: rockdaboot/libpsl
|
||||||
|
dependencies:
|
||||||
|
unicode.org: '*'
|
||||||
|
build:
|
||||||
|
dependencies:
|
||||||
|
mesonbuild.com: '*'
|
||||||
|
ninja-build.org: '*'
|
||||||
|
freedesktop.org/pkg-config: '*'
|
||||||
|
python.org: ~3.11
|
||||||
|
linux:
|
||||||
|
gnu.org/gcc: '*'
|
||||||
|
script:
|
||||||
|
- meson setup build $MESON_ARGS
|
||||||
|
- meson compile -C build
|
||||||
|
- meson install -C build
|
||||||
|
env:
|
||||||
|
linux:
|
||||||
|
LDFLAGS: -fPIC
|
||||||
|
MESON_ARGS:
|
||||||
|
- --prefix="{{prefix}}"
|
||||||
|
- --libdir="{{prefix}}/lib"
|
||||||
|
- --buildtype=release
|
||||||
|
- --wrap-mode=nofallback
|
||||||
|
- -Druntime=libicu
|
||||||
|
- -Dbuiltin=true
|
||||||
|
test:
|
||||||
|
dependencies:
|
||||||
|
linux:
|
||||||
|
gnu.org/gcc: '*'
|
||||||
|
script:
|
||||||
|
- cc test.c -lpsl -o test
|
||||||
|
- ./test
|
20
projects/rockdaboot.github.io/libpsl/test.c
Normal file
20
projects/rockdaboot.github.io/libpsl/test.c
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
#include <assert.h>
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <libpsl.h>
|
||||||
|
|
||||||
|
int main(void)
|
||||||
|
{
|
||||||
|
const psl_ctx_t *psl = psl_builtin();
|
||||||
|
|
||||||
|
const char *domain = ".eu";
|
||||||
|
assert(psl_is_public_suffix(psl, domain));
|
||||||
|
|
||||||
|
const char *host = "www.example.com";
|
||||||
|
const char *expected_domain = "example.com";
|
||||||
|
const char *actual_domain = psl_registrable_domain(psl, host);
|
||||||
|
assert(strcmp(actual_domain, expected_domain) == 0);
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in a new issue