I use Flatpak 1.14.4 on Ubuntu 22.03. I have been using like end-user flatpaks for years. But now I would like to build one of the flatpak myself.
I would like to build probably quite simple flatpak using PasswordSafe password manager.
Home page: XXXwww.pwsafe.orgXXX
Source code: XXXhttps://github.com/pwsafe/pwsafe/archive/refs/tags/1.17.0.tar.gzXXX
I am complete newbee building flatpaks! I have been reading tons of internet sources related to flatpak and now I am try and miss…
BUILD PASSWORDSAFE PROGRAM FROM SOURCE
- Download program’s source code from: https://github.com/pwsafe/pwsafe/archive/refs/tags/1.17.0.tar.gz
- Extract tar file.
- In extracted directory there is Misc subdir. From this subdir execute: ./setup-linux-dev-env.sh
This command installs dependency libraries. - More or less compile program’s source code, by following instructions in: README.LINUX.DEVELOPERS.md file (just copy/paste few commands).
BUILDING FLATPAK
Now I would like to create my first flatpak (if ignoring the ones on several internet sources).
- I opened terminal and changed directory to ~/Downloads, created file make.sh with 700 file permissions and then run the file: “./make.sh” Content of file is:
#!/bin/bash
# Install flatpak-builder
sudo apt -y install flatpak-builder
# Create src dir
mkdir src
# Download programs source code from https://github.com/pwsafe/pwsafe/releases?q=non-windows&expanded=true
wget https://github.com/pwsafe/pwsafe/archive/refs/tags/1.17.0.tar.gz --directory-prefix src/
# Create Manifest file
cat > com.github.pwsafe.pwsafe.yml <<EOL
app-id: com.github.pwsafe.pwsafe
runtime: org.freedesktop.Platform
runtime-version: '22.08'
sdk: org.freedesktop.Sdk
command: pwsafe
modules:
- name: pwsafe
buildsystem: cmake
sources:
- type: archive
path: src/1.17.0.tar.gz
EOL
# Build flatpak
flatpak-builder --force-clean build-dir com.github.pwsafe.pwsafe.yml
- Output of ./make.sh is missing dependency library: “libqrencode-dev(el) not installed”.
Details
========================================================================
Building module pwsafe in /home/igor/Downloads/.flatpak-builder/build/pwsafe-2
========================================================================
-- The CXX compiler identification is GNU 12.2.0
-- The C compiler identification is GNU 12.2.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++ - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working C compiler: /usr/bin/cc - skipped
-- Detecting C compile features
-- Detecting C compile features - done
-- Interprocedural optimization (LTO/LTCG) is enabled.
-- Found UnixCommands: /usr/bin/bash
-- Performing Test HARDEN_COMPILE_WFORMAT
-- Performing Test HARDEN_COMPILE_WFORMAT - Success
-- Performing Test HARDEN_COMPILE_WFORMAT_SECURITY
-- Performing Test HARDEN_COMPILE_WFORMAT_SECURITY - Success
-- Performing Test HARDEN_COMPILE_WERROR_FORMAT_SECURITY
-- Performing Test HARDEN_COMPILE_WERROR_FORMAT_SECURITY - Failed
-- Performing Test HARDEN_COMPILE_STACK_CLASH_PROTECTION
-- Performing Test HARDEN_COMPILE_STACK_CLASH_PROTECTION - Success
-- Performing Test HARDEN_COMPILE_SANITIZE_SAFE_STACK
-- Performing Test HARDEN_COMPILE_SANITIZE_SAFE_STACK - Failed
-- Performing Test HARDEN_LINK_SANITIZE_SAFE_STACK
-- Performing Test HARDEN_LINK_SANITIZE_SAFE_STACK - Failed
-- Performing Test HARDEN_COMPILE_STACK_PROTECTOR_STRONG
-- Performing Test HARDEN_COMPILE_STACK_PROTECTOR_STRONG - Success
-- Performing Test HARDEN_LINK_Z_RELRO
-- Performing Test HARDEN_LINK_Z_RELRO - Success
-- Performing Test HARDEN_LINK_Z_NOW
-- Performing Test HARDEN_LINK_Z_NOW - Success
-- Looking for qrencode.h
-- Looking for qrencode.h - not found
CMake Error at CMakeLists.txt:85 (message):
libqrencode-dev(el) not installed: install or select NO_QR
Compiler is throwing out an error, because dependency library is missing. When compiling into binary file those packages are installed as “apt install libqrencode-dev” (from Misc/setup-linux-dev-env.sh).
Like I understand, somehow in my Manifest file I need to include dependency libraries.
For example I have found required library source code for my error “libqrencode-dev”. It is available from: https://fukuchi.org/works/qrencode/qrencode-4.1.1.tar.gz
Library home page: hhttps://fukuchi.org/works/qrencode/index.html
Do I need to download and compile every dependent library main program is requiring or can I include it from some other source like deb package or something?
I am stuck here… any idea is greatly appreciated.
I know there are Dependencies and Manifests in documentation, but… pretty steep learning curve.
Regards