Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PoC Flatpak packaging #51

Open
tinywrkb opened this issue Jul 3, 2020 · 6 comments
Open

PoC Flatpak packaging #51

tinywrkb opened this issue Jul 3, 2020 · 6 comments

Comments

@tinywrkb
Copy link

tinywrkb commented Jul 3, 2020

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.

@ra3xdh ra3xdh self-assigned this May 9, 2022
@ra3xdh
Copy link
Owner

ra3xdh commented May 9, 2022

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

@tinywrkb
Copy link
Author

tinywrkb commented May 9, 2022

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
Copy link
Author

tinywrkb commented May 9, 2022

- --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
Copy link
Author

tinywrkb commented May 12, 2022

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

@luzpaz
Copy link
Contributor

luzpaz commented Aug 31, 2023

Is flatpak qucs-s support up to date ?

@ra3xdh
Copy link
Owner

ra3xdh commented Feb 12, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants