Having trouble installing OpenSSL Cocoapod - xcode

I'm trying to install the OpenSSL Cocoapod in Xcode 9.4 and I get the following:
[!] /bin/bash -c set -e VERSION="1.0.2h" SDKVERSION=xcrun --sdk
iphoneos --show-sdk-version 2> /dev/null
MIN_SDK_VERSION_FLAG="-miphoneos-version-min=7.0"
BASEPATH="${PWD}" CURRENTPATH="/tmp/openssl" ARCHS="i386 x86_64 armv7
armv7s arm64" DEVELOPER=xcode-select -print-path
mkdir -p "${CURRENTPATH}" mkdir -p "${CURRENTPATH}/bin"
cp "file.tgz" "${CURRENTPATH}/file.tgz" cd "${CURRENTPATH}" tar -xzf
file.tgz cd "openssl-${VERSION}"
for ARCH in ${ARCHS} do CONFIGURE_FOR="iphoneos-cross"
if [ "${ARCH}" == "i386" ] || [ "${ARCH}" == "x86_64" ] ; then
PLATFORM="iPhoneSimulator"
if [ "${ARCH}" == "x86_64" ] ;
then
CONFIGURE_FOR="darwin64-x86_64-cc"
fi else
sed -ie "s!static volatile sig_atomic_t intr_signal;!static volatile intr_signal;!" "crypto/ui/ui_openssl.c"
PLATFORM="iPhoneOS" fi
export
CROSS_TOP="${DEVELOPER}/Platforms/${PLATFORM}.platform/Developer"
export CROSS_SDK="${PLATFORM}${SDKVERSION}.sdk"
echo "Building openssl-${VERSION} for ${PLATFORM} ${SDKVERSION}
${ARCH}" echo "Please stand by..."
export CC="${DEVELOPER}/usr/bin/gcc -arch ${ARCH}
${MIN_SDK_VERSION_FLAG}" mkdir -p
"${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk"
LOG="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/build-openssl-${VERSION}.log"
LIPO_LIBSSL="${LIPO_LIBSSL}
${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libssl.a"
LIPO_LIBCRYPTO="${LIPO_LIBCRYPTO}
${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk/lib/libcrypto.a"
./Configure ${CONFIGURE_FOR}
--openssldir="${CURRENTPATH}/bin/${PLATFORM}${SDKVERSION}-${ARCH}.sdk" > "${LOG}" 2>&1 sed -ie "s!^CFLAG=!CFLAG=-isysroot ${CROSS_TOP}/SDKs/${CROSS_SDK} !" "Makefile"
make >> "${LOG}" 2>&1 make all install_sw >> "${LOG}" 2>&1 make
clean >> "${LOG}" 2>&1 done
echo "Build library..." rm -rf "${BASEPATH}/lib/" mkdir -p
"${BASEPATH}/lib/" lipo -create ${LIPO_LIBSSL} -output
"${BASEPATH}/lib/libssl.a" lipo -create ${LIPO_LIBCRYPTO} -output
"${BASEPATH}/lib/libcrypto.a"
echo "Copying headers..." rm -rf "${BASEPATH}/opensslIncludes/" mkdir
-p "${BASEPATH}/opensslIncludes/" cp -RL "${CURRENTPATH}/openssl-${VERSION}/include/openssl"
"${BASEPATH}/opensslIncludes/"
cd "${BASEPATH}" echo "Building done."
echo "Cleaning up..." rm -rf "${CURRENTPATH}" echo "Done."
cp: file.tgz: No such file or directory
This is the command I'm using in the podfile:
pod 'OpenSSL', '~> 1.0'
I've tried installing the Xcode Command Line Tools but this did not fix the problem.
Anyone have any idea what the problem is?

First things first: If you can, try to switch to a different POD. That one is no longer maintained.
Workaround if you cannot switch:
curl https://www.openssl.org/source/openssl-<your-version>.tar.gz > file.tgz
cp file.tgz /tmp/openssl #create directory if needed
sed 's/cp \\"file.tgz\\" \\"${CURRENTPATH}\/file.tgz\\"//' `find ~/.cocoapods|grep "OpenSSL/<your-version>/OpenSSL.podspec.json"`
pod install
"< your version >" would be e.g. "1.0.2j" for the URL and "1.0.210" for the grep

I am seeing this issue also. Have not been able to resolve. Frustratingly this is happening on a Jenkins slave machine - whereas my own Mac has no issue with 'pod update' and seems to get OpenSSL without problem...
I since found out that the cocoapod-downloader had to be downgraded...for this to install...
https://github.com/FredericJacobs/OpenSSL-Pod/issues/49

I went around with several of the possible solutions, the one that worked for me was to downgrade cocoapods and the downloader. After OpenSSL is installed the pod install is done its fine to go back to the current ones. Exact steps:
sudo gem uninstall cocoapods-downloader
sudo gem install cocoapods-downloader -v 1.2.0
sudo gem uninstall cocoapods
sudo gem install cocoapods -v 1.5.3
pod deintegrate
rm -rf /tmp/openssl
pod install

While I was trying to install a different cococapod, I got the same error. For me the solution was to downgrade cococapods downloader. This is the commands I used:
sudo gem uninstall cocoapods-downloader
sudo gem install cocoapods-downloader -v 1.2.0
Thnx

Patric's answer works for me. But to make the answer a little bit more clear here:
rm -rf /tmp/openssl; mkdir /tmp/openssl && cd /tmp/openssl;
curl https://www.openssl.org/source/openssl-1.0.2j.tar.gz > file.tgz
cd -;
sed -i 's/cp \\"file.tgz\\" \\"${CURRENTPATH}\/file.tgz\\"//' `find ~/.cocoapods|grep "OpenSSL/1.0.210/OpenSSL.podspec.json"`
pod install
Note:
The pod install spent about 10 minutes on my mac air.
Replace 1.0.2j and 1.0.210 with your proper version if needed.
If you want to try, downgrade the cocoapods and cocoapods-downloader is another solution, please refer here.

update:
just use
pod 'OpenSSL', :git => 'https://github.com/isee15/OpenSSL.git'
replace pod OpenSSL with OpenSSL-XM
or
replace "prepare_command" in find ~/.cocoapods|grep "OpenSSL/1.0.2j/OpenSSL.podspec.json"
with https://github.com/CocoaPods/Specs/blob/3b17051d7e0bbb5c97420a7a6d3aa9b1f6b601db/Specs/3/2/e/OpenSSL-XM/1.0.210.1/OpenSSL-XM.podspec.json

Related

ERROR: The Python zlib extension was not compiled. Missing the zlib?

I'm trying to install Python 2.7.7 using Homebrew AND pyenv on my Mac (MacBook Air, OSX 12.5 Monterrey, 1.6 GHz Dual-Core Intel Core i5) but keep getting this “Missing zlib” error.
Just for reference, I have done the following:
When I Installed pyenv, I ran command nano ~/.bashrc (I'm using bash shell) - and pasted and saved on /.bashrc ---> eval "$(pyenv init -)"
then I ran pyenv install 2.7.7 (didn't work and found online step 3.)
CPPFLAGS="-I$(brew --prefix zlib)/include" pyenv install -v 2.7.7 (Again, same error and did step 4.)
ran brew reinstall zlib and overrode on "/.bashrc" eval "$(pyenv init -)" to:
export PATH="/usr/local/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include"
-------------Start of Error ----------------
rm -f /Users/victor/.pyenv/versions/2.7.7/bin/python2
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2.7 python2)
rm -f /Users/victor/.pyenv/versions/2.7.7/bin/python2-config
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2.7-config python2-config)
rm -f /Users/victor/.pyenv/versions/2.7.7/bin/python-config
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2-config python-config)
test -d /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig || /usr/bin/install -c -d -m 755 /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python2.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python-2.7.pc python2.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python2.pc python.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python2.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.7.1 python2.1)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.1 python.1)
ERROR: The Python zlib extension was not compiled. Missing the zlib?
Please consult to the Wiki page to fix the problem.
https://github.com/pyenv/pyenv/wiki/Common-build-problems
BUILD FAILED (OS X 12.5 using python-build 20180424)
Inspect or clean up the working tree at /var/folders/__/1_b0871s7fl7fpwydg4ycjj80000gn/T/python-build.20220729111901.75727
Results logged to /var/folders/__/1_b0871s7fl7fpwydg4ycjj80000gn/T/python-build.20220729111901.75727.log
Last 10 log lines:
(cd /Users/victor/.pyenv/versions/2.7.7/bin; ln -s python2-config python-config)
test -d /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig || /usr/bin/install -c -d -m 755 /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python2.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python-2.7.pc python2.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig/python.pc
(cd /Users/victor/.pyenv/versions/2.7.7/lib/pkgconfig; ln -s python2.pc python.pc)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python2.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.7.1 python2.1)
rm -f /Users/victor/.pyenv/versions/2.7.7/share/man/man1/python.1
(cd /Users/victor/.pyenv/versions/2.7.7/share/man/man1; ln -s python2.1 python.1)
Victors-MacBook-Air:~ victor$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Victors-MacBook-Air:~ victor$
Victors-MacBook-Air:~ victor$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Victors-MacBook-Air:~ victor$
Victors-MacBook-Air:~ victor$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Victors-MacBook-Air:~ victor$
Victors-MacBook-Air:~ victor$ software update
-bash: software: command not found
------------- End of Error -----------------
Any idea?.... Please let me know... I'd highly appreciate it
With a similar configuration, 2018 MBA on Monterey, I was having the same problem as you with pyenv install 2.7.6
I was able to go past the missing zlib issue with the following additions to the shell's profile:
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export LDFLAGS="-L/usr/local/opt/zlib/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include"
export PKG_CONFIG_PATH="/usr/local/opt/zlib/lib/pkgconfig"
As a side note, the installation still didn't go through due to a different issue:
That OpenSSL issue has to do with OpenSSL 1.0 being EOL, more info here.
At the end I just went with 2.7.14 which is OpenSSL 2.0 compatible and good enough for my use case.
command line tools are already installed, use "Software Update" to install updates
This is indicating you need to use the Settings to update the command line tools.
$ software update
-bash: software: command not found
There is no command line called "software". Instead open system preferences. Then click on this:
Install any updates requested.

Installing Homebrew on Macbook running El Capitan

When I run this command:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
I get the following error:
It appears Homebrew is already installed. If your intent is to reinstall you
should do the following before running this installer again:
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
The current contents of /usr/local are bin CODEOFCONDUCT.md git include lib libexec Library LICENSE.txt n share var .git .github .gitignore
However, when I run brew doctor, this error is thrown:
bash: brew: command not found
And when I try to un-install Homebrew using this script:
sudo ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
my command prompt responds with:
Failed to locate Homebrew!
Please help.
First delete all homebrew files manually. Then reinstall Homebrew from scratch. Prefix sudo at your own discretion:
# packages
rm -rf /usr/local/Cellar
# executable
rm /usr/local/bin/brew
# meta
rm -rf /usr/local/.git
rm /usr/local/.github
rm /usr/local/.gitignore
rm /usr/local/.travis.yml
rm /usr/local/.yardopts
rm /usr/local/CODEOFCONDUCT.md
rm /usr/local/LICENSE.txt
rm /usr/local/README.md
# home
rm ~/.rvm/bin/brew
rm ~/.homebrew
rm -rf ~/Library/Caches/Homebrew
rm -rf ~/Library/Logs/Homebrew
# other
rm -rf /Library/Caches/Homebrew
# find more files to delete; delete Homebrew files only!
find / -name "*brew*"
IMPORTANT: because of permission errors upon reinstall, you may have to do one of the following steps before reinstallation; see: https://github.com/Homebrew/legacy-homebrew/issues/15138
# via: https://github.com/Homebrew/legacy-homebrew/issues/15138#issuecomment-19258042
cd /usr/local
sudo mv -v Library Library.old
# --OR--
# via: https://github.com/Homebrew/legacy-homebrew/issues/15138#issuecomment-33338868
# see: http://linuxcommand.org/man_pages/chmod1.html
cd /usr/local
chmod -R 775 Library
Reinstall Homebrew; see: http://brew.sh
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
There is a problem related to the latest version of XCode and Homebrew. Open a terminal and run:
rm -rf /usr/local/Cellar /usr/local/.git
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
If you get permission denied error use sudo. Directory /usr/local/Cellar/ is completely removed when uninstalling Homebrew, so it is safe to remove it.

Unable to install parse.com command line tool on Mac OSX 10.10 Yosemite

Running the command
curl -s https://www.parse.com/downloads/cloud_code/installer.sh | sudo /bin/bash
does not install the tool
I was able to install it easily on my other computer running 10.9.2
STEP : 1
Make a copy of this
#!/bin/bash
TMP_FILE=/tmp/parse.tmp
if [ -e /tmp/parse.tmp ]; then
echo "Cleaning up from previous install failure"
rm -f /tmp/parse.tmp
fi
echo "Fetching latest version ..."
curl --progress-bar https://www.parse.com/downloads/cloud_code/parse -o /tmp/parse.tmp
if [ ! -d /usr/local/bin ]; then
echo "Making /usr/local/bin"
mkdir -p /usr/local/bin
fi
echo "Installing ..."
mv /tmp/parse.tmp /usr/local/bin/parse
chmod 755 /usr/local/bin/parse `
to a file named install.sh and run it in your terminal as bash install.sh. This will install you parse in your Terminal.
STEP :2
Download the Gist from this link and run the file named install.sh in your Terminal preceded by bash

installing komozer on fedora 18 ?

i have download kompozer and installed by following step:
~> sudo yum install compat-libstdc++-33
~> sudo cp ~/Download/kompozer-077-i686.tgz /usr/local/src/kompozer/
~> cd /usr/local/src/kompozer
~> sudo tar vfzx kompozer-077-i686.tgz
~> sudo rm kompozer-077-i686.tgx
~> sudo mv kompozer kompozer-077
~> sudo ln -s /usr/local/src/kompozer/kompozer-077/kompozer /usr/local/bin/.
~> source ~/.tcshrc
on running this command
~> kompozer &
i application doesn't start and got an error on terminal :
[root#HyperWorkstation kompozer]# /usr/local/src/kompozer/kompozer-077/run-mozilla.sh:
/usr/local/src/kompozer/kompozer-077/kompozer-bin: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
please help what goes wrong actually i feel bad may happened in .tcshrc file
........... thanx for reply in advance
# yum install ld-linux.so.2
or
$ tar xvzf kompozer-0.8b3.es-ES.gcc4.2-i686.tar.gz
$ cd kompozer
$ ./kompozer-bin

Heroku buildpacks - installing executables that are used by Python packages

I am trying to install M2Crypto on Heroku. This relies on SWIG being installed.
I've created a custom compiled swig executable and a custom buildpack.
I then git push my code up to Heroku, the custom buildpack installs SWIG then tries to install M2Crypto but fails because it can't find swig.
This is the buildpack customisation:
# Install SWIG
if [ ! -d $CACHE_DIR/swig ]; then
cd $BUILD_DIR
echo "-----> Fetching and installing SWIG 2"
curl -O https://s3.amazonaws.com/guybowden/swig.tar.gz >/dev/null 2>&1
echo "-----> Installing ..."
tar xzvf swig.tar.gz >/dev/null 2>&1
mv swig $CACHE_DIR/swig
rm swig.tar.gz
echo "SWIG installed" | indent
fi
mkdir -p .paybox
cp -R $CACHE_DIR/swig .paybox
echo "updating path..." | indent
PATH=$PATH:/app/.paybox/swig/bin/
export PATH
echo $PATH | indent
echo "setting SWIG_LIB environment var"
export SWIG_LIB=/app/.paybox/swig/share/swig/2.0.5/
This happens before any pip install commands are run.
If I heroku run bash and then manually run source .heroku/venv/bin/activate && pip install M2Crypto it installs no problem and my App works inside the bash prompt for the lifetime of that instance.
I think there's a problem with the PATH setting when the initial pip install -r requirements runs... any ideas?
And the answer is..
PATH=$PATH:$BUILD_DIR/.paybox/swig/bin/
export PATH
echo $PATH | indent
echo "setting SWIG_LIB environment var"
export SWIG_LIB=$BUILD_DIR/.paybox/swig/share/swig/2.0.5/
$BUILD_DIR is where the stuff is built when the buildpack is executed - not /app/ (which is where it lives when the app runs!

Resources