Skip to content

Commit

Permalink
implement a general library linking function
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuseteam committed Apr 14, 2024
1 parent b08e3ee commit 2b073bc
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
13 changes: 13 additions & 0 deletions lib/linkfunc
Original file line number Diff line number Diff line change
@@ -1,4 +1,17 @@
#!/usr/bin/env bash
function link_lib(){
while read lib
do
cd $lib
while read libdir
do
mkdir -p $PKG_PREFIX/lib/$libdir
ln -s $(find $lib/$libdir -type f -maxdepth 1) $PKG_PREFIX/lib/$libdir 2> /dev/null
symlinks=$(find $lib/$libdir -type l -maxdepth 1)
[[ -n $symlinks ]] && cp $symlinks $PKG_PREFIX/lib/$libdir
done < <(find . -type d)
done < <(find $PKGS_DIR -name lib -type d);
}
function link_bin(){
[ ! -d "$HOME/.local/bin" ] && mkdir -p "$HOME/.local/bin";
[ ! -d "$SUDO_BIN" ] && sudo_run "mkdir -p $SUDO_BIN";
Expand Down
1 change: 1 addition & 0 deletions lib/pkgfunc
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ function pkg_install () {
PKGS_DIR=${PKG_PATH}/${pkgname};
echo "${pkgversion}" > "${PKGS_DIR}/${pkgname}.version";
link_bin;
link_lib;
if [ -f "${PKG_PREFIX}/lib/crackle/${pkgname}" ]; then
source "${PKG_PREFIX}/lib/crackle/${pkgname}";
install_${pkgname};
Expand Down

0 comments on commit 2b073bc

Please sign in to comment.