Browse Source

Check lib

Joachim M. Giæver 2 years ago
parent
commit
c24960e9f1
2 changed files with 13 additions and 5 deletions
  1. 5 4
      snap/snapcraft.yaml
  2. 8 1
      src/bin/curl

+ 5 - 4
snap/snapcraft.yaml

@@ -1,15 +1,15 @@
 name: home-assistant-toolbox
 base: core20
-version: '0.1' 
-summary: Extend your Home Assistant (home-assistant-snap)
+version: '0.2' 
+summary: "Extend your Home Assistant (home-assistant-snap)"
 description: |
   Toolbox contains executables that extends functionality
   to you home-assistant-snap installation.
 
   The following tools are included:
     - cURL
-
-  (More to come, and feel free to come up with suggestions!)
+    - make (build-essential)
+  + More to come, and feel free to come up with suggestions!
 
   Requires home-assistant-snap revision 71 or later!
 grade: stable
@@ -33,3 +33,4 @@ parts:
     source-type: local
     stage-packages:
       - curl
+      - build-essential

+ 8 - 1
src/bin/curl

@@ -1,3 +1,10 @@
 #!/usr/bin/env bash
-LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$SNAP/shared-bin/lib/x86_64-linux-gnu:$SNAP/shared-bin/usr/lib/x86_64-linux-gnu
+
+for LIB in $(find "${SNAP}/shared-bin" -name libcurl.so* -exec dirname {} \;); do
+    if [ ! -z "${LD_LIBRARY_PATH##*$LIB*}" ]; then
+        export LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:${LIB}"
+    fi
+done
+echo "SHARED-LIBS: ${LD_LIBRARY_PATH}"
+
 eval $SNAP/shared-bin/usr/bin/curl $@