Merge pull request #45988 from thefloweringash/emacs-darwin-cli
emacs: allow X and cli-only builds on Darwin
This commit is contained in:
commit
f45fe1f17e
@ -4,8 +4,9 @@
|
|||||||
, alsaLib, cairo, acl, gpm, AppKit, GSS, ImageIO, m17n_lib, libotf
|
, alsaLib, cairo, acl, gpm, AppKit, GSS, ImageIO, m17n_lib, libotf
|
||||||
, systemd ? null
|
, systemd ? null
|
||||||
, withX ? !stdenv.isDarwin
|
, withX ? !stdenv.isDarwin
|
||||||
, withGTK2 ? false, gtk2 ? null
|
, withNS ? stdenv.isDarwin
|
||||||
, withGTK3 ? true, gtk3 ? null, gsettings-desktop-schemas ? null
|
, withGTK2 ? false, gtk2-x11 ? null
|
||||||
|
, withGTK3 ? true, gtk3-x11 ? null, gsettings-desktop-schemas ? null
|
||||||
, withXwidgets ? false, webkitgtk ? null, wrapGAppsHook ? null, glib-networking ? null
|
, withXwidgets ? false, webkitgtk ? null, wrapGAppsHook ? null, glib-networking ? null
|
||||||
, withCsrc ? true
|
, withCsrc ? true
|
||||||
, srcRepo ? false, autoconf ? null, automake ? null, texinfo ? null
|
, srcRepo ? false, autoconf ? null, automake ? null, texinfo ? null
|
||||||
@ -13,10 +14,12 @@
|
|||||||
|
|
||||||
assert (libXft != null) -> libpng != null; # probably a bug
|
assert (libXft != null) -> libpng != null; # probably a bug
|
||||||
assert stdenv.isDarwin -> libXaw != null; # fails to link otherwise
|
assert stdenv.isDarwin -> libXaw != null; # fails to link otherwise
|
||||||
assert withGTK2 -> withX || stdenv.isDarwin;
|
assert withNS -> !withX;
|
||||||
assert withGTK3 -> withX || stdenv.isDarwin;
|
assert withNS -> stdenv.isDarwin;
|
||||||
assert withGTK2 -> !withGTK3 && gtk2 != null;
|
assert (withGTK2 && !withNS) -> withX;
|
||||||
assert withGTK3 -> !withGTK2 && gtk3 != null;
|
assert (withGTK3 && !withNS) -> withX;
|
||||||
|
assert withGTK2 -> !withGTK3 && gtk2-x11 != null;
|
||||||
|
assert withGTK3 -> !withGTK2 && gtk3-x11 != null;
|
||||||
assert withXwidgets -> withGTK3 && webkitgtk != null;
|
assert withXwidgets -> withGTK3 && webkitgtk != null;
|
||||||
|
|
||||||
let
|
let
|
||||||
@ -56,19 +59,22 @@ stdenv.mkDerivation rec {
|
|||||||
++ lib.optionals stdenv.isLinux [ dbus libselinux systemd ]
|
++ lib.optionals stdenv.isLinux [ dbus libselinux systemd ]
|
||||||
++ lib.optionals withX
|
++ lib.optionals withX
|
||||||
[ xlibsWrapper libXaw Xaw3d libXpm libpng libjpeg libungif libtiff librsvg libXft
|
[ xlibsWrapper libXaw Xaw3d libXpm libpng libjpeg libungif libtiff librsvg libXft
|
||||||
imagemagick gconf m17n_lib libotf ]
|
imagemagick gconf ]
|
||||||
++ lib.optional (withX && withGTK2) gtk2
|
++ lib.optionals (stdenv.isLinux && withX) [ m17n_lib libotf ]
|
||||||
++ lib.optionals (withX && withGTK3) [ gtk3 gsettings-desktop-schemas ]
|
++ lib.optional (withX && withGTK2) gtk2-x11
|
||||||
|
++ lib.optionals (withX && withGTK3) [ gtk3-x11 gsettings-desktop-schemas ]
|
||||||
++ lib.optional (stdenv.isDarwin && withX) cairo
|
++ lib.optional (stdenv.isDarwin && withX) cairo
|
||||||
++ lib.optionals (withX && withXwidgets) [ webkitgtk ];
|
++ lib.optionals (withX && withXwidgets) [ webkitgtk ];
|
||||||
|
|
||||||
propagatedBuildInputs = lib.optionals stdenv.isDarwin [ AppKit GSS ImageIO ];
|
propagatedBuildInputs = lib.optionals withNS [ AppKit GSS ImageIO ];
|
||||||
|
|
||||||
hardeningDisable = [ "format" ];
|
hardeningDisable = [ "format" ];
|
||||||
|
|
||||||
configureFlags = [ "--with-modules" ] ++
|
configureFlags = [ "--with-modules" ] ++
|
||||||
(if stdenv.isDarwin
|
(lib.optional stdenv.isDarwin
|
||||||
then [ "--with-ns" "--disable-ns-self-contained" ]
|
(lib.withFeature withNS "ns")) ++
|
||||||
|
(if withNS
|
||||||
|
then [ "--disable-ns-self-contained" ]
|
||||||
else if withX
|
else if withX
|
||||||
then [ "--with-x-toolkit=${toolkit}" "--with-xft" ]
|
then [ "--with-x-toolkit=${toolkit}" "--with-xft" ]
|
||||||
else [ "--with-x=no" "--with-xpm=no" "--with-jpeg=no" "--with-png=no"
|
else [ "--with-x=no" "--with-xpm=no" "--with-jpeg=no" "--with-png=no"
|
||||||
@ -103,7 +109,7 @@ stdenv.mkDerivation rec {
|
|||||||
cp $srcdir/TAGS $dstdir
|
cp $srcdir/TAGS $dstdir
|
||||||
echo '((nil . ((tags-file-name . "TAGS"))))' > $dstdir/.dir-locals.el
|
echo '((nil . ((tags-file-name . "TAGS"))))' > $dstdir/.dir-locals.el
|
||||||
done
|
done
|
||||||
'' + lib.optionalString stdenv.isDarwin ''
|
'' + lib.optionalString withNS ''
|
||||||
mkdir -p $out/Applications
|
mkdir -p $out/Applications
|
||||||
mv nextstep/Emacs.app $out/Applications
|
mv nextstep/Emacs.app $out/Applications
|
||||||
'';
|
'';
|
||||||
|
Loading…
x
Reference in New Issue
Block a user