Skip to content
Snippets Groups Projects
Commit b615e4f8 authored by Benoit Lavenier's avatar Benoit Lavenier
Browse files

enh(build) Fix AppImage build

parent 532bd7dd
No related branches found
No related tags found
No related merge requests found
...@@ -13,18 +13,18 @@ arch/linux/.vagrant ...@@ -13,18 +13,18 @@ arch/linux/.vagrant
arch/linux/cesium-* arch/linux/cesium-*
arch/linux/splash.html arch/linux/splash.html
arch/linux/package.json arch/linux/package.json
arch/linux/package-lock.json
arch/linux/yarn.lock arch/linux/yarn.lock
arch/linux/LICENSE.txt arch/linux/LICENSE.txt
arch/linux/ubuntu*
arch/linux/nw* arch/linux/nw*
arch/windows/.vagrant arch/windows/.vagrant
arch/windows/cesium-* arch/windows/cesium-*
arch/windows/splash.html arch/windows/splash.html
arch/windows/package.json arch/windows/package.json
arch/windows/package-lock.json
arch/windows/yarn.lock arch/windows/yarn.lock
arch/windows/LICENSE.txt arch/windows/LICENSE.txt
arch/windows/LICENSE.txt
arch/windows/*.box arch/windows/*.box
arch/windows/*.exe arch/windows/*.exe
arch/windows/.directory arch/windows/.directory
......
...@@ -20,7 +20,7 @@ This script will run Cesium Desktop, taking care of installing Cesium + Nw.js if ...@@ -20,7 +20,7 @@ This script will run Cesium Desktop, taking care of installing Cesium + Nw.js if
The release script use some Vagrant, and a VM running into VirtualBox. The release script use some Vagrant, and a VM running into VirtualBox.
- Install VirtualBox version 6 (not tested under version 7) - Install VirtualBox version 7
- Install the VirtualBox Extension Pack (need by OSx build, for USB support). - Install the VirtualBox Extension Pack (need by OSx build, for USB support).
- Install vagrant : `sudo apt install vagrant` - Install vagrant : `sudo apt install vagrant`
......
...@@ -2,10 +2,11 @@ app: cesium-desktop ...@@ -2,10 +2,11 @@ app: cesium-desktop
ingredients: ingredients:
script: script:
- rm -rf cesium-desktop.AppDir/opt/cesium - CESIUM_ROOT=cesium-desktop.AppDir/opt/cesium
- mkdir -p cesium-desktop.AppDir/opt/cesium - rm -rf $CESIUM_ROOT
- mkdir -p $CESIUM_ROOT
- TGZ_FILE=$(ls ../cesium-desktop-v*-linux-x64.tar.gz | sort -V | tail -n 1) - TGZ_FILE=$(ls ../cesium-desktop-v*-linux-x64.tar.gz | sort -V | tail -n 1)
- tar xzf $TGZ_FILE -C cesium-desktop.AppDir/opt/cesium - tar xzf $TGZ_FILE -C $CESIUM_ROOT
script: script:
- cat > cesium.desktop <<EOF - cat > cesium.desktop <<EOF
- [Desktop Entry] - [Desktop Entry]
...@@ -18,7 +19,13 @@ script: ...@@ -18,7 +19,13 @@ script:
- EOF - EOF
- ln -s opt/cesium/nw/nw usr/bin/cesium - ln -s opt/cesium/nw/nw usr/bin/cesium
- mkdir -p usr/share/icons/hicolor/256x256/apps - mkdir -p usr/share/icons/hicolor/256x256/apps
- cp opt/cesium/nw/cesium/img/logo_32px.png usr/share/icons/hicolor/32x32/apps/cesium.png
- cp opt/cesium/nw/cesium/img/logo_128px.png usr/share/icons/hicolor/128x128/apps/cesium.png
- cp opt/cesium/nw/cesium/img/logo_256px.png usr/share/icons/hicolor/256x256/apps/cesium.png - cp opt/cesium/nw/cesium/img/logo_256px.png usr/share/icons/hicolor/256x256/apps/cesium.png
- cp usr/share/icons/hicolor/256x256/apps/cesium.png ./app.png - cp opt/cesium/nw/cesium/img/logo_512px.png usr/share/icons/hicolor/512x512/apps/cesium.png
- chmod ugo+r -R opt/cesium - cp usr/share/icons/hicolor/256x256/apps/cesium.png .
- chmod ugo+x -R opt/cesium/nw/nw opt/cesium/nw/lib opt/cesium/nw/locales - chmod +r -R opt/cesium
- chmod +x opt/cesium/nw/nw opt/cesium/nw/lib opt/cesium/nw/locales
- sed -i 's/Cesium/Cesium Ğ1/g' opt/cesium/nw/splash.html
- sed -i 's/Cesium/Cesium Ğ1/g' opt/cesium/nw/cesium/index.html
- sed -i 's/"Cesium"/"Cesium Ğ1"/g' opt/cesium/nw/cesium-desktop.js
...@@ -5,7 +5,7 @@ apt update ...@@ -5,7 +5,7 @@ apt update
# Deps need for tar.gz and .deb build # Deps need for tar.gz and .deb build
apt install --yes git curl python3-minimal zip fakeroot apt install --yes git curl python3-minimal zip fakeroot
# Deps need for AppImage build # Deps need for AppImage build
apt install --yes imagemagick desktop-file-utils binutils apt install --yes imagemagick desktop-file-utils binutils fuse3
# User installation # User installation
sudo su vagrant -c "bash /vagrant/user-bootstrap.sh" sudo su vagrant -c "bash /vagrant/user-bootstrap.sh"
...@@ -154,12 +154,16 @@ rm -rf "${RELEASES}/${PROJECT_NAME}-x64" || exit 1 ...@@ -154,12 +154,16 @@ rm -rf "${RELEASES}/${PROJECT_NAME}-x64" || exit 1
# Build Desktop version .AppImage # Build Desktop version .AppImage
# ------------------------------------------------- # -------------------------------------------------
cp -f /vagrant/appimage/* "${RELEASES}/" || exit 1 cp -f /vagrant/appimage.yml "${RELEASES}/" || exit 1
cp -f /vagrant/${OUTPUT_BASENAME}.tar.gz "${RELEASES}/" || exit 1 cp -f /vagrant/pkg2appimage "${RELEASES}/" || exit 1
ln -s /vagrant/${OUTPUT_BASENAME}.tar.gz "${RELEASES}/${OUTPUT_BASENAME}.tar.gz" || exit 1
cd "${RELEASES}" cd "${RELEASES}"
bash -ex ./pkg2appimage appimage.yml || exit 1 ./pkg2appimage appimage.yml || exit 1
OUTPUT_APPIMAGE=$(ls ./out/*.AppImage | sort -V | tail -n 1)
OUTPUT_APPIMAGE=$(ls "./out/*.AppImage" | sort -V | tail -n 1) if [ ! -f "${OUTPUT_APPIMAGE}" ]; then
echo "ERROR: No AppImage file found in directory ${RELEASES}/out - Please check previous error"
exit 1
fi
mv "${OUTPUT_APPIMAGE}" "/vagrant/${OUTPUT_BASENAME}.AppImage" || exit 1 mv "${OUTPUT_APPIMAGE}" "/vagrant/${OUTPUT_BASENAME}.AppImage" || exit 1
# ------------------------------------------------- # -------------------------------------------------
......
File moved
echo off
set NW_VERSION=0.42.2 set NW_VERSION=0.42.2
set NW_RELEASE=v%NW_VERSION% set NW_RELEASE=v%NW_VERSION%
...@@ -11,17 +12,26 @@ REM NPM ...@@ -11,17 +12,26 @@ REM NPM
set PATH="C:\Users\vagrant\AppData\Roaming\npm";%PATH% set PATH="C:\Users\vagrant\AppData\Roaming\npm";%PATH%
REM InnoSetup REM InnoSetup
set PATH="C:\Program Files (x86)\Inno Setup 5";%PATH% set PATH="C:\Program Files (x86)\Inno Setup 5";%PATH%
set SOURCE=C:\vagrant
if not exist "%SOURCE%" (
set SOURCE=\\VBOXSVR\vagrant
)
if not exist "%SOURCE%" (
echo "vagrant folder not mounted !"
pause
exit 1
)
cd C:\Users\vagrant cd C:\Users\vagrant
REM echo "Deleting old source..." REM echo "Deleting old source..."
del /s /q cesium-v*-web.zip del /s /q cesium-v*-web.zip
rd /s /q cesium rd /s /q cesium
rd /s /q cesium_release rd /s /q cesium_release
echo "Cloning Cesium (from git.duniter.org)..."
echo "Cloning Cesium (from github.com)..." echo "Cloning Cesium (from github.com)..."
git clone https://github.com/duniter/cesium.git git clone https://github.com/duniter/cesium.git
if not exist C:\Users\vagrant\cesium ( if not exist C:\Users\vagrant\cesium (
echo "ERROR: Cannot clone Cesium source!" echo "ERROR: Cannot clone Cesium source!"
pause
exit 1 exit 1
) )
cd cesium cd cesium
...@@ -30,35 +40,39 @@ for /f "delims=" %%a in ('git rev-list --tags --max-count=1') do @set CESIUM_REV ...@@ -30,35 +40,39 @@ for /f "delims=" %%a in ('git rev-list --tags --max-count=1') do @set CESIUM_REV
for /f "delims=" %%a in ('git describe --tags %CESIUM_REV%') do @set CESIUM_TAG=%%a for /f "delims=" %%a in ('git describe --tags %CESIUM_REV%') do @set CESIUM_TAG=%%a
set CESIUM=cesium-%CESIUM_TAG%-web set CESIUM=cesium-%CESIUM_TAG%-web
set CESIUM_ZIP=%CESIUM%.zip set CESIUM_ZIP=%CESIUM%.zip
echo %CESIUM_TAG% echo "Version: %CESIUM_TAG%"
echo %CESIUM% echo "Basename: %CESIUM%"
echo %CESIUM_ZIP% echo "Filename: %CESIUM_ZIP%"
cd .. cd ..
if not exist C:\vagrant\%NW_GZ% ( if not exist %SOURCE%\%NW_GZ% (
echo "Downloading %NW%.zip..." echo "Downloading %NW%.zip..."
REM powershell -Command "Invoke-WebRequest -Uri https://dl.nwjs.io/v%NW_VERSION%/%NW%.zip -OutFile C:\vagrant\%NW_GZ%" REM powershell -Command "Invoke-WebRequest -Uri https://dl.nwjs.io/v%NW_VERSION%/%NW%.zip -OutFile %SOURCE%\%NW_GZ%"
powershell -Command "(New-Object System.Net.WebClient).DownloadFile(\"https://dl.nwjs.io/v%NW_VERSION%/%NW%.zip\", \"C:\vagrant\%NW_GZ%\")" powershell -Command "(New-Object System.Net.WebClient).DownloadFile(\"https://dl.nwjs.io/v%NW_VERSION%/%NW%.zip\", \"%SOURCE%\%NW_GZ%\")"
) )
if not exist C:\vagrant\%CESIUM_ZIP% ( if not exist %SOURCE%\%CESIUM_ZIP% (
echo "Downloading %CESIUM_ZIP%..." echo "Downloading %CESIUM_ZIP%..."
powershell -Command "(New-Object System.Net.WebClient).DownloadFile(\"https://github.com/duniter/cesium/releases/download/%CESIUM_TAG%/%CESIUM_ZIP%\", \"C:\vagrant\%CESIUM_ZIP%\")" powershell -Command "(New-Object System.Net.WebClient).DownloadFile(\"https://github.com/duniter/cesium/releases/download/%CESIUM_TAG%/%CESIUM_ZIP%\", \"%SOURCE%\%CESIUM_ZIP%\")"
) )
call 7z x C:\vagrant\%NW_GZ% call 7z x %SOURCE%\%NW_GZ%
move %NW% cesium_release move %NW% cesium_release
if not exist cesium_release (
echo "ERROR Missing cesium_release folder !"
exit 1
)
cd cesium_release cd cesium_release
mkdir cesium mkdir cesium
cd cesium cd cesium
call 7z x C:\vagrant\%CESIUM_ZIP% call 7z x %SOURCE%\%CESIUM_ZIP%
cd .. cd ..
xcopy C:\vagrant\LICENSE.txt .\ /s /e xcopy %SOURCE%\LICENSE.txt .\ /s /e
xcopy C:\vagrant\package.json .\ /s /e xcopy %SOURCE%\package.json .\ /s /e
xcopy C:\vagrant\cesium-desktop.js .\ /s /e xcopy %SOURCE%\cesium-desktop.js .\ /s /e
xcopy C:\vagrant\splash.html .\ /s /e xcopy %SOURCE%\splash.html .\ /s /e
call npm install call npm install
cd C:\Users\vagrant\cesium_release\cesium cd C:\Users\vagrant\cesium_release\cesium
...@@ -70,8 +84,9 @@ rmdir /s /q "maps" ...@@ -70,8 +84,9 @@ rmdir /s /q "maps"
rmdir /s /q ".git" rmdir /s /q ".git"
cd .. cd ..
iscc C:\vagrant\cesium.iss /DROOT_PATH=%cd% iscc %SOURCE%\cesium.iss /DROOT_PATH=%cd%
move %cd%\Cesium.exe C:\vagrant\cesium-desktop-%CESIUM_TAG%-windows-x64.exe move %cd%\Cesium.exe %SOURCE%\cesium-desktop-%CESIUM_TAG%-windows-x64.exe
echo "Build done: binary available at cesium-desktop-%CESIUM_TAG%-windows-x64.exe" echo "Build done: binary available at cesium-desktop-%CESIUM_TAG%-windows-x64.exe"
pause
exit 0 exit 0
...@@ -100,7 +100,7 @@ for ASSET_BASENAME in $EXPECTED_ASSETS; do ...@@ -100,7 +100,7 @@ for ASSET_BASENAME in $EXPECTED_ASSETS; do
if [[ -z `echo $ASSETS | grep -F "$ASSET_BASENAME"` ]]; then if [[ -z `echo $ASSETS | grep -F "$ASSET_BASENAME"` ]]; then
# Debian # Debian
if [[ $ASSET_BASENAME == *"linux-x64.deb" ]] || [[ $ASSET_BASENAME == *"linux-x64.tar.gz" ]] || [[ $ASSET_BASENAME == *"linux-x64.AppImage" ]]; then if [[ $ASSET_BASENAME == *"linux-x64."* ]]; then
if [[ $ARCH == "x86_64" ]]; then if [[ $ARCH == "x86_64" ]]; then
ASSET_PATH="$PWD/arch/linux/$ASSET_BASENAME" ASSET_PATH="$PWD/arch/linux/$ASSET_BASENAME"
......
...@@ -7,7 +7,7 @@ make) ...@@ -7,7 +7,7 @@ make)
case "$2" in case "$2" in
linux) linux)
cd arch/linux cd arch/linux
if [[ ! -f "cesium-desktop-v$TAG-linux-x64.deb" ]]; then if [[ ! -f "cesium-desktop-v$TAG-linux-x64.AppImage" ]]; then
[[ $? -eq 0 ]] && echo ">> Copying Cesium Desktop sources..." [[ $? -eq 0 ]] && echo ">> Copying Cesium Desktop sources..."
[[ $? -eq 0 ]] && cp -f ../../src/* ./ [[ $? -eq 0 ]] && cp -f ../../src/* ./
[[ $? -eq 0 ]] && cp -f ../../LICENSE ./LICENSE.txt [[ $? -eq 0 ]] && cp -f ../../LICENSE ./LICENSE.txt
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment