mirror of
https://github.com/balena-io/etcher.git
synced 2025-07-21 18:26:32 +00:00
chore: adopt new build script command convention in GNU/Linux (#899)
The GNU/Linux build script (as the rest of the OSes will in the near future), now accepts the following command: - `develop-electron` - `develop-cli` - `installer-cli` - `installer-appimage` - `installer-debian` Each of the commands is now completely independent from the others. Signed-off-by: Juan Cruz Viotti <jviotti@openmailbox.org>
This commit is contained in:
parent
553f7f3f4b
commit
19b3bc56c2
@ -45,7 +45,7 @@ install:
|
|||||||
- npm install -g bower
|
- npm install -g bower
|
||||||
- npm install -g electron-installer-debian
|
- npm install -g electron-installer-debian
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
- if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
|
||||||
./scripts/build/linux.sh install x64;
|
./scripts/build/linux.sh develop-electron x64;
|
||||||
fi
|
fi
|
||||||
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
- if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
|
||||||
brew install afsctool;
|
brew install afsctool;
|
||||||
|
@ -44,7 +44,8 @@ $ ./scripts/build/darwin.sh all
|
|||||||
Run the following command:
|
Run the following command:
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
$ ./scripts/build/linux.sh all <x64|x86>
|
$ ./scripts/build/linux.sh installer-appimage <x64|x86>
|
||||||
|
$ ./scripts/build/linux.sh installer-debian <x64|x86>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -56,7 +56,7 @@ the application might not run successfully.
|
|||||||
### GNU/Linux
|
### GNU/Linux
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
./scripts/build/linux.sh install <x64|x86>
|
./scripts/build/linux.sh develop-electron <x64|x86>
|
||||||
```
|
```
|
||||||
|
|
||||||
### Windows
|
### Windows
|
||||||
|
@ -33,31 +33,42 @@ if [ "$#" -ne 2 ]; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
COMMAND=$1
|
COMMAND=$1
|
||||||
if [ "$COMMAND" != "install" ] && [ "$COMMAND" != "package" ] && [ "$COMMAND" != "debian" ] && [ "$COMMAND" != "appimage" ] && [ "$COMMAND" != "cli" ] && [ "$COMMAND" != "all" ]; then
|
|
||||||
echo "Unknown command: $COMMAND" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$COMMAND" == "appimage" ] || [ "$COMMAND" == "all" ]; then
|
|
||||||
if ! command -v upx 2>/dev/null; then
|
|
||||||
echo "Dependency missing: upx" 1>&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
ARCH=$2
|
ARCH=$2
|
||||||
if [ "$ARCH" != "x64" ] && [ "$ARCH" != "x86" ]; then
|
if [ "$ARCH" != "x64" ] &&
|
||||||
|
[ "$ARCH" != "x86" ];
|
||||||
|
then
|
||||||
echo "Unknown architecture: $ARCH" 1>&2
|
echo "Unknown architecture: $ARCH" 1>&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
ELECTRON_VERSION=`node -e "console.log(require('./package.json').devDependencies['electron-prebuilt'])"`
|
ELECTRON_VERSION=`node -e "console.log(require('./package.json').devDependencies['electron-prebuilt'])"`
|
||||||
|
NODE_VERSION="6.2.2"
|
||||||
APPLICATION_NAME=`node -e "console.log(require('./package.json').displayName)"`
|
APPLICATION_NAME=`node -e "console.log(require('./package.json').displayName)"`
|
||||||
APPLICATION_DESCRIPTION=`node -e "console.log(require('./package.json').description)"`
|
APPLICATION_DESCRIPTION=`node -e "console.log(require('./package.json').description)"`
|
||||||
APPLICATION_VERSION=`node -e "console.log(require('./package.json').version)"`
|
APPLICATION_VERSION=`node -e "console.log(require('./package.json').version)"`
|
||||||
|
|
||||||
if [ "$COMMAND" == "cli" ]; then
|
if [ "$COMMAND" == "develop-electron" ]; then
|
||||||
./scripts/unix/dependencies.sh -r "$ARCH" -v 6.2.2 -t node -f -p
|
./scripts/unix/dependencies.sh \
|
||||||
|
-r "$ARCH" \
|
||||||
|
-v "$ELECTRON_VERSION" \
|
||||||
|
-t electron
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$COMMAND" == "develop-cli" ]; then
|
||||||
|
./scripts/unix/dependencies.sh \
|
||||||
|
-r "$ARCH" \
|
||||||
|
-v "$NODE_VERSION" \
|
||||||
|
-t node
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$COMMAND" == "installer-cli" ]; then
|
||||||
|
./scripts/unix/dependencies.sh -f -p \
|
||||||
|
-r "$ARCH" \
|
||||||
|
-v "$NODE_VERSION" \
|
||||||
|
-t node
|
||||||
|
|
||||||
./scripts/unix/package-cli.sh \
|
./scripts/unix/package-cli.sh \
|
||||||
-n etcher \
|
-n etcher \
|
||||||
-e bin/etcher \
|
-e bin/etcher \
|
||||||
@ -67,19 +78,11 @@ if [ "$COMMAND" == "cli" ]; then
|
|||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$COMMAND" == "install" ] || [ "$COMMAND" == "all" ]; then
|
if [ "$COMMAND" == "installer-debian" ]; then
|
||||||
./scripts/unix/dependencies.sh \
|
./scripts/unix/dependencies.sh -p \
|
||||||
-r "$ARCH" \
|
-r "$ARCH" \
|
||||||
-v "$ELECTRON_VERSION" \
|
-v "$ELECTRON_VERSION" \
|
||||||
-t electron
|
-t electron
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$COMMAND" == "package" ] || [ "$COMMAND" == "all" ]; then
|
|
||||||
./scripts/unix/dependencies.sh \
|
|
||||||
-r "$ARCH" \
|
|
||||||
-v "$ELECTRON_VERSION" \
|
|
||||||
-t electron \
|
|
||||||
-p
|
|
||||||
|
|
||||||
./scripts/linux/package.sh \
|
./scripts/linux/package.sh \
|
||||||
-n "$APPLICATION_NAME" \
|
-n "$APPLICATION_NAME" \
|
||||||
@ -89,29 +92,48 @@ if [ "$COMMAND" == "package" ] || [ "$COMMAND" == "all" ]; then
|
|||||||
-f "package.json,lib,node_modules,bower_components,build,assets" \
|
-f "package.json,lib,node_modules,bower_components,build,assets" \
|
||||||
-e "$ELECTRON_VERSION" \
|
-e "$ELECTRON_VERSION" \
|
||||||
-o etcher-release/$APPLICATION_NAME-linux-$ARCH
|
-o etcher-release/$APPLICATION_NAME-linux-$ARCH
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$COMMAND" == "debian" ] || [ "$COMMAND" == "all" ]; then
|
|
||||||
./scripts/linux/installer-deb.sh \
|
./scripts/linux/installer-deb.sh \
|
||||||
-p etcher-release/$APPLICATION_NAME-linux-$ARCH \
|
-p etcher-release/$APPLICATION_NAME-linux-$ARCH \
|
||||||
-r "$ARCH" \
|
-r "$ARCH" \
|
||||||
-c scripts/build/debian/config.json \
|
-c scripts/build/debian/config.json \
|
||||||
-o etcher-release/installers
|
-o etcher-release/installers
|
||||||
|
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ "$COMMAND" == "appimage" ] || [ "$COMMAND" == "all" ]; then
|
if [ "$COMMAND" == "installer-appimage" ]; then
|
||||||
|
./scripts/unix/dependencies.sh -p \
|
||||||
|
-r "$ARCH" \
|
||||||
|
-v "$ELECTRON_VERSION" \
|
||||||
|
-t electron
|
||||||
|
|
||||||
|
./scripts/linux/package.sh \
|
||||||
|
-n "$APPLICATION_NAME" \
|
||||||
|
-r "$ARCH" \
|
||||||
|
-v "$APPLICATION_VERSION" \
|
||||||
|
-l LICENSE \
|
||||||
|
-f "package.json,lib,node_modules,bower_components,build,assets" \
|
||||||
|
-e "$ELECTRON_VERSION" \
|
||||||
|
-o etcher-release/$APPLICATION_NAME-linux-$ARCH
|
||||||
|
|
||||||
./scripts/linux/installer-appimage.sh \
|
./scripts/linux/installer-appimage.sh \
|
||||||
-n "$APPLICATION_NAME" \
|
-n "$APPLICATION_NAME" \
|
||||||
-d "$APPLICATION_DESCRIPTION" \
|
-d "$APPLICATION_DESCRIPTION" \
|
||||||
-p etcher-release/Etcher-linux-$ARCH \
|
-p etcher-release/$APPLICATION_NAME-linux-$ARCH \
|
||||||
-r $ARCH \
|
-r $ARCH \
|
||||||
-b etcher \
|
-b etcher \
|
||||||
-i assets/icon.png \
|
-i assets/icon.png \
|
||||||
-o etcher-release/$APPLICATION_NAME-linux-$ARCH.AppImage
|
-o etcher-release/$APPLICATION_NAME-linux-$ARCH.AppImage
|
||||||
|
|
||||||
pushd etcher-release
|
pushd etcher-release
|
||||||
zip Etcher-$APPLICATION_VERSION-linux-$ARCH.zip Etcher-linux-$ARCH.AppImage
|
zip $APPLICATION_NAME-$APPLICATION_VERSION-linux-$ARCH.zip $APPLICATION_NAME-linux-$ARCH.AppImage
|
||||||
mkdir -p installers
|
mkdir -p installers
|
||||||
mv Etcher-$APPLICATION_VERSION-linux-$ARCH.zip installers
|
mv $APPLICATION_NAME-$APPLICATION_VERSION-linux-$ARCH.zip installers
|
||||||
popd
|
popd
|
||||||
|
|
||||||
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo "Unknown command: $COMMAND" 1>&2
|
||||||
|
exit 1
|
||||||
|
@ -130,6 +130,9 @@ download_executable \
|
|||||||
# Compress binaries
|
# Compress binaries
|
||||||
upx -9 "$APPDIR_PATH/usr/bin/$ARGV_BINARY"
|
upx -9 "$APPDIR_PATH/usr/bin/$ARGV_BINARY"
|
||||||
|
|
||||||
|
# upx fails with an error if .so are not executables
|
||||||
|
chmod +x "$APPDIR_PATH"/usr/bin/*.so*
|
||||||
|
|
||||||
# UPX fails for some reason with some other so libraries
|
# UPX fails for some reason with some other so libraries
|
||||||
# other than libnode.so in the x86 build
|
# other than libnode.so in the x86 build
|
||||||
if [ "$ARGV_ARCHITECTURE" == "x86" ]; then
|
if [ "$ARGV_ARCHITECTURE" == "x86" ]; then
|
||||||
|
@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
set -u
|
set -u
|
||||||
set -e
|
set -e
|
||||||
set -x
|
|
||||||
|
|
||||||
OS=$(uname)
|
OS=$(uname)
|
||||||
if [[ "$OS" != "Linux" ]]; then
|
if [[ "$OS" != "Linux" ]]; then
|
||||||
@ -84,6 +83,7 @@ then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
OUTPUT_DIRNAME=$(dirname "$ARGV_OUTPUT")
|
OUTPUT_DIRNAME=$(dirname "$ARGV_OUTPUT")
|
||||||
|
rm -rf "$ARGV_OUTPUT"
|
||||||
mkdir -p "$OUTPUT_DIRNAME"
|
mkdir -p "$OUTPUT_DIRNAME"
|
||||||
|
|
||||||
ELECTRON_ARCHITECTURE=$ARGV_ARCHITECTURE
|
ELECTRON_ARCHITECTURE=$ARGV_ARCHITECTURE
|
||||||
|
Loading…
x
Reference in New Issue
Block a user