Initial commit
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
Some checks failed
Build Kernel / Build all affected Kernels (push) Has been cancelled
Build all core packages / Build all core packages for selected target (push) Has been cancelled
Build and Push prebuilt tools container / Build and Push all prebuilt containers (push) Has been cancelled
Build Toolchains / Build Toolchains for each target (push) Has been cancelled
Build host tools / Build host tools for linux and macos based systems (push) Has been cancelled
Coverity scan build / Coverity x86/64 build (push) Has been cancelled
This commit is contained in:
96
package/system/apk/Makefile
Normal file
96
package/system/apk/Makefile
Normal file
@@ -0,0 +1,96 @@
|
||||
include $(TOPDIR)/rules.mk
|
||||
|
||||
PKG_NAME:=apk
|
||||
PKG_RELEASE:=2
|
||||
|
||||
PKG_SOURCE_URL=https://gitlab.alpinelinux.org/alpine/apk-tools.git
|
||||
PKG_SOURCE_PROTO:=git
|
||||
PKG_SOURCE_DATE:=2024-11-30
|
||||
PKG_SOURCE_VERSION:=8d93a79fb8958607f097be2c4ac97f4596faf91d
|
||||
PKG_MIRROR_HASH:=565c87fac26e696c362c2fe85159cc3ed2fd27153f244c2e9dc0fd7fa67a4173
|
||||
|
||||
PKG_VERSION=3.0.0_pre$(subst -,,$(PKG_SOURCE_DATE))
|
||||
|
||||
PKG_MAINTAINER:=Paul Spooren <mail@aparcar.org>
|
||||
PKG_LICENSE:=GPL-2.0-only
|
||||
PKG_LICENSE_FILES:=LICENSE
|
||||
PKG_INSTALL:=2
|
||||
|
||||
HOST_BUILD_PREFIX:=$(STAGING_DIR_HOST)
|
||||
HOST_BUILD_DEPENDS:=lua/host
|
||||
|
||||
include $(INCLUDE_DIR)/package.mk
|
||||
include $(INCLUDE_DIR)/host-build.mk
|
||||
include $(INCLUDE_DIR)/meson.mk
|
||||
|
||||
define Package/apk/default
|
||||
SECTION:=base
|
||||
CATEGORY:=Base system
|
||||
TITLE:=apk package manager
|
||||
DEPENDS:=+zlib +wget
|
||||
URL:=$(PKG_SOURCE_URL)
|
||||
PROVIDES:=apk
|
||||
endef
|
||||
|
||||
define Package/apk-mbedtls
|
||||
$(Package/apk/default)
|
||||
TITLE += (mbedtls)
|
||||
DEPENDS +=+libmbedtls
|
||||
DEFAULT:=y if USE_APK
|
||||
VARIANT:=mbedtls
|
||||
DEFAULT_VARIANT:=1
|
||||
CONFLICTS:=apk-openssl
|
||||
endef
|
||||
|
||||
define Package/apk-openssl
|
||||
$(Package/apk/default)
|
||||
TITLE += (openssl)
|
||||
DEPENDS +=+libopenssl
|
||||
VARIANT:=openssl
|
||||
endef
|
||||
|
||||
MESON_HOST_VARS+=VERSION=$(PKG_VERSION)
|
||||
MESON_VARS+=VERSION=$(PKG_VERSION)
|
||||
|
||||
MESON_COMMON_ARGS = \
|
||||
-Db_lto=true \
|
||||
-Dcompressed-help=false \
|
||||
-Ddocs=disabled \
|
||||
-Dhelp=enabled \
|
||||
-Dlua_version=5.1 \
|
||||
-Ddefault_library=static \
|
||||
-Durl_backend=wget \
|
||||
-Dzstd=false \
|
||||
-Dtests=disabled
|
||||
|
||||
MESON_HOST_ARGS += \
|
||||
$(MESON_COMMON_ARGS) \
|
||||
-Dcrypto_backend=openssl
|
||||
|
||||
MESON_ARGS += \
|
||||
$(MESON_COMMON_ARGS) \
|
||||
-Dcrypto_backend=$(BUILD_VARIANT)
|
||||
|
||||
define Package/apk/conffiles
|
||||
/etc/apk/repositories.d/customfeeds.list
|
||||
endef
|
||||
|
||||
Package/apk-mbedtls/conffiles = $(Package/apk/conffiles)
|
||||
Package/apk-openssl/conffiles = $(Package/apk/conffiles)
|
||||
|
||||
define Package/apk/default/install
|
||||
$(INSTALL_DIR) $(1)/lib/apk/db
|
||||
|
||||
$(INSTALL_DIR) $(1)/usr/bin
|
||||
$(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/apk $(1)/usr/bin/apk
|
||||
|
||||
$(INSTALL_DIR) $(1)/etc/apk/repositories.d
|
||||
$(INSTALL_DATA) ./files/customfeeds.list $(1)/etc/apk/repositories.d/customfeeds.list
|
||||
endef
|
||||
|
||||
Package/apk-mbedtls/install = $(Package/apk/default/install)
|
||||
Package/apk-openssl/install = $(Package/apk/default/install)
|
||||
|
||||
$(eval $(call BuildPackage,apk-mbedtls))
|
||||
$(eval $(call BuildPackage,apk-openssl))
|
||||
$(eval $(call HostBuild))
|
||||
3
package/system/apk/files/customfeeds.list
Normal file
3
package/system/apk/files/customfeeds.list
Normal file
@@ -0,0 +1,3 @@
|
||||
# add your custom package feeds here
|
||||
#
|
||||
# http://www.example.com/path/to/files/packages.adb
|
||||
@@ -0,0 +1,21 @@
|
||||
From 9918c683fcc2f148328332d58d030ec5750a1473 Mon Sep 17 00:00:00 2001
|
||||
From: Paul Spooren <mail@aparcar.org>
|
||||
Date: Sat, 19 Feb 2022 17:20:37 +0100
|
||||
Subject: [PATCH 1/4] openwrt: move layer db to temp folder
|
||||
|
||||
Signed-off-by: Paul Spooren <mail@aparcar.org>
|
||||
---
|
||||
src/database.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/src/database.c
|
||||
+++ b/src/database.c
|
||||
@@ -1624,7 +1624,7 @@ const char *apk_db_layer_name(int layer)
|
||||
{
|
||||
switch (layer) {
|
||||
case APK_DB_LAYER_ROOT: return "lib/apk/db";
|
||||
- case APK_DB_LAYER_UVOL: return "lib/apk/db-uvol";
|
||||
+ case APK_DB_LAYER_UVOL: return "tmp/run/uvol/.meta/apk";
|
||||
default:
|
||||
assert(!"invalid layer");
|
||||
return 0;
|
||||
52
package/system/apk/patches/0002-meson-add-tests-option.patch
Normal file
52
package/system/apk/patches/0002-meson-add-tests-option.patch
Normal file
@@ -0,0 +1,52 @@
|
||||
From a6180e4cfa1a98d361ffdce9e48857504997fbe9 Mon Sep 17 00:00:00 2001
|
||||
From: Rosen Penev <rosenp@gmail.com>
|
||||
Date: Tue, 3 Dec 2024 18:12:58 -0800
|
||||
Subject: [PATCH] meson: add tests option
|
||||
|
||||
Allows disabling tests when not desired.
|
||||
|
||||
Signed-off-by: Rosen Penev <rosenp@gmail.com>
|
||||
---
|
||||
meson_options.txt | 1 +
|
||||
test/meson.build | 10 +++++++---
|
||||
test/unit/meson.build | 2 +-
|
||||
3 files changed, 9 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/meson_options.txt
|
||||
+++ b/meson_options.txt
|
||||
@@ -6,6 +6,7 @@ option('docs', description: 'Build manpa
|
||||
option('help', description: 'Build help into apk binaries, needs lua', type: 'feature', value: 'auto')
|
||||
option('lua', description: 'Build luaapk (lua bindings)', type: 'feature', value: 'auto')
|
||||
option('lua_version', description: 'Lua version to build against', type: 'string', value: '5.3')
|
||||
+option('tests', description: 'Build tests', type: 'feature', value: 'auto')
|
||||
option('url_backend', description: 'URL backend', type: 'combo', choices: ['libfetch', 'wget'], value: 'libfetch')
|
||||
option('uvol_db_target', description: 'Default target for uvol database layer', type: 'string')
|
||||
option('zstd', description: 'Build with zstd support', type: 'boolean', value: true)
|
||||
--- a/test/meson.build
|
||||
+++ b/test/meson.build
|
||||
@@ -1,10 +1,14 @@
|
||||
+enum_sh = find_program('enum.sh', required: get_option('tests'))
|
||||
+solver_sh = find_program('solver.sh', required: get_option('tests'))
|
||||
+
|
||||
+if not enum_sh.found() or not solver_sh.found()
|
||||
+ subdir_done()
|
||||
+endif
|
||||
+
|
||||
cur_dir = meson.current_source_dir()
|
||||
env = environment()
|
||||
env.set('APK', apk_exe.full_path())
|
||||
|
||||
-enum_sh = files('enum.sh')
|
||||
-solver_sh = files('solver.sh')
|
||||
-
|
||||
subdir('unit')
|
||||
|
||||
foreach t : run_command(enum_sh, 'shell', check: true).stdout().strip().split(' ')
|
||||
--- a/test/unit/meson.build
|
||||
+++ b/test/unit/meson.build
|
||||
@@ -1,4 +1,4 @@
|
||||
-cmocka_dep = dependency('cmocka', required: false)
|
||||
+cmocka_dep = dependency('cmocka', required: get_option('tests'))
|
||||
|
||||
if cmocka_dep.found()
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
From f74ca42e0fa5bf131644a46d8259edd493bf072c Mon Sep 17 00:00:00 2001
|
||||
From: Christian Marangi <ansuelsmth@gmail.com>
|
||||
Date: Wed, 23 Oct 2024 01:11:01 +0200
|
||||
Subject: [PATCH] app_list: add full print
|
||||
|
||||
Add full print variant to dump info about each package.
|
||||
|
||||
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
|
||||
---
|
||||
src/app_list.c | 42 +++++++++++++++++++++++++++++++++++++++++-
|
||||
1 file changed, 41 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/src/app_list.c
|
||||
+++ b/src/app_list.c
|
||||
@@ -27,6 +27,7 @@ struct list_ctx {
|
||||
unsigned int match_depends : 1;
|
||||
unsigned int match_providers : 1;
|
||||
unsigned int manifest : 1;
|
||||
+ unsigned int full : 1;
|
||||
|
||||
struct apk_string_array *filters;
|
||||
};
|
||||
@@ -118,6 +119,40 @@ static void print_manifest(const struct
|
||||
printf("%s " BLOB_FMT "\n", pkg->name->name, BLOB_PRINTF(*pkg->version));
|
||||
}
|
||||
|
||||
+static void print_full(const struct apk_package *pkg, const struct list_ctx *ctx)
|
||||
+{
|
||||
+ struct apk_dependency *d;
|
||||
+
|
||||
+ printf("Package: %s\n", pkg->name->name);
|
||||
+ printf("Version: " BLOB_FMT "\n", BLOB_PRINTF(*pkg->version));
|
||||
+ if (apk_array_len(pkg->depends)) {
|
||||
+ int i = 0;
|
||||
+
|
||||
+ printf("Depends: ");
|
||||
+ foreach_array_item(d, pkg->depends) {
|
||||
+ i++;
|
||||
+ printf("%s%s", d->name->name, i < apk_array_len(pkg->depends) ? ", ": "\n");
|
||||
+ }
|
||||
+ }
|
||||
+ if (apk_array_len(pkg->provides)) {
|
||||
+ int i = 0;
|
||||
+
|
||||
+ printf("Provides: ");
|
||||
+ foreach_array_item(d, pkg->provides) {
|
||||
+ i++;
|
||||
+ printf("%s%s", d->name->name, i < apk_array_len(pkg->provides) ? ", ": "\n");
|
||||
+ }
|
||||
+ }
|
||||
+ if (pkg->ipkg && ctx->installed)
|
||||
+ printf("Status: install ok %s\n", pkg->marked ? "hold" : "installed");
|
||||
+ if (pkg->description)
|
||||
+ printf("Description: " BLOB_FMT "\n", BLOB_PRINTF(*pkg->description));
|
||||
+ printf("License: " BLOB_FMT "\n", BLOB_PRINTF(*pkg->license));
|
||||
+ printf("Installed-Size: %zu\n", pkg->installed_size);
|
||||
+ printf("Size: %zu\n", pkg->size);
|
||||
+ printf("\n");
|
||||
+}
|
||||
+
|
||||
static void filter_package(const struct apk_database *db, const struct apk_package *pkg, const struct list_ctx *ctx, const struct apk_name *name)
|
||||
{
|
||||
if (ctx->match_origin && !origin_matches(ctx, pkg))
|
||||
@@ -138,7 +173,9 @@ static void filter_package(const struct
|
||||
if (ctx->match_providers)
|
||||
printf("<%s> ", name->name);
|
||||
|
||||
- if (ctx->manifest)
|
||||
+ if (ctx->full)
|
||||
+ print_full(pkg, ctx);
|
||||
+ else if (ctx->manifest)
|
||||
print_manifest(pkg, ctx);
|
||||
else
|
||||
print_package(db, pkg, ctx);
|
||||
@@ -178,6 +215,7 @@ static int print_result(struct apk_datab
|
||||
OPT(OPT_LIST_depends, APK_OPT_SH("d") "depends") \
|
||||
OPT(OPT_LIST_installed, APK_OPT_SH("I") "installed") \
|
||||
OPT(OPT_LIST_manifest, "manifest") \
|
||||
+ OPT(OPT_LIST_full, "full") \
|
||||
OPT(OPT_LIST_origin, APK_OPT_SH("o") "origin") \
|
||||
OPT(OPT_LIST_orphaned, APK_OPT_SH("O") "orphaned") \
|
||||
OPT(OPT_LIST_providers, APK_OPT_SH("P") "providers") \
|
||||
@@ -191,6 +229,8 @@ static int option_parse_applet(void *pct
|
||||
struct list_ctx *ctx = pctx;
|
||||
|
||||
switch (opt) {
|
||||
+ case OPT_LIST_full:
|
||||
+ ctx->full = 1;
|
||||
case OPT_LIST_available:
|
||||
ctx->available = 1;
|
||||
ctx->orphaned = 0;
|
||||
Reference in New Issue
Block a user