update packaging

This commit is contained in:
Kevin Yue 2021-09-07 07:37:17 +08:00
parent bb78aed8eb
commit a70340ce55
3 changed files with 166 additions and 34 deletions

View File

@ -40,7 +40,7 @@ QString GPService::findBinary()
} }
/* Port from https://github.com/qt/qtbase/blob/11d1dcc6e263c5059f34b44d531c9ccdf7c0b1d6/src/corelib/io/qprocess.cpp#L2115 */ /* Port from https://github.com/qt/qtbase/blob/11d1dcc6e263c5059f34b44d531c9ccdf7c0b1d6/src/corelib/io/qprocess.cpp#L2115 */
QStringList GPService::splitCommand(QStringView command) QStringList GPService::splitCommand(QString command)
{ {
QStringList args; QStringList args;
QString tmp; QString tmp;
@ -114,6 +114,7 @@ void GPService::connect(QString server, QString username, QString passwd, QStrin
QStringList args; QStringList args;
args << QCoreApplication::arguments().mid(1) args << QCoreApplication::arguments().mid(1)
<< "--protocol=gp" << "--protocol=gp"
<< "-s" << qgetenv("VPNC_SCRIPT")
<< splitCommand(extraArgs) << splitCommand(extraArgs)
<< "-u" << username << "-u" << username
<< "-C" << passwd << "-C" << passwd

View File

@ -3,7 +3,6 @@
#include <QObject> #include <QObject>
#include <QProcess> #include <QProcess>
#include <QStringView>
static const QString binaryPaths[] { static const QString binaryPaths[] {
"/usr/local/bin/openconnect", "/usr/local/bin/openconnect",
@ -55,7 +54,7 @@ private:
void log(QString msg); void log(QString msg);
static QString findBinary(); static QString findBinary();
static QStringList splitCommand(QStringView command); static QStringList splitCommand(QString command);
}; };
#endif // GLOBALPROTECTSERVICE_H #endif // GLOBALPROTECTSERVICE_H

View File

@ -8,11 +8,9 @@ description: |
grade: devel grade: devel
confinement: devmode # use 'strict' once you have the right plugs and slots confinement: devmode # use 'strict' once you have the right plugs and slots
package-repositories: layout:
- type: apt /usr/share/qt5:
ppa: beineri/opt-qt-5.12.10-bionic bind: $SNAP/usr/share/qt5
- type: apt
ppa: dominik-stadler/dsta-bionic-ppa
slots: slots:
gpservice-slot: gpservice-slot:
@ -32,17 +30,21 @@ apps:
command: usr/bin/gpservice command: usr/bin/gpservice
environment: environment:
LANG: en_US.utf8 LANG: en_US.utf8
VPNC_SCRIPT: $SNAP/usr/share/vpnc-scripts/vpnc-script
plugs: plugs:
- network - network
# slots: slots:
# - gpservice-slot - gpservice-slot
gpclient: gpclient:
common-id: com.yuezk.qt.gpclient.desktop common-id: com.yuezk.qt.gpclient
command: usr/bin/gpclient command: usr/bin/gpclient
extensions:
- kde-neon
desktop: usr/share/applications/com.yuezk.qt.gpclient.desktop desktop: usr/share/applications/com.yuezk.qt.gpclient.desktop
environment: environment:
QT_PLUGIN_PATH: $SNAP/opt/qt512/plugins # QT_PLUGIN_PATH: $SNAP/opt/qt512/plugins
QT_PLUGIN_PATH: $SNAP/usr/lib/x86_64-linux-gnu/qt5/plugins
plugs: plugs:
- desktop - desktop
- desktop-legacy - desktop-legacy
@ -53,32 +55,162 @@ apps:
- gpservice-plug - gpservice-plug
parts: parts:
application: gmplib:
plugin: nil plugin: autotools
source: . source: https://gmplib.org/download/gmp/gmp-6.2.1.tar.xz
nettle:
plugin: autotools
source: https://ftp.gnu.org/gnu/nettle/nettle-3.7.3.tar.gz
configflags:
- --disable-openssl
- --disable-documentation
after:
- gmplib
tpm2-tss:
plugin: autotools
source: https://github.com/tpm2-software/tpm2-tss.git
source-depth: 1
source-tag: 3.1.0
build-packages: build-packages:
- g++ - autoconf-archive
- make - libcmocka-dev
- libgl1-mesa-dev - build-essential
- qt512base - pkg-config
- qt512websockets - libtool
- qt512webengine - automake
- libssl-dev
- autoconf
- libjson-c-dev
- libini-config-dev
- libcurl4-openssl-dev
- acl
stage-packages: stage-packages:
- qt512base - libasn1-8-heimdal
- qt512websockets - libcurl4
- qt512webengine - libgssapi3-heimdal
- libhcrypto4-heimdal
- libheimbase1-heimdal
- libheimntlm0-heimdal
- libhx509-5-heimdal
- libkrb5-26-heimdal
- libldap-2.4-2
- libnghttp2-14
- libpsl5
- libroken18-heimdal
- librtmp1
- libsasl2-2
- libwind0-heimdal
configflags:
- --disable-doxygen-doc
override-build: | gnutls:
QT_BASE_DIR=/opt/qt512 plugin: autotools
source: http://mirrors.dotsrc.org/gcrypt/gnutls/v3.7/gnutls-3.7.2.tar.xz
build-packages:
- wget
- build-essential
- autoconf
- libtool
- gettext
- autopoint
- automake
- autogen
- libp11-kit-dev
- libtspi-dev
- libunistring-dev
- guile-2.2-dev
- libtasn1-6-dev
- libidn2-0-dev
- gperf
- libunbound-dev
- bison
stage-packages:
- guile-2.2-libs
- libgc1c2
- libltdl7
- libopts25
- libunbound2
configflags:
- --disable-doc
- --disable-full-test-suite
after:
- gmplib
- nettle
export QTDIR=$QT_BASE_DIR libpskc:
export PATH=$QT_BASE_DIR/bin:$PATH plugin: autotools
export LD_LIBRARY_PATH=$QT_BASE_DIR/lib/x86_64-linux-gnu:$QT_BASE_DIR/lib:$LD_LIBRARY_PATH source: https://download.savannah.nongnu.org/releases/oath-toolkit/oath-toolkit-2.6.7.tar.gz
export PKG_CONFIG_PATH=$QT_BASE_DIR/lib/pkgconfig:$PKG_CONFIG_PATH source-subdir: libpskc
build-packages:
- build-essential
- autoconf
- automake
- libtool
- bison
- gengetopt
- libxmlsec1-dev
- libxml2-utils
openconnect:
plugin: autotools
source: https://github.com/openconnect/openconnect.git
source-depth: 1
source-tag: v8.10
build-packages:
- build-essential
- gettext
- autoconf
- automake
- libtool
- libxml2-dev
- zlib1g-dev
- pkg-config
- libp11-kit-dev
- libproxy-dev
- trousers
- libtasn1-6-dev
- libstoken-dev
- libpcsclite-dev
- vpnc-scripts
stage-packages:
- vpnc-scripts
- libp11-kit0
- libproxy1v5
- libstoken1
- libpcsclite1
- libxml2
- zlib1g
after:
- gnutls
- tpm2-tss
- libpskc
application:
plugin: qmake
build-attributes:
- keep-execstack
source: .
build-packages:
- qt5-default
- qtwebengine5-dev
- libqt5websockets5-dev
stage-packages:
- libqt5printsupport5
- libqt5gui5
- libqt5network5
- libqt5svg5
- libqt5webengine5
- libqt5websockets5
- libqt5quickwidgets5
- libqt5webenginewidgets5
- libqt5dbus5
- libatm1
- libtspi1
- libxmlsec1
- libxmlsec1-openssl
options:
- CONFIG+=release
qmake CONFIG+=release
make
make install INSTALL_ROOT="${SNAPCRAFT_PART_INSTALL}"