Browse Source

fix osx build, closes #1 (checked under 10.13.2)

pull/29/head
R4SAS 6 years ago
parent
commit
b163b32695
  1. 30
      osx/build/build.sh

30
osx/build/build.sh

@ -7,7 +7,7 @@
# See full license text in LICENSE file at top of project tree # See full license text in LICENSE file at top of project tree
arch=$(uname -m) arch=$(uname -m)
language=$(echo $LANG | cut -c-5 | sed s/_/-/g) language=$(osascript -e 'user locale of (get system info)')
version="60.0.2esr" version="60.0.2esr"
i2pdversion="2.18.0" i2pdversion="2.18.0"
@ -21,23 +21,27 @@ fi
echo "This script is preparing Firefox $version for use with I2Pd" echo "This script is preparing Firefox $version for use with I2Pd"
file="Firefox\ ${version}.dmg" file="Firefox ${version}.dmg"
filepath="mac/${language}/${file}" filepath="mac/${language}/${file}"
echo "Downloading $application..." echo "Downloading $application..."
curl -L -f -# -O ${ftpmirror}/${filepath}
tmpfilepath=$(echo $filepath | sed 's/ /%20/g')
curl -L -f -# -O "${ftpmirror}/${tmpfilepath}"
if [ $? -ne 0 ]; then # Not found error, trying to cut language variable if [ $? -ne 0 ]; then # Not found error, trying to cut language variable
echo "[TRY 2] I'll try downloading Firefox with shorter language code"; echo "[TRY 2] I'll try downloading Firefox with shorter language code";
language=$(echo $language | cut -c-2) language=$(echo $language | cut -c-2)
# re-create variable with cutted lang # re-create variable with cutted lang
filepath="mac/$language/$file" filepath="mac/$language/$file"
curl -L -f -# -O ${ftpmirror}/${filepath} tmpfilepath=$(echo $filepath | sed 's/ /%20/g')
curl -L -f -# -o "${file}" "${ftpmirror}/${tmpfilepath}"
if [ $? -ne 0 ]; then # Not found error, trying to download english version if [ $? -ne 0 ]; then # Not found error, trying to download english version
echo "[TRY 3] I'll try downloading Firefox with the English language code"; echo "[TRY 3] I'll try downloading Firefox with the English language code";
language="en_US" language="en_US"
# re-create lang variable # re-create lang variable
filepath="mac/$language/$file" filepath="mac/$language/$file"
curl -L -f -# -O ${ftpmirror}/${filepath} tmpfilepath=$(echo $filepath | sed 's/ /%20/g')
curl -L -f -# -O "${ftpmirror}/${tmpfilepath}"
if [ $? -ne 0 ]; then # After that i can say only that user haven't internet connection if [ $? -ne 0 ]; then # After that i can say only that user haven't internet connection
echo "[Error] Can't download file. Check your internet connectivity." echo "[Error] Can't download file. Check your internet connectivity."
exit 1; exit 1;
@ -51,9 +55,9 @@ if [ ! -f $file ]; then
fi fi
echo "Downloading checksum file and checking SHA512 checksum" echo "Downloading checksum file and checking SHA512 checksum"
curl -L -f -# -O ${ftpmirror}/SHA512SUMS curl -L -f -# -O "${ftpmirror}/SHA512SUMS"
recv_sum=$(grep "$filepath" SHA512SUMS | cut -c-128) recv_sum=$(grep "$filepath" SHA512SUMS | cut -c-128)
file_sum=$(sha512sum $file | cut -c-128) file_sum=$(shasum -a 512 "$file" | cut -c-128)
if [ $recv_sum != $file_sum ]; then if [ $recv_sum != $file_sum ]; then
echo "[Error] File checksum failed!" echo "[Error] File checksum failed!"
exit 1; exit 1;
@ -63,13 +67,13 @@ else
fi fi
echo "Attaching image and copying files..." echo "Attaching image and copying files..."
hdiutil attach $file hdiutil attach "$file"
cp -rf /Volumes/Firefox/Firefox.app ../FirefoxESR.app cp -rf /Volumes/Firefox/Firefox.app ../FirefoxESR.app
mkdir ../data mkdir ../data
echo "Detaching image and removing image file..." echo "Detaching image and removing image file..."
hdiutil detach /Volumes/Firefox hdiutil detach /Volumes/Firefox
rm $file rm "$file"
## TODO: check on linux before make that changes ## TODO: check on linux before make that changes
# Deleting some not needed files # Deleting some not needed files
@ -87,11 +91,11 @@ rm $file
# Done! # Done!
echo "Downloading language packs..." echo "Downloading language packs..."
curl -L -f -# -o ../FirefoxESR.app/Contents/Resources/browser/extensions/langpack-ru@firefox.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/978562/russian_ru_language_pack-60.0buildid20180605171542-an+fx.xpi curl -L -f -# -o ../FirefoxESR.app/Contents/Resources/browser/extensions/langpack-ru@firefox.mozilla.org.xpi "https://addons.mozilla.org/firefox/downloads/file/978562/russian_ru_language_pack-60.0buildid20180605171542-an+fx.xpi"
curl -L -f -# -o ../FirefoxESR.app/Contents/Resources/browser/extensions/langpack-en-US@firefox.mozilla.org.xpi https://addons.mozilla.org/firefox/downloads/file/978493/english_us_language_pack-60.0buildid20180605171542-an+fx.xpi curl -L -f -# -o ../FirefoxESR.app/Contents/Resources/browser/extensions/langpack-en-US@firefox.mozilla.org.xpi "https://addons.mozilla.org/firefox/downloads/file/978493/english_us_language_pack-60.0buildid20180605171542-an+fx.xpi"
echo "Downloading NoScript extension..." echo "Downloading NoScript extension..."
curl -L -f -# -o ../FirefoxESR.app/Contents/Resources/browser/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi https://addons.mozilla.org/firefox/downloads/file/972162/noscript_security_suite-10.1.8.2-an+fx.xpi curl -L -f -# -o ../FirefoxESR.app/Contents/Resources/browser/extensions/{73a6fe31-595d-460b-a920-fcc0f8843232}.xpi "https://addons.mozilla.org/firefox/downloads/file/972162/noscript_security_suite-10.1.8.2-an+fx.xpi"
echo "Adding standard configs..." echo "Adding standard configs..."
cp profile/* ../data/ cp profile/* ../data/
@ -107,7 +111,7 @@ echo 'FirefoxESR.app/Contents/MacOS/firefox -profile ../data -no-remote' >> "../
chmod +x "../i2pdbrowser-portable" chmod +x "../i2pdbrowser-portable"
echo "Downloading i2pd..." echo "Downloading i2pd..."
curl -L -f -# -O https://github.com/PurpleI2P/i2pd/releases/download/${i2pdversion}/i2pd_${i2pdversion}_osx.tar.gz curl -L -f -# -O "https://github.com/PurpleI2P/i2pd/releases/download/${i2pdversion}/i2pd_${i2pdversion}_osx.tar.gz"
mkdir ../i2pd mkdir ../i2pd
tar xfz i2pd_${i2pdversion}_osx.tar.gz -C ../i2pd tar xfz i2pd_${i2pdversion}_osx.tar.gz -C ../i2pd
mv ../i2pd/i2pd ../i2pd/i2pd-osx mv ../i2pd/i2pd ../i2pd/i2pd-osx

Loading…
Cancel
Save