diff options
-rw-r--r-- | .SRCINFO | 22 | ||||
-rw-r--r-- | PKGBUILD | 46 | ||||
-rw-r--r-- | fix-build-error.patch | 13 | ||||
-rw-r--r-- | fix-conversion-errors.patch | 48 |
4 files changed, 129 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO new file mode 100644 index 000000000000..d99bbacbd996 --- /dev/null +++ b/.SRCINFO @@ -0,0 +1,22 @@ +pkgbase = qt5-opcua + pkgdesc = Qt wrapper for existing OPC UA stacks + pkgver = 5.15.2 + pkgrel = 1 + url = https://www.qt.io + arch = x86_64 + groups = qt5 + license = GPL3 + license = LGPL3 + license = FDL + license = custom + makedepends = git + depends = qt5-base + depends = mbedtls2 + source = git+https://code.qt.io/qt/qtopcua.git#branch=5.15.2 + source = fix-conversion-errors.patch + source = fix-build-error.patch + sha256sums = SKIP + sha256sums = 406fcd9e4621b9674f8fbef60aa5fba08892cd947e83e9d7d09da0577c3bd09f + sha256sums = becae32d741f86105e24a62ca3718fa908523b6d81c79d9bf3f6a22311c4ab50 + +pkgname = qt5-opcua diff --git a/PKGBUILD b/PKGBUILD new file mode 100644 index 000000000000..6a1bcdbb1dda --- /dev/null +++ b/PKGBUILD @@ -0,0 +1,46 @@ +# Maintainer: Václav Kubernát <sir.venceslas@gmail.com> + +pkgname=qt5-opcua +pkgver=5.15.2 +pkgrel=1 +arch=('x86_64') +url='https://www.qt.io' +license=('GPL3' 'LGPL3' 'FDL' 'custom') +pkgdesc='Qt wrapper for existing OPC UA stacks' +depends=('qt5-base' 'mbedtls2') +makedepends=('git') +groups=('qt5') +_pkgfqn=${pkgname/5-/} +source=(git+https://code.qt.io/qt/qtopcua.git#branch=5.15.2 fix-conversion-errors.patch fix-build-error.patch) +sha256sums=('SKIP' '406fcd9e4621b9674f8fbef60aa5fba08892cd947e83e9d7d09da0577c3bd09f' becae32d741f86105e24a62ca3718fa908523b6d81c79d9bf3f6a22311c4ab50) + +prepare() { + cd qtopcua + patch -Np1 < ../fix-conversion-errors.patch + patch -Np1 < ../fix-build-error.patch +} + +build() { + mkdir -p build + cd build + + qmake ../${_pkgfqn} \ + CONFIG+=fat-static-lto \ + QMAKE_CFLAGS+="-I/usr/include/mbedtls2" \ + QMAKE_CXXFLAGS+="-I/usr/include/mbedtls2" \ + QMAKE_LFLAGS+="-L/usr/lib/mbedtls2" + make +} + +package() { + cd build + make INSTALL_ROOT="$pkgdir" install + + # Drop QMAKE_PRL_BUILD_DIR because reference the build dir + find "$pkgdir/usr/lib" -type f -name '*.prl' \ + -exec sed -i -e '/^QMAKE_PRL_BUILD_DIR/d' {} \; + + install -d "$pkgdir"/usr/share/licenses + ln -s /usr/share/licenses/qt5-base "$pkgdir"/usr/share/licenses/${pkgname} +} + diff --git a/fix-build-error.patch b/fix-build-error.patch new file mode 100644 index 000000000000..5c44a55e567e --- /dev/null +++ b/fix-build-error.patch @@ -0,0 +1,13 @@ +diff --git a/src/3rdparty/open62541.pri b/src/3rdparty/open62541.pri +index 011fb8b8..7841eec4 100644 +--- a/src/3rdparty/open62541.pri ++++ b/src/3rdparty/open62541.pri +@@ -8,7 +8,7 @@ win32-g++: LIBS += -lws2_32 + win32-msvc|winrt: { + SOURCES += $$OPEN62541_SOURCES + } else { +- OPEN62541_CFLAGS += -Wno-unused-parameter -Wno-unused-function -Wno-format -Wno-strict-aliasing -Wno-unused-result -std=c99 ++ OPEN62541_CFLAGS += -Wno-unused-parameter -Wno-unused-function -Wno-strict-aliasing -Wno-unused-result -std=c99 + + # The open62541 source code produces lots of warnings. + # This custom compiler will disable these warnings just for open62541.c diff --git a/fix-conversion-errors.patch b/fix-conversion-errors.patch new file mode 100644 index 000000000000..6c9f043aa78d --- /dev/null +++ b/fix-conversion-errors.patch @@ -0,0 +1,48 @@ +diff --git a/src/opcua/x509/openssl_symbols.cpp b/src/opcua/x509/openssl_symbols.cpp +index e4807e0c8..0ad1396b1 100644 +--- a/src/opcua/x509/openssl_symbols.cpp ++++ b/src/opcua/x509/openssl_symbols.cpp +@@ -273,7 +273,7 @@ DEFINEFUNC3(int, BIO_read, BIO *a, a, void *b, b, int c, c, return -1, return) + DEFINEFUNC3(int, BIO_write, BIO *a, a, const void *b, b, int c, c, return -1, return) + DEFINEFUNC(int, BN_num_bits, const BIGNUM *a, a, return 0, return) + DEFINEFUNC2(BN_ULONG, BN_mod_word, const BIGNUM *a, a, BN_ULONG w, w, return static_cast<BN_ULONG>(-1), return) +-DEFINEFUNC2(int, BN_set_word, const BIGNUM *a, a, BN_ULONG w, w, return 0, return) ++DEFINEFUNC2(int, BN_set_word, BIGNUM *a, a, BN_ULONG w, w, return 0, return) + DEFINEFUNC(BIGNUM *, BN_new, void, DUMMYARG, return nullptr, return) + DEFINEFUNC(void, BN_clear, BIGNUM *bignum, bignum, return, return) + DEFINEFUNC(void, BN_free, BIGNUM *bignum, bignum, return, return) +@@ -339,7 +339,7 @@ DEFINEFUNC4(DH *, PEM_read_bio_DHparams, BIO *a, a, DH **b, b, pem_password_cb * + DEFINEFUNC7(int, PEM_write_bio_DSAPrivateKey, BIO *a, a, DSA *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) + DEFINEFUNC7(int, PEM_write_bio_RSAPrivateKey, BIO *a, a, RSA *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) + DEFINEFUNC7(int, PEM_write_bio_PrivateKey, BIO *a, a, EVP_PKEY *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) +-DEFINEFUNC7(int, PEM_write_bio_PKCS8PrivateKey, BIO *a, a, EVP_PKEY *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) ++DEFINEFUNC7(int, PEM_write_bio_PKCS8PrivateKey, BIO *a, a, EVP_PKEY *b, b, const EVP_CIPHER *c, c, char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) + #ifndef OPENSSL_NO_EC + DEFINEFUNC7(int, PEM_write_bio_ECPrivateKey, BIO *a, a, EC_KEY *b, b, const EVP_CIPHER *c, c, unsigned char *d, d, int e, e, pem_password_cb *f, f, void *g, g, return 0, return) + #endif +diff --git a/src/opcua/x509/openssl_symbols_p.h b/src/opcua/x509/openssl_symbols_p.h +index 7c51e0871..c0ba6774e 100644 +--- a/src/opcua/x509/openssl_symbols_p.h ++++ b/src/opcua/x509/openssl_symbols_p.h +@@ -385,7 +385,7 @@ int q_PEM_write_bio_RSAPrivateKey(BIO *a, RSA *b, const EVP_CIPHER *c, unsigned + int e, pem_password_cb *f, void *g); + int q_PEM_write_bio_PrivateKey(BIO *a, EVP_PKEY *b, const EVP_CIPHER *c, unsigned char *d, + int e, pem_password_cb *f, void *g); +-int q_PEM_write_bio_PKCS8PrivateKey(BIO *a, EVP_PKEY *b, const EVP_CIPHER *c, unsigned char *d, ++int q_PEM_write_bio_PKCS8PrivateKey(BIO *a, EVP_PKEY *b, const EVP_CIPHER *c, char *d, + int e, pem_password_cb *f, void *g); + #ifndef OPENSSL_NO_EC + int q_PEM_write_bio_ECPrivateKey(BIO *a, EC_KEY *b, const EVP_CIPHER *c, unsigned char *d, +diff --git a/src/opcua/x509/qopcuakeypair_openssl.cpp b/src/opcua/x509/qopcuakeypair_openssl.cpp +index 0f0df5c9f..6c475f530 100644 +--- a/src/opcua/x509/qopcuakeypair_openssl.cpp ++++ b/src/opcua/x509/qopcuakeypair_openssl.cpp +@@ -240,7 +240,7 @@ QByteArray QOpcUaKeyPairPrivate::privateKeyToByteArray(QOpcUaKeyPair::Cipher cip + } + + if (0 == q_PEM_write_bio_PKCS8PrivateKey(bio, m_keyData, enc, +- enc ? (unsigned char*)password.toUtf8().constData() : NULL, ++ enc ? (char*)password.toUtf8().constData() : NULL, + enc ? password.length() : 0, + NULL /* callback */, NULL /* userdata */)) { + qCWarning(lcSsl) << "Failed to write private key:" << getOpenSslError(); |