Browse Source

Removing some unused and old stuff

dev
fekt 2 months ago
parent
commit
1878701ab1
  1. 2
      application.qrc
  2. 13
      res/appdmg.json
  3. BIN
      res/connectoverinternetcheckbox.png
  4. BIN
      res/dmgbg.png
  5. BIN
      res/hushdlogo.gif
  6. BIN
      res/images/sapling paper.png
  7. 38
      res/mkicns.sh
  8. BIN
      res/new-sdl-logo.gif
  9. 6
      res/resize.sh
  10. BIN
      res/sdl-logo.gif
  11. BIN
      res/silentdragonxlite-animated-startup.gif
  12. BIN
      res/wormholeconnect.png
  13. BIN
      res/wxsbanner.bmp
  14. BIN
      res/wxsdialog.bmp
  15. 78
      src/scripts/SilentDragonLite.wxs
  16. 7
      src/scripts/control
  17. 13
      src/scripts/desktopentry
  18. 61
      src/scripts/dobuild.ps1
  19. 62
      src/scripts/docker/Dockerfile
  20. 17
      src/scripts/dotranslations.sh
  21. 104
      src/scripts/dounifiedbuild.ps1
  22. 116
      src/scripts/mkmacdmg.sh
  23. 166
      src/scripts/mkrelease.sh
  24. 26
      src/scripts/mkwininstaller.ps1
  25. 53
      src/scripts/signbinaries.sh
  26. 19
      src/scripts/translation_analysis.sh

2
application.qrc

@ -51,10 +51,8 @@
</qresource>
<qresource prefix="/img">
<file>res/hushdlogo.png</file>
<file>res/hushdlogo.gif</file>
<file>res/silentdragonxlite-animated.gif</file>
<file>res/silentdragonxlite-animated-dark.gif</file>
<file>res/silentdragonxlite-animated-startup.gif</file>
<file>res/silentdragonxlite-animated-startup-dark.gif</file>
<file>res/loaderblack.gif</file>
<file>res/loaderwhite.gif</file>

13
res/appdmg.json

@ -1,13 +0,0 @@
{
"title": "silentdragon-vRELEASE_VERSION",
"icon": "logo.icns",
"background": "dmgbg.png",
"window" : {
"size" : { "width" : 600, "height" : 100},
"position" : { "x" : 200, "y" : 200}
},
"contents": [
{ "x": 448, "y": 80, "type": "link", "path": "/Applications" },
{ "x": 152, "y": 80, "type": "file", "path": "silentdragon.app" }
]
}

BIN
res/connectoverinternetcheckbox.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

BIN
res/dmgbg.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

BIN
res/hushdlogo.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

BIN
res/images/sapling paper.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

38
res/mkicns.sh

@ -1,38 +0,0 @@
#!/usr/bin/env bash
###
# Adapted from: https://stackoverflow.com/a/20703594
###
if [ -z "${1+set}" ]; then
echo "Pass path to the inkscape command as first argument"
exit 1
fi
if [ -z "${2+set}" ]; then
echo "Pass svg file as second argument"
exit 1
fi
if [ -z "${3+set}" ]; then
echo "Pass output name (w/o .icns) as third argument"
exit 1
fi
inkscape=$1
svg_file=$2
output_name=$3
set -e
mkdir $output_name.iconset
$inkscape -z -e "$PWD/$output_name.iconset/icon_16x16.png" -w 16 -h 16 -y 0 "$PWD/$svg_file"
$inkscape -z -e "$PWD/$output_name.iconset/icon_16x16@2x.png" -w 32 -h 32 -y 0 "$PWD/$svg_file"
$inkscape -z -e "$PWD/$output_name.iconset/icon_32x32.png" -w 32 -h 32 -y 0 "$PWD/$svg_file"
$inkscape -z -e "$PWD/$output_name.iconset/icon_32x32@2x.png" -w 64 -h 64 -y 0 "$PWD/$svg_file"
$inkscape -z -e "$PWD/$output_name.iconset/icon_128x128.png" -w 128 -h 128 -y 0 "$PWD/$svg_file"
$inkscape -z -e "$PWD/$output_name.iconset/icon_128x128@2x.png" -w 256 -h 256 -y 0 "$PWD/$svg_file"
$inkscape -z -e "$PWD/$output_name.iconset/icon_256x256.png" -w 256 -h 256 -y 0 "$PWD/$svg_file"
$inkscape -z -e "$PWD/$output_name.iconset/icon_256x256@2x.png" -w 512 -h 512 -y 0 "$PWD/$svg_file"
$inkscape -z -e "$PWD/$output_name.iconset/icon_512x512.png" -w 512 -h 512 -y 0 "$PWD/$svg_file"
$inkscape -z -e "$PWD/$output_name.iconset/icon_512x512@2x.png" -w 1024 -h 1024 -y 0 "$PWD/$svg_file"
iconutil -c icns "$output_name.iconset"
rm -R "$output_name.iconset"

BIN
res/new-sdl-logo.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 75 KiB

6
res/resize.sh

@ -1,6 +0,0 @@
#!/bin/bash
for size in 16 32 48 128 256; do
inkscape -z -e $size.png -w $size -h $size logo.svg >/dev/null 2>/dev/null
done
convert 16.png 32.png 48.png 128.png 256.png -colors 256 icon.ico
rm 16.png 32.png 48.png 128.png 256.png

BIN
res/sdl-logo.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 30 KiB

BIN
res/silentdragonxlite-animated-startup.gif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1015 KiB

BIN
res/wormholeconnect.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

BIN
res/wxsbanner.bmp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 84 KiB

BIN
res/wxsdialog.bmp

Binary file not shown.

Before

Width:  |  Height:  |  Size: 451 KiB

78
src/scripts/SilentDragonLite.wxs

@ -1,78 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="SilentDragonXLite vRELEASE_VERSION" Language="1033" Version="RELEASE_VERSION" Manufacturer="silentdragonxlite-org" UpgradeCode="fb9bf166-b55f-46b5-a990-9189bdf64533">
<Package InstallerVersion="200" Compressed="yes" InstallScope="perMachine" />
<MajorUpgrade DowngradeErrorMessage="A newer version of [ProductName] is already installed." />
<MediaTemplate EmbedCab="yes"/>
<Icon Id="SilentDragonXLite.exe" SourceFile="res/icon.ico"/>
<Property Id="ARPPRODUCTICON" Value="SilentDragonXLite.exe" />
<Feature Id="ProductFeature" Title="silentdragonxlite" Level="1">
<ComponentGroupRef Id="ProductComponents" />
<ComponentRef Id="ProgramMenuDir"/>
</Feature>
<Property Id="WIXUI_INSTALLDIR" Value="INSTALLFOLDER" />
<WixVariable Id="WixUIBannerBmp" Value="res/wxsbanner.bmp" />
<WixVariable Id="WixUIDialogBmp" Value="res/wxsdialog.bmp" />
<UI>
<UIRef Id="WixUI_InstallDir" />
<Publish Dialog="WelcomeDlg"
Control="Next"
Event="NewDialog"
Value="InstallDirDlg"
Order="2">1</Publish>
<Publish Dialog="InstallDirDlg"
Control="Back"
Event="NewDialog"
Value="WelcomeDlg"
Order="2">1</Publish>
</UI>
</Product>
<Fragment>
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
<Directory Id="INSTALLFOLDER" Name="silentdragonxlite" />
</Directory>
<Directory Id="ProgramMenuFolder" Name="Programs">
<Directory Id="ApplicationProgramsFolder" Name="silentdragonxlite">
<Component Id="ProgramMenuDir" Guid="0D560F5A-53E0-4E7E-ADDA-15A26995505E">
<RemoveFolder Id="ProgramMenuDir" On="uninstall"/>
<RegistryValue Root="HKCU" Key="Software\[Manufacturer]\silentdragonxlite\WixSetup"
Type="integer" Value="1" Name="installed" KeyPath="yes" />
</Component>
</Directory>
</Directory>
</Directory>
</Fragment>
<Fragment>
<ComponentGroup Id="ProductComponents" Directory="INSTALLFOLDER">
<Component Id="ProductComponent" Guid="0D210F5A-53E0-4E7E-CAAD-15A26995505E">
<File Source="SilentDragonXLite.exe" KeyPath="yes">
<Shortcut Id="startMenuShotcut" Advertise="yes" Directory="ApplicationProgramsFolder"
Name="SilentDragonXLite" WorkingDirectory="INSTALLFOLDER" Icon="SilentDragonXLite.exe" >
</Shortcut>
</File>
<File Source="LICENSE" />
<RegistryKey Root="HKCR" Key="hush">
<RegistryValue Type="string" Name="URL Protocol" Value=""/>
<RegistryValue Type="string" Value="URL:hush URI protocol"/>
<RegistryKey Key="DefaultIcon">
<RegistryValue Type="string" Value="SilentDragonXLite.exe" />
</RegistryKey>
<RegistryKey Key="shell\open\command">
<RegistryValue Type="string" Value="&quot;[INSTALLFOLDER]SilentDragonXLite.exe&quot; &quot;%1&quot;" />
</RegistryKey>
</RegistryKey>
</Component>
</ComponentGroup>
</Fragment>
</Wix>

7
src/scripts/control

@ -1,7 +0,0 @@
Package: SilentDragonXLite
Version: RELEASE_VERSION
Section: base
Priority: optional
Architecture: amd64
Maintainer: DenioD <admin@hush-lightwallet.de>
Description: SilentDragonXLite is a Lightwallet for Dragonx.

13
src/scripts/desktopentry

@ -1,13 +0,0 @@
[Desktop Entry]
Name=SilentDragonXLite
Comment=Lightclient UI wallet for DragonX
GenericName=Wallet
Exec=/usr/local/bin/SilentDragonXLite %u
Icon=SilentDragonXLite.xpm
Type=Application
StartupNotify=true
StartupWMClass=SilentDragonXLite
Categories=Utility;
MimeType=x-scheme-handler/dragonx;
Keywords=SilentDragonXLite;

61
src/scripts/dobuild.ps1

@ -1,61 +0,0 @@
# Unified build script for Windows, Linux and Mac builder. Run on a Windows machine inside powershell.
param (
[Parameter(Mandatory=$true)][string]$version,
[Parameter(Mandatory=$true)][string]$prev,
[Parameter(Mandatory=$true)][string]$server
)
Write-Host "[Initializing]"
Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-binaries-silentdragonxlite-v$version.tar.gz
Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-deb-silentdragonxlite-v$version.deb
Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-binaries-silentdragonxlite-v$version.zip
Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-installer-silentdragonxlite-v$version.msi
Remove-Item -Force -ErrorAction Ignore ./artifacts/macOS-silentdragonxlite-v$version.dmg
Remove-Item -Recurse -Force -ErrorAction Ignore ./bin
Remove-Item -Recurse -Force -ErrorAction Ignore ./debug
Remove-Item -Recurse -Force -ErrorAction Ignore ./release
# Create the version.h file and update README version number
Write-Output "#define APP_VERSION `"$version`"" > src/version.h
Get-Content README.md | Foreach-Object { $_ -replace "$prev", "$version" } | Out-File README-new.md
Move-Item -Force README-new.md README.md
Write-Host ""
Write-Host "[Building Linux + Windows]"
Write-Host -NoNewline "Copying files.........."
ssh $server "rm -rf /tmp/zqwbuild"
ssh $server "mkdir /tmp/zqwbuild"
scp -r src/ res/ ./silentdragonxlite.pro ./application.qrc ./LICENSE ./README.md ${server}:/tmp/zqwbuild/ | Out-Null
ssh $server "dos2unix -q /tmp/zqwbuild/src/scripts/mkrelease.sh" | Out-Null
ssh $server "dos2unix -q /tmp/zqwbuild/src/version.h"
Write-Host "[OK]"
ssh $server "cd /tmp/zqwbuild && APP_VERSION=$version PREV_VERSION=$prev bash src/scripts/mkrelease.sh"
if (!$?) {
Write-Output "[Error]"
exit 1;
}
New-Item artifacts -itemtype directory -Force | Out-Null
scp ${server}:/tmp/zqwbuild/artifacts/* artifacts/ | Out-Null
scp -r ${server}:/tmp/zqwbuild/release . | Out-Null
Write-Host -NoNewline "Building Installer....."
src/scripts/mkwininstaller.ps1 -version $version 2>&1 | Out-Null
if (!$?) {
Write-Output "[Error]"
exit 1;
}
Write-Host "[OK]"
# Finally, test to make sure all files exist
Write-Host -NoNewline "Checking Build........."
if (! (Test-Path ./artifacts/linux-binaries-silentdragonxlite-v$version.tar.gz) -or
! (Test-Path ./artifacts/linux-deb-silentdragonxlite-v$version.deb) -or
! (Test-Path ./artifacts/Windows-binaries-silentdragonxlite-v$version.zip) -or
! (Test-Path ./artifacts/Windows-installer-silentdragonxlite-v$version.msi) ) {
Write-Host "[Error]"
exit 1;
}
Write-Host "[OK]"

62
src/scripts/docker/Dockerfile

@ -1,62 +0,0 @@
FROM ubuntu:16.04
LABEL Description="Ubuntu 16.04 for static Qt 5.11.2"
# Dependencies of the Qt offline installer
RUN apt-get -y update && apt-get install -y \
curl libdbus-1-3 libexpat1 \
libgl1-mesa-dev libglu1-mesa-dev libfontconfig1-dev libssl-dev \
libfreetype6 libgl1-mesa-glx libglib2.0-0 \
libx11-6 libx11-xcb1 \
g++ build-essential cmake wget git clang++-6.0 \
software-properties-common \
autoconf automake autopoint bison flex gperf libtool libtool-bin intltool lzip python ruby unzip p7zip-full libgdk-pixbuf2.0-dev libltdl-dev
# Hack to make clang work with Qt
RUN ln -s /usr/bin/clang++-6.0 /usr/bin/clang++ && \
ln -s /usr/bin/clang-6.0 /usr/bin/clang
# Get OpenSSL
RUN cd /opt && wget https://www.openssl.org/source/openssl-1.0.2r.tar.gz && \
tar xvf openssl-1.0.2r.tar.gz && \
cd openssl-1.0.2r && ./Configure linux-x86_64 && make -j$(nproc) && \
cd /opt && rm openssl-1.0.2r.tar.gz
# Get Qt5.11.2
RUN cd /opt && \
wget https://download.qt.io/archive/qt/5.11/5.11.2/single/qt-everywhere-src-5.11.2.tar.xz && \
tar xvf qt-everywhere-src-5.11.2.tar.xz && \
cd qt-everywhere-src-5.11.2 && \
OPENSSL_LIBS='-L/opt/openssl-1.0.2r -lssl -lcrypto' ./configure -static -prefix /opt/Qt/5.11.2/static -skip qtlocation -skip qtmacextras -skip qtpurchasing -skip qtscript -skip qtsensors -skip qtserialbus -skip qtserialport -skip qtspeech -skip qtdatavis3d -skip qtdoc -skip qtcharts -skip qtdeclarative -skip qt3d -skip qtwebengine -skip qtandroidextras -skip qtwebview -skip qtgamepad -skip qtquickcontrols -skip qtquickcontrols2 -skip qtremoteobjects -skip qtwebview -skip qtwebchannel -skip qtwebglplugin -nomake examples -nomake tests -qt-zlib -qt-libpng -qt-xcb -qt-xkbcommon -feature-fontconfig -no-feature-getentropy -release -openssl-linked -platform linux-clang -opensource -confirm-license
# Run the make multiple times, because for some reason (multithreading, probably) it fails
# the first time.
RUN cd /opt/qt-everywhere-src-5.11.2 && ( make -j$(nproc) || make -j4 || make )
RUN mkdir -p /opt/Qt/5.11.2 && cd /opt/qt-everywhere-src-5.11.2 && make -j4 install
RUN cd /opt && rm qt-everywhere-src-5.11.2.tar.xz && rm -rf qt-everywhere-src-5.11.2
# Get and build MXE
RUN cd /opt && \
git clone https://github.com/mxe/mxe.git && \
cd /opt/mxe && \
make -j$(nproc) MXE_TARGETS=x86_64-w64-mingw32.static qtbase
# Add rust
RUN apt install -y gcc-aarch64-linux-gnu
RUN curl https://sh.rustup.rs -sSf | sh -s -- --default-toolchain 1.38.0 -y
RUN echo 'source $HOME/.cargo/env' >> $HOME/.bashrc
RUN ~/.cargo/bin/rustup target add x86_64-pc-windows-gnu
RUN ~/.cargo/bin/rustup target add aarch64-unknown-linux-gnu
# Append the linker to the cargo config for Windows cross compile
RUN echo "[target.x86_64-pc-windows-gnu]" >> ~/.cargo/config && \
echo "linker = 'x86_64-w64-mingw32.static-gcc'" >> ~/.cargo/config
RUN echo "[target.aarch64-unknown-linux-gnu]" >> ~/.cargo/config && \
echo "linker = '/usr/bin/aarch64-linux-gnu-gcc'" >> ~/.cargo/config
ENV CC_x86_64_pc_windows_gnu="x86_64-w64-mingw32.static-gcc"
ENV CC_aarch64_unknown_linux_gnu="aarch64-linux-gnu-gcc"
ENV PATH="/opt/mxe/usr/bin:${PATH}"

17
src/scripts/dotranslations.sh

@ -1,17 +0,0 @@
#!/bin/bash
if [ -z $QT_STATIC ]; then
echo "QT_STATIC is not set. Please set it to the base directory of a statically compiled Qt";
exit 1;
fi
rm -f res/*.qm
$QT_STATIC/bin/lrelease silentdragon-lite.pro
# Then update the qt base translations. First, get all languages
ls res/*.qm | awk -F '[_.]' '{print $4}' | while read -r language ; do
if [ -f $QT_STATIC/translations/qtbase_$language.qm ]; then
$QT_STATIC/bin/lconvert -o res/zec_$language.qm $QT_STATIC/translations/qtbase_$language.qm res/silentdragonxlite_$language.qm
mv res/zec_$language.qm res/silentdragonxlite_$language.qm
fi
done

104
src/scripts/dounifiedbuild.ps1

@ -1,104 +0,0 @@
# Unified build script for Windows, Linux and Mac builder. Run on a Windows machine inside powershell.
param (
[Parameter(Mandatory=$true)][string]$version,
[Parameter(Mandatory=$true)][string]$prev,
[Parameter(Mandatory=$true)][string]$certificate,
[Parameter(Mandatory=$true)][string]$server,
[Parameter(Mandatory=$true)][string]$winserver
)
Write-Host "[Initializing]"
Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-binaries-SilentDragonXLite-v$version.tar.gz
Remove-Item -Force -ErrorAction Ignore ./artifacts/linux-deb-SilentDragonXLite-v$version.deb
Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-binaries-SilentDragonXLite-v$version.zip
Remove-Item -Force -ErrorAction Ignore ./artifacts/Windows-installer-SilentDragonXLite-v$version.msi
Remove-Item -Force -ErrorAction Ignore ./artifacts/macOS-SilentDragonXLite-v$version.dmg
Remove-Item -Force -ErrorAction Ignore ./artifacts/signatures-v$version.tar.gz
Remove-Item -Recurse -Force -ErrorAction Ignore ./bin
Remove-Item -Recurse -Force -ErrorAction Ignore ./debug
Remove-Item -Recurse -Force -ErrorAction Ignore ./release
# Create the version.h file and update README version number
Write-Output "#define APP_VERSION `"$version`"" > src/version.h
Get-Content README.md | Foreach-Object { $_ -replace "$prev", "$version" } | Out-File README-new.md
Move-Item -Force README-new.md README.md
Write-Host ""
Write-Host "[Building on Mac]"
bash src/scripts/mkmacdmg.sh --qt_path ~/Qt/5.11.1/clang_64/ --version $version --certificate "$certificate"
if (! $?) {
Write-Output "[Error]"
exit 1;
}
Write-Host ""
Write-Host "[Building Linux + Windows]"
Write-Host -NoNewline "Copying files.........."
# Cleanup some local files to aid copying
rm -rf lib/target/
ssh $server "rm -rf /tmp/zqwbuild"
ssh $server "mkdir /tmp/zqwbuild"
scp -r src/ singleapplication/ res/ ./silentdragon-lite.pro ./application.qrc ./LICENSE ./README.md ${server}:/tmp/zqwbuild/ | Out-Null
ssh $server "dos2unix -q /tmp/zqwbuild/src/scripts/mkrelease.sh" | Out-Null
ssh $server "dos2unix -q /tmp/zqwbuild/src/version.h"
Write-Host "[OK]"
ssh $server "cd /tmp/zqwbuild && APP_VERSION=$version PREV_VERSION=$prev bash src/scripts/mkrelease.sh"
if (!$?) {
Write-Output "[Error]"
exit 1;
}
New-Item artifacts -itemtype directory -Force | Out-Null
scp ${server}:/tmp/zqwbuild/artifacts/* artifacts/ | Out-Null
scp -r ${server}:/tmp/zqwbuild/release . | Out-Null
Write-Host -NoNewline "Building Installer....."
ssh $winserver "Remove-Item -Path zqwbuild -Recurse" | Out-Null
ssh $winserver "New-Item zqwbuild -itemtype directory" | Out-Null
# Note: For some mysterious reason, we can't seem to do a scp from here to windows machine.
# So, we'll ssh to windows, and execute an scp command to pull files from here to there.
# Same while copying the built msi. A straight scp pull from windows to here doesn't work,
# so we ssh to windows, and then scp push the file to here.
$myhostname = (ipconfig getifaddr en0) | Out-String -NoNewline
# Powershell seems not to be able to remove this directory for some reason!
# Remove-Item -Path /tmp/zqwbuild -Recurse -ErrorAction Ignore | Out-Null
bash "rm -rf /tmp/zqwbuild" 2>&1 | Out-Null
New-Item -Path /tmp/zqwbuild -itemtype directory -Force | Out-Null
Copy-Item src /tmp/zqwbuild/ -Recurse -Force
Copy-Item res /tmp/zqwbuild/ -Recurse -Force
Copy-Item release /tmp/zqwbuild/ -Recurse -Force
# Remove some unnecessary stuff from the tmp directory to speed up copying
Remove-Item -Recurse -ErrorAction Ignore /tmp/zqwbuild/res/libsodium
ssh $winserver "scp -r ${myhostname}:/tmp/zqwbuild/* zqwbuild/"
ssh $winserver "cd zqwbuild ; src/scripts/mkwininstaller.ps1 -version $version" >/dev/null
if (!$?) {
Write-Output "[Error]"
exit 1;
}
ssh $winserver "scp zqwbuild/artifacts/* ${myhostname}:/tmp/zqwbuild/"
Copy-Item /tmp/zqwbuild/*.msi artifacts/
Write-Host "[OK]"
# Finally, test to make sure all files exist
Write-Host -NoNewline "Checking Build........."
if (! (Test-Path ./artifacts/linux-binaries-SilentDragonXLite-v$version.tar.gz) -or
! (Test-Path ./artifacts/linux-deb-SilentDragonXLite-v$version.deb) -or
! (Test-Path ./artifacts/Windows-binaries-SilentDragonXLite-v$version.zip) -or
! (Test-Path ./artifacts/macOS-SilentDragonXLite-v$version.dmg) -or
! (Test-Path ./artifacts/Windows-installer-SilentDragonXLite-v$version.msi) ) {
Write-Host "[Error]"
exit 1;
}
Write-Host "[OK]"
Write-Host -NoNewline "Signing Binaries......."
bash src/scripts/signbinaries.sh --version $version
Write-Host "[OK]"

116
src/scripts/mkmacdmg.sh

@ -1,116 +0,0 @@
#!/bin/bash
# Accept the variables as command line arguments as well
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-q|--qt_path)
QT_PATH="$2"
shift # past argument
shift # past value
;;
-c|--certificate)
CERTIFICATE="$2"
shift # past argument
shift # past value
;;
-u|--username)
APPLE_USERNAME="$2"
shift # past argument
shift # past value
;;
-p|--password)
APPLE_PASSWORD="$2"
shift # past argument
shift # past value
;;
-v|--version)
APP_VERSION="$2"
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [ -z $QT_PATH ]; then
echo "QT_PATH is not set. Please set it to the base directory of Qt";
exit 1;
fi
if [ -z "$CERTIFICATE" ]; then
echo "CERTIFICATE is not set. Please set it the name of the MacOS developer certificate to sign the binary with";
exit 1;
fi
if [ -z "$APPLE_USERNAME" ]; then
echo "APPLE_USERNAME is not set. Please set it the name of the MacOS developer login email to submit the binary for Apple for notarization";
exit 1;
fi
if [ -z "$APPLE_PASSWORD" ]; then
echo "APPLE_PASSWORD is not set. Please set it the name of the MacOS developer Application password to submit the binary for Apple for notarization";
exit 1;
fi
if [ -z $APP_VERSION ]; then
echo "APP_VERSION is not set. Please set it to the current release version of the app";
exit 1;
fi
if ! cat src/version.h | grep -q "$APP_VERSION"; then
echo "Version mismatch in src/version.h"
exit 1
fi
export PATH=$PATH:/usr/local/bin
#Clean
echo -n "Cleaning..............."
make distclean >/dev/null 2>&1
rm -f artifacts/macOS-SilentDragonXLite-v$APP_VERSION.dmg
echo "[OK]"
echo -n "Configuring............"
# Build
QT_STATIC=$QT_PATH src/scripts/dotranslations.sh >/dev/null
$QT_PATH/bin/qmake silentdragon-lite.pro CONFIG+=release >/dev/null
echo "[OK]"
echo -n "Building..............."
make -j4 >/dev/null
echo "[OK]"
#Qt deploy
echo -n "Deploying.............."
mkdir artifacts >/dev/null 2>&1
rm -f artifcats/SilentDragonXLite.dmg >/dev/null 2>&1
rm -f artifacts/rw* >/dev/null 2>&1
$QT_PATH/bin/macdeployqt SilentDragonXLite.app
codesign --deep --force --verify --verbose -s "$CERTIFICATE" --options runtime --timestamp SilentDragonXLite.app
echo "[OK]"
echo -n "Building dmg..........."
mv SilentDragonXLite.app SilentDragonXLite.app
create-dmg --volname "SilentDragonXLite-v$APP_VERSION" --volicon "res/logo.icns" --window-pos 200 120 --icon "SilentDragonXLite.app" 200 190 --icon-size 100 --app-drop-link 600 185 --hide-extension "SilentDragonXLite.app" --window-size 800 400 --hdiutil-quiet --background res/dmgbg.png artifacts/macOS-SilentDragonXLite-v$APP_VERSION.dmg SilentDragonXLite.app >/dev/null 2>&1
if [ ! -f artifacts/macOS-SilentDragonXLite-v$APP_VERSION.dmg ]; then
echo "[ERROR]"
exit 1
fi
echo "[OK]"
# Submit to Apple for notarization
echo -n "Apple notarization....."
xcrun altool --notarize-app -t osx -f artifacts/macOS-SilentDragonXLite-v$APP_VERSION.dmg --primary-bundle-id="com.MyHush.SilentDragonXLite" -u "$APPLE_USERNAME" -p "$APPLE_PASSWORD"
echo "[OK]"

166
src/scripts/mkrelease.sh

@ -1,166 +0,0 @@
#!/bin/bash
if [ -z $QT_STATIC ]; then
echo "QT_STATIC is not set. Please set it to the base directory of a statically compiled Qt";
exit 1;
fi
if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi
if [ -z $PREV_VERSION ]; then echo "PREV_VERSION is not set"; exit 1; fi
echo -n "Version files.........."
# Replace the version number in the .pro file so it gets picked up everywhere
sed -i "s/${PREV_VERSION}/${APP_VERSION}/g" silentdragon-lite.pro > /dev/null
# Also update it in the README.md
sed -i "s/${PREV_VERSION}/${APP_VERSION}/g" README.md > /dev/null
echo "[OK]"
echo -n "Cleaning..............."
rm -rf bin/*
rm -rf artifacts/*
make distclean >/dev/null 2>&1
echo "[OK]"
echo ""
echo "[Building on" `lsb_release -r`"]"
echo -n "Configuring............"
QT_STATIC=$QT_STATIC bash src/scripts/dotranslations.sh >/dev/null
$QT_STATIC/bin/qmake silentdragon-lite.pro -spec linux-clang CONFIG+=release > /dev/null
echo "[OK]"
echo -n "Building..............."
rm -rf bin/SilentDragonXLite* > /dev/null
# Build the lib first
cd lib && make release && cd ..
make -j$(nproc) > /dev/null
make install INSTALL_ROOT=AppDir
# now, build AppImage using linuxdeploy and linuxdeploy-plugin-qt
# download linuxdeploy and its Qt plugin
wget https://github.com/linuxdeploy/linuxdeploy/releases/download/continuous/linuxdeploy-x86_64.AppImage
wget https://github.com/linuxdeploy/linuxdeploy-plugin-qt/releases/download/continuous/linuxdeploy-plugin-qt-x86_64.AppImage
# make them executable
chmod +x linuxdeploy*.AppImage
echo "[OK]"
# Test for Qt
echo -n "Static link............"
if [[ $(ldd SilentDragonXLite | grep -i "Qt") ]]; then
echo "FOUND QT; ABORT";
exit 1
fi
echo "[OK]"
echo -n "Packaging.............."
mkdir bin/SilentDragonXLite-v$APP_VERSION > /dev/null
strip SilentDragonXLite
cp SilentDragonXLite bin/SilentDragonXLite-v$APP_VERSION > /dev/null
cp README.md bin/SilentDragonXLite-v$APP_VERSION > /dev/null
cp LICENSE bin/SilentDragonXLite-v$APP_VERSION > /dev/null
cd bin && tar czf linux-SilentDragonXLite-v$APP_VERSION.tar.gz SilentDragonXLite-v$APP_VERSION/ > /dev/null
cd ..
mkdir artifacts >/dev/null 2>&1
cp bin/linux-SilentDragonXLite-v$APP_VERSION.tar.gz ./artifacts/linux-binaries-SilentDragonXLite-v$APP_VERSION.tar.gz
echo "[OK]"
if [ -f artifacts/linux-binaries-SilentDragonXLite-v$APP_VERSION.tar.gz ] ; then
echo -n "Package contents......."
# Test if the package is built OK
if tar tf "artifacts/linux-binaries-SilentDragonXLite-v$APP_VERSION.tar.gz" | wc -l | grep -q "4"; then
echo "[OK]"
else
echo "[ERROR]"
exit 1
fi
else
echo "[ERROR]"
exit 1
fi
echo -n "Building deb..........."
debdir=bin/deb/SilentDragonXLite-v$APP_VERSION
mkdir -p $debdir > /dev/null
mkdir $debdir/DEBIAN
mkdir -p $debdir/usr/local/bin
cat src/scripts/control | sed "s/RELEASE_VERSION/$APP_VERSION/g" > $debdir/DEBIAN/control
cp SilentDragonXLite $debdir/usr/local/bin/
mkdir -p $debdir/usr/share/pixmaps/
cp res/SilentDragonXLite.xpm $debdir/usr/share/pixmaps/
mkdir -p $debdir/usr/share/applications
cp src/scripts/desktopentry $debdir/usr/share/applications/SilentDragonXLite.desktop
dpkg-deb --build $debdir >/dev/null
cp $debdir.deb artifacts/linux-deb-SilentDragonXLite-v$APP_VERSION.deb
echo "[OK]"
echo ""
echo "[Windows]"
if [ -z $MXE_PATH ]; then
echo "MXE_PATH is not set. Set it to ~/github/mxe/usr/bin if you want to build Windows"
echo "Not building Windows"
exit 0;
fi
export PATH=$MXE_PATH:$PATH
echo -n "Configuring............"
make clean > /dev/null
#rm -f SilentDragonXLite-mingw.pro
rm -rf release/
cp src/precompiled.h release/
#Mingw seems to have trouble with precompiled headers, so strip that option from the .pro file
#cat silentdragon-lite.pro | sed "s/precompile_header/release/g" | sed "s/PRECOMPILED_HEADER.*//g" > SilentDragonXLite-mingw.pro
echo "[OK]"
echo -n "Building..............."
cp src/precompiled.h release/
# Build the lib first
cd lib && make winrelease && cd ..
cp src/precompiled.h release/
x86_64-w64-mingw32.static-qmake-qt5 silentdragon-lite.pro CONFIG+=release > /dev/null
cp src/precompiled.h release/
make -j32 > /dev/null
echo "[OK]"
echo -n "Packaging.............."
mkdir release/SilentDragonXLite-v$APP_VERSION
cp release/SilentDragonXLite.exe release/SilentDragonXLite-v$APP_VERSION
cp README.md release/SilentDragonXLite-v$APP_VERSION
cp LICENSE release/SilentDragonXLite-v$APP_VERSION
cd release && zip -r Windows-binaries-SilentDragonXLite-v$APP_VERSION.zip SilentDragonXLite-v$APP_VERSION/ > /dev/null
cd ..
mkdir artifacts >/dev/null 2>&1
cp release/Windows-binaries-SilentDragonXLite-v$APP_VERSION.zip ./artifacts/
echo "[OK]"
if [ -f artifacts/Windows-binaries-SilentDragonXLite-v$APP_VERSION.zip ] ; then
echo -n "Package contents......."
if unzip -l "artifacts/Windows-binaries-SilentDragonXLite-v$APP_VERSION.zip" | wc -l | grep -q "9"; then
echo "[OK]"
else
echo "[ERROR]"
exit 1
fi
else
echo "[ERROR]"
exit 1
fi

26
src/scripts/mkwininstaller.ps1

@ -1,26 +0,0 @@
param (
[Parameter(Mandatory=$true)][string]$version
)
$target="SilentDragonXLite-v$version"
Remove-Item -Path release/wininstaller -Recurse -ErrorAction Ignore | Out-Null
New-Item release/wininstaller -itemtype directory | Out-Null
Copy-Item release/$target/SilentDragonXLite.exe release/wininstaller/
Copy-Item release/$target/LICENSE release/wininstaller/
Get-Content src/scripts/silentdragonxlite.wxs | ForEach-Object { $_ -replace "RELEASE_VERSION", "$version" } | Out-File -Encoding utf8 release/wininstaller/silentdragonxlite.wxs
candle.exe release/wininstaller/silentdragonxlite.wxs -o release/wininstaller/silentdragonxlite.wixobj
if (!$?) {
exit 1;
}
light.exe -ext WixUIExtension -cultures:en-us release/wininstaller/SilentDragonXLite.wixobj -out release/wininstaller/SilentDragonXLite.msi
if (!$?) {
exit 1;
}
New-Item artifacts -itemtype directory -Force | Out-Null
Copy-Item release/wininstaller/SilentDragonXLite.msi ./artifacts/Windows-installer-$target.msi

53
src/scripts/signbinaries.sh

@ -1,53 +0,0 @@
#!/bin/bash
# Accept the variables as command line arguments as well
POSITIONAL=()
while [[ $# -gt 0 ]]
do
key="$1"
case $key in
-v|--version)
APP_VERSION="$2"
shift # past argument
shift # past value
;;
*) # unknown option
POSITIONAL+=("$1") # save it in an array for later
shift # past argument
;;
esac
done
set -- "${POSITIONAL[@]}" # restore positional parameters
if [ -z $APP_VERSION ]; then echo "APP_VERSION is not set"; exit 1; fi
# Store the hash and signatures here
rm -rf release/signatures
mkdir -p release/signatures
# Staple the notarization
xcrun stapler staple artifacts/macOS-SilentDragonXLite-v$APP_VERSION.dmg
cd artifacts
# Remove previous signatures/hashes
rm -f sha256sum-v$APP_VERSION.txt
rm -f signatures-v$APP_VERSION.tar.gz
# sha256sum the binaries
sha256sum *$APP_VERSION* > sha256sum-v$APP_VERSION.txt
for i in $( ls *SilentDragonXLite-v$APP_VERSION* sha256sum-v$APP_VERSION* ); do
echo "Signing" $i
gpg --batch --output ../release/signatures/$i.sig --detach-sig $i
done
mv sha256sum-v$APP_VERSION.txt ../release/signatures/
cp ../res/SIGNATURES_README ../release/signatures/README
cd ../release/signatures
#tar -czf signatures-v$APP_VERSION.tar.gz *
zip signatures-v$APP_VERSION.zip *
mv signatures-v$APP_VERSION.zip ../../artifacts

19
src/scripts/translation_analysis.sh

@ -1,19 +0,0 @@
#!/bin/bash
echo -n AR: ;grep unfinished silentdragonxlite_ar.ts | wc -l
echo -n BE: ;grep unfinished silentdragonxlite_be.ts | wc -l
echo -n DE: ;grep unfinished silentdragonxlite_de.ts | wc -l
echo -n ES: ;grep unfinished silentdragonxlite_es.ts | wc -l
echo -n FA: ;grep unfinished silentdragonxlite_fa.ts | wc -l
echo -n FR: ;grep unfinished silentdragonxlite_fr.ts | wc -l
echo -n HR: ;grep unfinished silentdragonxlite_hr.ts | wc -l
echo -n ID: ;grep unfinished silentdragonxlite_id.ts | wc -l
echo -n IT: ;grep unfinished silentdragonxlite_it.ts | wc -l
echo -n NL: ;grep unfinished silentdragonxlite_nl.ts | wc -l
echo -n PT: ;grep unfinished silentdragonxlite_pt.ts | wc -l
echo -n RO: ;grep unfinished silentdragonxlite_ro.ts | wc -l
echo -n RU: ;grep unfinished silentdragonxlite_ru.ts | wc -l
echo -n SR: ;grep unfinished silentdragonxlite_sr.ts | wc -l
echo -n TR: ;grep unfinished silentdragonxlite_tr.ts | wc -l
echo -n UD: ;grep unfinished silentdragonxlite_ud.ts | wc -l
echo -n ZH: ;grep unfinished silentdragonxlite_zh.ts | wc -l
Loading…
Cancel
Save