From 1c3a59888112b71729571fc5ef84b39f158beda4 Mon Sep 17 00:00:00 2001 From: TraceLumen Date: Fri, 11 Sep 2026 18:01:43 +0300 Subject: [PATCH] Fix pkg download don't update ld.so.cache: add ldconfig exec (func shell_update) --- assets/var/gnu/hplip.md | 76 ++++++++++++++++++++++++++++++++- assets/var/gnu/sane-backends.md | 9 ++++ src/commands/download.rs | 3 +- 3 files changed, 86 insertions(+), 2 deletions(-) create mode 100644 assets/var/gnu/sane-backends.md diff --git a/assets/var/gnu/hplip.md b/assets/var/gnu/hplip.md index e94c460..0715068 100644 --- a/assets/var/gnu/hplip.md +++ b/assets/var/gnu/hplip.md @@ -2,10 +2,84 @@ hplip = https://sourceforge.net/projects/hplip/files/hplip/3.26.4/hplip-3.26.4.tar.gz +``` sh *** patch *** +sed -i '/#include "utils.h"/a\ +\ +/* Missing prototypes for internal HPLIP functions */\ +extern void _releaseCupsInstance(void);\ +extern int addCupsPrinter(const char *name, const char *device_uri,\ + const char *location, const char *ppd_file,\ + const char *model, const char *info);\ +extern int delCupsPrinter(const char *name);\ +extern int setDefaultCupsPrinter(const char *name);\ +extern int controlCupsPrinter(const char *name, int op);' prnt/cupsext/cupsext.c +sed -i '/#include "orblitei.h"/a\ +\ +/* Forward declarations for orblite backend to fix implicit-function-declaration errors */\ +extern SANE_Status orblite_init(SANE_Int *version_code, SANE_Auth_Callback authorize);\ +extern void orblite_get_devices(SANE_Device ***device_list, SANE_Bool local_only);\ +extern SANE_Status orblite_open(SANE_String_Const devicename, SANE_Handle *handle);\ +extern void orblite_close(SANE_Handle handle);\ +extern SANE_Status orblite_control_option(SANE_Handle handle, SANE_Int option, SANE_Action action, void *value, SANE_Int *info);\ +extern SANE_Status orblite_get_parameters(SANE_Handle handle, SANE_Parameters *params);\ +extern SANE_Status orblite_start(SANE_Handle handle);\ +extern SANE_Status orblite_read(SANE_Handle handle, SANE_Byte *data, SANE_Int max_length, SANE_Int *length);\ +extern void orblite_cancel(SANE_Handle handle);' scan/sane/hpaio.c +sed -i 's/int bb_is_paper_in_adf();/int bb_is_paper_in_adf(struct ledm_session *ps);/' scan/sane/ledmi.h +sed -i '/# include /a\ +# include ' scan/sane/bb_ledm.c +sed -i '/#include /a\ +#include ' scan/sane/http.c +sed -i '/#include /a\ +#include ' scan/sane/sclpml.c + +sed -i \ + -e '/#include "io.h"/a\ +#include ' \ + -e 's/(SANE_Char\*\*)&SANE_rangeLeft/(const SANE_Char * const*)\&SANE_rangeLeft/g' \ + -e 's/(SANE_Char\*\*)&SANE_rangeTop/(const SANE_Char * const*)\&SANE_rangeTop/g' \ + -e 's/(SANE_Char\*\*)&SANE_rangeRight/(const SANE_Char * const*)\&SANE_rangeRight/g' \ + -e 's/(SANE_Char\*\*)&SANE_rangeBottom/(const SANE_Char * const*)\&SANE_rangeBottom/g' \ + -e 's/(SANE_Char\*\*)SANE_resolutions/(const SANE_Char * const*)SANE_resolutions/g' \ + -e 's/(SANE_Char\*\*)SANE_modes/(const SANE_Char * const*)SANE_modes/g' \ + -e 's/(SANE_Char\*\*)SANE_sources/(const SANE_Char * const*)SANE_sources/g' \ + -e 's/(SANE_Char\*\*)SANE_paper_sizes/(const SANE_Char * const*)SANE_paper_sizes/g' \ + -e 's/_DBG("Calling orblite bb_unload/DBG("Calling orblite bb_unload/' \ + -e 's/bb_orblite_open(devicename, &g_handle)/bb_orblite_open(devicename, (void **)\&g_handle)/' \ + scan/sane/orblite.c + +sed -i '/^#include /a\ +\ +/* Python 2\/3 compatibility */\ +#if PY_MAJOR_VERSION >= 3\ +#define PyString_AsStringAndSize(obj, buf, len) PyBytes_AsStringAndSize((obj), (buf), (len))\ +#define PyString_FromStringAndSize(str, len) PyBytes_FromStringAndSize((str), (len))\ +#define PyInt_AS_LONG(obj) PyLong_AsLong(obj)\ +#endif' pcard/pcardext/pcardext.c +sed -i '/^void initpcardext/,/^}$/c\ +PyMODINIT_FUNC PyInit_pcardext(void)\ +{\ + static struct PyModuleDef moduledef = {\ + PyModuleDef_HEAD_INIT, "pcardext", pcardext_documentation, -1, pcardext_methods,\ + };\ + PyObject *mod = PyModule_Create(\&moduledef);\ + if (mod == NULL)\ + return NULL;\ + return mod;\ +}' pcard/pcardext/pcardext.c +sed -i 's/static column = 0 ;/static int column = 0 ;/' prnt/hpps/pserror.c +``` + ``` sh *** build *** -./configure --prefix=/pkg/gnu/hplip --disable-network-build +./configure --prefix=$pkgpath --disable-network-build --disable-pcard-build +make -j$(nproc) +make install ``` ``` cfg *** build deps *** libusb +sane-backends +cups ``` + +sane-backends - scan diff --git a/assets/var/gnu/sane-backends.md b/assets/var/gnu/sane-backends.md new file mode 100644 index 0000000..6f14e0d --- /dev/null +++ b/assets/var/gnu/sane-backends.md @@ -0,0 +1,9 @@ +sane-backends 1.4.0 += +https://gitlab.com/-/project/429008/uploads/843c156420e211859e974f78f64c3ea3/sane-backends-1.4.0.tar.gz + +``` sh *** build *** +./configure --prefix=$pkgpath +make -j$(nproc) +make install +``` diff --git a/src/commands/download.rs b/src/commands/download.rs index 5b30338..f80f1b3 100644 --- a/src/commands/download.rs +++ b/src/commands/download.rs @@ -6,7 +6,7 @@ use std::cell::RefCell; use super::get_aeropkg_base; use crate::utils::parser::{self, env::get_install_env, repoinfo, pkginfo, env::get_custom_env}; -use crate::utils::shell; +use crate::utils::shell::{self, shell_update}; use crate::commands::link::link; use crate::commands::run::config::config; @@ -139,6 +139,7 @@ pub fn download(repo: &String, pkgname: &String, force: bool, recursive: bool) { } else { link(repo, pkgname) } + shell_update(); } fn check_build_dependency(repo: &String, pkg_md_path: &Path, force: bool, recursive: bool) {