Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • clients/cesium-grp/cesium-desktop
1 result
Show changes
Commits on Source (25)
Showing
with 705 additions and 71 deletions
......@@ -13,19 +13,21 @@ arch/linux/.vagrant
arch/linux/cesium-*
arch/linux/splash.html
arch/linux/package.json
arch/linux/package-lock.json
arch/linux/yarn.lock
arch/linux/LICENSE.txt
arch/linux/ubuntu*
arch/linux/nw*
arch/windows/.vagrant
arch/windows/cesium-*
arch/windows/splash.html
arch/windows/package.json
arch/windows/package-lock.json
arch/windows/yarn.lock
arch/windows/LICENSE.txt
arch/windows/LICENSE.txt
arch/windows/*.box
arch/windows/*.exe
arch/windows/*.zip
arch/windows/.directory
arch/osx/.vagrant
......
#!/bin/bash
VERSION=1.3.11
VERSION=1.6.12
EXPECTED_ASSETS="cesium-desktop-v${VERSION}-osx-x64.zip"
export EXPECTED_ASSETS
......
......@@ -12,7 +12,7 @@ This script will run Cesium Desktop, taking care of installing Cesium + Nw.js if
#### Authentication token
**Requires your GITHUB token with full access to `repo`** to be stored in clear in `$HOME/.config/duniter/.github` text file.
**Requires your GITHUB token with full access to `repo`** to be stored in clear in `$HOME/.config/cesium/.github` text file.
> You can create such a token at https://github.com/settings/tokens > "Generate a new token". Then copy the token and paste it in the file.
......@@ -20,9 +20,9 @@ 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.
- Install VirtualBox
- Install VirtualBox version 7
- Install the VirtualBox Extension Pack (need by OSx build, for USB support).
- Install vagrant : `sudo apt-get install vagrant`
- Install vagrant : `sudo apt install vagrant`
### Execute release script
......
......@@ -2,9 +2,8 @@
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
config.vm.define "cesium-release-ubuntu"
config.vm.box = "duniter/cesium_trusty64"
config.vm.box_url = "https://s3.eu-central-1.amazonaws.com/duniter/vagrant/duniter_trusty64.box"
config.vm.define "cesium-release-debian"
config.vm.box = "debian/bookworm64"
config.vm.provision :shell, path: "bootstrap.sh"
......
app: cesium-desktop
ingredients:
script:
- CESIUM_ROOT=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)
- tar xzf $TGZ_FILE -C $CESIUM_ROOT
script:
- cat > cesium.desktop <<EOF
- [Desktop Entry]
- Type=Application
- Name=Cesium Ğ1
- Exec=cesium
- StartupNotify=true
- Icon=cesium
- Categories=Utility;
- EOF
- ln -s opt/cesium/nw/nw usr/bin/cesium
- 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_512px.png usr/share/icons/hicolor/512x512/apps/cesium.png
- cp usr/share/icons/hicolor/256x256/apps/cesium.png .
- chmod a+rX -R opt/cesium
- chmod a+x opt/cesium/nw/nw
- 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
#!/bin/bash
# Yarn
curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
# System tools
apt-get update
apt-get install --yes git curl yarn python-minimal zip
apt update
# Deps need for tar.gz and .deb build
apt install --yes git curl python3-minimal zip fakeroot
# Deps need for AppImage build
apt install --yes imagemagick desktop-file-utils binutils fuse3
# User installation
sudo su vagrant -c "bash /vagrant/user-bootstrap.sh"
......@@ -10,7 +10,7 @@ export NVM_DIR="$HOME/.nvm"
# Prepare
NVER=$(node -v)
NW_VERSION=0.42.2
NW_VERSION=0.83.0
NW_RELEASE=v${NW_VERSION}
NW_BASENAME=nwjs
#NW_BASENAME=nwjs-sdk
......@@ -26,7 +26,7 @@ RELEASES=${ROOT}/releases
# Downloads
# -----------
mkdir -p "${DOWNLOADS}" && cd "${DOWNLOADS}" || exit 1
mkdir -p "${DOWNLOADS}" && cd "${DOWNLOADS}" || exit 1
rm -rf "${DOWNLOADS}/${PROJECT_NAME}"
mkdir -p "${DOWNLOADS}/${PROJECT_NAME}"
......@@ -37,7 +37,7 @@ if [ ! -d "${DOWNLOADS}/${PROJECT_NAME}_src" ]; then
cd ${PROJECT_NAME}_src
else
cd ${PROJECT_NAME}_src
git fetch origin
git fetch origin --tags
git reset HEAD
fi
......@@ -58,10 +58,10 @@ fi
if [ ! -d "${DOWNLOADS}/${WEB_ZIP_FILE}" ]; then
cd ${DOWNLOADS}
echo "Downloading ${WEB_ZIP_FILE} into ${DOWNLOADS} ..."
wget -kL "${REPO_PUBLIC_URL}/releases/download/v${PROJECT_VERSION}/${WEB_ZIP_FILE}"
wget -q "${REPO_PUBLIC_URL}/releases/download/v${PROJECT_VERSION}/${WEB_ZIP_FILE}"
rm -rf ${PROJECT_NAME} && mkdir -p ${PROJECT_NAME} || exit 1
unzip -o ${WEB_ZIP_FILE} -d "${DOWNLOADS}/${PROJECT_NAME}"
rm -rf ${PROJECT_NAME} && mkdir -p ${PROJECT_NAME} || exit 1
unzip -q -o ${WEB_ZIP_FILE} -d "${DOWNLOADS}/${PROJECT_NAME}"
rm ${WEB_ZIP_FILE}
fi
......@@ -69,8 +69,8 @@ fi
if [[ ! -d "${DOWNLOADS}/${NW}" ]]; then
cd ${DOWNLOADS}
echo "Downloading ${NW_GZ}..."
wget -kL https://dl.nwjs.io/${NW_RELEASE}/${NW_GZ}
tar xvzf ${NW_GZ}
wget -q "http://dl.nwjs.io/${NW_RELEASE}/${NW_GZ}"
tar xzf ${NW_GZ}
fi
# -----------
......@@ -78,15 +78,16 @@ fi
# -----------
# Clean previous artifacts
rm -rf "/vagrant/${OUTPUT_BASENAME}.deb"
rm -rf "/vagrant/${OUTPUT_BASENAME}.tar.gz"
rm -rf "/vagrant/${OUTPUT_BASENAME}.deb"
rm -rf "/vagrant/${OUTPUT_BASENAME}.AppImage"
# Clean previous releases directory
rm -rf "${RELEASES}"
mkdir -p "${RELEASES}"
# Releases builds
mv "${DOWNLOADS}/${PROJECT_NAME}" "${RELEASES}/" && cd "${RELEASES}/${PROJECT_NAME}" || exit 1
mv "${DOWNLOADS}/${PROJECT_NAME}" "${RELEASES}/" && cd "${RELEASES}/${PROJECT_NAME}" || exit 1
# Remove git files
rm -Rf .git
......@@ -112,22 +113,21 @@ cp -r "${RELEASES}/${PROJECT_NAME}" "${RELEASES}/desktop_release/nw/"
ls "${RELEASES}/desktop_release/nw/"
# Copy Cesium desktop sources files
cp -r /vagrant/package.json "${RELEASES}/desktop_release/nw/"
cp -r /vagrant/yarn.lock "${RELEASES}/desktop_release/nw/"
cp -r /vagrant/cesium-desktop.js "${RELEASES}/desktop_release/nw"
cp -r /vagrant/splash.html "${RELEASES}/desktop_release/nw"
cp -r /vagrant/package.json "${RELEASES}/desktop_release/nw/"
cp -r /vagrant/package-lock.json "${RELEASES}/desktop_release/nw/"
# Injection
sed -i 's/<script src="config.js"[^>]*><\/script>/<script src="config.js"><\/script><script src="..\/cesium-desktop.js"><\/script>/' ${RELEASES}/desktop_release/nw/${PROJECT_NAME}/index*.html || exit 1
# Specific desktop dependencies (for reading Duniter conf, ...)
cd "${RELEASES}/desktop_release/nw"
yarn
npm install
# Releases
cp -R "${RELEASES}/desktop_release" "${RELEASES}/desktop_release_tgz"
cd "${RELEASES}/desktop_release_tgz"
tar czf /vagrant/${OUTPUT_BASENAME}.tar.gz * --exclude ".git" --exclude "coverage" --exclude "test"
cd "${RELEASES}/desktop_release"
tar czf "/vagrant/${OUTPUT_BASENAME}.tar.gz" *
# -------------------------------------------------
# Build Desktop version .deb
......@@ -138,12 +138,45 @@ cp -r "/vagrant/package" "${RELEASES}/${PROJECT_NAME}-x64" || exit 1
mkdir -p "${RELEASES}/${PROJECT_NAME}-x64/opt/${PROJECT_NAME}/" || exit 1
chmod 755 ${RELEASES}/${PROJECT_NAME}-x64/DEBIAN/post*
chmod 755 ${RELEASES}/${PROJECT_NAME}-x64/DEBIAN/pre*
sed -i "s/Version:.*/Version:${PROJECT_VERSION}/g" ${RELEASES}/${PROJECT_NAME}-x64/DEBIAN/control || exit 1
sed -i "s/Version:.*/Version: ${PROJECT_VERSION}/g" "${RELEASES}/${PROJECT_NAME}-x64/DEBIAN/control" || exit 1
gzip --best -n ${RELEASES}/${PROJECT_NAME}-x64/usr/share/doc/${PROJECT_NAME}-desktop/changelog.* || exit 1
cd "${RELEASES}/desktop_release/nw" || exit 1
zip -qr "${RELEASES}/${PROJECT_NAME}-x64/opt/${PROJECT_NAME}/nw.nwb" *
sed -i "s/Package: .*/Package: ${PROJECT_NAME}-desktop/g" "${RELEASES}/${PROJECT_NAME}-x64/DEBIAN/control" || exit 1
cd ${RELEASES}/ || exit 1
cd "${RELEASES}/" || exit 1
fakeroot dpkg-deb --build "${PROJECT_NAME}-x64" || exit 1
mv "${PROJECT_NAME}-x64.deb" "/vagrant/${OUTPUT_BASENAME}.deb" || exit 1
rm -rf "${RELEASES}/${PROJECT_NAME}-x64" || exit 1
# -------------------------------------------------
# Build Desktop version .AppImage
# -------------------------------------------------
cp -f /vagrant/appimage.yml "${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}"
./pkg2appimage appimage.yml || exit 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
# -------------------------------------------------
# Build Desktop sha256 files
# -------------------------------------------------
cd "/vagrant" || exit 1
sha256sum ${OUTPUT_BASENAME}.tar.gz > ${OUTPUT_BASENAME}.tar.gz.sha256
sha256sum ${OUTPUT_BASENAME}.deb > ${OUTPUT_BASENAME}.deb.sha256
sha256sum ${OUTPUT_BASENAME}.AppImage > ${OUTPUT_BASENAME}.AppImage.sha256
# -------------------------------------------------
# Clean release files
# -------------------------------------------------
rm -rf "${RELEASES}"
/usr/share/metainfo/cesium.metainfo.xml
Package: cesium
Version: 1.4.0
Section: misc
Priority: optional
Package: cesium-desktop
Version: 1.7.12
Architecture: all
Installed-Size: 235351
Maintainer: Duniter Team <contact@duniter.org>
Installed-Size: 235351
Depends: libgconf-2-4 (>= 3.2.0), libatomic1
Conflicts: cesium, cesium-desktop
Replaces: cesium, cesium-desktop
Provides: cesium-desktop
Section: contrib/misc
Priority: optional
Homepage: https://www.cesium.app
Package-Type: deb
Description: Cesium Wallet for G1 currency
Cesium is a wallet (client-software) for G1 a libre currency.
Please visit https://www.duniter.org for more information on G1 and libre currencies.
Depends: libgconf-2-4 (>= 3.2.0), libatomic1
Homepage: https://www.cesium.app
License AGPL-3
#!/bin/bash
CESIUM_ROOT=/opt/cesium
CESIUM_G1_TEST=/opt/cesium-g1-test
CESIUM_NW=$CESIUM_ROOT/nw
CESIUM_TEST=/opt/cesium-test
if [[ -f $CESIUM_ROOT/nw.nwb ]]; then
unzip -q -d $CESIUM_NW $CESIUM_ROOT/nw.nwb
chmod +x $CESIUM_NW/nw $CESIUM_NW/lib $CESIUM_NW/locales
ln -s $CESIUM_NW/nw /usr/bin/cesium
if [[ -f "$CESIUM_ROOT/nw.nwb" ]]; then
echo "Unpack nw.nwb ..."
unzip -q -d "$CESIUM_ROOT/nw" "$CESIUM_ROOT/nw.nwb"
chmod a+x $CESIUM_ROOT/nw/nw
ln -s $CESIUM_ROOT/nw/nw /usr/bin/cesium
fi
chmod +r -R $CESIUM_ROOT
chmod a+rX -R $CESIUM_ROOT
# Create a Cesium for G1-Test
cd /opt
cp -r "$CESIUM_ROOT" "$CESIUM_G1_TEST"
cd "$CESIUM_G1_TEST/nw/"
sed -i 's/"cesium"/"cesium-g1-test"/g' package.json
ln -s "$CESIUM_G1_TEST/nw/nw" /usr/bin/cesium-g1-test
cp -r "$CESIUM_ROOT" "$CESIUM_TEST"
cd "$CESIUM_TEST/nw/"
sed -i 's/"cesium"/"cesium-test"/g' package.json
ln -s "$CESIUM_TEST/nw/nw" /usr/bin/cesium-test
# Change title of Cesium test
sed -i 's/Cesium/Cesium Ğ1-Test/g' splash.html
sed -i 's/Cesium/Cesium Ğ1-Test/g' cesium/index.html
sed -i 's/g1.duniter/g1-test.duniter/g' cesium/config.js
sed -i 's/g1.data/g1-test.data/g' cesium/config.js
sed -i 's/"g1"/"g1-test"/g' cesium-desktop.js
sed -i 's/.config\/cesium\//.config\/cesium-g1-test\//g' cesium-desktop.js
sed -i 's/config\.js/config-test.js/g' cesium/index.html
sed -i 's/"cesium"/"cesium-test"/g' cesium-desktop.js
sed -i 's/"Cesium"/"Cesium Ğ1-Test"/g' cesium-desktop.js
# Change title of Cesium classic
cd "$CESIUM_ROOT/nw/"
sed -i 's/Cesium/Cesium Ğ1/g' splash.html
sed -i 's/Cesium/Cesium Ğ1/g' cesium/index.html
sed -i 's/"Cesium"/"Cesium Ğ1"/g' cesium-desktop.js
#!/bin/bash
[[ -f /usr/bin/cesium ]] && rm /usr/bin/cesium
[[ -f /usr/bin/cesium-g1-test ]] && rm /usr/bin/cesium-g1-test
[[ -f /usr/bin/cesium-desktop ]] && rm -f /usr/bin/cesium-desktop
[[ -f /usr/bin/cesium-test ]] && rm /usr/bin/cesium-test
[[ -d /opt/cesium ]] && rm -Rf /opt/cesium
[[ -d /opt/cesium-g1-test ]] && rm -Rf /opt/cesium-g1-test
[[ -d /opt/cesium-test ]] && rm -Rf /opt/cesium-test
[Desktop Entry]
Name=Cesium Ğ1-Test
Exec=cesium-g1-test
Exec=cesium-test
Icon=/opt/cesium/nw/cesium/img/logo.png
Type=Application
Categories=Utility
[Desktop Entry]
Type=Application
Name=Cesium Ğ1
Exec=cesium
Icon=/opt/cesium/nw/cesium/img/logo.png
Type=Application
Categories=Utility
cesium-desktop (1.7.12) stable; urgency=low
[ Duniter Team ]
* Upgrade to NW.js v0.83.0 (Chromium 120)
-- Duniter Team <contact@duniter.org> Wed, 3 Jan 2024 11:30:00 +0100
cesium-desktop
Copyright: 2024 Duniter Team <contact@duniter.org>
2024-01-01
The entire code base may be distributed under the terms of the GNU General
Public License (GPL), which appears immediately below. Alternatively, all
of the source code as any code derived from that code may instead be
distributed under the GNU Lesser General Public License (LGPL), at the
choice of the distributor. The complete text of the LGPL appears at the
bottom of this file.
See /usr/share/common-licenses/GPL-3
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: Cesium
Upstream-Contact: Duniter Team <contact@duniter.org>
Source: https://git.duniter.org/clients/cesium-grp/cesium
Copyright: 2017-2020 Benoit Lavenier
License: GPL-3+
Files: *
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>cesium-desktop</id>
<launchable type="desktop-id">cesium.desktop</launchable>
<metadata_license>GPL-3.0+ o GFDL-1.3-only</metadata_license>
<project_license>GPL-3.0+</project_license>
<name>Cesium</name>
<summary>Wallet for Ğ1 Currency</summary>
<description>
<p>
Cesium is a wallet (client-software) for Ğ1, a libre currency. It allows
users to manage their G1 accounts, send and receive transactions, and view
the history of their operations. Please visit https://www.duniter.org for
more information on G1 and libre currencies.
</p>
</description>
<screenshots>
<screenshot type="default">
<image>https://cesium.app/i18n/en_GB/contents/home/Cesium-G1-mockup.png</image>
<caption>Main interface</caption>
</screenshot>
<screenshot>
<image>https://cesium.app/i18n/en_GB/contents/features/signup.png</image>
<caption>Create your account</caption>
</screenshot>
<screenshot>
<image>https://cesium.app/i18n/en_GB/contents/features/receive-libre-money.png</image>
<caption>Receive</caption>
</screenshot>
<screenshot>
<image>https://cesium.app/i18n/en_GB/contents/features/send-libre-money.png</image>
<caption>Send</caption>
</screenshot>
</screenshots>
<url type="homepage">https://cesium.app</url>
<url type="bugtracker">https://git.duniter.org/clients/cesium-grp/cesium/issues</url>
<url type="help">https://forum.duniter.org/c/support/cesium/37</url>
<url type="donation">https://cesium.app/en/merci</url>
<project_group>DUNITER</project_group>
<developer_name>Duniter Team</developer_name>
<update_contact>contact@duniter.org</update_contact>
<content_rating type="oars-1.1" />
<categories>
<category>Utility</category>
<category>Finance</category>
</categories>
<releases>
<release version="1.7.12" date="2024-01-01">
<description>
<p>New features in Cesium 1.7.12:</p>
<ul>
<li>Upgrade to NW.js v0.83.0 (Chromium 120).</li>
</ul>
</description>
</release>
</releases>
</component>
#!/usr/bin/env bash
HERE="$(dirname "$(readlink -f "${0}")")"
export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"
export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}"
export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}"
# Specify a certain commit if you do not want to use master
# by using:
# export PKG2AICOMMIT=<git sha>
if [ -z "$PKG2AICOMMIT" ] ; then
PKG2AICOMMIT=master
fi
usage() {
if [ -z "$APPIMAGE" ] ; then
MYSELF="$0"
else
MYSELF="$APPIMAGE"
fi
echo "usage:"
echo " $MYSELF [--di] META-NAME|YAMLFILE"
echo ""
echo "options:"
echo " --di enable legacy desktop integration (unsupported)"
exit 1
}
check_dependencies() {
for executable in $@; do
which "${executable}" >/dev/null 2>&1 || {
(echo "${executable} missing"; exit 1)
}
done
}
if [ $# -eq 0 ] || [ "x${!#}" = "x--di" ] ; then
usage
fi
if [ $# -eq 2 ] && [ "x$1" != "x--di" ] ; then
usage
fi
if [ "x$1" = "x--di" ] ; then
ENABLE_DI="yes"
else
ENABLE_DI="no"
fi
# Halt on errors
set -e
set -x
# Check dependencies
check_dependencies \
dpkg \
dpkg-deb \
convert \
wget \
grep \
sed \
cut \
file \
desktop-file-validate \
strings
# If the yaml file doesn't exist locally, get it from GitHub
if [ ! -f "${!#}" ] ; then
YAMLFILE=/tmp/_recipe.yml
rm -f "$YAMLFILE"
wget -q "https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/recipes/${!#}.yml" -O "$YAMLFILE"
else
YAMLFILE=$(readlink -f "${!#}")
fi
# Lightweight bash-only dpkg-scanpackages replacement
scanpackages() {
for deb in *.deb ; do
dpkg -I $deb | sed 's/^ *//g' | grep -i -E '(package|version|installed-size|architecture|depends|priority):'
echo "Filename: $(readlink -f $deb)"
echo "MD5sum: $(md5sum -b $deb | cut -d' ' -f1)"
echo "SHA1: $(sha1sum -b $deb | cut -d' ' -f1)"
echo "SHA256: $(sha256sum -b $deb | cut -d' ' -f1)"
echo
done
}
# Function to parse yaml
# https://gist.github.com/epiloque/8cf512c6d64641bde388
# based on https://gist.github.com/pkuczynski/8665367
parse_yaml() {
local prefix=$2
local s
local w
local fs
s='[[:blank:]]*'
w='[a-zA-Z0-9_]*'
fs="$(echo @|tr @ '\034')"
sed -ne "s|^\($s\)\($w\)$s:$s\"\(.*\)\"$s\$|\1$fs\2$fs\3|p" \
-e "s|^\($s\)\($w\)$s[:-]$s\(.*\)$s\$|\1$fs\2$fs\3|p" "$1" |
awk -F"$fs" '{
indent = length($1)/2;
vname[indent] = $2;
for (i in vname) {if (i > indent) {delete vname[i]}}
if (length($3) > 0) {
vn=""; for (i=0; i<indent; i++) {vn=(vn)(vname[i])("_")}
printf("%s%s%s=(\"%s\")\n", "'"$prefix"'",vn, $2, $3);
}
}' | sed 's/_=/+=/g'
}
# Read yaml file
parse_yaml $YAMLFILE "_"
eval $(parse_yaml $YAMLFILE "_")
if [ ! -z $_enable_di ]; then
ENABLE_DI="$_enable_di"
fi
# Execute multiple script lines together as one
# shell_execute filename key_of_group_of_commands
shell_execute() {
if [ -f /tmp/recipe_script ] ; then
rm /tmp/recipe_script
fi
parse_yaml $YAMLFILE "_" | grep "^$2+=" > /tmp/recipe_script
sed -i -e 's|^'$2'+=("||g' /tmp/recipe_script
sed -i -e 's|")$||g' /tmp/recipe_script
bash -ex /tmp/recipe_script
rm /tmp/recipe_script
}
APP=$_app
LOWERAPP=${APP,,}
if [ ! -z $_lowerapp ] ; then
LOWERAPP=$_lowerapp
fi
mkdir -p ./$APP/$APP.AppDir/usr/lib
cd ./$APP/
if [ -d "./$APP.AppDir/" ] ; then
rm -rf ./$APP.AppDir/
fi
# Source the bundled functions.sh if it exists
# in "${HERE}/usr/share/pkg2appimage/functions.sh"
# or source a user-provided functions.sh if the environment
# variable FUNCTIONS_SH was set and the file exists
if [ -e "${HERE}/usr/share/pkg2appimage/functions.sh" ] ; then
. "${HERE}/usr/share/pkg2appimage/functions.sh"
elif [ -z "$FUNCTIONS_SH" ] ; then
if [ ! -e functions.sh ] ; then
wget -q https://github.com/AppImage/AppImages/raw/${PKG2AICOMMIT}/functions.sh -O ./functions.sh
fi
. ./functions.sh
else
if [ -e "$FUNCTIONS_SH" ] ; then
. "$FUNCTIONS_SH"
fi
fi
# If there is an ARCH environment variable, then use that
# architecture to for apt-get. Not that for the AppImage to be
# operable, we also need to embed a matching AppImage runtime
# and ingredients of that architecture. Debian packages
# should be available for most architectures, e.g., oldstable
# has "armhf"
if [ ! -z "$ARCH" ] ; then
OPTIONS="$OPTIONS -o APT::Architecture=$ARCH"
fi
if [ ! -z "${_ingredients_ghreleases[0]}" ] ; then
for GHREPO in "${_ingredients_ghreleases[@]}" ; do
wget -q "https://github.com/${GHREPO}/releases/" -O /tmp/gh-release.html
DEB=$(cat /tmp/gh-release.html | grep ".deb" | grep x86_64 | head -n 1 | cut -d '"' -f 2)
if [ -z "$DEB" ] ; then
DEB=$(cat /tmp/gh-release.html | grep ".deb" | grep amd64 | head -n 1 | cut -d '"' -f 2)
fi
if [ -z "$DEB" ] ; then
DEB=$(cat /tmp/gh-release.html | grep ".deb" | grep x64 | head -n 1 | cut -d '"' -f 2)
fi
if [ -z "$DEB" ] ; then
DEB=$(cat /tmp/gh-release.html | grep ".deb" | grep linux64 | head -n 1 | cut -d '"' -f 2)
fi
rm /tmp/gh-release.html
wget -c "https://github.com/${DEB}"
done
fi
if [ ! -z "${_ingredients_dist}" ] ; then
rm status 2>/dev/null || true
generate_status
# Some packages depend on packages which we do not want to bundle,
# in addition to the global excludes defined in excludedeblist.
# Use
# ingredients:
# exclude:
# - packagename
if [ ! -z "${_ingredients_exclude[0]}" ] ; then
for PACKAGE in "${_ingredients_exclude[@]}" ; do
printf "Package: $PACKAGE\nStatus: install ok installed\nArchitecture: all\nVersion: 9:999.999.999\n\n" >> status
done
fi
# Some packages depend on an exact version of a dependency to be installed.
# Use
# ingredients:
# pretend:
# - packagename version_to_be_pretended
if [ ! -z "${_ingredients_pretend[0]}" ] ; then
for PRETEND in "${_ingredients_pretend[@]}" ; do
P_PKG=$(echo "$PRETEND" | cut -d " " -f 1)
P_VER=$(echo "$PRETEND" | cut -d " " -f 2)
cat status | tr '\n' '@' | sed -e 's|@@|\n\n|g' | sed -e 's|Package: '"$P_PKG"'@Status: install ok installed@Architecture: all@Version: 9:999.999.999|Package: '"$P_PKG"'@Status: install ok installed@Architecture: all@Version: '"$P_VER"'|g' | sed -e 's|@|\n|g' > status.temp
mv status.temp status
done
fi
if [ -e sources.list ] ; then
rm sources.list
fi
for PPA in "${_ingredients_ppas[@]}" ; do
echo "deb http://ppa.launchpad.net/${PPA}/ubuntu/ ${_ingredients_dist} main" >> sources.list
done
for SOURCE in "${_ingredients_sources[@]}" ; do
echo "${SOURCE}" >> sources.list
done
for DEBFILE in "${_ingredients_debs[@]}" ; do
cp ${DEBFILE} .
done
# Use libcurl-slim to reduce AppImage size, thanks darealshinji
# Not really compiled on xenial but CentOS 6, https://github.com/AppImage/AppImages/issues/187
echo "deb http://ppa.launchpad.net/djcj/libcurl-slim/ubuntu xenial main" >> sources.list
# Use gnutls-patched to have libgnutls look in various distributions' places for certificates,
# https://github.com/darealshinji/vlc-AppImage/issues/1#issuecomment-321041496
# echo "deb http://ppa.launchpad.net/djcj/gnutls-patched/ubuntu ${_ingredients_dist} main" >> sources.list
### echo "deb http://ppa.launchpad.net/djcj/gnutls-patched/ubuntu trusty main" >> sources.list # https://github.com/AppImage/pkg2appimage/issues/345
fi
if [ ! -z "${_ingredients_script[0]}" ] ; then
# Execute extra steps defined in recipe
shell_execute $YAMLFILE _ingredients_script
fi
if [ ! -z "${_ingredients_dist}" ] ; then
# Some projects provide raw .deb files without a repository
# hence we create our own local repository as part of
# the AppImage creation process in order to "install"
# the package using apt-get as normal
if [ ! -z "${_ingredients_debs[0]}" ] ; then
for DEB in "${_ingredients_debs[@]}" ; do
if [ ! -f $(basename "$DEB") ] ; then
wget -c $DEB
fi
done
fi
scanpackages | gzip -9c > Packages.gz
echo "deb file:$(readlink -e $PWD) ./" >> sources.list
INSTALL=$LOWERAPP
if [ ! -z "${_ingredients_package}" ] ; then
INSTALL="${_ingredients_package}"
fi
if [ ! -z "${_ingredients_packages}" ] ; then
INSTALL=""
fi
# If packages are specifically listed, only install these, not a package with the name of the app
if [ ! -z "${_ingredients_packages[0]}" ] ; then
INSTALL=${_ingredients_packages[@]}
fi
# apt-get -o Acquire::AllowInsecureRepositories=true -o Acquire::Languages="none" -o Acquire::AllowDowngradeToInsecureRepositories=true $OPTIONS update || true
# URLS=$(apt-get --allow-unauthenticated -o Apt::Get::AllowUnauthenticated=true $OPTIONS -y install --print-uris $INSTALL | cut -d "'" -f 2 | grep -e "^http") || true
# if which aria2c &>/dev/null; then
# dltool=aria2c
# else
# dltool=wget
# fi
# $dltool -c -i- <<<"$URLS"
set +x
apt-get.update
INSTALL=$(echo "${INSTALL}" | sed "s| |\n|g")
for pkg in ${INSTALL}; do
apt-get.do-download ${pkg}
done
set -x
fi
if [ ! -z "${_ingredients_post_script[0]}" ] ; then
# Execute extra steps defined in recipe
shell_execute $YAMLFILE _ingredients_post_script
fi
mkdir -p ./$APP.AppDir/
cd ./$APP.AppDir/
mkdir -p usr/bin usr/lib
find ../*.deb -exec dpkg-deb -X {} . \; || true
unset LD_PRELOAD
# Try to copy icons to standard locations where appimaged can pick them up
mkdir -p usr/share/icons/hicolor/{22x22,24x24,32x32,48x48,64x64,128x128,256x256,512x512}/apps/
find . -path *icons* -path *22* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/22x22/apps/ \; || true
find . -path *icons* -path *24* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/24x24/apps/ \; || true
find . -path *icons* -path *32* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/32x32/apps/ \; || true
find . -path *icons* -path *48* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/48x48/apps/ \; || true
find . -path *icons* -path *64* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/64x64/apps/ \; || true
find . -path *icons* -path *128* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/128x128/apps/ \; || true
find . -path *icons* -path *256* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/256x256/apps/ \; || true
find . -path *icons* -path *512* -name "*$LOWERAPP*" -exec cp {} usr/share/icons/hicolor/512x512/apps/ \; || true
get_icon
if [ -z "${_union}" ] ; then
get_apprun
else
cat > AppRun <<\EOF
#!/bin/sh
HERE="$(dirname "$(readlink -f "${0}")")"
export UNION_PRELOAD="${HERE}"
export LD_PRELOAD="${HERE}/libunionpreload.so"
export PATH="${HERE}"/usr/bin/:"${HERE}"/usr/sbin/:"${HERE}"/usr/games/:"${HERE}"/bin/:"${HERE}"/sbin/:"${PATH}"
export LD_LIBRARY_PATH="${HERE}"/usr/lib/:"${HERE}"/usr/lib/i386-linux-gnu/:"${HERE}"/usr/lib/x86_64-linux-gnu/:"${HERE}"/usr/lib32/:"${HERE}"/usr/lib64/:"${HERE}"/lib/:"${HERE}"/lib/i386-linux-gnu/:"${HERE}"/lib/x86_64-linux-gnu/:"${HERE}"/lib32/:"${HERE}"/lib64/:"${LD_LIBRARY_PATH}"
export PYTHONPATH="${HERE}"/usr/share/pyshared/:"${PYTHONPATH}"
export PYTHONHOME="${HERE}"/usr/
export XDG_DATA_DIRS="${HERE}"/usr/share/:"${XDG_DATA_DIRS}"
export PERLLIB="${HERE}"/usr/share/perl5/:"${HERE}"/usr/lib/perl5/:"${PERLLIB}"
export GSETTINGS_SCHEMA_DIR="${HERE}"/usr/share/glib-2.0/schemas/:"${GSETTINGS_SCHEMA_DIR}"
export QT_PLUGIN_PATH="${HERE}"/usr/lib/qt4/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt4/plugins/:"${HERE}"/usr/lib32/qt4/plugins/:"${HERE}"/usr/lib64/qt4/plugins/:"${HERE}"/usr/lib/qt5/plugins/:"${HERE}"/usr/lib/i386-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib/x86_64-linux-gnu/qt5/plugins/:"${HERE}"/usr/lib32/qt5/plugins/:"${HERE}"/usr/lib64/qt5/plugins/:"${QT_PLUGIN_PATH}"
EXEC=$(grep -e '^Exec=.*' "${HERE}"/*.desktop | head -n 1 | cut -d "=" -f 2- | sed -e 's|%.||g')
exec ${EXEC} "$@"
EOF
chmod a+x AppRun
fi
get_desktop
# Prevent Qt from loading plugins from the system
unset QTPATH
QTPATH=$(find usr/lib -type d -name qt4 -or -name qt5 | sed -e 's|usr/|../|g')
if [ ! -z $QTPATH ] ; then
cat > usr/bin/qt.conf <<EOF
[Paths]
Prefix = $QTPATH
EOF
fi
# http://www.mono-project.com/docs/advanced/assemblies-and-the-gac/
# At runtime, Mono looks in three places for assemblies necessary
# to run a program. It first searches the location of the executing assembly.
# For this to work without setting $MONO_PATH, we need to move the
# main *.exe to usr/lib/mono/exe, because we move all "assemblies" (sic)
# there in this script
if [ -e usr/lib/mono ] ; then
# Force all so files referenced in config files into LD_LIBRARY_PATH
find . -name "*.dll.config" -exec cat {} > temp \;
# Remove all absolute paths
sed -i -E 's|target=\"\/(.*\/)([a-z0-9].*?)>|target=\"\2>|g' temp
SONAMES=$(cat temp | cut -d '"' -f 4 | grep ".so" || true)
if [ "" != "$SONAMES" ] ; then
for SONAME in $SONAMES; do
find . -name "$SONAME" -exec mv {} usr/lib \;
done
fi
rm temp
PATH_OF_THE_EXE="usr/lib/mono/exe"
mkdir -p "$PATH_OF_THE_EXE"
# Force all dll files into PATH_OF_THE_EXE (or MONO_PATH which we would have to set)
find . -name "*.dll" -and -not -name "mscorlib.dll" -exec mv {} "$PATH_OF_THE_EXE" \;
# Edit all config files in place to remove absolute paths
find . -name "*.dll.config" -exec sed -i -E 's|target=\"\/(.*\/)([a-z0-9].*?)>|target=\"\2>|g' {} \;
# Force all config files into the PATH_OF_THE_EXE (or MONO_PATH which we would have to set)
find . -name "*.dll.config" -exec mv {} "$PATH_OF_THE_EXE" \;
# Remove gac, we are not using it since it is convoluted
rm -rf usr/lib/mono/gac/
fi
if [ -d "./usr/lib/x86_64-linux-gnu/gstreamer-1.0/" ] ; then
mv ./usr/lib/x86_64-linux-gnu/gstreamer-1.0/* ./usr/lib/x86_64-linux-gnu/
rm -r ./usr/lib/x86_64-linux-gnu/gstreamer-1.0
fi
if [ -d "./usr/lib/x86_64-linux-gnu/pulseaudio/" ] ; then
mv ./usr/lib/x86_64-linux-gnu/pulseaudio/* ./usr/lib/x86_64-linux-gnu/
rm -r ./usr/lib/x86_64-linux-gnu/pulseaudio
fi
# Execute extra steps defined in recipe
if [ ! -z "${_script}" ] ; then
shell_execute $YAMLFILE _script
fi
DESKTOP=$(find . -name '*.desktop' | sort | head -n 1)
# desktop-file-validate complains about missing trailing semicolons for some
# keys although the format definition says that they are optional
fix_desktop "$DESKTOP"
# Some non-distribution provided applications have an absolute
# path in the Exec= line which we remove for relocateability
if [ -z "$DESKTOP" ] ; then
echo "desktop file not found, aborting"
exit 1
else
desktop-file-validate "$DESKTOP" || exit 1
ORIG=$(grep -o "^Exec=.*$" "${DESKTOP}" | head -n 1| cut -d " " -f 1)
REPL=$(basename $(grep -o "^Exec=.*$" "${DESKTOP}" | head -n 1 | cut -d " " -f 1 | sed -e 's|Exec=||g'))
sed -i -e 's|'"${ORIG}"'|Exec='"${REPL}"'|g' "${DESKTOP}"
fi
# Compile GLib schemas if the subdirectory is present in the AppImage
# AppRun has to export GSETTINGS_SCHEMA_DIR for this to work
if [ -d usr/share/glib-2.0/schemas/ ] ; then
( cd usr/share/glib-2.0/schemas/ ; glib-compile-schemas . )
fi
if [ -f ../VERSION ] ; then
VERSION=$(cat ../VERSION)
else
get_version || true
fi
# patch_usr
# Patching only the executable files seems not to be enough for some apps
if [ ! -z "${_binpatch}" ] ; then
find usr/ -type f -exec sed -i -e 's|/usr|././|g' {} \;
find usr/ -type f -exec sed -i -e 's@././/bin/env@/usr/bin/env@g' {} \;
fi
# Don't suffer from NIH; use LD_PRELOAD to override calls to /usr paths
if [ ! -z "${_union}" ] ; then
mkdir -p usr/src/
wget -q "https://raw.githubusercontent.com/mikix/deb2snap/master/src/preload.c" -O - | \
sed -e 's|SNAPPY|UNION|g' | sed -e 's|SNAPP|UNION|g' | sed -e 's|SNAP|UNION|g' | \
sed -e 's|snappy|union|g' > usr/src/libunionpreload.c
gcc -shared -fPIC usr/src/libunionpreload.c -o libunionpreload.so -ldl -DUNION_LIBNAME=\"libunionpreload.so\"
strip libunionpreload.so
fi
delete_blacklisted
if [ "$ENABLE_DI" = "yes" ] ; then
get_desktopintegration $LOWERAPP
fi
# Fix desktop files that have file endings for icons
sed -i -e 's|\.png||g' *.desktop || true
sed -i -e 's|\.svg||g' *.desktop || true
sed -i -e 's|\.svgz||g' *.desktop || true
sed -i -e 's|\.xpm||g' *.desktop || true
# Setting PYTHONHOME instead
# Fix Python imports,
# https://github.com/AppImage/AppImages/issues/172
# SITECUSTOMIZEFILES=$(find . -name "sitecustomize.py")
# for SITECUSTOMIZEFILE in $SITECUSTOMIZEFILES ; do
# rm $SITECUSTOMIZEFILE # Remove symlinks, replace by files
# cat > $SITECUSTOMIZEFILE <<\EOF
# import sys,os
# if sys.version_info[0] < 3:
# prefix = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(sys.path[0]))))
# sys.path = [ prefix+s for s in sys.path if not s.startswith(prefix) ]
# EOF
# done
# Execute extra steps defined in recipe
if [ ! -z "${_post_script[0]}" ] ; then
shell_execute $YAMLFILE _post_script
fi
# Go out of AppImage
cd ..
if [ -z "${_updateinformation}" ] ; then
generate_type2_appimage
else
generate_type2_appimage -u "${_updateinformation}"
fi
ls -lh ../out/*.AppImage
......@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="viewport-fit=cover,width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=yes,width=device-width,minimal-ui">
<title>Cesium</title>
<title>Cesium loading...</title>
<link rel="stylesheet" href="cesium/dist_css/cesium.css">
......
#!/bin/bash
# NVM
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
# Node.js
nvm install 10
nvm install 18
# node-pre-gyp
npm install -g nw-gyp node-pre-gyp