Skip to content

Commit 08f0c55

Browse files
authored
Update vo_dependency_installer.sh
1 parent d164529 commit 08f0c55

1 file changed

Lines changed: 33 additions & 152 deletions

File tree

vo_dependency_installer.sh

Lines changed: 33 additions & 152 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/bash
22

33
#=======================================
4-
# Copyright 2022, 2023 AT&T
4+
# Copyright 2022, 2023, 2024 AT&T
55
#
66
# Licensed under the Apache License, Version 2.0 (the "License");
77
# you may not use this file except in compliance with the License.
@@ -18,7 +18,7 @@
1818

1919
#=======================================
2020
# vo_dependency_installer.sh
21-
VERSION="1.0.1.3"
21+
VERSION="1.0.2.0"
2222
#
2323
# Howto use this script:
2424
# From your browser, select 'Save' and choose or create an empty folder. Make sure the script has the extension '.sh'.
@@ -44,19 +44,17 @@ VERSION="1.0.1.3"
4444
# Some of the depenancies do not have functional formula to allow 'brew' to install them,
4545
# and there for must be cloned from github and compiled.
4646
#
47-
# These include 'ifuse' and 'libimobiledevice-glue'
4847
# see:
4948
# git clone https://github.com/libimobiledevice/ifuse.git
50-
# git clone https://github.com/libimobiledevice/libimobiledevice-glue.git
5149
#
5250
# There are some basic requirements before this script can be run.
5351
# 1 You must have and run this under an Admin account, do not launch under 'sudo'
54-
# 2 macOS 13.4 or 13.4.1
55-
# 3 Xcode 14.3.1
52+
# 2 macOS 14
53+
# 3 Xcode 16
5654
# 4 brew (aka HomeBrew https://brew.sh)
5755
#
5856
# Testing:
59-
# This script has been tested on Macbook Pro intel and M1 machines running Monterey 12.6 and Ventura early December 2022
57+
# This script has been tested on Macbook Pro intel and M1 machines running os 14.5, 15.0 on intel and Apple Silicon
6058
# Ventura 13.2.1 Mar 31, 2023
6159
# Ventura 13.4.1, Intel & M1 July 18 2023
6260
#
@@ -68,14 +66,12 @@ echo "
6866
if [ -f "`which brew`" ]
6967
then
7068
brew update
71-
brew upgrade
72-
brew tap homebrew/core
7369

7470
# make sure we can compile
7571
brew install cmake
76-
brew install automake
7772
brew install autogen
7873
brew install autoconf
74+
brew install automake
7975

8076
else
8177
echo "failed to find brew" >> error
@@ -92,104 +88,24 @@ echo ">>>>> uninstall <<<<<"
9288
brew uninstall --ignore-dependencies libplist 2>/dev/null
9389
brew uninstall --ignore-dependencies libimobiledevice 2>/dev/null
9490
brew uninstall --ignore-dependencies ifuse 2>/dev/null
95-
brew uninstall --ignore-dependencies openssl 2>/dev/null
9691
sudo rm `which ifuse` 2>/dev/null
97-
}
98-
99-
#=======================================
100-
function compile_libimobiledevice-glue () {
101-
echo ""
102-
echo ">>>>> compile_libimobiledevice-glue <<<<<"
103-
104-
# install dependencies
105-
# 1 libplist non-head version
106-
107-
brew install --head libplist
10892

109-
if [ "${PWD##*/}" = "libimobiledevice-glue" ]; then
110-
if [ "${ARCH_NAME}" = "x86_64" ]; then
111-
touch "__compile_x86"
112-
echo "./autogen.sh --prefix=/usr/local"
113-
./autogen.sh --prefix=/usr/local
114-
make
115-
echo "sudo make install"
116-
sudo make install
117-
ln -s /usr/local/lib/pkgconfig/libimobiledevice-glue-1.0.pc /usr/local/opt/libplist/lib/pkgconfig/libimobiledevice-glue-1.0.pc
118-
else
119-
touch "__compile_aarch"
120-
echo "./autogen.sh --prefix=/opt/homebrew"
121-
./autogen.sh --prefix=/opt/homebrew
122-
make
123-
make install
124-
ln -s /opt/homebrew/lib/pkgconfig/libimobiledevice-glue-1.0.pc /opt/homebrew/opt/libplist/lib/pkgconfig/libimobiledevice-glue-1.0.pc
125-
fi
126-
else
127-
echo "libimobiledevice-glue failure, in wrong path: `pwd`"
128-
exit_install
129-
fi
13093
}
13194

13295
#=======================================
13396
function install_libimobiledevice () {
134-
echo ""
135-
echo ">>>>> install_libimobiledevice <<<<<"
136-
137-
brew uninstall --ignore-dependencies libimobiledevice 2>/dev/null
138-
139-
brew install --head usbmuxd
140-
# brew install --head libplist
141-
brew install --head libimobiledevice
142-
brew unlink libimobiledevice && brew link libimobiledevice
97+
brew install usbmuxd
98+
brew install libplist
99+
brew install libimobiledevice
143100
}
144-
145101
#=======================================
146102
# install ifuse
147-
# plus openssl
103+
#=======================================
148104
function install_ifuse () {
149105
echo ""
150-
echo ">>>>> install_ifuse <<<<<"
151-
152-
# install dependencies
153-
# 1 libimobiledevice non-head version for openssl
154-
# 2 openssl
155-
156-
install_libimobiledevice
157-
brew install openssl
158-
159-
LISTING=$(brew list openssl)
160-
regex="(^.*)(/Cellar.*@[0-9]{0,9}/)(.*)/bin/openssl"
106+
echo ">>>>> build & install_ifuse <<<<<"
161107

162-
PATH_OSSL=""
163-
VERSION_OSSL=""
164-
for f in $LISTING
165-
do
166-
# echo $f
167-
if [[ "$f" =~ $regex ]]
168-
then
169-
echo "found in <<$f>>"
170-
PATH_OSSL="${BASH_REMATCH[1]}"
171-
MID="${BASH_REMATCH[2]}"
172-
VERSION_OSSL="${BASH_REMATCH[3]}"
173-
break
174-
fi
175-
done
176-
177-
echo "==============================="
178-
echo "version = $VERSION_OSSL"
179-
echo "path = $PATH_OSSL"
180-
echo "mid = $MID"
181-
182-
if [ -f $PATH_OSSL$MID$VERSION_OSSL/lib/pkgconfig/openssl.pc ]
183-
then
184-
ln -sF $PATH_OSSL$MID$VERSION_OSSL/lib/pkgconfig/openssl.pc $PATH_OSSL/lib/pkgconfig/openssl.pc
185-
ln -sF $PATH_OSSL$MID$VERSION_OSSL/lib/pkgconfig/libssl.pc $PATH_OSSL/lib/pkgconfig/libssl.pc
186-
ln -sF $PATH_OSSL$MID$VERSION_OSSL/lib/pkgconfig/libcrypto.pc $PATH_OSSL/lib/pkgconfig/libcrypto.pc
187-
else
188-
echo "install_ifuse (): failed to symlink openSSL" >> error
189-
exit_install
190-
fi
191-
192-
# now compile ifuse
108+
# if [ "${PWD##*/}" = "ifuse" ]; then
193109
./autogen.sh
194110
make
195111
echo "sudo make install"
@@ -205,27 +121,13 @@ echo ""
205121

206122
echo "Archetecture $ARCH_NAME"
207123
echo "$0 $VERSION"
208-
echo "============================ prepare ============================"
209-
if [[ -d /Library/PreferencePanes/macFUSE.prefPane ]]; then
210-
init_brew
211-
do_uninstall
212-
else
213-
echo "MacFuse not detected"
214-
echo "To install, visit https://osxfuse.github.io"
215-
fi
124+
init_brew
125+
do_uninstall
216126

217-
echo "============================ libimobiledevice-glue ============================"
218-
rm -fr libimobiledevice-glue
219-
git clone https://github.com/libimobiledevice/libimobiledevice-glue.git
220-
# unzip ../bu/libimobiledevice-glue.zip -d ./ ; rm -fr __MACOSX
221-
if [ -d libimobiledevice-glue ]; then
222-
( cd libimobiledevice-glue && compile_libimobiledevice-glue )
223-
else
224-
echo "clone: failed to git clone https://github.com/libimobiledevice/libimobiledevice-glue.git" >> error
225-
exit_install
226-
fi
227-
228-
echo "============================ compile iFuse ============================"
127+
echo ">>>>> install_libimobiledevice <<<<<"
128+
install_libimobiledevice
129+
130+
echo "============================ clone iFuse ============================"
229131
rm -fr ifuse
230132
git clone https://github.com/libimobiledevice/ifuse.git
231133
# unzip ../bu/ifuse.zip -d ./ ; rm -fr __MACOSX
@@ -259,6 +161,7 @@ function exit_install (){
259161
# 5: <$5> sub:1 version
260162
# 6: <$6> sub:1 version
261163
# 7: <$7> full version
164+
# check_version "$BREW_CONFIG" "$regex" CLT 15 0 0 "CLT: 15.3.0.0.1.1708646388"
262165
function check_version () {
263166

264167
txt=$1
@@ -269,7 +172,6 @@ function check_version () {
269172
M3=$6
270173
F_VERSION=$7
271174

272-
# echo "[check $label]"
273175
if [[ "$txt" =~ $rgx ]]
274176
then
275177
V_CHECK="pass"
@@ -332,11 +234,11 @@ function machine_precheck (){
332234

333235
# CLT: 14.2.0.0.1.1668646533
334236
regex="(CLT): ([0-9A-Za-z/]*)\.([0-9]*)\.([0-9]*)"
335-
check_version "$BREW_CONFIG" "$regex" CLT 14 3 0 14.2.0 "CLT: 14.3.0.0.1.1668646533"
237+
check_version "$BREW_CONFIG" "$regex" CLT 16 1 0 "CLT: 16.1"
336238

337239
# Xcode: 14.1
338240
regex="(Xcode): ([0-9]*)\.([0-9]*)"
339-
check_version "$BREW_CONFIG" "$regex" Xcode 14 3 "" "Xcode: 14.3"
241+
check_version "$BREW_CONFIG" "$regex" Xcode 16 0 "" "Xcode: 16.0"
340242
echo $CHECK
341243

342244
if [[ ${CHECK} = "fail"* ]] ; then
@@ -368,52 +270,31 @@ if [ ! "$PTH" = "" ]; then
368270
exit_install
369271
fi
370272

371-
# machine_precheck > error.log
273+
machine_precheck > error.log
372274

373-
# test=`cat error.log|grep "ready to proceed"`
275+
test=`cat error.log|grep "ready to proceed"`
374276

375-
# if [[ "$test" != "ready to proceed"* ]];then
376-
# cat error.log
377-
# echo ""
378-
# echo "Aborting $0, no changes to your system"
379-
# exit_install
380-
# else
381-
# rm error.log
382-
# echo $test
383-
# fi
277+
if [[ "$test" != "ready to proceed"* ]];then
278+
cat error.log
279+
echo ""
280+
echo "Aborting $0, no changes to your system"
281+
exit_install
282+
else
283+
rm error.log
284+
echo $test
285+
fi
384286

385287
#-----------------------------------------------------
386288
# version pre-checks DONE
387289
# will now configure system
388290
#-----------------------------------------------------
389291

390-
if [ ! "${PWD##*/}" = "libimobile_installation" ]
391-
then
392-
if [ ! -d libimobile_installation ]
393-
then
394-
echo "create libimobile_installation"
395-
mkdir "libimobile_installation"
396-
fi
397-
if [ -d libimobile_installation ]
398-
then
399-
echo "cd into libimobile_installation folder and launch do_install"
400-
( cd libimobile_installation && (do_install | tee vo_install.log))
401-
exit_install
402-
else
403-
echo "$0: Failed to create the temporary directory 'libimobile_installation'"
404-
exit_install
405-
fi
406-
#
407-
else
408-
echo "Please exit the folder 'libimobile_installation'"
409-
exit_install
410-
fi
292+
do_install
411293

412294
if [ -f "./error" ]
413295
then
414296
cat error
415297
exit_install
416298
else
417299
echo "No errors"
418-
rm -fr libimobile_installation
419300
fi

0 commit comments

Comments
 (0)