internal/rosa/package: migrate many libraries

This also adds more string helpers.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-20 03:14:11 +09:00
parent 96abf266dd
commit ef414ab01a
36 changed files with 479 additions and 595 deletions

View File

@@ -0,0 +1,23 @@
package libbsd {
description = "provides useful functions commonly found on BSD systems";
website = "https://libbsd.freedesktop.org";
anitya = 1567;
version* = "0.12.2";
source = remoteGit {
url = "https://gitlab.freedesktop.org/libbsd/libbsd.git";
tag = version;
checksum = "NVS0xFLTwSP8JiElEftsZ-e1_C-IgJhHrHE77RwKt5178M7r087waO-zYx2_dfGX";
};
exec = make {
generate = "echo '" + version + "' > .dist-version && ./autogen";
};
inputs = [
automake,
libtool,
libmd,
];
}

View File

@@ -0,0 +1,44 @@
package libcap {
description = "a library for getting and setting POSIX.1e draft 15 capabilities";
website = "https://sites.google.com/site/fullycapable";
anitya = 1569;
version* = "2.78";
source = remoteTar {
url = "https://git.kernel.org/pub/scm/libs/libcap/libcap.git/"+
"snapshot/libcap-"+version+".tar.gz";
checksum = "wFdUkBhFMD9InPnrBZyegWrlPSAg_9JiTBC-eSFyWWlmbzL2qjh2mKxr9Kx2a8ut";
compress = gzip;
};
// uses source tree as scratch space
writable = true;
chmod = true;
env = [
"prefix=/system",
"lib=lib",
];
early = "\nln -s ../system/bin/bash /bin/\n";
exec = make {
skipConfigure = true;
inPlace = true;
make = [
"CC=cc",
"all",
];
check = [
"CC=cc",
"test",
];
};
inputs = [
bash,
diffutils,
];
}

View File

@@ -0,0 +1,20 @@
diff --git a/tests/tests.c b/tests/tests.c
index eba7eae..f916d2e 100644
--- a/tests/tests.c
+++ b/tests/tests.c
@@ -753,7 +753,6 @@ int main(int argc, char **argv)
int failures;
TT_SUITE_START(LibConfigTests);
- TT_SUITE_TEST(LibConfigTests, ParsingAndFormatting);
TT_SUITE_TEST(LibConfigTests, ParseInvalidFiles);
TT_SUITE_TEST(LibConfigTests, ParseInvalidStrings);
TT_SUITE_TEST(LibConfigTests, BigInt1);
@@ -768,7 +767,6 @@ int main(int argc, char **argv)
TT_SUITE_TEST(LibConfigTests, OverrideSetting);
TT_SUITE_TEST(LibConfigTests, SettingLookups);
TT_SUITE_TEST(LibConfigTests, ReadStream);
- TT_SUITE_TEST(LibConfigTests, BinaryAndHex);
TT_SUITE_RUN(LibConfigTests);
failures = TT_SUITE_NUM_FAILURES(LibConfigTests);
TT_SUITE_END(LibConfigTests);

View File

@@ -0,0 +1,15 @@
package libconfig {
description = "a simple library for processing structured configuration files";
website = "https://hyperrealm.github.io/libconfig";
anitya = 1580;
version* = "1.8.2";
source = remoteGitHub {
suffix = "hyperrealm/libconfig";
tag = "v"+version;
checksum = "fD32hjeAZuTz98g6WYHRwsxphrgrEFqxi5Z1jlJemPckPBfxpS3i5HgshAuA6vmT";
};
patches = [ "disable-broken-tests.patch" ];
exec = cmake {};
}

View File

@@ -0,0 +1,21 @@
package libdisplay-info {
description = "EDID and DisplayID library";
website = "https://gitlab.freedesktop.org/emersion/libdisplay-info";
anitya = 326668;
version* = "0.3.0";
source = remoteGitLab {
domain = "gitlab.freedesktop.org";
suffix = "emersion/libdisplay-info";
ref = version;
checksum = "yjOqPUHHYgRtpqGw5RI1n2Q1_hO5j0LiFNMbjcRWV4Nf71XwwoC9fZMlKBDeLchT";
};
exec = meson {};
inputs = [
diffutils,
hwdata,
];
}

View File

@@ -0,0 +1,21 @@
package libepoxy {
description = "a library for handling OpenGL function pointer management";
website = "https://github.com/anholt/libepoxy";
anitya = 6090;
version* = "1.5.10";
source = remoteGitHub {
suffix = "anholt/libepoxy";
tag = version;
checksum = "OHI8wshrlGw6BMGrmSyejJtwzM2gPhyFJrTsKxULyKMmYrfgcOe7Iw2ibVoUND_Q";
};
exec = meson {
setup = {
"Dglx": "no";
"Degl": "no";
};
};
inputs = [ libX11 ];
}

View File

@@ -0,0 +1,14 @@
package libev {
description = "a full-featured and high-performance event loop";
website = "http://libev.schmorp.de";
anitya = 1605;
version* = "4.33";
source = remoteTar {
url = "https://dist.schmorp.de/libev/Attic/libev-"+version+".tar.gz";
checksum = "774eSXV_4k8PySRprUDChbEwsw-kzjIFnJ3MpNOl5zDpamBRvC3BqPyRxvkwcL6_";
compress = gzip;
};
exec = make {};
}

View File

@@ -0,0 +1,22 @@
package libexpat {
description = "a stream-oriented XML parser library";
website = "https://libexpat.github.io";
anitya = 770;
version* = "2.8.1";
source = remoteGitHubRelease {
suffix = "libexpat/libexpat";
tag = "R_"+replace {
s = version;
old = ".";
new = "_";
};
name = "expat-"+version+".tar.bz2";
checksum = "iMEtbOJhQfGof2GxSlxffQSI1va_NDDQ9VIuqcPbNZ0291Dr8wttD5QecYyjIQap";
compress = bzip2;
};
exec = make {};
inputs = [ bash ];
}

View File

@@ -0,0 +1,18 @@
package libffi {
description = "a portable, high level programming interface to various calling conventions";
website = "https://sourceware.org/libffi";
anitya = 1611;
version* = "3.5.2";
source = remoteGitHubRelease {
suffix = "libffi/libffi";
tag = "v"+version;
name = "libffi-"+version+".tar.gz";
checksum = "2_Q-ZNBBbVhltfL5zEr0wljxPegUimTK4VeMSiwJEGksls3n4gj3lV0Ly3vviSFH";
compress = gzip;
};
exec = make {};
inputs = [ kernel-headers ];
}

View File

@@ -0,0 +1,25 @@
package libgd {
description = "an open source code library for the dynamic creation of images";
website = "https://libgd.github.io";
anitya = 880;
version* = "2.3.3";
source = remoteGitHubRelease {
suffix = "libgd/libgd";
tag = "gd-"+version;
name = "libgd-"+version+".tar.gz";
checksum = "8T-sh1_FJT9K9aajgxzh8ot6vWIF-xxjcKAHvTak9MgGUcsFfzP8cAvvv44u2r36";
compress = gzip;
};
env = [
"TMPDIR=/dev/shm/gd",
];
early = "\nmkdir /dev/shm/gd\n";
exec = make {};
inputs = [ zlib ];
runtime = [ zlib ];
}

View File

@@ -0,0 +1,22 @@
package libmd {
description = "Message Digest functions from BSD systems";
website = "https://www.hadrons.org/software/libmd";
anitya = 15525;
version* = "1.2.0";
source = remoteGit {
url = "https://git.hadrons.org/git/libmd.git";
tag = version;
checksum = "1rJ6joAO0wwMZvSfnRNkc1MOhywyAq7SM8VmF92NvDtv7Qdl1LRbjm5fg_DFFtGj";
};
exec = make {
generate = "echo '" + version + "' > .dist-version && ./autogen";
preMake = "\ninstall -D /usr/src/libmd/src/helper.c src/helper.c\n";
};
inputs = [
automake,
libtool,
];
}

View File

@@ -0,0 +1,27 @@
package libpng {
description = "the official PNG reference library";
website = "https://www.libpng.org/pub/png/libpng.html";
anitya = 1705;
version* = "1.6.58";
source = remoteTar {
url = "https://downloads.sourceforge.net/project/libpng/libpng"+
join {
elems = slice {
elems = split {
s = version;
sep = ".";
n = 3;
};
end = 2;
};
}+"/"+version+"/libpng-"+version+".tar.gz";
checksum = "m_a5lROJH7vmF3cMjqwTUqURuQLhV1JQx2ySPzcN3VPdgDB9pG3UINsIx_mtkr-t";
compress = gzip;
};
exec = make {};
inputs = [ zlib ];
runtime = [ zlib ];
}

View File

@@ -0,0 +1,25 @@
package libpsl {
description = "provides functions to work with the Mozilla Public Suffix List";
website = "https://rockdaboot.github.io/libpsl";
anitya = 7305;
version* = "0.21.5";
source = remoteGitHubRelease {
suffix = "rockdaboot/libpsl";
tag = version;
name = "libpsl-"+version+".tar.gz";
checksum = "XjfxSzh7peG2Vg4vJlL8z4JZJLcXqbuP6pLWkrGCmRxlnYUFTKNBqWGHCxEOlCad";
compress = gzip;
};
writable = true;
early = `
test_disable() { chmod +w "$2" && echo "$1" > "$2"; }
test_disable 'int main(){return 0;}' tests/test-is-public-builtin.c
`;
exec = make {};
inputs = [ python ];
}

View File

@@ -0,0 +1,13 @@
diff --git a/src/api.c b/src/api.c
index adccef3..65a277a 100644
--- a/src/api.c
+++ b/src/api.c
@@ -786,7 +786,7 @@ API int seccomp_export_bpf_mem(const scmp_filter_ctx ctx, void *buf,
if (BPF_PGM_SIZE(program) > *len)
rc = _rc_filter(-ERANGE);
else
- memcpy(buf, program->blks, *len);
+ memcpy(buf, program->blks, BPF_PGM_SIZE(program));
}
*len = BPF_PGM_SIZE(program);

View File

@@ -0,0 +1,27 @@
package libseccomp {
description = "an interface to the Linux Kernel's syscall filtering mechanism";
website = "https://github.com/seccomp/libseccomp";
anitya = 13823;
version* = "2.6.0";
source = remoteGitHubRelease {
suffix = "seccomp/libseccomp";
tag = "v"+version;
name = "libseccomp-"+version+".tar.gz";
checksum = "mMu-iR71guPjFbb31u-YexBaanKE_nYPjPux-vuBiPfS_0kbwJdfCGlkofaUm-EY";
compress = gzip;
};
patches = [ "fix-export-oob-read.patch" ];
early = "\nln -s ../system/bin/bash /bin/\n";
exec = make {};
inputs = [
bash,
diffutils,
gperf,
kernel-headers,
];
}

View File

@@ -0,0 +1,36 @@
package libtirpc {
description = "a port of Suns Transport-Independent RPC library to Linux";
website = "https://sourceforge.net/projects/libtirpc";
anitya = 1740;
version* = "1.3.7";
source = remoteGit {
url = "git://linux-nfs.org/~steved/libtirpc";
tag = "libtirpc-"+join {
elems = split {
s = version;
sep = ".";
n = 3;
};
sep = "-";
};
checksum = "nzFfu7LNvnSNiNAryD1vtnNWnU-Xqee8KqfXUKoBf5yjb5-dkeRkYuRijdCoYLof";
};
exec = make {
generate = "sh -e ./bootstrap";
configure = {
"CFLAGS": `"$(pkg-config --cflags libbsd-overlay) ${CFLAGS:-}"`;
"disable-gssapi";
};
};
inputs = [
automake,
libtool,
pkg-config,
libbsd,
kernel-headers,
];
}

View File

@@ -0,0 +1,28 @@
package libucontext {
description = "ucontext implementation featuring glibc-compatible ABI";
website = "https://github.com/kaniini/libucontext";
anitya = 17085;
version* = "1.5.1";
source = remoteGitHub {
suffix = "kaniini/libucontext";
tag = "libucontext-"+version;
checksum = "mUgeyJknjMxT-5fORzz-rqhZfP3Y7EZGBhOwvhuX7MsF4Pk9wkuwtrLf5IML-jWu";
};
// uses source tree as scratch space
writable = true;
chmod = true;
enterSource = true;
exec = make {
omitDefaults = true;
skipConfigure = true;
inPlace = true;
make = [
"ARCH=" + linuxArch,
];
install = "make prefix=/system DESTDIR=/work install";
};
}

View File

@@ -0,0 +1,23 @@
package libxml2 {
description = "an XML toolkit implemented in C";
website = "https://gitlab.gnome.org/GNOME/libxml2";
anitya = 1783;
version* = "2.15.3";
source = remoteGitLab {
domain = "gitlab.gnome.org";
suffix = "GNOME/libxml2";
ref = "v"+version;
checksum = "oJy74htGlEpf70KPvpW18fYJo0RQQkCXZRwqUz6NoXborS3HCq3Nm4gsyaSeNmUH";
};
// can't create shell.out: Read-only file system
writable = true;
exec = meson {};
inputs = [
git,
diffutils,
];
}

View File

@@ -0,0 +1,31 @@
package libxslt {
description = "an XSLT processor based on libxml2";
website = "https://gitlab.gnome.org/GNOME/libxslt";
anitya = 13301;
version* = "1.1.45";
source = remoteGitLab {
domain = "gitlab.gnome.org";
suffix = "GNOME/libxslt";
ref = "v"+version;
checksum = "67ks7v8od2oWaEGf23Sst_Xbn_8brQyolQjqxPoO-lK35k_WJhi2Px5JJgbk-nfn";
};
exec = make {
generate = "NOCONFIGURE=1 ./autogen.sh";
// python libxml2 cyclic dependency
skipCheck = true;
};
inputs = [
automake,
libtool,
python,
pkg-config,
libxml2,
];
runtime = [ libxml2 ];
}