Skip to content

Conversation

@donmor
Copy link

@donmor donmor commented Dec 1, 2025

Makefile allows quick build/installation using make/sudo make install. debian directory adds basic support for building debian package using Makefile (target version updates debian/changelog and deb calls dpkg-buildpackage -us -uc).

Build dependencies can be installd by:

sudo apt install rustc cargo # add "-t trixie-backports" on trixie
sudo apt install libasound2-dev libudev-dev

Impl. #12633 .

@kjarosh kjarosh self-requested a review December 1, 2025 09:08
debian/control Outdated
@@ -0,0 +1,24 @@
Source: ruffle-nightly
Copy link
Member

Choose a reason for hiding this comment

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

Can you put all these files (including the Makefile) in ruffle/desktop/packages/linux/debian? If this produces more than one package (or has a potential to), it should be placed in a subdirectory there, e.g. ruffle/desktop/packages/linux/debian/ruffle, similarly to AUR

Copy link
Author

Choose a reason for hiding this comment

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

This debian directory has a 3.0 (native) format, which has to be in root directory of source code. Maybe we should use the more complicated 3.0 (quilt) format?

Copy link
Member

Choose a reason for hiding this comment

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

(Disclaimer: I'm not very proficient in debian packaging)

I think we have to talk through the general approach of building the package. I see two approaches: (1) build based on the repository, and (2) build from an external source.

Currently, we have a bit of a mix of both, but I would personally prefer the (2) approach. That's how we did AUR and Flatpak, and it just makes it easier for everyone, because packaging is not tightly coupled with the repo, and there's a hierarchy: the repo (upstream) decides how it should be built, and the package (downstream) builds it the way it should. This also fits with the general approach to packaging software, where the downstream is a separate repo.

So I would really prefer this approach, and IIUC it currently works a bit like that? Based on what you said about the tags and tarballs. But on the other side it doesn't, because it requires to be in a specific directory. Could you elaborate on the flow? Like a step by step instruction on how to produce a package with this PR? I think the (2) approach I described should be easily doable in ruffle/desktop/packages/linux/debian—the packaging code would just download the source (the tarball) and do the build as it wishes.

Copy link
Author

Choose a reason for hiding this comment

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

Debian packaging tools won't download source code; apt source does (it requires a source repository).

AFAIK:

3.0 (native) tries to build from where the debian directory is, and build the source as-is. It also build a source tarball outside the source directory (with local changes). Revisioning is not allowed.

3.0 (quilt) requires a properly named source tarball to be placed along with the source directory, and will verify the source tree with the tarball (any local file changes should be in separated patches rather than the source tree). Revisioning is required. A .dsc file and .debian.tar.xz (containing the whole debian directory with control, changelog, rules, patches, etc.) is created during build (for properly extract the source with dpkg-source -x)

Copy link
Member

Choose a reason for hiding this comment

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

Hmmm, based on what I read about the difference between (native) and (quilt), (quilt) would fit better for Ruffle, as it's not a Debian-native application. We're building a Debian package as a downstream, and coupling Ruffle with Debian that tightly could be problematic IMO.

But the main question is: what do we do with this debian packaging config? Do you want Ruffle to be published in Debian repos? Is it meant to be available for users to build? Do you want us to provide .deb packages for each release?

Copy link
Author

Choose a reason for hiding this comment

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

I'm not sure about this (I'm not a debian maintainer)... Maybe it's a good start to have debian scripts in repository.

Copy link
Member

@kjarosh kjarosh Dec 2, 2025

Choose a reason for hiding this comment

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

I'm asking because I don't see how we could use those scripts in the first place. I see issues with every application, but it would be useful to focus on the one we're planning to use, because we need to somehow address those issues before we can merge.

The main issue I see is that Ruffle does not have stable releases (and it's not gonna happen soon, the community doesn't want that), and is inherently incompatible with how Debian releases software and their stabilization process. Dependencies in Debian repos are old compared to what Ruffle uses, and we have no way of supporting older releases. It means that Debian users (using the latest Debian release) would have to use a ~8 months old Ruffle release without any patch in between the release date and today. Something is broken in Ruffle on Debian? You have to wait a year before you can enjoy the fix. (And that is without the guarantee that something else doesn't get broken by the way.)

debian/changelog Outdated
@@ -0,0 +1,5 @@
ruffle-nightly (20251201) UNRELEASED; urgency=medium
Copy link
Member

Choose a reason for hiding this comment

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

The changelog should start empty, and it should be updated by the .github/scripts/release.py script.

Copy link
Author

Choose a reason for hiding this comment

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

Without this I can't test the whole thing.

Copy link
Author

Choose a reason for hiding this comment

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

It seems that changelogs are generated upon creating releases (where they're never been written into repository files before creation of the corresponding tag). Maybe we should write a log somewhere in repository everytime a pull request is merged?

Copy link
Member

Choose a reason for hiding this comment

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

I think it's fine to leave an empty changelog, we'll only be packaging releases, no?

debian/control Outdated
@@ -0,0 +1,24 @@
Source: ruffle-nightly
Copy link
Member

Choose a reason for hiding this comment

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

How do you get the source package? Why does it have "nightly" in name, but this package doesn't?

Copy link
Author

Choose a reason for hiding this comment

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

I'd reconsider this later...

Makefile Outdated
Comment on lines 28 to 30
version:
@echo $(VERSION)
@sed -i '1s/([0-9]\{8\})/($(VERSION))/' debian/changelog
Copy link
Member

@kjarosh kjarosh Dec 1, 2025

Choose a reason for hiding this comment

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

This should not be needed after the changelog starts being properly updated.

Copy link
Author

Choose a reason for hiding this comment

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

Yep

Makefile Outdated
Comment on lines 4 to 7
VERSION := $(shell echo $(notdir $(CURDIR)) | tr -cd '0-9')
ifeq ($(VERSION),)
VERSION := $(shell date +%Y%m%d)
endif
Copy link
Member

@kjarosh kjarosh Dec 1, 2025

Choose a reason for hiding this comment

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

This should not be needed after the changelog starts being properly updated. (Not to mention it doesn't work properly.)

debian/changelog Outdated
@@ -0,0 +1,5 @@
ruffle-nightly (20251201) UNRELEASED; urgency=medium
Copy link
Member

Choose a reason for hiding this comment

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

Can't we use the version we have in Cargo.toml? Why does it say ruffle-nightly?

Copy link
Author

Choose a reason for hiding this comment

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

I initially get this from tags (which are nightly). Will change to that in Cargo.toml later.

Copy link
Member

Choose a reason for hiding this comment

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

Using approach (1) (building using the repo), this should automatically read the version from Cargo.toml, or using approach (2) (building from an external source), the version can be updated in the release script.


all: ruffle_desktop

clean:
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't it also clean the ignored files in /debian?

Copy link
Author

Choose a reason for hiding this comment

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

Will add this later

Rules-Requires-Root: no
Build-Depends:
debhelper-compat (= 13),
rustc (>= 1.86),
Copy link
Member

Choose a reason for hiding this comment

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

This will definitely desync. Maybe setting up a CI would somehow address it

Copy link
Author

Choose a reason for hiding this comment

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

Some dependencies may require a random rust toolchain version (rather than 1.85 for edition2024, etc.), I changed it to 1.86 because it complains about it. There may be a way to detect the minimum required toolchain version (hoping it won't be newer than that in sid...)

Copy link
Member

Choose a reason for hiding this comment

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

Usually, Ruffle waits several days after a new Rust version is released and then starts using it. So we generally keep up with repos such as Fedora, Arch, but I'm not sure how this works in sid.

Based on my previous interest in packaging Ruffle, we are just incompatible with most distributions, and packaging Ruffle doesn't make sense, because you would be using versions from several months ago, because dependencies cannot keep up. The only two distributions where packaging Ruffle would be doable was Fedora and Arch.

From what I see, there's rustc 1.90.0 on sid, which means the newest Ruffle version working there would be ~1 month old as of today. I think this is acceptable, but looking at the latest stable, it would be ~8 months, for the oldest stable it would be ~5 years. IMO this is unacceptable considering the current development model of Ruffle, as it would produce packages which are basically unsupported at launch. Not to mention we don't have a way of backporting bugfixes, because we don't have stable releases.

But that's also the reason we have the Flatpak app, it should work on every distro and we don't have to worry about dependencies too much.

debian/control Outdated
@@ -0,0 +1,24 @@
Source: ruffle-nightly
Copy link
Member

Choose a reason for hiding this comment

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

We'll need to have a CI set up so that this package is being built automatically. Otherwise it will decay, and merging it doesn't make sense, because we won't be supporting it properly.

It doesn't have to produce release artifacts yet, but it should be built at least once per day to make sure it doesn't start failing.

cargo build --release --package=$@
install -m755 target/release/$@ ./$@

install: ruffle_desktop
Copy link
Member

Choose a reason for hiding this comment

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

I think you missed some stuff. We have a desktop file, metainfo, and an icon which should be installed too, along the binary.

Copy link
Author

Choose a reason for hiding this comment

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

I'll add them later.

@kjarosh
Copy link
Member

kjarosh commented Dec 1, 2025

A general question: how this package is going to be used? Is it meant to be something we can attach as a release artifact? Do users have to build it themselves? Have you thought about just submitting this package to debian repositories instead?

@kjarosh kjarosh added A-desktop Area: Desktop Application linux T-feature Type: New Feature (that Flash doesn't have) labels Dec 1, 2025
@donmor
Copy link
Author

donmor commented Dec 1, 2025

A general question: how this package is going to be used? Is it meant to be something we can attach as a release artifact? Do users have to build it themselves? Have you thought about just submitting this package to debian repositories instead?

The current one is for building from source tarballs downloaded from tags (it updates changelog from extracted directory name with date, has "nightly" in source name, and is in 3.0 (native) format). The Makefile is tend to be a general-propose script (local building/installing, CIs, and other stuff). I'd try making something useful for CIs later.

@donmor donmor changed the title Add Makefile and debian directory ci: Add Makefile and debian directory Dec 2, 2025
@donmor
Copy link
Author

donmor commented Dec 2, 2025

Patch refactored, now:

  • make install installs .desktop, metainfo and icon
  • Moved debian into desktop/packages/linux/
  • Migrated to 3.0 quilt format
  • Source package ruffle now builds package ruffle-desktop
  • Now get version from cargo metadata (0.1.0 at present)
  • Get revision from directory name (any digits, but version is stripped out; use system date if got nothing from directory name)
  • make version now writes a new entry in debian/changelog, if a new revision is used, using content from .github/changelog.entries (maintained by ci: Add actions to write to changelog.entries on each merged PRs #22390 , may require extra steps)
  • make deb now do:
    • create ../ruffle_<version>.orig.tar.gz with git archive (if not exists; .orig.tar.xz is valid; make sure working tree is clean)
    • remove any existing debian directory and make a new copy from desktop/packages/linux/debian
    • run dpkg-buildpackage -us -uc

Status:

  • make deb works in a clean working tree
  • make deb works in newly extracted nightly release tarballs (not confirmed)
  • changelog.entries maintained by CIs (strip lines in previous tags)

@donmor donmor force-pushed the patch-deb branch 8 times, most recently from 9b13cb7 to 91e206c Compare December 3, 2025 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-desktop Area: Desktop Application linux T-feature Type: New Feature (that Flash doesn't have)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants