-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* 🏗️ Add system dependency management script * 🏗️ Add preinstall script
- Loading branch information
Showing
2 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
#!/bin/bash | ||
|
||
function green(){ | ||
echo -e "\x1B[32m $1 \x1B[0m" | ||
if [ ! -z "${2}" ]; then | ||
echo -e "\x1B[32m $($2) \x1B[0m" | ||
fi | ||
} | ||
function install-on-mac-os-x() { | ||
green 'OS X detected' | ||
green 'Installing system dependent packages' | ||
|
||
brew install pkg-config cairo pango libpng jpeg giflib librsvg pixman | ||
} | ||
|
||
# This method uses apt-get as package manager, might not work on Fedora | ||
function install-on-linux { | ||
green 'Linux distribution detected' | ||
green 'Installing system dependent packages (using apt-get)' | ||
|
||
sudo apt-get install build-essential libcairo2-dev libpango1.0-dev libjpeg-dev libgif-dev librsvg2-dev | ||
} | ||
|
||
function main() { | ||
case "$OSTYPE" in | ||
darwin*) | ||
install-on-mac-os-x;; | ||
linux*) install-on-linux;; | ||
msys|cygwin) | ||
green 'Windows detected' | ||
green 'No system dependent packages needed' | ||
green 'Installing node dependencies' | ||
return;; | ||
esac | ||
|
||
echo System dependent packages installed | ||
echo Installing node dependencies | ||
} | ||
|
||
main |