calamares / calamares-extensions

Examples of Calamares branding
36 stars 19 forks source link

Flatpak puller #28

Open nintyfan opened 11 months ago

nintyfan commented 11 months ago

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 commented 11 months ago

https://github.com/calamares/calamares-extensions/issues/27

nintyfan commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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

nintyfan commented 11 months ago

Yes. I will do this tomorrow.

nintyfan commented 11 months ago

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

Done

dalto8 commented 11 months ago

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

nintyfan commented 11 months ago

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

Repaired.

Airmancooma commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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 commented 11 months ago

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.

adriaandegroot commented 10 months ago

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

nintyfan commented 10 months ago

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 commented 10 months ago

I do not known if mechanism inside packages is merged.

That was merged on August 12th.

dalto8 commented 10 months ago

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 commented 10 months ago

Which global variable? I remove boolean variable. Did you write about installed package list? In this case, I will move it to module class, or at least - try.

niedz., 22 paź 2023, 17:08 użytkownik dalto8 @.***> napisał:

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.

— Reply to this email directly, view it on GitHub https://github.com/calamares/calamares-extensions/pull/28#issuecomment-1774119126, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGXA6Q353WJR4KTV45CKLBTYAUZGRAVCNFSM6AAAAAA4L43CVGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONZUGEYTSMJSGY . You are receiving this because you were mentioned.Message ID: @.***>

dalto8 commented 10 months ago

Which global variable?

Any global variable.

Did you write about installed package list?

Yes, that was the one I noticed.

nintyfan commented 10 months ago

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 commented 9 months ago

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

nintyfan commented 9 months ago

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 commented 9 months ago

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...