Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

{id3lib,game-music-emu,mpd,a52dec,yabai,handbrake,cmus}: fix on aarch64-darwin #137942

Closed
wants to merge 11 commits into from

Conversation

emilazy
Copy link
Member

@emilazy emilazy commented Sep 15, 2021

Motivation for this change

The third in the series of quick Apple Silicon fixes, and maybe the last batch for now.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

These appear to be two independent packages of exactly the same piece of
software! Replace the one that's broken on aarch64-darwin with the one
that isn't.
This fixes the build on aarch64-darwin.
liba52 is the library; a52dec is the example program it ships with. Most
(all?) of the packages depending on this use it for the library; a52dec
is left as an alias for users.
@r-rmcgibbo
Copy link

r-rmcgibbo commented Sep 15, 2021

Result of nixpkgs-review pr 137942 at 9d82782a run on aarch64-linux 1

3 packages marked as broken and skipped:
  • obs-studio-plugins.obs-ndi
  • odpdown
  • termplay
9 packages failed to build:
80 packages skipped due to time constraints:
  • MIDIVisualizer
  • alarm-clock-applet
  • audio-recorder
  • beets
  • beetsExternalPlugins.alternatives
  • beetsExternalPlugins.copyartifacts
  • beetsExternalPlugins.extrafiles
  • byzanz
  • clementine
  • denemo
  • ...
39 packages built successfully:
  • ffmpeg-full (arcan.ffmpeg)
  • brasero
  • brasero-original
  • corrscope
  • cozy
  • eolie
  • gmrender-resurrect
  • gnome.cheese
  • gnome.totem
  • gscrabble
  • gst_all_1.gst-plugins-ugly
  • handbrake
  • imagination
  • liba52
  • lollypop
  • mopidy-iris
  • mopidy-mopify
  • mopidy-mpd
  • mopidy-mpris
  • mopidy-musicbox-webclient
  • mopidy-podcast
  • mopidy-scrobbler
  • mopidy-somafm
  • mopidy-soundcloud
  • mopidy-subidy
  • mopidy-tunein
  • mopidy-youtube
  • mpd
  • mpd-small
  • pithos
  • printrun
  • python38Packages.moderngl-window
  • python38Packages.pyglet
  • python38Packages.pytmx
  • python39Packages.moderngl-window
  • python39Packages.pyglet
  • python39Packages.pytmx
  • qt-video-wlr
  • rpiplay
3 suggestions:
  • warning: maintainers-missing

    Package does not have a maintainer. Consider adding yourself?

    Near pkgs/development/libraries/liba52/default.nix:30:3:

       |
    30 |   meta = with lib; {
       |   ^
    
  • warning: missing-patch-comment

    Consider adding a comment explaining the purpose of this patch on the line preceeding.
    Near pkgs/development/libraries/liba52/default.nix:21:5:

       |
    21 |     ./no-always-inline.patch
       |     ^
    
  • warning: missing-patch-comment

    Consider adding a comment explaining the purpose of this patch on the line preceeding.
    Near pkgs/development/libraries/liba52/default.nix:20:5:

       |
    20 |     ./no-disable-pic.patch
       |     ^
    

Note that build failures may predate this PR, and could be nondeterministic or hardware dependent.
Please exercise your independent judgement. Does something look off? Please file an issue or reach out on IRC.


Result of nixpkgs-review pr 137942 at 717c5c6 run on x86_64-linux 1

2 packages marked as broken and skipped:
  • odpdown
  • termplay
200 packages skipped due to time constraints:
  • MIDIVisualizer
  • Sylk
  • alarm-clock-applet
  • altair
  • anki-bin
  • anytype
  • appimage-run
  • apple-music-electron
  • arcan.all-wrapped
  • arcan.arcan
  • ...
17 packages built successfully:
  • ffmpeg-full (arcan.ffmpeg)
  • brasero
  • brasero-original
  • cinelerra
  • gst_all_1.gst-plugins-ugly
  • handbrake
  • imagination
  • liba52
  • libvlc
  • mpd
  • mpd-small
  • reaper
  • restream
  • rpiplay
  • transcribe
  • vlc (vlc_qt5)
  • zdoom
3 suggestions:
  • warning: missing-patch-comment

    Consider adding a comment explaining the purpose of this patch on the line preceeding.
    Near pkgs/development/libraries/liba52/default.nix:20:5:

       |
    20 |     ./no-disable-pic.patch
       |     ^
    
  • warning: maintainers-missing

    Package does not have a maintainer. Consider adding yourself?

    Near pkgs/development/libraries/liba52/default.nix:30:3:

       |
    30 |   meta = with lib; {
       |   ^
    
  • warning: missing-patch-comment

    Consider adding a comment explaining the purpose of this patch on the line preceeding.
    Near pkgs/development/libraries/liba52/default.nix:21:5:

       |
    21 |     ./no-always-inline.patch
       |     ^
    

The SourceForge site hasn't seen a release since 2002; the VideoLAN
repository has over 7 years of additional changes and fixes, including
quite a few by the maintainer listed on the SF site, so I'm going to
take it as the canonical repository. I'm not sure if these ever saw
formal release, so I've just tagged it with a commit date.

VLC needs a trivial patch to accommodate a slight API change; this was
previously reported and rejected in 2010
(https://code.videolan.org/videolan/vlc/-/issues/3731) and a patch was
shared and considered, but never applied, in 2012
(https://mailman.videolan.org/pipermail/vlc-devel/2012-January/084325.html).
I considered backing out this update in light of this, but I think
carrying the tiny VLC patch is probably the better approach;
other downstream consumers like GStreamer already handle both APIs, and
the unreleased commits include some important-looking fixes (including
potential UB).

All of this is probably irrelevant in practice, since VLC prefers using
libavcodec to decode AC3 where possible, and I imagine other software
either follows suit or ought to. Arguably the liba52 package should just
be removed.
I'm hoping this fixes the test failure on i686, though I haven't tested
it yet.
This fixes the build on aarch64-darwin.
Contains fixes for aarch64-darwin.
Contains fixes for aarch64-darwin.
Fixes the build on aarch64-darwin.
@emilazy emilazy force-pushed the even-more-aarch64-darwin-fixes branch from 9d82782 to 717c5c6 Compare September 15, 2021 04:06
@emilazy
Copy link
Member Author

emilazy commented Sep 15, 2021

Force-pushed to (hopefully) fix VLC. See 4785666 for the annoying details.

@risicle
Copy link
Contributor

risicle commented Sep 15, 2021

handbrake fails for me on macos 10.15:

builder for '/nix/store/bl50manhqg7nashcajkmkfdn4ifxrqqr-handbrake-1.4.1.drv' failed with exit code 2; last 10 log lines:
                     ^
  ../libhb/platform/macosx/vt_common.m:169:93: error: use of undeclared identifier 'kVTProfileLevel_HEVC_Main10_AutoLevel'; did you mean 'kVTProfileLevel_H264_Main_AutoLevel'?
              vt_h265_10bit_available = is_hardware_encoder_available(kCMVideoCodecType_HEVC, kVTProfileLevel_HEVC_Main10_AutoLevel);
                                                                                              ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                                                                              kVTProfileLevel_H264_Main_AutoLevel
  /nix/store/avz81w2jaikr5hqs0q3n837h4ld67prf-apple-framework-VideoToolbox/Library/Frameworks/VideoToolbox.framework/Headers/VTCompressionProperties.h:258:29: note: 'kVTProfileLevel_H264_Main_AutoLevel' declared here
  VT_EXPORT const CFStringRef kVTProfileLevel_H264_Main_AutoLevel API_AVAILABLE(macosx(10.9), ios(8.0), tvos(10.2));
                              ^
  1 warning and 1 error generated.
  make: *** [../libhb/module.rules:15: libhb/platform/macosx/vt_common.o] Error 1

@emilazy
Copy link
Member Author

emilazy commented Sep 25, 2021

It looks like the VideoToolbox dependency was present before b725cd7, so I guess this is a case of the updated version depending on things that aren't in the old headers we use for x86_64-darwin. Maybe we could drop VideoToolbox support for non-Apple Silicon? That's not very satisfying though.

@risicle Could you check if it works with this (possibly evil, this doesn't seem to be done in-tree at present) change?

diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index aca7715bc5a..ab9c66af554 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -25580,7 +25580,8 @@ with pkgs;
   lxdvdrip = callPackage ../applications/video/lxdvdrip { };
 
   handbrake = callPackage ../applications/video/handbrake {
-    inherit (darwin.apple_sdk.frameworks) AudioToolbox Foundation VideoToolbox;
+    inherit (darwin.apple_sdk.frameworks) AudioToolbox Foundation;
+    inherit (darwin.apple_sdk_11_0.frameworks) VideoToolbox;
     inherit (darwin) libobjc;
   };
 

@risicle
Copy link
Contributor

risicle commented Sep 25, 2021

error: attribute 'apple_sdk_11_0' missing, at /Users/xxx/.cache/nixpkgs-review/pr-137942/nixpkgs/pkgs/top-level/all-packages.nix:25764:14

Comment on lines +16329 to +16331
id3lib = callPackage ../development/libraries/id3lib {
inherit (darwin) libiconv;
};
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
id3lib = callPackage ../development/libraries/id3lib {
inherit (darwin) libiconv;
};
id3lib = callPackage ../development/libraries/id3lib { };

libiconv is part of top-level.

description = "ATSC A/52 stream decoder";
homepage = "https://code.videolan.org/videolan/liba52";
platforms = platforms.unix;
license = licenses.gpl2Plus;
Copy link
Member

Choose a reason for hiding this comment

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

Missing maintainer

extraPostFetch = ''
echo "DATE=$(date +"%F %T %z" -r $out/NEWS.markdown)" > $out/version.txt
'';
};

# Remove with a release after 1.3.3
patches = [
(fetchpatch {
Copy link
Member

Choose a reason for hiding this comment

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

Please remove the unused fetchpatch from inputs.

@SuperSandro2000 SuperSandro2000 added the 2.status: merge conflict This PR has merge conflicts with the target branch label Nov 16, 2021
@Sciencentistguy
Copy link
Member

Any news on this PR moving forward?

@marcelarie
Copy link

👀

@Artturin
Copy link
Member

@marcelarie @Sciencentistguy feel free to pick it up

@Artturin Artturin marked this pull request as draft June 22, 2022 17:41
@SuperSandro2000
Copy link
Member

Closing due to inactivity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: merge conflict This PR has merge conflicts with the target branch 6.topic: darwin Running or building packages on Darwin 8.has: clean-up 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 11-100 10.rebuild-linux: 101-500
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants