Skip to content

audacity_4: init at 4.0.0 - #559623

Merged
wegank merged 1 commit into
NixOS:masterfrom
johnrichardrinehart:audacity-4.0.0
Sep 7, 2026
Merged

wegank merged 1 commit into
NixOS:masterfrom
johnrichardrinehart:audacity-4.0.0

Conversation

@johnrichardrinehart

@johnrichardrinehart johnrichardrinehart commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

The prerequisite #557920 has merged. Verification of an aarch64-linux build producing an x86_64-linux executable is in progress.

Description of changes

Update audacity to 4.0.0, retain 3.7.9 as audacity_3, and provide audacity_4 as an alias. Use Qt 6, the official source archive, and pinned offline dependencies. Supported libraries come from nixpkgs. Declare Expat explicitly and disable WebKit in wxWidgets.

On Darwin, build only the host architecture and use stdenv.hostPlatform.darwinMinVersion. Retain Qt bundling. Supply NIX_QMLIMPORTSCANNER and existing QML import directories. Pass -no-strip to macdeployqt; Nix performs final stripping.

Install the bundle under $out/Applications and provide $out/bin/audacity. Wrap only the application executable, not bundled framework libraries. Clear external Qt plugin/QML search paths to avoid loading a second Qt installation. Preserve FFmpeg/JACK runtime library paths. This incorporates @wegank’s bundling and layout recommendations.

Vendor the upstream patches in-tree, with their PR links beside each entry in patches:

The unused bundling-disable patch from audacity/audacity#12026 is removed. No downstream CMake substitution is needed for deployment options.

Audacity 3 retains strictDeps, __structuredAttrs, and native wxWidgets for wx-config, as explicitly requested. These are the only differences from the moved master packaging; rapidjson.patch is byte-identical. Its deployment-target correction remains separate in #560876.

Verification

  • The promoted package built successfully on an M2 MacBook running macOS 15.6.1. --long-version and --plugin-registration-self-test passed, including Nyquist resource lookup.
  • The user confirmed GUI runtime operation with a small recording in both Audacity 4.0.0 and Audacity 3.7.9 on the M2. Audacity 3 also built successfully from this PR with strict dependencies and structured attributes enabled.
  • A Linux-hosted wrapper smoke test exercised the actual Darwin hooks: both entry points cleared conflicting Qt paths, preserved runtime library paths and arguments, and loaded an unwrapped bundled shared library.
  • x86_64-linux, aarch64-linux, and aarch64-darwin evaluation passed. Formatting passed. Linux keeps automatic Qt wrapping. A full Linux build was verified earlier, not repeated for this promotion.

Deployment warnings

The earlier bundled experiment logged macOS sandbox write denials during Qt deployment but exited successfully. The affected final frameworks were complete and matched a prior working bundled artifact. Repeated forced overwrites are a hypothesis, not a confirmed cause. Post-build file modes do not establish permissions at the time of failure. No security protections were disabled. Spotlight discovery remains unverified.

Automation disclosure

OpenAI Codex assisted with implementation, upstream patches, validation, and PR text. Human review is required before merging.

The in-tree patch files are byte-identical to the previous normalized fetchpatch2 outputs. All four apply to the release archive with zero fuzz. Linux and Darwin evaluation and the formatting check passed after vendoring.

@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (new) This PR adds a new package 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. llm-assisted Contributions that include code generation with LLMs labels Sep 3, 2026
@johnrichardrinehart
johnrichardrinehart force-pushed the audacity-4.0.0 branch 3 times, most recently from 2f2c4c2 to b9e4338 Compare September 3, 2026 20:21
@claymorwan

Copy link
Copy Markdown
Contributor

little question but why not making audacity 4 as audacity and moving audacity 3 to audacity_3 ? Just trying to undersrand why

@johnrichardrinehart

Copy link
Copy Markdown
Contributor Author

little question but why not making audacity 4 as audacity and moving audacity 3 to audacity_3 ? Just trying to undersrand why

It's a good question. I don't have a good reason other than that I'm the one introducing the change and I don't want to change things silently for people. If that's better/recommended then I'm happy to change the PR.

@claymorwan

Copy link
Copy Markdown
Contributor

Well personally as a user I'd expect the regular audacity package to be the latest one while still having audicity_3 if i really want the old version. But that's just my opinion obviously if u don't like it or if other maintainers prefer ur way then yea having audacity_4 is fine too

@johnrichardrinehart

Copy link
Copy Markdown
Contributor Author

Well personally as a user I'd expect the regular audacity package to be the latest one while still having audicity_3 if i really want the old version. But that's just my opinion obviously if u don't like it or if other maintainers prefer ur way then yea having audacity_4 is fine too

Take a look at the recent changes, if you get the chance. Basically, .#audacity_3 resolves to .#audacity as it stands before this PR lands. .#audacity is now an alias to .#audacity_4. And, so, of course, we also introduce .#audacity_4, now, too.

@nixpkgs-ci nixpkgs-ci Bot removed 10.rebuild-darwin: 1 This PR causes 1 package to rebuild on Darwin. 10.rebuild-linux: 1 This PR causes 1 package to rebuild on Linux. labels Sep 6, 2026
@OctoRocket

Copy link
Copy Markdown

Is there any particular reason why fetchurl is being used instead of sticking with fetchFromGitHub?

@nixpkgs-review-gha

Copy link
Copy Markdown

❌ nixpkgs-review result

Generated using nixpkgs-review-gha (85fc054)

Command: nixpkgs-review pr 559623
Commit: dde6cb5b818fa9f6f1f228db3e1ecf24b8ee4369 (subsequent changes)
Merge: 9d855b95788632493238f7aed154fd7ec696f2fd

Triggered by @wegank (9713184)
Logs: https://github.com/wegank/nixpkgs-review-gha/actions/runs/34110308900/attempts/1

Download packages from cache:
  • x86_64-linux
    nix-store -r \
      --option binary-caches 'https://cache.nixos.org/ https://wegank.cachix.org' \
      --option trusted-public-keys '
        cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
        wegank.cachix.org-1:xHignps7GtkPP/gYK5LvA/6UFyz98+sgaxBSy7qK0Vs=
      ' \
      /nix/store/1iirb4411bmbbxcdilmkh92izcraax17-audacity-3.7.9 \
      /nix/store/ga5jjwdma40mgy6nqq1i58krn3ws1z01-audacity-4.0.0
  • aarch64-linux
    nix-store -r \
      --option binary-caches 'https://cache.nixos.org/ https://wegank.cachix.org' \
      --option trusted-public-keys '
        cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
        wegank.cachix.org-1:xHignps7GtkPP/gYK5LvA/6UFyz98+sgaxBSy7qK0Vs=
      ' \
      /nix/store/mx2p54r2plr9imrv38i12h95vf7kfmci-audacity-4.0.0 \
      /nix/store/hfqgylf5i84whqab4jwm42gd06p68prf-audacity-3.7.9
  • aarch64-darwin
    nix-store -r \
      --option binary-caches 'https://cache.nixos.org/ https://wegank.cachix.org' \
      --option trusted-public-keys '
        cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
        wegank.cachix.org-1:xHignps7GtkPP/gYK5LvA/6UFyz98+sgaxBSy7qK0Vs=
      ' \
      /nix/store/825868rraggv93fs4s644yw3qg1x4ini-audacity-3.7.9

x86_64-linux

✅ 2 packages built:
  • audacity
  • audacity_3

aarch64-linux

✅ 2 packages built:
  • audacity
  • audacity_3

aarch64-darwin (sandbox = relaxed)

❌ 1 package failed to build:
  • audacity
✅ 1 package built:
  • audacity_3

@wegank

wegank commented Sep 7, 2026

Copy link
Copy Markdown
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 559623 --package audacity
Commit: dde6cb5b818fa9f6f1f228db3e1ecf24b8ee4369


aarch64-darwin

❌ 1 package failed to build:
  • audacity

audacity
-- Found WrapVulkanHeaders: /nix/store/hwrh2gyy4ln4khwmgc5rkqz6jixd2qjc-vulkan-headers-1.4.357.0/include
-- Found Cups: /nix/store/zjm8nm8f2nf77ycwkj1zfncsi6m83bpj-cups-2.4.19-lib/lib/libcups.dylib (found version "2.4.19")
Detected locale "C" with character encoding "US-ASCII", which is not UTF-8.
Qt depends on a UTF-8 locale, and has switched to "UTF-8" instead.
If this causes problems, reconfigure your locale. See the locale(1) manual
for more information.
-- Qt version: 6.11.2
-- Setup dependencies
CMake Error at muse_deps/buildtools/resolve.cmake:176 (message):
  [expat] system header 'expat.h' not found (USE_SYSTEM)
Call Stack (most recent call first):
  muse_deps/buildtools/resolve.cmake:477 (_extdeps_resolve_system)
  muse_deps/buildtools/manifest.cmake:109 (extdeps_resolve)
  muse_deps/buildtools/manifest.cmake:177 (_extdeps_run)
  buildscripts/cmake/DependencyManifest.cmake:1 (require_dep)
  buildscripts/cmake/SetupDependencies.cmake:15 (include)
  CMakeLists.txt:201 (include)

-- Configuring incomplete, errors occurred!

@johnrichardrinehart

Copy link
Copy Markdown
Contributor Author

@OctoRocket No specific reason for using fetchurl. Happy to use fetchFromGitHub if that’s preferred.

@nixpkgs-ci nixpkgs-ci Bot added 8.has: package (update) This PR updates a package to a newer version and removed 8.has: package (new) This PR adds a new package labels Sep 7, 2026
@johnrichardrinehart

johnrichardrinehart commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

@wegank Could you trigger a fresh nixpkgs-review for audacity on aarch64-darwin, targeting the updated PR head a87b9587da72?

I added expat as a direct build dependency to address the missing expat.h error and squashed the PR into one commit. The updated package builds on x86_64-linux, and the automatic Darwin evaluation passed, but the Darwin package build still needs verification. Thanks!

@wegank

wegank commented Sep 7, 2026

Copy link
Copy Markdown
Member

Sure, nixpkgs-review running now.

@johnrichardrinehart

Copy link
Copy Markdown
Contributor Author

The Audacity 3 macOS deployment-target inconsistency seen in the review logs is addressed separately in #560876. That PR replaces the hard-coded minimums with stdenv.hostPlatform.darwinMinVersion and is kept separate because this is a fix to the upstream-maintained Audacity 3 package, not part of the Audacity 4 upgrade.

The deployment-target smoke checks pass; native Darwin build/runtime verification is still outstanding. This Audacity 4 PR is unchanged.

@wegank

wegank commented Sep 7, 2026

Copy link
Copy Markdown
Member

I think muse_deps/recipes/wxwidgets/meta.cmake needs a patch. I'll push it once I've verified that my fix works.

@nixpkgs-review-gha

Copy link
Copy Markdown

❌ nixpkgs-review result

Generated using nixpkgs-review-gha (85fc054)

Command: nixpkgs-review pr 559623
Commit: a87b9587da72fdf2b8545c02e02755cfeaf1aea2 (subsequent changes)
Merge: eb1d3b13813452842f0a6dc471fae6646bd7f22a

Triggered by @wegank (9713184)
Logs: https://github.com/wegank/nixpkgs-review-gha/actions/runs/34118778456/attempts/1

Download packages from cache:
  • aarch64-darwin
    nix-store -r \
      --option binary-caches 'https://cache.nixos.org/ https://wegank.cachix.org' \
      --option trusted-public-keys '
        cache.nixos.org-1:6NCHdD59X431o0gWypbMrAURkbJ16ZPMQFGspcDShjY=
        wegank.cachix.org-1:xHignps7GtkPP/gYK5LvA/6UFyz98+sgaxBSy7qK0Vs=
      ' \
      /nix/store/825868rraggv93fs4s644yw3qg1x4ini-audacity-3.7.9

aarch64-darwin (sandbox = relaxed)

❌ 1 package failed to build:
  • audacity
✅ 1 package built:
  • audacity_3

@johnrichardrinehart

johnrichardrinehart commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

@wegank, your layout and bundling recommendations are now implemented in 8a1c09e9bac7.

The package retains bundled Qt dependencies, moves the bundle to $out/Applications/audacity.app, and provides $out/bin/audacity. It wraps only Audacity’s executable and clears external Qt plugin/QML search paths. Automatic bundle scanning is disabled because it can wrap bundled framework libraries as executables.

The original automatic-wrapping recommendation applied to the store-backed variant. It is not suitable for the retained-bundling variant.

The current approach and validation are described in #559623 (comment).

@wegank

wegank commented Sep 7, 2026

Copy link
Copy Markdown
Member

I submitted audacity/audacity#12026 to restore the switch. This PR consumes the commit with fetchpatch2 and disables bundling on Darwin. Nix keeps Qt dependencies in the store and wraps the application.

I don't think disable bundling is a good idea, as most users wouldn't expect to open Audacity from the terminal, but rather from Spotlight. Could you check if it's possible to keep the bundling?

@johnrichardrinehart

johnrichardrinehart commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

@wegank, replying to #559623 (comment): we will definitely investigate retaining Qt bundling, including the qmlimportscanner lookup and strip failures. Finder and Spotlight launch must work; terminal-only operation is not acceptable.

The current approach retains the application bundle and wraps its executable in Contents/MacOS, not just the command-line launcher. That wrapper supplies the Qt environment without shell initialization. However, we have not verified native Finder or Spotlight launch, so this does not settle your concern.

We're turning on our M2 Macbook to confirm native bundling and Finder/Spotlight launch behavior.

@nixpkgs-review-gha

Copy link
Copy Markdown

✅ nixpkgs-review result

Generated using nixpkgs-review-gha (00a1ae2)

Command: nixpkgs-review pr 559623 --package audacity
Commit: 2b5f1e3a450b4220d7432c3ef8c33d94ed315196 (subsequent changes)
Merge: 1859ed0395a7171352ca2defd71c76688a5461ef

Triggered by @johnrichardrinehart (6321578)
Logs: https://github.com/johnrichardrinehart/nixpkgs-review-gha/actions/runs/34132122437/attempts/1


aarch64-darwin (sandbox = relaxed)

✅ 1 package built:
  • audacity

@nixpkgs-review-gha

Copy link
Copy Markdown

✅ nixpkgs-review result

Generated using nixpkgs-review-gha (00a1ae2)

Command: nixpkgs-review pr 559623 --package audacity
Commit: 1dcb32c89bc68bc07a14ab0c983acfaccd6638a0 (subsequent changes)
Merge: 3145b0c0884f263afd1f4c1ce51503de9a9d9a6b

Triggered by @johnrichardrinehart (6321578)
Logs: https://github.com/johnrichardrinehart/nixpkgs-review-gha/actions/runs/34133562198/attempts/1


aarch64-darwin (sandbox = relaxed)

✅ 1 package built:
  • audacity

@johnrichardrinehart

johnrichardrinehart commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

@wegank, native testing on the M2 MacBook confirms that retained Qt bundling can complete the build. The experiment sets the existing Nix Qt override NIX_QMLIMPORTSCANNER, supplies only existing QML import directories, and passes -no-strip to macdeployqt. Nix still performs its normal stripping phase.

The first bundled artifact then failed at runtime: the automatic Qt hook wrapped copied framework libraries as executables. dyld rejected QtCore5Compat with “cannot link against a main executable”. For retained bundling, your targeted wrapQtApp approach is necessary here: disable automatic bundle scanning and wrap only Audacity’s executable. The corrected experiment built successfully on the M2 and passed --long-version and --plugin-registration-self-test. The self-test found the bundled Nyquist runtime resources. These checks do not establish successful GUI plugin scanning or Spotlight discovery. My earlier statement that an explicit call was unnecessary applied to the store-backed variant, not a bundle containing executable-bit framework libraries.

The bundling changes are now promoted in commit 8a1c09e9bac7; see #559623 (comment).

@wegank

wegank commented Sep 7, 2026

Copy link
Copy Markdown
Member

Okay. So let's go back to bundling, do the wrapQtApp thing, and then ship it? #557920 has already been merged.

@johnrichardrinehart

johnrichardrinehart commented Sep 7, 2026 •

Copy link
Copy Markdown
Contributor Author

Okay. So let's go back to bundling, do the wrapQtApp thing, and then ship it? #557920 has already been merged.

@wegank Yeah, let's go back to bundling. But, I had to use dontWrapQtApps because Qt framework libs were being wrapped as executables which broke things at runtime. I ended up using wrapProgram in postFixup to try to provide only a single version of Qt at runtime. I had an earlier/proto version of this wrapping work which accidentally included 2 different copies of Qt (macdeployqt + our nix wrapper) which failed Cocoa initialization. So, the latest commit is what I've landed on, runtime-tested on x86_64-linux and aarch64-darwin (recorded a small clip to prove hardware and software).

Before merging/shipping: the derivation/package.nix looks pretty gross, now, so I'd love recommendations on how to clean it up if it's possible.

@nixpkgs-review-gha

Copy link
Copy Markdown

✅ nixpkgs-review result

Generated using nixpkgs-review-gha (00a1ae2)

Command: nixpkgs-review pr 559623 --package audacity
Commit: 8a1c09e9bac7ae241443733e0da9c7dda16f3fb9 (subsequent changes)
Merge: e3950318d8c9f1452a9acaf2f7f9cb4b1673d973

Triggered by @johnrichardrinehart (6321578)
Logs: https://github.com/johnrichardrinehart/nixpkgs-review-gha/actions/runs/34142689593/attempts/1


aarch64-darwin (sandbox = relaxed)

✅ 1 package built:
  • audacity

@nixpkgs-review-gha

Copy link
Copy Markdown

✅ nixpkgs-review result

Generated using nixpkgs-review-gha (00a1ae2)

Command: nixpkgs-review pr 559623 --package audacity --package audacity_3
Commit: 1de9554ef4b89bbbf7cae8cf592485e832fa96da (subsequent changes)
Merge: 1a9abdabde38bf44a475f6af2e04daf4c0b5b6e3

Triggered by @johnrichardrinehart (6321578)
Logs: https://github.com/johnrichardrinehart/nixpkgs-review-gha/actions/runs/34144951979/attempts/1


x86_64-linux

✅ 2 packages built:
  • audacity
  • audacity_3

aarch64-linux

✅ 2 packages built:
  • audacity
  • audacity_3

aarch64-darwin (sandbox = relaxed)

✅ 2 packages built:
  • audacity
  • audacity_3

Comment thread pkgs/by-name/au/audacity/package.nix Outdated
Make Audacity 4 the default, retain Audacity 3 as audacity_3, and provide audacity_4 as an alias.

Use the official offline source archive and system libraries. Disable WebKit in wxWidgets, enable strict dependency checking, and declare Expat explicitly.

Build for the configured Darwin architecture and minimum macOS version. Fetch commit-pinned upstream fixes for wxWidgets framework linking and deployment target overrides.

Assisted-by: OpenAI Codex / GPT-5.6-sol

Assisted-by: OpenAI Codex / GPT-6-astra
@wegank
wegank added this pull request to the merge queue Sep 7, 2026
Merged via the queue into NixOS:master with commit f261125 Sep 7, 2026
28 checks passed
@wegank

wegank commented Sep 7, 2026

Copy link
Copy Markdown
Member

Feel free to add yourself as a maintainer, if you are interested!

@johnrichardrinehart

Copy link
Copy Markdown
Contributor Author

The aarch64-linux to x86_64-linux cross-build and local execution checks now pass with two follow-up fixes: Qt Declarative host-tool discovery in #561181, and Audacity host-tool selection in #561198.

The unmodified cross-build first failed on mixed native/target Qt setup hooks, then exposed missing Qt Quick in the cross-built dependency. Both causes are addressed separately. The resulting x86_64 executable ran locally: --long-version and --plugin-registration-self-test exited 0. This is startup/initialization coverage, not a recording test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

8.has: package (update) This PR updates a package to a newer version 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. llm-assisted Contributions that include code generation with LLMs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants