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

Flatpak puller #28

Merged
merged 44 commits into from
Nov 5, 2024
Merged

Conversation

nintyfan
Copy link
Contributor

@nintyfan nintyfan commented Sep 5, 2023

Some changes need to be done, like:

  1. Using calamares utilities to deal with creating processes and handling output data from it
  2. Eliminating duplicates

Currently, it is speedy, have small amount of code and works. I must told, it is hacky. I check if flatpak write to output line contains dot to filter-out broken data (empty lines?): I did not check, what these data was yet, so this is third point to correct. Without that check, netinstall displays virtual packages (with empty names).

@nintyfan
Copy link
Contributor Author

nintyfan commented Sep 5, 2023

#27

@nintyfan
Copy link
Contributor Author

nintyfan commented Sep 6, 2023

First point was done.
Second was untouched.
Third is also untouched.

Many work was done, but from your point of view it could not, because of my description.

@nintyfan
Copy link
Contributor Author

nintyfan commented Sep 7, 2023

I think it was done, but we have problems with my previous patch (implement flatpak package manager support in packages module of core). It asks question in some cases, like adding the same repo to system and user installation. I do not known, how to fix it. Or, maybe just do not scary cause it is task for distribution to enable only one repo?

@dalto8
Copy link
Collaborator

dalto8 commented Sep 7, 2023

Can you apply the Calamares code format/style using clang-format

@nintyfan
Copy link
Contributor Author

nintyfan commented Sep 7, 2023

Yes. I will do this tomorrow.

@nintyfan
Copy link
Contributor Author

nintyfan commented Sep 8, 2023

Can you apply the Calamares code format/style using clang-format

Done

@dalto8
Copy link
Collaborator

dalto8 commented Sep 10, 2023

The commit where clang-format was applied appears to have removed all the code.

@nintyfan
Copy link
Contributor Author

The commit where clang-format was applied appears to have removed all the code.

Repaired.

@Airmancooma
Copy link

Hi @nintyfan,

I am currently working on installing a module which supports both Flatpak and apt packages. I have managed to download the necessary files and successfully compiled the C++ source code into a .so (shared object) file. However, I am unsure about how to properly utilize this module to achieve my goal.

Could you please guide me on how to use this file or integrate it within my existing setup? Any help or guidance would be greatly appreciated.

Thank you!
This is my yaml:

- name: "I am a Light User"
  description: "Installs the basics. Browser, Multimedia Player, FreeTube etc"
  critical: false
  hidden: false
  selected: false
  packages:
    - libreoffice

- name: "I am a GAMER!"
  description: "Installs everything needed for a Gaming Ready System"
  critical: false
  hidden: false
  selected: false
  packages:
    - steam-installer
    - gamemode
    - goverlay
    - gamescope
    - wmctrl
    - libreoffice
and my idea put
  flatpaks:
    - com.expidusos.calculator 
like packages. Is this possible? 

@dalto8
Copy link
Collaborator

dalto8 commented Sep 20, 2023

However, I am unsure about how to properly utilize this module to achieve my goal.

This module only populates the list.

What you are trying to do is to use the netinstall module to install packages using multiple backends. However, it doesn't currently have an ability to support that. You can use it to install flatpaks or you can use it to install repo packages but not both.

I think you would need to modify the netinstall module(and maybe the packages module) to support your use case.

@nintyfan
Copy link
Contributor Author

Hi @nintyfan,

I am currently working on installing a module which supports both Flatpak and apt packages. I have managed to download the necessary files and successfully compiled the C++ source code into a .so (shared object) file. However, I am unsure about how to properly utilize this module to achieve my goal.

Could you please guide me on how to use this file or integrate it within my existing setup? Any help or guidance would be greatly appreciated.

Thank you! This is my yaml:

- name: "I am a Light User"
  description: "Installs the basics. Browser, Multimedia Player, FreeTube etc"
  critical: false
  hidden: false
  selected: false
  packages:
    - libreoffice

- name: "I am a GAMER!"
  description: "Installs everything needed for a Gaming Ready System"
  critical: false
  hidden: false
  selected: false
  packages:
    - steam-installer
    - gamemode
    - goverlay
    - gamescope
    - wmctrl
    - libreoffice
and my idea put
  flatpaks:
    - com.expidusos.calculator 
like packages. Is this possible? 

I have send PR to main calamares bugtracker. It contains support for installing flatpak. This code is designed to achieve different goal: populate list of packages. For more info, see related issue.

@nintyfan
Copy link
Contributor Author

Hi @nintyfan,

I am currently working on installing a module which supports both Flatpak and apt packages. I have managed to download the necessary files and successfully compiled the C++ source code into a .so (shared object) file. However, I am unsure about how to properly utilize this module to achieve my goal.

Could you please guide me on how to use this file or integrate it within my existing setup? Any help or guidance would be greatly appreciated.

Thank you! This is my yaml:

- name: "I am a Light User"
  description: "Installs the basics. Browser, Multimedia Player, FreeTube etc"
  critical: false
  hidden: false
  selected: false
  packages:
    - libreoffice

- name: "I am a GAMER!"
  description: "Installs everything needed for a Gaming Ready System"
  critical: false
  hidden: false
  selected: false
  packages:
    - steam-installer
    - gamemode
    - goverlay
    - gamescope
    - wmctrl
    - libreoffice
and my idea put
  flatpaks:
    - com.expidusos.calculator 
like packages. Is this possible? 

I have send PR to main calamares bugtracker. It contains support for installing flatpak. This code is designed to achieve different goal: populate list of packages. For more info, see related issue.

Hi @nintyfan,

I am currently working on installing a module which supports both Flatpak and apt packages. I have managed to download the necessary files and successfully compiled the C++ source code into a .so (shared object) file. However, I am unsure about how to properly utilize this module to achieve my goal.

Could you please guide me on how to use this file or integrate it within my existing setup? Any help or guidance would be greatly appreciated.

Thank you! This is my yaml:

- name: "I am a Light User"
  description: "Installs the basics. Browser, Multimedia Player, FreeTube etc"
  critical: false
  hidden: false
  selected: false
  packages:
    - libreoffice

- name: "I am a GAMER!"
  description: "Installs everything needed for a Gaming Ready System"
  critical: false
  hidden: false
  selected: false
  packages:
    - steam-installer
    - gamemode
    - goverlay
    - gamescope
    - wmctrl
    - libreoffice
and my idea put
  flatpaks:
    - com.expidusos.calculator 
like packages. Is this possible? 

I think you should place source field to package group. Next - packaging module should split packages based on this info and install it separately. To achieve this, netinstall or other should copy source info from package group into related packages.

modules/flatpakinfo/CMakeLists.txt Show resolved Hide resolved
modules/flatpakinfo/CMakeLists.txt Outdated Show resolved Hide resolved
modules/flatpakinfo/ItemFlatpak.cpp Show resolved Hide resolved
modules/flatpakinfo/ItemFlatpak.cpp Outdated Show resolved Hide resolved
modules/flatpakinfo/ItemFlatpak.cpp Outdated Show resolved Hide resolved
modules/flatpakinfo/ItemFlatpak.h Outdated Show resolved Hide resolved
modules/flatpakinfo/ItemFlatpak.h Outdated Show resolved Hide resolved
modules/flatpakinfo/ItemFlatpak.h Outdated Show resolved Hide resolved
modules/flatpakinfo/ItemFlatpak.h Outdated Show resolved Hide resolved
modules/flatpakinfo/PackagePool.h Outdated Show resolved Hide resolved
@adriaandegroot
Copy link
Contributor

So, overall, here is the thing you are trying to do:

  • get a list of flatpaks (that are available for installation) by running flatpak tools inside the target system
  • adding those flatpaks to the data for netinstall, so that a following netinstall step can display those packages
  • (and then existing mechanisms will somehow install those flatpaks that are selected in netinstall)

@nintyfan
Copy link
Contributor Author

So, overall, here is the thing you are trying to do:

* get a list of flatpaks (that are available for installation) by running flatpak tools inside the target system

* adding those flatpaks to the data for netinstall, so that a following netinstall step can display those packages

* (and then existing mechanisms will somehow install those flatpaks that are selected in netinstall)

You are right. I do not known if mechanism inside packages is merged. I send it. Firstly, we need to wait for merge to packages module.

@dalto8
Copy link
Collaborator

dalto8 commented Oct 22, 2023

For me, personally, I would not be comfortable merging this with that global variable and all those free functions that reference it. I really think it should have an object model more similar to the rest of the C++ Calamares code.

However, this is extensions so someone else may feel differently.

@nintyfan
Copy link
Contributor Author

nintyfan commented Oct 22, 2023 via email

@dalto8
Copy link
Collaborator

dalto8 commented Oct 23, 2023

Which global variable?

Any global variable.

Did you write about installed package list?

Yes, that was the one I noticed.

@nintyfan
Copy link
Contributor Author

Variable removed.
I am not object-oriented programming enthusiast, so maybe I do something wrong, especially look at constructor I create in latest patch: is it valid to prepare installed list inside constructor? Maybe better to not establish connection and allocate memory inside and move this to separate method?

@nintyfan
Copy link
Contributor Author

I think, there is no more global-variables in flatpakinfo module.

@nintyfan
Copy link
Contributor Author

Hi @nintyfan,

I am currently working on installing a module which supports both Flatpak and apt packages. I have managed to download the necessary files and successfully compiled the C++ source code into a .so (shared object) file. However, I am unsure about how to properly utilize this module to achieve my goal.

Could you please guide me on how to use this file or integrate it within my existing setup? Any help or guidance would be greatly appreciated.

Thank you! This is my yaml:

- name: "I am a Light User"
  description: "Installs the basics. Browser, Multimedia Player, FreeTube etc"
  critical: false
  hidden: false
  selected: false
  packages:
    - libreoffice

- name: "I am a GAMER!"
  description: "Installs everything needed for a Gaming Ready System"
  critical: false
  hidden: false
  selected: false
  packages:
    - steam-installer
    - gamemode
    - goverlay
    - gamescope
    - wmctrl
    - libreoffice
and my idea put
  flatpaks:
    - com.expidusos.calculator 
like packages. Is this possible? 

Hi. I tries to send private message, but I cannot. You can use instance of Calamares module and joins PACKAGES string with instance name - both in packages.py and in some file of calamares library (search for add packages to install), where packages list to install was built.

To get instance:
netinstall@normal_packages
packages@normal_packages
netinstall@flatpak
packages@flatpak

You must also wrote special configuration for each instance of modules (netinstall@normal_packages, packages@normal_packages, ...) . I think, that it should work.

@Airmancooma
Copy link

Hi @nintyfan,
I am currently working on installing a module which supports both Flatpak and apt packages. I have managed to download the necessary files and successfully compiled the C++ source code into a .so (shared object) file. However, I am unsure about how to properly utilize this module to achieve my goal.
Could you please guide me on how to use this file or integrate it within my existing setup? Any help or guidance would be greatly appreciated.
Thank you! This is my yaml:

- name: "I am a Light User"
  description: "Installs the basics. Browser, Multimedia Player, FreeTube etc"
  critical: false
  hidden: false
  selected: false
  packages:
    - libreoffice

- name: "I am a GAMER!"
  description: "Installs everything needed for a Gaming Ready System"
  critical: false
  hidden: false
  selected: false
  packages:
    - steam-installer
    - gamemode
    - goverlay
    - gamescope
    - wmctrl
    - libreoffice
and my idea put
  flatpaks:
    - com.expidusos.calculator 
like packages. Is this possible? 

Hi. I tries to send private message, but I cannot. You can use instance of Calamares module and joins PACKAGES string with instance name - both in packages.py and in some file of calamares library (search for add packages to install), where packages list to install was built.

To get instance: netinstall@normal_packages packages@normal_packages netinstall@flatpak packages@flatpak

You must also wrote special configuration for each instance of modules (netinstall@normal_packages, packages@normal_packages, ...) . I think, that it should work.

Oh sorry I completely forgot about that but thanks for replying! I was so annoyed with calamares that I made my own in python for my debian linux. It still needs some work because systemd-boot and grub need to be separate etc etc but since I do it I know what I need and I can configure what I want a thousand times better than in calamares where there is no proper description...

@nintyfan nintyfan marked this pull request as draft December 9, 2023 19:02
@nintyfan nintyfan marked this pull request as ready for review September 7, 2024 09:01
Copy link
Contributor Author

@nintyfan nintyfan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably done all of requests.

@adriaandegroot adriaandegroot merged commit a50195e into calamares:calamares Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants