aandrew-me / ytDownloader

A modern GUI App for downloading Videos and Audios from hundreds of sites
https://ytdn.netlify.app/
GNU General Public License v3.0
935 stars 86 forks source link

[Feature Request] Update snap to latest Gnome stack like gnome-42 and update snap core version to core22 #113

Closed ghost closed 1 year ago

ghost commented 1 year ago

Description The Snap version uses outdated version of Snap base and Core, please use new core and base snap..

aandrew-me commented 1 year ago

Hello, Thanks for mentioning this. I haven't even noticed that electron-builder was using such an old base. Moreover they didn't even provide a way to change the base . ~However I still found a way to change the base~.

I am trying to find out how to build with core20+

aandrew-me commented 1 year ago

Ok I was able to build with core22. I have published the update to Snapcraft.

Now its using core22

>> snap info --verbose ytdownloader
name:      ytdownloader
summary:   Download videos and audios from Youtube and hundreds of other sites.
publisher: Andrew (aandreww)
store-url: https://snapcraft.io/ytdownloader
links:
  website:
    - https://github.com/aandrew-me/ytdownloader
license: AGPL-3.0
description: |
  Ytdownloader is a Free and Open source GUI app for downloading videos and audios from Youtube and
  hundreds of other sites including but not limited to Facebook, Instagram, Twitter, Tiktok, Twitch
  and so on..

  Source Code - https://github.com/aandrew-me/ytdownloader
notes:         
  private:     false
  confinement: strict
base:    core22
snap-id: gUWL3Wjxk7CmprKFts2KPsznR1ODvt0N
channels:
  latest/stable:    3.12.0 2023-02-26 (38) 117MB -
  latest/candidate: ↑                            
  latest/beta:      ↑                            
  latest/edge:      3.12.0 2023-02-26 (38) 117MB -
ghost commented 1 year ago

Thanks for Checking Out, I also request you to update the runtime, it currently use gnome-3-28-1804, which is pretty ancient, try to use gnome-42-2204 or even gnome-3-38-2004.

aandrew-me commented 1 year ago

I am trying to find a way

ghost commented 1 year ago

Ok, i think you may be having a extension area in Your Snap YAML, please check or search for it...

aandrew-me commented 1 year ago

For some reason, whenever I am adding gnome-42, app is not launching and I am getting errors.

You can check if its the same for you sudo snap install ytdownloader --edge

ghost commented 1 year ago

ok will try

ghost commented 1 year ago

For some reason, whenever I am adding gnome-42, app is not launching and I am getting errors.

You can check if its the same for you sudo snap install ytdownloader --edge

It works fine, downloaded from edge channel

aandrew-me commented 1 year ago

Ok great, is it using gnome-42 or the legacy gnome-3-28-1804?

aandrew-me commented 1 year ago

Also I pushed an update to edge (46th revision). Check if that works

ghost commented 1 year ago

No its using legacy gnome 28, will try the new revision

ghost commented 1 year ago

Also I pushed an update to edge (46th revision). Check if that works

The revision wont work without gnome-3-28-1804 the legacy stack

aandrew-me commented 1 year ago

Ok Thanks for letting me know, let me make some changes and I will push another update. I really appreciate your help

ghost commented 1 year ago

Can you please share your snapcraft yaml ??

ghost commented 1 year ago

The new updates have made the app not to open, downloaded the recent version..

aandrew-me commented 1 year ago

The new updates have made the app not to open, downloaded the recent version..

Yeah that happened as I removed gnome-3-28-1804

aandrew-me commented 1 year ago

The fact is, I use electron builder to build the app. So they handle the snapcraft.yaml file. What I have to do is instead specify the necessary options in package.json file. And they are still using core-18 to package with gnome-3-28-1804. Only in Alpha version of the tool they added support to change core, but that still uses the legacy gnome-3-28-1804. But there is a snapcraft.yaml file that can be modified, though its not the official way. So in package.json file I add

"snap": {
            "grade": "stable",
            "base": "core22",
            "plugs": [
                {
                    "gnome-42-2204": {
                        "interface": "content",
                        "target": "$SNAP/gnome-platform",
                        "default-provider": "gnome-42-2204"
                    }
                }
            ]
        }

And here is the snapcraft.yaml file

base: core18
grade: stable
confinement: strict
parts:
  launch-scripts:
    plugin: dump
    source: scripts
  gnome-platform-empty-dirs:
    plugin: nil
    override-build: >
      mkdir -p "$SNAPCRAFT_PART_INSTALL/data-dir/themes"
      mkdir -p "$SNAPCRAFT_PART_INSTALL/data-dir/icons"
      mkdir -p "$SNAPCRAFT_PART_INSTALL/data-dir/sounds"
      mkdir $SNAPCRAFT_PART_INSTALL/gnome-platform

  app-files:
    plugin: dump
    source: app
    organize:
      '*': app/
    stage:
      - -app/chrome-sandbox
      - -LICENSES.chromium.html
  app:
    plugin: "nil"
      # cd ~ && rm -rf ~/squashfs-root && unsquashfs /media/psf/ramdisk/electron-builder-test/dist/__snap-x64/se-wo-template_1.1.0_amd64.snap
      # comm -12 <(ls ~/squashfs-root/usr/lib/x86_64-linux-gnu/) <(ls /snap/gnome-3-28-1804/current/usr/lib/x86_64-linux-gnu/) > /media/psf/Home/f.txt
      # run snap-exclude-list.js
    stage:
      - '-usr/lib/python*'
      - '-usr/bin/python*'
      - '-var/lib/ucf'
      - '-usr/include'
      - '-usr/lib/X11'
      - '-usr/share'
      - '-usr/sbin'
      - '-usr/bin'
      - "-usr/lib/*/libicudata.*"
      - "-usr/lib/*/libicui18n.*"
      - "-usr/lib/*/libgtk-*"
      - "-usr/lib/*/libgdk-*"
      - "-usr/lib/*/glib-*"
      - "-usr/lib/*/gtk-*"
      - "-usr/lib/*/gdk-*"
      - "-usr/lib/*/krb5"
      - "-usr/lib/systemd"
      - "-usr/lib/glib-networking"
      - "-usr/lib/dconf"
      - "-usr/lib/*/avahi"
      - "-usr/lib/*/gio"
      - "-usr/lib/*/libatk*"
      - "-usr/lib/*/libatspi*"
      - "-usr/lib/*/libavahi*"
      - "-usr/lib/*/libcairo*"
      - "-usr/lib/*/libcolordprivate*"
      - "-usr/lib/*/libcolord*"
      - "-usr/lib/*/libcroco*"
      - "-usr/lib/*/libcups*"
      - "-usr/lib/*/libdatrie*"
      - "-usr/lib/*/libdconf*"
      - "-usr/lib/*/libepoxy*"
      - "-usr/lib/*/libexpatw*"
      - "-usr/lib/*/libffi*"
      - "-usr/lib/*/libfontconfig*"
      - "-usr/lib/*/libfreetype*"
      - "-usr/lib/*/libgdk_pixbuf*"
      - "-usr/lib/*/libgdk_pixbuf_xlib*"
      - "-usr/lib/*/libgio*"
      - "-usr/lib/*/libglib*"
      - "-usr/lib/*/libgmodule*"
      - "-usr/lib/*/libgmp*"
      - "-usr/lib/*/libgnutls*"
      - "-usr/lib/*/libgobject*"
      - "-usr/lib/*/libgraphite2*"
      - "-usr/lib/*/libgssapi_krb5*"
      - "-usr/lib/*/libgthread*"
      - "-usr/lib/*/libharfbuzz*"
      - "-usr/lib/*/libhogweed*"
      - "-usr/lib/*/libicuio*"
      - "-usr/lib/*/libicutest*"
      - "-usr/lib/*/libicutu*"
      - "-usr/lib/*/libicuuc*"
      - "-usr/lib/*/libidn2*"
      - "-usr/lib/*/libjbig*"
      - "-usr/lib/*/libjpeg*"
      - "-usr/lib/*/libjson*"
      - "-usr/lib/*/libk5crypto*"
      - "-usr/lib/*/libkrb5*"
      - "-usr/lib/*/libkrb5support*"
      - "-usr/lib/*/liblcms2*"
      - "-usr/lib/*/libnettle*"
      - "-usr/lib/*/libp11*"
      - "-usr/lib/*/libpango*"
      - "-usr/lib/*/libpangocairo*"
      - "-usr/lib/*/libpangoft2*"
      - "-usr/lib/*/libpixman*"
      - "-usr/lib/*/libpng16*"
      - "-usr/lib/*/libproxy*"
      - "-usr/lib/*/librest*"
      - "-usr/lib/*/librsvg*"
      - "-usr/lib/*/libsecret*"
      - "-usr/lib/*/libsoup*"
      - "-usr/lib/*/libsqlite3*"
      - "-usr/lib/*/libtasn1*"
      - "-usr/lib/*/libthai*"
      - "-usr/lib/*/libtiff*"
      - "-usr/lib/*/libunistring*"
      - "-usr/lib/*/libwayland*"
      - "-usr/lib/*/libX11*"
      - "-usr/lib/*/libXau*"
      - "-usr/lib/*/libxcb.so*"
      - "-usr/lib/*/libxcb-dri2*"
      - "-usr/lib/*/libxcb-dri3*"
      - "-usr/lib/*/libxcb-glx*"
      - "-usr/lib/*/libxcb-present*"
      - "-usr/lib/*/libxcb-render*"
      - "-usr/lib/*/libxcb-shm*"
      - "-usr/lib/*/libxcb-sync*"
      - "-usr/lib/*/libxcb-xfixes*"
      - "-usr/lib/*/libXcomposite*"
      - "-usr/lib/*/libXcursor*"
      - "-usr/lib/*/libXdamage*"
      - "-usr/lib/*/libXdmcp*"
      - "-usr/lib/*/libXext*"
      - "-usr/lib/*/libXfixes*"
      - "-usr/lib/*/libXinerama*"
      - "-usr/lib/*/libXi*"
      - "-usr/lib/*/libxkbcommon*"
      - "-usr/lib/*/libxml2*"
      - "-usr/lib/*/libXrandr*"
      - "-usr/lib/*/libXrender*"
plugs:
  gnome-3-28-1804:
    interface: content
    target: $SNAP/gnome-platform
    default-provider: gnome-3-28-1804
  gtk-3-themes:
    interface: content
    target: $SNAP/data-dir/themes
    default-provider: gtk-common-themes
  icon-themes:
    interface: content
    target: $SNAP/data-dir/icons
    default-provider: gtk-common-themes
  sound-themes:
    interface: content
    target: $SNAP/data-dir/sounds
    default-provider: gtk-common-themes

core18 is overridden by core22 from package.json file In the recent edge update I had removed the gnome-3-28-1804 part and looks like it broke the app.

ghost commented 1 year ago

Yes thats the problem remove all the gnome parts section, the latest gnome extension can be added with a single command, thats just add extension block to the app part and enter value --> [gnome], thats it remove all other gnome part, the new one automatically adds all those option so no need to specify them remove the complete last part of YAML

ghost commented 1 year ago

Do it like this : app:

   extensions: [gnome]

DONE !!

ghost commented 1 year ago

try to edit the snap yaml manually

aandrew-me commented 1 year ago

You mean removing the plugs?

plugs:
  gnome-3-28-1804:
    interface: content
    target: $SNAP/gnome-platform
    default-provider: gnome-3-28-1804
  gtk-3-themes:
    interface: content
    target: $SNAP/data-dir/themes
    default-provider: gtk-common-themes
  icon-themes:
    interface: content
    target: $SNAP/data-dir/icons
    default-provider: gtk-common-themes
  sound-themes:
    interface: content
    target: $SNAP/data-dir/sounds
    default-provider: gtk-common-themes
ghost commented 1 year ago

yes

ghost commented 1 year ago

remove them completely, the new one adds them automatically

ghost commented 1 year ago

do re share the modified yaml

aandrew-me commented 1 year ago
base: core18
grade: stable
confinement: strict
parts:
  launch-scripts:
    plugin: dump
    source: scripts
  gnome-platform-empty-dirs:
    plugin: nil
    override-build: >
      mkdir -p "$SNAPCRAFT_PART_INSTALL/data-dir/themes"
      mkdir -p "$SNAPCRAFT_PART_INSTALL/data-dir/icons"
      mkdir -p "$SNAPCRAFT_PART_INSTALL/data-dir/sounds"
      mkdir $SNAPCRAFT_PART_INSTALL/gnome-platform

  app-files:
    plugin: dump
    source: app
    organize:
      '*': app/
    stage:
      - -app/chrome-sandbox
      - -LICENSES.chromium.html
  app:
    extensions: [gnome]
    plugin: "nil"
      # cd ~ && rm -rf ~/squashfs-root && unsquashfs /media/psf/ramdisk/electron-builder-test/dist/__snap-x64/se-wo-template_1.1.0_amd64.snap
      # comm -12 <(ls ~/squashfs-root/usr/lib/x86_64-linux-gnu/) <(ls /snap/gnome-3-28-1804/current/usr/lib/x86_64-linux-gnu/) > /media/psf/Home/f.txt
      # run snap-exclude-list.js
    stage:
      - '-usr/lib/python*'
      - '-usr/bin/python*'
      - '-var/lib/ucf'
      - '-usr/include'
      - '-usr/lib/X11'
      - '-usr/share'
      - '-usr/sbin'
      - '-usr/bin'
      - "-usr/lib/*/libicudata.*"
      - "-usr/lib/*/libicui18n.*"
      - "-usr/lib/*/libgtk-*"
      - "-usr/lib/*/libgdk-*"
      - "-usr/lib/*/glib-*"
      - "-usr/lib/*/gtk-*"
      - "-usr/lib/*/gdk-*"
      - "-usr/lib/*/krb5"
      - "-usr/lib/systemd"
      - "-usr/lib/glib-networking"
      - "-usr/lib/dconf"
      - "-usr/lib/*/avahi"
      - "-usr/lib/*/gio"
      - "-usr/lib/*/libatk*"
      - "-usr/lib/*/libatspi*"
      - "-usr/lib/*/libavahi*"
      - "-usr/lib/*/libcairo*"
      - "-usr/lib/*/libcolordprivate*"
      - "-usr/lib/*/libcolord*"
      - "-usr/lib/*/libcroco*"
      - "-usr/lib/*/libcups*"
      - "-usr/lib/*/libdatrie*"
      - "-usr/lib/*/libdconf*"
      - "-usr/lib/*/libepoxy*"
      - "-usr/lib/*/libexpatw*"
      - "-usr/lib/*/libffi*"
      - "-usr/lib/*/libfontconfig*"
      - "-usr/lib/*/libfreetype*"
      - "-usr/lib/*/libgdk_pixbuf*"
      - "-usr/lib/*/libgdk_pixbuf_xlib*"
      - "-usr/lib/*/libgio*"
      - "-usr/lib/*/libglib*"
      - "-usr/lib/*/libgmodule*"
      - "-usr/lib/*/libgmp*"
      - "-usr/lib/*/libgnutls*"
      - "-usr/lib/*/libgobject*"
      - "-usr/lib/*/libgraphite2*"
      - "-usr/lib/*/libgssapi_krb5*"
      - "-usr/lib/*/libgthread*"
      - "-usr/lib/*/libharfbuzz*"
      - "-usr/lib/*/libhogweed*"
      - "-usr/lib/*/libicuio*"
      - "-usr/lib/*/libicutest*"
      - "-usr/lib/*/libicutu*"
      - "-usr/lib/*/libicuuc*"
      - "-usr/lib/*/libidn2*"
      - "-usr/lib/*/libjbig*"
      - "-usr/lib/*/libjpeg*"
      - "-usr/lib/*/libjson*"
      - "-usr/lib/*/libk5crypto*"
      - "-usr/lib/*/libkrb5*"
      - "-usr/lib/*/libkrb5support*"
      - "-usr/lib/*/liblcms2*"
      - "-usr/lib/*/libnettle*"
      - "-usr/lib/*/libp11*"
      - "-usr/lib/*/libpango*"
      - "-usr/lib/*/libpangocairo*"
      - "-usr/lib/*/libpangoft2*"
      - "-usr/lib/*/libpixman*"
      - "-usr/lib/*/libpng16*"
      - "-usr/lib/*/libproxy*"
      - "-usr/lib/*/librest*"
      - "-usr/lib/*/librsvg*"
      - "-usr/lib/*/libsecret*"
      - "-usr/lib/*/libsoup*"
      - "-usr/lib/*/libsqlite3*"
      - "-usr/lib/*/libtasn1*"
      - "-usr/lib/*/libthai*"
      - "-usr/lib/*/libtiff*"
      - "-usr/lib/*/libunistring*"
      - "-usr/lib/*/libwayland*"
      - "-usr/lib/*/libX11*"
      - "-usr/lib/*/libXau*"
      - "-usr/lib/*/libxcb.so*"
      - "-usr/lib/*/libxcb-dri2*"
      - "-usr/lib/*/libxcb-dri3*"
      - "-usr/lib/*/libxcb-glx*"
      - "-usr/lib/*/libxcb-present*"
      - "-usr/lib/*/libxcb-render*"
      - "-usr/lib/*/libxcb-shm*"
      - "-usr/lib/*/libxcb-sync*"
      - "-usr/lib/*/libxcb-xfixes*"
      - "-usr/lib/*/libXcomposite*"
      - "-usr/lib/*/libXcursor*"
      - "-usr/lib/*/libXdamage*"
      - "-usr/lib/*/libXdmcp*"
      - "-usr/lib/*/libXext*"
      - "-usr/lib/*/libXfixes*"
      - "-usr/lib/*/libXinerama*"
      - "-usr/lib/*/libXi*"
      - "-usr/lib/*/libxkbcommon*"
      - "-usr/lib/*/libxml2*"
      - "-usr/lib/*/libXrandr*"
      - "-usr/lib/*/libXrender*"

I tried building with the new yaml but still getting some error

ghost commented 1 year ago

change the core to 22 and use the following guide to change things to core22, lots of commands has changed from core18 to 22 --> https://forum.snapcraft.io/t/micro-howto-migrate-from-core20-to-core22/30188

ghost commented 1 year ago

try to preserve the old and original yaml in case anything goes wrong, the one with gnome 3.28 one

ghost commented 1 year ago

also i think the gnome empty dirs part isnt useful ?? comment it and disable it but dont delete if you may be needing it

aandrew-me commented 1 year ago

Thank you very much for helping. I am actually outside, so I can't test properly. first you clone the project then you do npm install it will install the required dependencies Once installed you will find a snapcraft.yaml file in tDownloader/node_modules/app-builder-lib/templates/snap/snapcraft.yaml

To build the app you can run ./linux.sh && npx electron-builder -l snap

ghost commented 1 year ago

Sorry for the delay,i have your snap yaml testing against it, i am myself busy creating snaps, hope i will be able to successfully implement gnome-42 ??

ghost commented 1 year ago

The problem is this is an electron build and doesnt work like other snap yamls, like other snap yamls have name, architectures and adding gnome extension is easy just adding gnome to extensions work, but the electron build structure is beyond my understanding, though i will still try, if you are also stuck without solutions, we may keep this open and will relook this in future when we have more details and understanding for this, still trying, last attempt for now from my side, keep up with the good work by reverting to original yaml with core22 atleast ....

aandrew-me commented 1 year ago

Hello, I am back.

You are right, electron-builder is handling everything here and they are still using core18 as default which is disappointing. Moreover I couldn't find much online too about about building snap apps with electron-builder

ghost commented 1 year ago

Yeps, so lets leave it for now and use the legacy methods, hope this is not the case in future ??

aandrew-me commented 1 year ago

Right, I will look more into it. There is Element-Desktop app which is built on electron and it uses a custom snapcraft.yaml file - https://github.com/kenvandine/element-desktop/blob/main/snap/snapcraft.yaml

I am trying to find out how they do it

aandrew-me commented 1 year ago

They say We simply ingest the latest deb directly from upstream and bundle it in a snap

ghost commented 1 year ago

Goodluck, i am there if any help is needed from my side...

ghost commented 1 year ago

I checked the YAML it has given some hopes also its maintained by ken a member of snapcraft himself so can be useful...

ghost commented 1 year ago

I can help in that it simple needs a deb source i mean a place from where we can get the latest builds always and then treat it as normal snap yaml, if possible check my thonny-ide yaml to understand what i am writing

aandrew-me commented 1 year ago

I can build deb files with electron-builder.

ghost commented 1 year ago

I can build deb files with electron-builder.

You got success with the deb file ??, if you have the deb file provide it to me it can be easily snapped, with gnome 42 and core22 I recently snapped a deb app xdm in snap although its still beta

aandrew-me commented 1 year ago

I can build deb files with electron-builder.

You got success with the deb file ??, if you have the deb file provide it to me it can be easily snapped, with gnome 42 and core22 I recently snapped a deb app xdm in snap although its still beta

Yes here is the link https://github.com/aandrew-me/ytDownloader/releases/download/v3.12.0/YTDownloader.deb

ghost commented 1 year ago

I can build deb files with electron-builder.

You got success with the deb file ??, if you have the deb file provide it to me it can be easily snapped, with gnome 42 and core22 I recently snapped a deb app xdm in snap although its still beta

Yes here is the link https://github.com/aandrew-me/ytDownloader/releases/download/v3.12.0/YTDownloader.deb

I will give you the prototype yaml and you can use it...

ghost commented 1 year ago

I can build deb files with electron-builder.

You got success with the deb file ??, if you have the deb file provide it to me it can be easily snapped, with gnome 42 and core22 I recently snapped a deb app xdm in snap although its still beta

Yes here is the link https://github.com/aandrew-me/ytDownloader/releases/download/v3.12.0/YTDownloader.deb

what is the path of executable, i mean where is the executable located ??, the problem here is usually deb comes with prebuilt executables but here the deb needs further processing of a file in /opt, this makes it tricky to package as the fundamental to snap deb is to simply unpack and dump them in snapcraft tree structure, but now i will have to find a workaround to further process it..

aandrew-me commented 1 year ago

Hm I don't know, I just specify deb and it builds deb formatted package.

aandrew-me commented 1 year ago

For Linux I prefer flatpaks and I don't like snaps. However as I can build snaps easily I build them. I don't have the time to go through all the hassle for building the snap package.

ghost commented 1 year ago

Ok i get it, closing this than