internal/rosa/package: migrate bzip2, curl, connman

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-05-19 22:26:40 +09:00
parent 009a4e0d58
commit 1c6f30379e
7 changed files with 112 additions and 143 deletions

View File

@@ -0,0 +1,27 @@
package bzip2 {
description = "a freely available, patent free, high-quality data compressor";
website = "https://sourceware.org/bzip2";
anitya = 237;
version* = "1.0.8";
source = remoteTar {
url = "https://sourceware.org/pub/bzip2/bzip2-"+version+".tar.gz";
checksum = "cTLykcco7boom-s05H1JVsQi1AtChYL84nXkg_92Dm1Xt94Ob_qlMg_-NSguIK-c";
compress = gzip;
};
// uses source tree as scratch space
writable = true;
enterSource = true;
exec = make {
skipConfigure = true;
skipCheck = true;
inPlace = true;
make = [
"CC=cc",
];
install = "make PREFIX=/work/system install";
};
}

View File

@@ -0,0 +1,59 @@
musl does not implement res_ninit
--- a/gweb/gresolv.c
+++ b/gweb/gresolv.c
@@ -877,8 +877,6 @@
resolv->index = index;
resolv->nameserver_list = NULL;
- res_ninit(&resolv->res);
-
return resolv;
}
@@ -918,8 +916,6 @@
flush_nameservers(resolv);
- res_nclose(&resolv->res);
-
g_free(resolv);
}
@@ -1022,24 +1018,19 @@
debug(resolv, "hostname %s", hostname);
if (!resolv->nameserver_list) {
- int i;
-
- for (i = 0; i < resolv->res.nscount; i++) {
- char buf[100];
- int family = resolv->res.nsaddr_list[i].sin_family;
- void *sa_addr = &resolv->res.nsaddr_list[i].sin_addr;
-
- if (family != AF_INET &&
- resolv->res._u._ext.nsaddrs[i]) {
- family = AF_INET6;
- sa_addr = &resolv->res._u._ext.nsaddrs[i]->sin6_addr;
+ FILE *f = fopen("/etc/resolv.conf", "r");
+ if (f) {
+ char line[256], *s;
+ int i;
+ while (fgets(line, sizeof(line), f)) {
+ if (strncmp(line, "nameserver", 10) || !isspace(line[10]))
+ continue;
+ for (s = &line[11]; isspace(s[0]); s++);
+ for (i = 0; s[i] && !isspace(s[i]); i++);
+ s[i] = 0;
+ g_resolv_add_nameserver(resolv, s, 53, 0);
}
-
- if (family != AF_INET && family != AF_INET6)
- continue;
-
- if (inet_ntop(family, sa_addr, buf, sizeof(buf)))
- g_resolv_add_nameserver(resolv, buf, 53, 0);
+ fclose(f);
}
if (!resolv->nameserver_list)

View File

@@ -0,0 +1,37 @@
package connman {
description = "a daemon for managing Internet connections";
website = "https://git.kernel.org/pub/scm/network/connman/connman.git";
anitya = 337;
version* = "2.0";
source = remoteTar {
url = "https://git.kernel.org/pub/scm/network/connman/connman.git/"+
"snapshot/connman-"+version+".tar.gz";
checksum = "MhVTdJOhndnZn2SWd8URKo_Pj7Zvc14tntEbrVOf9L3yVWJvpb3v3Q6104tWJgtW";
compress = gzip;
};
patches = [ "alpine-musl-res.patch" ];
exec = make {
generate = "./bootstrap";
};
inputs = [
automake,
libtool,
pkg-config,
dbus,
iptables,
gnutls,
readline,
kernel-headers,
];
runtime = [
dbus,
iptables,
gnutls,
readline,
];
}

View File

@@ -0,0 +1,47 @@
package curl {
description = "command line tool and library for transferring data with URLs";
website = "https://curl.se";
anitya = 381;
version* = "8.20.0";
source = remoteTar {
url = "https://curl.se/download/curl-"+version+".tar.bz2";
checksum = "xyHXwrngIRGMasuzhn-I5MSCOhktwINbsWt1f_LuR-5jRVvyx_g6U1EQfDLEbr9r";
compress = bzip2;
};
// remove broken test
writable = true;
early = "\nchmod +w tests/data && rm -f tests/data/test459\n";
exec = make {
configure = {
"with-openssl";
"with-ca-bundle": "/system/etc/ssl/certs/ca-bundle.crt";
"disable-smb";
};
check = [
"TFLAGS=" + jobsLFlagE,
"test-nonflaky",
];
};
inputs = [
perl,
python,
pkg-config,
diffutils,
libpsl,
openssl,
];
runtime = [
zlib,
zstd,
libpsl,
openssl,
];
}