qucs_s icon indicating copy to clipboard operation
qucs_s copied to clipboard

PoC Flatpak packaging

Open tinywrkb opened this issue 4 years ago • 10 comments

This is an initial Flapak manifest for Qucs-S, not really tested except a basic simulation.
It definitely needs more work, testing, and cleanup.
This needs Qucs base app when building the app, so build and install it first.

I've followed the Arch Linux packaging and added every optional dependency for Qucs-S and its dependencies. So you have Ngspice, FreeHDL, GTKWave, and even also Qucs packaged.

I don't plan to publish this on Flathub myself, but I hope this might encourage you to choose Flatpak as a distribution channel.

BTW Qucs is also packaged here.

tinywrkb avatar Jul 03 '20 19:07 tinywrkb

I have recently started the generation of the Flatpak manifest for Qucs-S. I didn't find a way to launch an external application from system /usr from the flatpak. Therefore I decided to include the ngspice into the Flatpak package. The qucsator has dependency on ADMS that depends on Perl modules. And therefore the adding of the qucsator into the Flatpak is not a straightforward task. So I decided to restrict the Flatpak version of the Qucs-S by Ngspice support only. The manifest draft could be found here: https://github.com/ra3xdh/qucs_scripts/blob/master/FLATPAK/com.github.ra3xdh.qucs-s.yaml

ra3xdh avatar May 09 '22 08:05 ra3xdh

The qucsator has dependency on ADMS that depends on Perl modules. And therefore the adding of the qucsator into the Flatpak is not a straightforward task.

@ra3xdh you can use flatpak-cpan-generator.pl.

I packaged ADMS with QUCS like this

- name: adms
  config-opts:
   - --enable-maintainer-mode
   - PERL5LIB=/app/lib/perl5
  make-args:
   - PERL5LIB=/app/lib/perl5
  sources:
   - type: archive
     url: https://github.com/Qucs/ADMS/archive/release-2.3.7.tar.gz
     sha256: 0d24f645d7ce0daa447af1b0cff1123047f3b73cc41cf403650f469721f95173
  modules:
    - name: perl-dependencies
      buildsystem: simple
      build-options:
        env:
          - PERL5LIB=/app/lib/perl5
      build-commands:
        - perl-libs/install.sh
      post-install:
        # workaround for cpanm acting silly and installs files without write permission
        - find /app -type f ! -perm -0200 -exec chmod u+w '{}' \;
      sources:
        - perl-dependencies-sources.json
        - type: shell
          commands:
            # fix the generated install.sh to avoid having it try to install into /usr
            - sed -e 's|\(perl Makefile.PL\).* \&\& \(make install\).*|\1 INSTALL_BASE=/app \&\& \2|' -e
              's|\(perl Build.PL\) \&\&|\1 --install_base=/app \&\&|' -i perl-libs/install.sh

And perl-dependencies-sources.json was generated by running

$ flatpak-cpan-generator.pl --output perl-dependencies-sources.json XML::LibXML

tinywrkb avatar May 09 '22 10:05 tinywrkb

- --socket=x11

Unless you're forcing XCB QPA platform in the application or using ngspice's X11 plotting, it should have instead

--socket=fallback-x11
--socket=wayland

Please read the standard permission section.

  - name: ngspice
    build-options:
        strip: true

This means that you're throwing away ngspice's symbols, instead of extracting them and moving into a separate .Debug extension.
In fact, due to flatpak-builder bug, this actually remove symbols from everything that is already in $FLATPAK_DEST.

And last, this is obviously missing an AppStream MetaInfo, which will be needed for Flathub submission. Please see the documentation here, the AppStream MetaInfo Creator, and the Appstream section in App Requirements wiki page.

tinywrkb avatar May 09 '22 11:05 tinywrkb

I updated the example ADMS packaging to work with the latest revision of flatpak-cpan-generator.pl.

tinywrkb avatar May 12 '22 00:05 tinywrkb

Is flatpak qucs-s support up to date ?

luzpaz avatar Aug 31 '23 13:08 luzpaz

Is flatpak qucs-s support up to date ?

The main issue with Flatpak was sandboxing concept which is against Qucs-S architecture. Qucs-S is intended to reference an external simulation kernel. It is required to compile every simulation kernel and provide fixed versions inside flatpak. The issue may be partially resolved after implementing Qucsator_RF integration. Otherwise supported kernels may be restricted to Ngspice only. Xyce build with flatpak is not possible because of Trillinos libraries.

ra3xdh avatar Feb 12 '24 08:02 ra3xdh