Skip to content

dexc-desktop: Snap package#2580

Merged
JoeGruffins merged 2 commits into
decred:masterfrom
peterzen:snapcraft-builder
Apr 11, 2025
Merged

dexc-desktop: Snap package#2580
JoeGruffins merged 2 commits into
decred:masterfrom
peterzen:snapcraft-builder

Conversation

@peterzen

@peterzen peterzen commented Oct 26, 2023

Copy link
Copy Markdown
Member

This PR adds configuration, build scripts and Github workflow to build the Snap package and publishing it in the Snap Store.

The snap build uses the .deb package. The PR also contains a few fixes/improvements in the deb build:

  • Icons: added SVG icon for hicolor and symbolic variations, fixed 128px PNG to match official version
  • icon install location changed to /usr/share/icons which is the XDG standard
  • binary installs in /usr/bin directly (this is standard practice, simplifies deb scripts)
  • added AppStream metainfo file (for GNOME/KDE/Ubuntu software centers and the snap)

@peterzen
peterzen marked this pull request as ready for review November 3, 2023 16:51

@JoeGruffins JoeGruffins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Getting an error when running ./pkg/pkg-debian.sh:

dpkg-deb: error: parsing file './build/dexc_bf46fe348fb83893408e875408499761a3df5ea4-0_amd64/DEBIAN/control' near line 2 package 'dexc':
 'Version' field value 'bf46fe348fb83893408e875408499761a3df5ea4': version number does not start with digit

Comment thread client/cmd/dexc-desktop/README.md Outdated
@peterzen

peterzen commented Nov 15, 2023

Copy link
Copy Markdown
Member Author

dpkg-deb: error: parsing file './build/dexc_bf46fe348fb83893408e875408499761a3df5ea4-0_amd64/DEBIAN/control' near line 2 package 'dexc':
'Version' field value 'bf46fe348fb83893408e875408499761a3df5ea4': version number does not start with digit

It pulls the version number from the git tag - the idea being that for release builds there's always a tag but for dev builds the commit hash confuses the deb build. Maybe this needs to be reconsidered.

If you git tag v0.7.0 or similar it will work.

@JoeGruffins

Copy link
Copy Markdown
Member

It pulls the version number from the git tag - the idea being that for release builds there's always a tag but for dev builds the commit hash confuses the deb build. Maybe this needs to be reconsidered.

So the commit needs a tag to work? I did not know. Maybe add that to the readme there at least if it is a requirement?

@JoeGruffins JoeGruffins left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

After adding a bogus tag was able to build and install with snap.

@buck54321 buck54321 left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'm not seeing the benefit of the github actions deployment. What does it do for us over just running the script ourselves?

Icons: added SVG icon for hicolor and symbolic variations, fixed 128px PNG to match official version

Can you say more about the new files and what they do for us? Or point me to some documentation?

I don't care about the official logo version. I changed it because the official color was too dark and looked bad in my panel. None of this matters much, of course, because we're rebranding anyway, but prefer to use the lighter color that has margins.

Comment thread client/cmd/dexc-desktop/metainfo/org.decred.dcrdex.metainfo.xml Outdated
Comment thread client/cmd/dexc-desktop/metainfo/org.decred.dcrdex.metainfo.xml Outdated
Comment thread client/cmd/dexc-desktop/metainfo/org.decred.dcrdex.metainfo.xml
Comment thread client/cmd/dexc-desktop/metainfo/org.decred.dcrdex.metainfo.xml Outdated
Comment thread client/cmd/dexc-desktop/metainfo/org.decred.dcrdex.metainfo.xml
Comment thread client/cmd/dexc-desktop/pkg/common.sh
@peterzen

Copy link
Copy Markdown
Member Author

I'm not seeing the benefit of the github actions deployment. What does it do for us over just running the script ourselves?

It does the same thing but makes life a tad easier. snapcraft, the snap builder isn't straightforward to run on systems other than Ubuntu as it requires several manual steps to initialize lxd which the build relies on. So basically you need to run the script in an Ubuntu VM which I presumed isn't the system of choice for running release builds.

The binary it packages into a snap comes from the .deb package.

Icons: added SVG icon for hicolor and symbolic variations, fixed 128px PNG to match official version

Can you say more about the new files and what they do for us? Or point me to some documentation?

dexc.png is scaled to 128px which is one of the default icon sizes, the 100px version was scaled up and rendered blurry
dexc.svg is a scalable version which the desktop environment picks up when a bitmap in the required size is not available
dexc-symbolic.svg is a B/W version that the desktop environment might use with certain accessibility settings like monochrome etc. Also this is ideally the icon to be used in the systray as in that size this provides the most contrast.

https://specifications.freedesktop.org/icon-theme-spec/icon-theme-spec-latest.html

I don't care about the official logo version. I changed it because the official color was too dark and looked bad in my panel. None of this matters much, of course, because we're rebranding anyway, but prefer to use the lighter color that has margins.

The tray icon should really match the other icons (menu, dock, task switcher), if it's different it looks odd. How about using the monochrome version? That's the most distinctly recognizable in the tray visually.

Comment thread client/cmd/dexc-desktop/pkg/pkg-debian.sh Outdated
Comment thread client/cmd/dexc-desktop/pkg/common.sh
Comment thread client/cmd/dexc-desktop/pkg/pkg-debian.sh Outdated
Comment thread client/cmd/dexc-desktop/pkg/publish-snap.sh
Comment thread client/cmd/dexc-desktop/snap/local/snapcraft.yaml.in
Comment thread client/cmd/dexc-desktop/snap/local/snapcraft.yaml.in
Comment thread client/cmd/dexc-desktop/go.mod Outdated
Comment thread .github/workflows/README.md Outdated
Comment thread .github/workflows/build-snap.yml
@JoeGruffins

Copy link
Copy Markdown
Member

@JoeGruffins

JoeGruffins commented Mar 24, 2025

Copy link
Copy Markdown
Member

Trying to build on a clean ubuntu 24.04 but stuck at these dependencies.

E: Unable to locate package libwebkit2gtk-4.0-dev
E: Couldn't find any package by glob 'libwebkit2gtk-4.0-dev'
E: Couldn't find any package by regex 'libwebkit2gtk-4.0-dev'

Comment thread client/cmd/bisonw-desktop/README.md Outdated
Comment on lines +23 to +35
# on Ubuntu:
sudo apt-get install snap
# on Debian:
sudo apt-get install snapd
sudo snap install --classic snapcraft
sudo adduser $USER lxd
newgrp lxd
lxd init --auto
sudo ufw disable # if ufw is installed on the host, this is neccessary for lxd to have network access

@JoeGruffins JoeGruffins Mar 24, 2025

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

on Ubuntu 24.04 I had to do the things labeled Debian

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah some things have changed since this was written 2 years ago... I wonder if it's worth warming up this PR at all, considering it wasn't merged for so long.

@peterzen

peterzen commented Apr 4, 2025

Copy link
Copy Markdown
Member Author

E: Unable to locate package libwebkit2gtk-4.0-dev
E: Couldn't find any package by glob 'libwebkit2gtk-4.0-dev'
E: Couldn't find any package by regex 'libwebkit2gtk-4.0-dev'

Apparently, libwebkit2gtk-4.0 was dropped from Ubuntu as of 24.0, but github.com/webview/webview has not been updated to link against 4.1 - this breaks the build (not just the snap package). There's an open PR fixing this (https://github.com/webview/webview_go/pull/62/files) but it hasn't been merged for quite some time (webview_go seems to be unmaintained).

We have 2 options - wait for that above PR to be merged, or fork webview_go, fix the deps and use that going forward. I think option 2 is the way to go.

cc @buck54321

@JoeGruffins

Copy link
Copy Markdown
Member

I guess this should be good to go after rebase?

@peterzen

peterzen commented Apr 9, 2025

Copy link
Copy Markdown
Member Author

I guess this should be good to go after rebase?

Yes, rebase is done and the README updated as well.

@JoeGruffins

Copy link
Copy Markdown
Member

@peterzen sorry, I merged your other pr first and it created a conflict

@JoeGruffins

Copy link
Copy Markdown
Member

I was able to build on newest Ubuntu.

@JoeGruffins
JoeGruffins merged commit 846c64f into decred:master Apr 11, 2025
@peterzen
peterzen deleted the snapcraft-builder branch April 11, 2025 19:59
martonp added a commit to martonp/dcrdex that referenced this pull request Oct 15, 2025
buck54321 pushed a commit that referenced this pull request Oct 17, 2025
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.

3 participants