Skip to content

Commit

Permalink
Add new Linux package using Flatpak
Browse files Browse the repository at this point in the history
This is a new distro-agnostic Linux package option
  • Loading branch information
agrr committed Sep 13, 2022
1 parent 7afab74 commit 693fbdd
Show file tree
Hide file tree
Showing 6 changed files with 208 additions and 3 deletions.
5 changes: 3 additions & 2 deletions pteid-mw-pt/_src/eidmw/dialogs/dialogsQT/dlgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
#include "eidErrors.h"
#include "Config.h"
#include "Thread.h"
#include "prefix.h"

using namespace eIDMW;

Expand Down Expand Up @@ -689,7 +690,7 @@ void eIDMW::CallQTServer(const DlgFunctionIndex index,
char csCommand[150];
Type_WndGeometry *pWndGeometry = (Type_WndGeometry *)wndGeometry;

std::string csServerPath = "/usr/local/bin/";
std::string csServerPath = STRINGIFY(EIDMW_PREFIX) "/bin/";
#ifdef __APPLE__
csServerPath += "pteiddialogsQTsrv.app/Contents/MacOS/";
#endif
Expand Down Expand Up @@ -735,4 +736,4 @@ bool eIDMW::getWndCenterPos(Type_WndGeometry *pWndGeometry,
if (outWndGeometry->y < 0 || outWndGeometry->y > desktop_height) return false;

return true;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
diff --git a/pteid-mw.pro b/pteid-mw-pt/_src/eidmw/pteid-mw.pro
index e5f689d67..bbbe37d44 100644
--- a/pteid-mw.pro
+++ b/pteid-mw.pro
@@ -20,8 +20,7 @@ SUBDIRS += cardlayer/cardlayer.pro
SUBDIRS += pkcs11/pkcs11.pro \
applayer \
CMD/services/cmdServices.pro \
- eidlib \
- eidlibJava_Wrapper
+ eidlib

applayer.depends = pteid-poppler

Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
diff --git a/pteid-mw-pt/_src/eidmw/common/ConfigCommon.cpp b/pteid-mw-pt/_src/eidmw/common/ConfigCommon.cpp
index 10d7945d8..9b0b44f09 100644
--- a/common/ConfigCommon.cpp
+++ b/common/ConfigCommon.cpp
@@ -39,17 +39,17 @@ namespace eIDMW
#ifdef WIN32
const struct CConfig::Param_Str CConfig::EIDMW_CONFIG_PARAM_GENERAL_CERTS_DIR = {EIDMW_CNF_SECTION_GENERAL, EIDMW_CNF_GENERAL_CERTSDIR, L"$home" WDIRSEP L"eidstore" WDIRSEP L"certs"};
#else
- const struct CConfig::Param_Str CConfig::EIDMW_CONFIG_PARAM_GENERAL_CERTS_DIR = {EIDMW_CNF_SECTION_GENERAL, EIDMW_CNF_GENERAL_CERTSDIR, WDIRSEP L"usr" WDIRSEP L"local" WDIRSEP L"share" WDIRSEP L"certs" WDIRSEP};
+ const struct CConfig::Param_Str CConfig::EIDMW_CONFIG_PARAM_GENERAL_CERTS_DIR = {EIDMW_CNF_SECTION_GENERAL, EIDMW_CNF_GENERAL_CERTSDIR, WDIRSEP L"app" WDIRSEP L"share" WDIRSEP L"certs" WDIRSEP};
#endif
#ifdef WIN32
const struct CConfig::Param_Str CConfig::EIDMW_CONFIG_PARAM_GENERAL_CERTS_DIR_TEST = {EIDMW_CNF_SECTION_GENERAL, EIDMW_CNF_GENERAL_CERTSDIR_TEST, L"$home" WDIRSEP L"eidstore" WDIRSEP L"certs_test"};
#else
- const struct CConfig::Param_Str CConfig::EIDMW_CONFIG_PARAM_GENERAL_CERTS_DIR_TEST = {EIDMW_CNF_SECTION_GENERAL, EIDMW_CNF_GENERAL_CERTSDIR_TEST, WDIRSEP L"usr" WDIRSEP L"local" WDIRSEP L"share" WDIRSEP L"certs_test" WDIRSEP};
+ const struct CConfig::Param_Str CConfig::EIDMW_CONFIG_PARAM_GENERAL_CERTS_DIR_TEST = {EIDMW_CNF_SECTION_GENERAL, EIDMW_CNF_GENERAL_CERTSDIR_TEST, WDIRSEP L"app" WDIRSEP L"share" WDIRSEP L"certs_test" WDIRSEP};
#endif
#ifdef WIN32
const struct CConfig::Param_Str CConfig::EIDMW_CONFIG_PARAM_GENERAL_WEB_DIR = {EIDMW_CNF_SECTION_GENERAL, EIDMW_CNF_GENERAL_WEBDIR, L"$home" WDIRSEP L"web"};
#else
- const struct CConfig::Param_Str CConfig::EIDMW_CONFIG_PARAM_GENERAL_WEB_DIR = {EIDMW_CNF_SECTION_GENERAL, EIDMW_CNF_GENERAL_WEBDIR, WDIRSEP L"usr" WDIRSEP L"local" WDIRSEP L"share" WDIRSEP L"pteid-mw" WDIRSEP L"www"};
+ const struct CConfig::Param_Str CConfig::EIDMW_CONFIG_PARAM_GENERAL_WEB_DIR = {EIDMW_CNF_SECTION_GENERAL, EIDMW_CNF_GENERAL_WEBDIR, WDIRSEP L"app" WDIRSEP L"share" WDIRSEP L"pteid-mw" WDIRSEP L"www"};
#endif

const struct CConfig::Param_Str CConfig::EIDMW_CONFIG_PARAM_GENERAL_LANGUAGE = {EIDMW_CNF_SECTION_GENERAL, EIDMW_CNF_GENERAL_LANGUAGE, L"nl"};
diff --git a/pteid-mw-pt/_src/eidmw/pteid-mw.pro b/pteid-mw-pt/_src/eidmw/pteid-mw.pro
index e5f689d67..d9682134e 100644
--- a/pteid-mw.pro
+++ b/pteid-mw.pro
@@ -38,10 +38,10 @@ CONFIG += ordered

QMAKE_STRIP = echo

-data.path += /usr/local/share/certs
+data.path += /app/share/certs
data.files += misc/certs/*

-web.path += /usr/local/share/pteid-mw/www
+web.path += /app/share/pteid-mw/www
web.files += misc/web/*

INSTALLS += data \
35 changes: 35 additions & 0 deletions pteid-mw-pt/_src/eidmw/pt.gov.autenticacao.metainfo.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="UTF-8"?>
<component type="desktop">
<id>pt.gov.autenticacao</id>
<launchable type="desktop-id">pt.gov.autenticacao.desktop</launchable>
<metadata_license>CC0-1.0</metadata_license>
<name>Autenticação.gov</name>

<summary>Autenticação.gov - Cartão de Cidadão e Chave Móvel Digital</summary>
<description>
<p>
A aplicação Autenticação.gov permite ao cidadão tirar partido das funcionalidades eletrónicas do seu Cartão de Cidadão, como:

- assinar documentos digitais com Cartão de Cidadão ou Chave Móvel Digital
- visualizar e imprimir os dados pessoais constantes no Cartão de Cidadão.
- personalizar a assinatura digital
- visualizar a morada e finalizar o processo de alteração de morada no Cartão de Cidadão
- alterar os códigos PIN do Cartão de Cidadão
- incluir notas ou informações que o cidadão entenda, como contactos a utilizar em caso de urgência, grupo sanguíneo, alergias, etc.
</p>
</description>

<url type="homepage">https://www.autenticacao.gov.pt</url>
<url type="bugtracker">https://github.com/amagovpt/autenticacao.gov/issues</url>
<url type="help">https://amagovpt.github.io/docs.autenticacao.gov/user_manual.html</url>

<releases>
<release version="3.9.0.beta" date="2022-09-12"/>
</releases>

<project_license>EUPL-1.2</project_license>
<developer_name>Estado Português</developer_name>
<screenshots>
<screenshot type="default">https://amagovpt.github.io/docs.autenticacao.gov/Pictures/Autenticacao.Gov_Home.png</screenshot>
</screenshots>
</component>
113 changes: 113 additions & 0 deletions pteid-mw-pt/_src/eidmw/pt.gov.autenticacao.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
app-id: pt.gov.autenticacao
runtime: org.kde.Platform
runtime-version: '5.15-21.08'
sdk: org.kde.Sdk
command: eidguiV2
finish-args:
- --socket=pcsc
- --socket=cups
- --socket=x11
- --device=dri
- --filesystem=home
- --share=ipc
- --share=network
modules:
- name: pcsc-lite
config-opts:
- --disable-libudev
- --disable-libsystemd
- --without-systemdsystemunitdir
- --disable-serial
- --disable-usb
- --disable-documentation
cleanup:
- '/include'
- '/bin/pcsc-spy'
- '/lib/libpcscspy*'
- '/lib/pkg-config'
- '/share/doc'
- '/share/man'
post-install:
- rm /app/sbin/pcscd
- rmdir /app/sbin || true
sources:
- type: archive
url: https://pcsclite.apdu.fr/files/pcsc-lite-1.8.25.tar.bz2
sha256: d76d79edc31cf76e782b9f697420d3defbcc91778c3c650658086a1b748e8792
- name: xerces-c
buildsystem: autotools
cleanup:
- '/include'
- '/bin/*'
- '/lib/pkg-config'
- '/lib/libxerces-c.a'
sources:
- type: archive
url: https://dlcdn.apache.org//xerces/c/3/sources/xerces-c-3.2.3.tar.gz
sha256: fb96fc49b1fb892d1e64e53a6ada8accf6f0e6d30ce0937956ec68d39bd72c7e
- name: libzip
buildsystem: cmake-ninja
cleanup:
- '/bin/zip*'
- '/share/man'
- '/lib/pkg-config'
sources:
- type: archive
url: https://libzip.org/download/libzip-1.9.2.tar.xz
sha256: c93e9852b7b2dc931197831438fee5295976ee0ba24f8524a8907be5c2ba5937
- name: xml-security-c
buildsystem: autotools
cleanup:
- '/include'
- '/bin/xsec-*'
- '/lib/pkg-config'
sources:
- type: archive
url: https://downloads.apache.org/santuario/c-library/xml-security-c-2.0.4.tar.gz
sha256: a78da6720f6c2ba14100d2426131e0d33eac5a2dba5cc11bdd04974b7eb89003
- name: openjpeg
buildsystem: cmake-ninja
cleanup:
- '/lib/libopenjp2.a'
- '/include'
- '/bin/opj_*'
sources:
- type: archive
url: https://github.com/uclouvain/openjpeg/archive/v2.3.1.tar.gz
sha256: 63f5a4713ecafc86de51bfad89cc07bb788e9bba24ebbf0c4ca637621aadb6a9
- name: poppler
buildsystem: cmake-ninja
cleanup:
- '/lib/pkg-config'
- '/include'
config-opts:
- -DBUILD_GTK_TESTS=OFF
- -DBUILD_QT5_TESTS=OFF
- -DBUILD_CPP_TESTS=OFF
- -DENABLE_UTILS=OFF
- -DENABLE_CPP=OFF
- -DENABLE_GLIB=OFF
- -DENABLE_BOOST=OFF
sources:
- type: archive
url: https://poppler.freedesktop.org/poppler-22.07.0.tar.xz
sha256: 420230c5c43782e2151259b3e523e632f4861342aad70e7e20b8773d9eaf3428
- name: pteid-mw
buildsystem: qmake
config-opts:
- LIBS += -L/app/lib/
- INCLUDEPATH += /app/include/PCSC
- INCLUDEPATH += /app/include/poppler/qt5
- PREFIX_DIR = /app/
build-commands:
- sed -i 's/pteid-scalable/pt.gov.autenticacao/g' debian/pteid-mw-gui.desktop
- install -Dm644 debian/pteid-mw-gui.desktop /app/share/applications/pt.gov.autenticacao.desktop
- install -Dm644 debian/pteid-scalable.svg /app/share/icons/hicolor/scalable/apps/pt.gov.autenticacao.svg
- install -Dm644 pt.gov.autenticacao.metainfo.xml /app/share/appdata/pt.gov.autenticacao.metainfo.xml
sources:
- type: dir
path: .
- type: patch
path: misc/flatpak-patches/dont-build-pteidlibj.patch
- type: patch
path: misc/flatpak-patches/dont-use-usrlocal.patch
2 changes: 1 addition & 1 deletion pteid-mw-pt/_src/eidmw/pteid-poppler/poppler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ clean:
rm -fv $(LIB_FILENAME)

install:
install -s $(LIB_FILENAME) $(INSTALL_ROOT)/usr/local/lib/
echo "pteid-poppler has nothing to install"

.PHONY: clean install prepare

0 comments on commit 693fbdd

Please sign in to comment.