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

pidgin: now builds and runs on osx #91882

Merged
merged 2 commits into from Jul 1, 2020
Merged

pidgin: now builds and runs on osx #91882

merged 2 commits into from Jul 1, 2020

Conversation

fkautz
Copy link
Member

@fkautz fkautz commented Jun 30, 2020

Signed-off-by: Frederick F. Kautz IV fkautz@alumni.cmu.edu

A quick note: this is my first patch in nixpkgs. I don't know if I have followed best practices. E.g. I read sandboxing is enabled by default but I don't know how to confirm it.

Also, this package does require an X11 server to run. Nix does provide access to the xquartz installer, but it is possible to run pidgin with an already running X11 server.

Motivation for this change

Before: No Pidgin on OSX
After: Pidgin on OSX

Things done

Changed build to support unix.

  • Build: constrain to platforms.unix instead of platforms.linux
  • Build: Differences Linux and OSX now parameterized
  • Darwin: build against gtk2-x11 instead of gtk
  • Darwin: disable gtkspell2 (spellcheck)
  • Darwin: disable farstream (voice and video)
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
    • I didn't disable sandbox, I read somewhere in docs that it is enabled by default. Don't know how to confirm.
  • 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)
    • I see that these tests exist, I don't know how to run them yet. Would appreciate assistance here.
  • 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/)
    • OSX
    • Linux (I have a headless NixOS)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
    • No docs found
  • Fits CONTRIBUTING.md.
    • I read through and attempted to adapt. Please verify.

We can now build and run pidgin on OSX.

Pidgin requires an X11 server to run.

* Build: Differences Linux and OSX now parameterized
* Darwin: build against gtk2-x11 instead of gtk
* Darwin: disable gtkspell2 (spellcheck)
* Darwin: disable farstream (voice and video)

Signed-off-by: Frederick F. Kautz IV <fkautz@alumni.cmu.edu>
Signed-off-by: Frederick F. Kautz IV <fkautz@alumni.cmu.edu>
@ofborg ofborg bot requested a review from vcunat June 30, 2020 20:33
@Mic92
Copy link
Member

Mic92 commented Jun 30, 2020

Not quite sure if I need to disable the sandbox?

[nix-shell:~/.cache/nixpkgs-review/pr-91882-1]$ nix log /nix/store/1nywh7sccp8l0x4f7wk2n5nkyi855v71-libstartup-notification-0.12.drv
warning: unknown setting 'experimental-features'
───────┬────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
       │ STDIN
───────┼────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
   1   │ @nix { "action": "setPhase", "phase": "unpackPhase" }
   2   │ unpacking sources
   3   │ unpacking source archive /nix/store/bbqnd6qxw97v4dh2dxlysp0kckfvdj51-startup-notification-0.12.tar.gz
   4   │ dyld: Library not loaded: @rpath/CoreFoundation.framework/Versions/A/CoreFoundation
   5   │   Referenced from: /nix/store/bzf81p8lczllrs1633zaj0rka7cz4k8g-gettext-0.20.1/lib/libintl.8.dylib
   6   │   Reason: no suitable image found.  Did find:
   7   │     /System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation: file system sandbox blocked stat()
   8   │ /nix/store/swr2h40348gmxmsxwfyhlm6xsrjyw0cj-stdenv-darwin/setup: line 838:  1661 Abort trap: 6           tar xf "$fn"
   9   │ do not know how to unpack source archive /nix/store/bbqnd6qxw97v4dh2dxlysp0kckfvdj51-startup-notification-0.12.tar.gz

@fkautz
Copy link
Member Author

fkautz commented Jul 1, 2020

@Mic92 was that posted to the correct PR? This code shouldn't affect anything in that library.

@fkautz
Copy link
Member Author

fkautz commented Jul 1, 2020

@vcunat I've ran nix-shell -p nixpkgs-review --run "nixpkgs-review wip" and found a problem with a downstream purple-matrix library. libpurple is pidgin's library for building IM messages on. It's in pidgin-plugins. I have a fix for it that I intend to submit after this one since it's a different package.

@Mic92
Copy link
Member

Mic92 commented Jul 1, 2020

@Mic92 was that posted to the correct PR? This code shouldn't affect anything in that library.

Well startup-notifications is one of pidgin's dependencies. I built with nix-review with also does a merge into current master before running the build.

@fkautz
Copy link
Member Author

fkautz commented Jul 1, 2020

@Mic92 what command did you use to reproduce this? I'm very new here so still trying to navigate the tooling. :)

I was just using nix-build -A pidgin and nix-shell -p nixpkgs-review --run "nixpkgs-review wip"

And would this be the appropriate PR to fix that problem or should I open a new PR?

@Mic92
Copy link
Member

Mic92 commented Jul 1, 2020

@Mic92 what command did you use to reproduce this? I'm very new here so still trying to navigate the tooling. :)

I was just using nix-build -A pidgin and nix-shell -p nixpkgs-review --run "nixpkgs-review wip"

And would this be the appropriate PR to fix that problem or should I open a new PR?

You can reproduce it by sandbox = true in $HOME/.config/nix/nix.conf or in your system-config nix.conf if you are an unprivileged user on a multi-user nix installation (in other words when you have a nix-daemon running). I don't know what are our policies are for macOS right now and if hydra has sandboxes enabled or not. I am only using a macOS vm occasionally and just copied my configuration over from Linux. For now I just trust of ofborg to be the ground truth:

@GrahamcOfBorg build pidgin

@Mic92 Mic92 merged commit 1b9b144 into NixOS:master Jul 1, 2020
@fkautz fkautz deleted the pidgin-osx branch July 1, 2020 08:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants