Skip to content

processing: Move to gradle-based build#466611

Merged
uninsane merged 4 commits intoNixOS:masterfrom
neobrain:processing-gradle
Feb 26, 2026
Merged

processing: Move to gradle-based build#466611
uninsane merged 4 commits intoNixOS:masterfrom
neobrain:processing-gradle

Conversation

@neobrain
Copy link
Copy Markdown
Contributor

@neobrain neobrain commented Nov 30, 2025

This drops use of upstream's deprecated ant build system in favor of the Gradle build scripts introduced in Processing 4.4.

Doing so has the nice side effect of enabling some previously broken functionality such as examples not being bundled.

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • [ ] Package update: when the change is major or breaking.
  • NixOS Release Notes
    • [ ] Module addition: when adding a new NixOS module.
    • [ ] Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

Add a 👍 reaction to pull requests you find important.

@neobrain neobrain mentioned this pull request Nov 30, 2025
7 tasks
ln -sf ${batik}/* java/libraries/svg/library/
cp java/libraries/svg/library/share/java/batik-all-${batik.version}.jar java/libraries/svg/library/batik.jar
echo "tarring ffmpeg"
tar --checkpoint=10000 -czf build/shared/tools/MovieMaker/ffmpeg-5.0.1.gz ${ffmpeg}
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note: I wasn't sure why this was needed before. Is it still required?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We unbundled the moviemaker tool

@nixpkgs-ci nixpkgs-ci Bot requested a review from evan-goode November 30, 2025 16:27
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Nov 30, 2025
@neobrain
Copy link
Copy Markdown
Contributor Author

neobrain commented Nov 30, 2025

Upstream generates a binary called Processing instead of processing now, which breaks nix run nixpkgs#processing (since that case-sensitively looks for bin/processing). How does one typically resolve this? Is there an attribute I can override, or should we just rename the binary back to processing (overriding upstream)?

@fxzzi
Copy link
Copy Markdown
Contributor

fxzzi commented Nov 30, 2025

Upstream generates a binary called Processing instead of processing now, which breaks nix run nixpkgs#processing (since that case-sensitively looks for bin/processing). How does one typically resolve this? Is there an attribute I can override, or should we just rename the binary back to processing (overriding upstream)?

set meta.mainProgram to Processing

@evan-goode
Copy link
Copy Markdown
Member

Upstream generates a binary called Processing instead of processing now

Unfortunate, this is a script-breaking and confusing change. Could we ship a processing symlink?

@neobrain
Copy link
Copy Markdown
Contributor Author

neobrain commented Dec 1, 2025

set meta.mainProgram to Processing

Thanks, done!

Unfortunate, this is a script-breaking and confusing change. Could we ship a processing symlink?

Presumably this would put both processing and Processing into my environment if I were to use nix profile install nixpkgs#processing, so not sure this is desirable either. I don't have a strong opinion on this either way, but for now I just went with the meta attribute.

@nixpkgs-ci nixpkgs-ci Bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Dec 13, 2025
@nixpkgs-ci nixpkgs-ci Bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Feb 2, 2026
@Stefterv
Copy link
Copy Markdown

Stefterv commented Feb 2, 2026

Does it make sense to upstream any of the patches @neobrain?

@@ -0,0 +1,24 @@
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Stefterv Without this patch, the build fails since it somehow doesn't find the createDistributable task. Does this make any sense to you?

processing> Running phase: buildPhase
processing> +++ gradle createDistributable
...
processing> FAILURE: Build failed with an exception.
processing> 
processing> * Where:
processing> Build file '/build/source/app/build.gradle.kts' line: 536
processing> 
processing> * What went wrong:
processing> Could not create task ':app:zipDistributable'.
processing> > Task with name 'createDistributable' not found in project ':app'.

We don't need the zip distributable either way, but its built automatically as part of "gradle assemble/createDistributable". Here are some options:

  • Figure out where that error comes from and fix it (and then build the zip distributable and throw it away)
  • Use another command than gradle assemble/createDistributable that only builds required files (if that exists?)
  • Keep this ugly patch in nixpkgs to skip the target

Copy link
Copy Markdown

@Stefterv Stefterv Feb 2, 2026

Choose a reason for hiding this comment

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

I have had issues before that the tasks generated by the Compose Packager are unavailable until later in the evaluation of the gradle files

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Just also noticed that on the latest commit this has been refactored a bit. Could you check if it happens to be working rn

Copy link
Copy Markdown
Contributor Author

@neobrain neobrain Feb 2, 2026

Choose a reason for hiding this comment

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

Is 4.5.2 recent enough or would I have to try latest git?

4.5.2 still has the same error.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Ah latest git, merged it in today

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Same error with 735bfa6 :(

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I have had issues before that the tasks generated by the Compose Packager are unavailable until later in the evaluation of the gradle files

Is there a way to eagerly trigger generation of these CP tasks?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Just cleaned up the existing approach and added a comment about it for now.

@neobrain
Copy link
Copy Markdown
Contributor Author

neobrain commented Feb 2, 2026

Does it make sense to upstream any of the patches @neobrain?

  • It would be nice if we found a way to make the skip-distributable.patch unnecessary (see my other comment)
  • Processing's gradle build pulls the "latest main" from processing-website and processing-examples, which is not compatible with nix's reproducibility requirements. But we need to maintain pins in deps.json anyway, and the substituteInPlace line added in 5af181b isn't the worst thing to have. No action needed from upstream.
  • fix-permissions.patch could be merged upstream, at least I don't see any downside in doing so

(btw, quick reminder that the nixpkgs review queue is prioritized by number of upvotes on the PR description 😇 )

cp -dpr app/build/compose/binaries/main/app/Processing/bin $out/unwrapped

mkdir -p $out/share/applications/
cp -dp build/linux/${pname}.desktop $out/share/applications/
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this .desktop file is old and will be deleted soon

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

sorry!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Is there a replacement? Remember Linux apps don't typically get taskbar/tabswitcher icons without desktop files.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Yes, but it is in the .deb file 🫠

Copy link
Copy Markdown

@Stefterv Stefterv Feb 2, 2026

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Where does the deb come from? Does gradle generate it automatically for you?

Nix can write its own desktop file if need be, though it still needs to know where to find official icons etc.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Run gradle packageDeb

@@ -0,0 +1,24 @@
diff --git a/app/build.gradle.kts b/app/build.gradle.kts
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This PR is merged so the patch can be removed no?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

nixpkgs pins package versions, so it still builds processing 4.4.10. We can trivially update in a follow-up once my PR is merged though. (That being said, dropping the patch from nixpkgs also requires upstream/you to ship the PR in a release, which I think hasn't happened yet?)

@neobrain neobrain force-pushed the processing-gradle branch 3 times, most recently from d1ecaca to 0dd7ec2 Compare February 3, 2026 18:12
@neobrain
Copy link
Copy Markdown
Contributor Author

neobrain commented Feb 3, 2026

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 466611
Commit: 0dd7ec2d9b9b77915559ff487eeee039c357123c


aarch64-linux

✅ 1 package built:
  • processing

@neobrain
Copy link
Copy Markdown
Contributor Author

neobrain commented Feb 9, 2026

@Stefterv @evan-goode Could we move forward with this? The deprecated ant build is not a robust base for future Processing version updates, and once this PR is in we can easily update from 4.4.10 to the current 4.5.2.

@Stefterv
Copy link
Copy Markdown

Stefterv commented Feb 9, 2026

All good with me, would just mention that a 4.5.3 is incoming...

@nixpkgs-ci nixpkgs-ci Bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Feb 9, 2026
@evan-goode
Copy link
Copy Markdown
Member

Works great in my testing! My only lingering complaint is the Processing binary...

Presumably this would put both processing and Processing into my environment if I were to use nix profile install nixpkgs#processing, so not sure this is desirable either. I don't have a strong opinion on this either way, but for now I just went with the meta attribute.

I would prefer having both Processing and processing. Primarily to avoid breaking existing scripts, but also since lowercase binary names are easier to type and more idiomatic. The freecad derivation in nixpkgs has both; the binary is bin/FreeCAD but there is a bin/freecad symlink to bin/FreeCAD.

@neobrain
Copy link
Copy Markdown
Contributor Author

Works great in my testing!

Thanks for giving it a spin!

My only lingering complaint is the Processing binary...
I would prefer having both Processing and processing. Primarily to avoid breaking existing scripts, but also since lowercase binary names are easier to type and more idiomatic. The freecad derivation in nixpkgs has both; the binary is bin/FreeCAD but there is a bin/freecad symlink to bin/FreeCAD.

Fair enough, I adopted the symlink approach from the FreeCAD derivation so that we get both Processing and processing now.

@neobrain
Copy link
Copy Markdown
Contributor Author

I would prefer having both Processing and processing. Primarily to avoid breaking existing scripts, but also since lowercase binary names are easier to type and more idiomatic. The freecad derivation in nixpkgs has both; the binary is bin/FreeCAD but there is a bin/freecad symlink to bin/FreeCAD.

Gentle ping now that there's both, is there anything more to do here? :)

Copy link
Copy Markdown
Member

@evan-goode evan-goode left a comment

Choose a reason for hiding this comment

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

LGTM, thank you!

@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 2 This PR was reviewed and approved by two persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. and removed 12.approvals: 1 This PR was reviewed and approved by one person. labels Feb 21, 2026
@neobrain
Copy link
Copy Markdown
Contributor Author

@uninsane Apologies for the ping, but any chance this could be queued for merging? The change enables future package updates (while also fixing functionality that was broken before) and has approval by upstream & by the nixpkgs maintainer.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Suggested change
(fetchurl {
# Remove after next release
name = "dir-permissions";
url = "https://github.com/processing/processing4/commit/9156f46974be1ff69ee3d1b6c5457e09477ea751.patch?full_index=1";
hash = "sha256-jc6KWhal9zLHU7QWT26XUmIIF+2C3itiaflxUEazqBQ=";
})

& remove the vendored fix-permissions.patch file

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good one, thanks!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Oof, bad news: The upstream patch doesn't actually work for me. So I reverted back to the vendored patch for now :/

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@Stefterv Did you intentionally patch the includeJavaMode step upstream instead of the includeJdk one? That seems to be the main difference between the two changes.

Comment thread pkgs/by-name/pr/processing/package.nix
@uninsane
Copy link
Copy Markdown
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 466611
Commit: 65cc689085e0841a2e5583b4db31f23afd7eb003


x86_64-linux

✅ 2 packages built:
  • nixpkgs-manual
  • processing

@uninsane
Copy link
Copy Markdown
Contributor

it's fine to sort out the patch/upstream discrepancies after merging / in a separate PR.

@uninsane uninsane added this pull request to the merge queue Feb 26, 2026
Merged via the queue into NixOS:master with commit 2c78d8e Feb 26, 2026
28 of 32 checks passed
@neobrain
Copy link
Copy Markdown
Contributor Author

Great, thanks again for the reviews everyone :)

@neobrain neobrain deleted the processing-gradle branch February 26, 2026 09:18
github-merge-queue Bot pushed a commit that referenced this pull request Apr 10, 2026
Resolves #501949.

Following #466611, JOGL from Maven
was being used instead of JOGL in nixpkgs. The nixpkgs JOGL contains a
patch to nixify a reference to /bin/true.

Assisted-by: GLM-5
halfwhey pushed a commit to halfwhey/nixpkgs that referenced this pull request Apr 12, 2026
Resolves NixOS#501949.

Following NixOS#466611, JOGL from Maven
was being used instead of JOGL in nixpkgs. The nixpkgs JOGL contains a
patch to nixify a reference to /bin/true.

Assisted-by: GLM-5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. 12.approvals: 2 This PR was reviewed and approved by two persons. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants