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

cheesecutter: unstable-2019-12-06 -> unstable-2020-04-03 #97939

Merged

Conversation

@OPNA2608
Copy link
Contributor

@OPNA2608 OPNA2608 commented Sep 13, 2020

ZHF: #97479

Also #81815, @fgaz here's the promised CheeseCutter PR.

Motivation for this change

Updated upstream commit & derivation contains fixes for macOS (will backport for ZHF once it's confirmed working by someone & merged). This'll need a Darwin user to help me test the ccutter binary.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs 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/)
    (on Linux)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.
@risicle
Copy link
Contributor

@risicle risicle commented Sep 14, 2020

Fails to build for me on macos 10.14 :(

...
clang++ -mmacosx-version-min=10.7 -I./src -O2 -c src/resid-fp/potfp.cpp -o src/resid-fp/potfp.o
clang++ -mmacosx-version-min=10.7 -I./src -O2 -c src/resid-fp/sidfp.cpp -o src/resid-fp/sidfp.o
clang++ -mmacosx-version-min=10.7 -I./src -O2 -c src/resid-fp/versionfp.cpp -o src/resid-fp/versionfp.o
clang++ -mmacosx-version-min=10.7 -I./src -O2 -c src/resid-fp/voicefp.cpp -o src/resid-fp/voicefp.o
clang++ -mmacosx-version-min=10.7 -I./src -O2 -c src/resid-fp/wavefp.cpp -o src/resid-fp/wavefp.o
clang -mmacosx-version-min=10.7 -Wl,-rpath,@executable_path/../Frameworks -o ccutter src/derelict/util/compat.o src/derelict/util/sharedlib.o src/derelict/util/exception.o src/derelict/util/loader.o src/derelict/util/wintypes.o src/derelict/util/xtypes.o src/derelict/sdl/sdl.o src/derelict/sdl/net.o src/derelict/sdl/ttf.o src/derelict/sdl/mixer.o src/derelict/sdl/image.o src/derelict/sdl/sdlfuncs.o src/derelict/sdl/sdltypes.o src/derelict/sdl/macinit/CoreFoundation.o src/derelict/sdl/macinit/DerelictSDLMacLoader.o src/derelict/sdl/macinit/ID.o src/derelict/sdl/macinit/MacTypes.o src/derelict/sdl/macinit/NSApplication.o src/derelict/sdl/macinit/NSArray.o src/derelict/sdl/macinit/NSAutoreleasePool.o src/derelict/sdl/macinit/NSDictionary.o src/derelict/sdl/macinit/NSEnumerator.o src/derelict/sdl/macinit/NSEvent.o src/derelict/sdl/macinit/NSGeometry.o src/derelict/sdl/macinit/NSMenu.o src/derelict/sdl/macinit/NSMenuItem.o src/derelict/sdl/macinit/NSNotification.o src/derelict/sdl/macinit/NSObject.o src/derelict/sdl/macinit/NSProcessInfo.o src/derelict/sdl/macinit/NSString.o src/derelict/sdl/macinit/NSZone.o src/derelict/sdl/macinit/runtime.o src/derelict/sdl/macinit/SDLMain.o src/derelict/sdl/macinit/selectors.o src/derelict/sdl/macinit/string.o src/audio/audio.o src/audio/player.o src/audio/timer.o src/audio/callback.o src/ct/purge.o src/ct/base.o src/ct/dump.o src/com/fb.o src/com/cpu.o src/com/kbd.o src/com/session.o src/com/util.o src/main.o src/ui/tables.o src/ui/dialogs.o src/ui/ui.o src/ui/input.o src/ui/help.o src/seq/seqtable.o src/seq/tracktable.o src/seq/trackmap.o src/seq/fplay.o src/seq/sequencer.o src/audio/resid/filter.o src/audio/resid/residctrl.o src/resid/envelope.o src/resid/extfilt.o src/resid/filter.o src/resid/w6_ps_.o src/resid/w6_pst.o src/resid/w6_p_t.o src/resid/w6__st.o src/resid/w8_ps_.o src/resid/w8_pst.o src/resid/w8_p_t.o src/resid/w8__st.o src/resid/pot.o src/resid/sid.o src/resid/voice.o src/resid/wave.o src/resid-fp/envelopefp.o src/resid-fp/extfiltfp.o src/resid-fp/filterfp.o src/resid-fp/potfp.o src/resid-fp/sidfp.o src/resid-fp/versionfp.o src/resid-fp/voicefp.o src/resid-fp/wavefp.o /usr/local/lib/libphobos2-ldc.a /usr/local/lib/libdruntime-ldc.a -lstdc++ -framework Foundation -framework SDL
clang-7: error: no such file or directory: '/usr/local/lib/libphobos2-ldc.a'
clang-7: error: no such file or directory: '/usr/local/lib/libdruntime-ldc.a'
make: *** [Makefile.mac:21: ccutter] Error 1
@risicle
Copy link
Contributor

@risicle risicle commented Sep 14, 2020

It's possible to get things a bit further with

postPatch = ''
    substituteInPlace Makefile.mac \
      --replace '/usr/local/lib/libphobos2-ldc.a' '${ldc}/lib/libphobos2-ldc.a' \
      --replace '/usr/local/lib/libdruntime-ldc.a' '${ldc}/lib/libdruntime-ldc.a' \
      --replace '-lstdc++' ""
  '';

but then we get

clang -mmacosx-version-min=10.7 -Wl,-rpath,@executable_path/../Frameworks -o ccutter src/derelict/util/compat.o src/derelict/util/sharedlib.o src/derelict/util/exception.o src/derelict/util/loader.o src/derelict/util/wintypes.o src/derelict/util/xtypes.o src/derelict/sdl/sdl.o src/derelict/sdl/net.o src/derelict/sdl/ttf.o src/derelict/sdl/mixer.o src/derelict/sdl/image.o src/derelict/sdl/sdlfuncs.o src/derelict/sdl/sdltypes.o src/derelict/sdl/macinit/CoreFoundation.o src/derelict/sdl/macinit/DerelictSDLMacLoader.o src/derelict/sdl/macinit/ID.o src/derelict/sdl/macinit/MacTypes.o src/derelict/sdl/macinit/NSApplication.o src/derelict/sdl/macinit/NSArray.o src/derelict/sdl/macinit/NSAutoreleasePool.o src/derelict/sdl/macinit/NSDictionary.o src/derelict/sdl/macinit/NSEnumerator.o src/derelict/sdl/macinit/NSEvent.o src/derelict/sdl/macinit/NSGeometry.o src/derelict/sdl/macinit/NSMenu.o src/derelict/sdl/macinit/NSMenuItem.o src/derelict/sdl/macinit/NSNotification.o src/derelict/sdl/macinit/NSObject.o src/derelict/sdl/macinit/NSProcessInfo.o src/derelict/sdl/macinit/NSString.o src/derelict/sdl/macinit/NSZone.o src/derelict/sdl/macinit/runtime.o src/derelict/sdl/macinit/SDLMain.o src/derelict/sdl/macinit/selectors.o src/derelict/sdl/macinit/string.o src/audio/audio.o src/audio/player.o src/audio/timer.o src/audio/callback.o src/ct/purge.o src/ct/base.o src/ct/dump.o src/com/fb.o src/com/cpu.o src/com/kbd.o src/com/session.o src/com/util.o src/main.o src/ui/tables.o src/ui/dialogs.o src/ui/ui.o src/ui/input.o src/ui/help.o src/seq/seqtable.o src/seq/tracktable.o src/seq/trackmap.o src/seq/fplay.o src/seq/sequencer.o src/audio/resid/filter.o src/audio/resid/residctrl.o src/resid/envelope.o src/resid/extfilt.o src/resid/filter.o src/resid/w6_ps_.o src/resid/w6_pst.o src/resid/w6_p_t.o src/resid/w6__st.o src/resid/w8_ps_.o src/resid/w8_pst.o src/resid/w8_p_t.o src/resid/w8__st.o src/resid/pot.o src/resid/sid.o src/resid/voice.o src/resid/wave.o src/resid-fp/envelopefp.o src/resid-fp/extfiltfp.o src/resid-fp/filterfp.o src/resid-fp/potfp.o src/resid-fp/sidfp.o src/resid-fp/versionfp.o src/resid-fp/voicefp.o src/resid-fp/wavefp.o /nix/store/sv685mw02w0m9hddwcml65pajyv5h5vr-ldc-1.20.1/lib/libphobos2-ldc.a /nix/store/sv685mw02w0m9hddwcml65pajyv5h5vr-ldc-1.20.1/lib/libdruntime-ldc.a  -framework Foundation -framework SDL
ld: framework not found SDL
clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Makefile.mac:21: ccutter] Error 1

and I've not really got any clue where to go from here.

@OPNA2608 OPNA2608 force-pushed the OPNA2608:update-cheesecutter-unstable-2020-04-03 branch 2 times, most recently from b2b4755 to 26ed8c5 Sep 14, 2020
@OPNA2608 OPNA2608 force-pushed the OPNA2608:update-cheesecutter-unstable-2020-04-03 branch from 26ed8c5 to 6463775 Sep 14, 2020
@OPNA2608
Copy link
Contributor Author

@OPNA2608 OPNA2608 commented Sep 14, 2020

Thanks for testing. I don't believe we have a -framework SDL in Nixpkgs, just the bare SDL .dylibs? In any case, it seems Makefile.mac mostly just adds wrapping to build an CheeseCutter.app and put it into a .dmg image for convenience.

I've switched back to the regular Makefile.ldc for all platforms. Does this approach compile and work better?

@fgaz
Copy link
Member

@fgaz fgaz commented Sep 14, 2020

@GrahamcOfBorg build cheesecutter

@risicle
Copy link
Contributor

@risicle risicle commented Sep 14, 2020

Builds and runs, macos 10.14, well done.

@fgaz fgaz mentioned this pull request Sep 20, 2020
13 of 49 tasks complete
@OPNA2608
Copy link
Contributor Author

@OPNA2608 OPNA2608 commented Sep 23, 2020

I'm actually unsure if the current patching is enough, there are further dynamically loaded libraries in the src/derelict/sdl directory. I'll keep those & switching to the proper macOS Makefile on my todo list somewhere, but as long as it runs this is prolly enough to unbreak the package for ZHF for now.

Copy link
Contributor

@jonringer jonringer left a comment

Improvement over master
shows usage

https://github.com/NixOS/nixpkgs/pull/97939
1 package built:
cheesecutter
@jonringer jonringer merged commit e782471 into NixOS:master Oct 4, 2020
20 of 22 checks passed
20 of 22 checks passed
tests tests
Details
action
Details
Wait for ofborg This failed status will be cleared when ofborg finishes eval.
Details
cheesecutter on x86_64-darwin
Details
cheesecutter on aarch64-linux No attempt
Details
cheesecutter, cheesecutter.passthru.tests on aarch64-linux No attempt
Details
Evaluation Performance Report Evaluator Performance Report
Details
cheesecutter on x86_64-linux Success
Details
cheesecutter, cheesecutter.passthru.tests on x86_64-linux Success
Details
grahamcofborg-eval ^.^!
Details
grahamcofborg-eval-check-maintainers matching changed paths to changed attrs...
Details
grahamcofborg-eval-check-meta config.nix: checkMeta = true
Details
grahamcofborg-eval-darwin nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6463775"; rev="6463775d84f4abadb5e8657cc1aa1c23da7e343d"; } ./pkgs/t
Details
grahamcofborg-eval-lib-tests nix-build --arg pkgs import ./. {} ./lib/tests/release.nix
Details
grahamcofborg-eval-nixos nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6463775"; rev="6463775d84f4abadb5e8657cc1aa1c23da7e343d"; } ./nixos/
Details
grahamcofborg-eval-nixos-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6463775"; rev="6463775d84f4abadb5e8657cc1aa1c23da7e343d"; } ./nixos/
Details
grahamcofborg-eval-nixos-options nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6463775"; rev="6463775d84f4abadb5e8657cc1aa1c23da7e343d"; } ./nixos/
Details
grahamcofborg-eval-nixpkgs-manual nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6463775"; rev="6463775d84f4abadb5e8657cc1aa1c23da7e343d"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-tarball nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6463775"; rev="6463775d84f4abadb5e8657cc1aa1c23da7e343d"; } ./pkgs/t
Details
grahamcofborg-eval-nixpkgs-unstable-jobset nix-instantiate --arg nixpkgs { outPath=./.; revCount=999999; shortRev="6463775"; rev="6463775d84f4abadb5e8657cc1aa1c23da7e343d"; } ./pkgs/t
Details
grahamcofborg-eval-package-list nix-env -qa --json --file .
Details
grahamcofborg-eval-package-list-no-aliases nix-env -qa --json --file . --arg config { allowAliases = false; }
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.