nixpkgs/pkgs/applications/editors/emacs/macport.nix

108 lines
3.8 KiB
Nix
Raw Normal View History

{ stdenv, fetchurl, ncurses, pkgconfig, texinfo, libxml2, gnutls, gettext, autoconf, automake
emacsMacport: add cf-private Also remove incorrect emacs25Macport alias. Undefined symbols for architecture x86_64: "_CFNotificationCenterAddObserver", referenced from: _mac_term_init in macterm.o _macfont_copy_available_families_cache in macfont.o "_CFNotificationCenterGetDistributedCenter", referenced from: _mac_term_init in macterm.o "_CFNotificationCenterGetLocalCenter", referenced from: _macfont_copy_available_families_cache in macfont.o "_CFURLCopyResourcePropertyForKey", referenced from: _Fmac_file_alias_p in mac.o "_CFURLCreateBookmarkDataFromFile", referenced from: _Fmac_file_alias_p in mac.o "_CFURLCreateByResolvingBookmarkData", referenced from: _Fmac_file_alias_p in mac.o "_CFURLResourceIsReachable", referenced from: _mac_update_title_bar in macfns.o _mac_input_source_properties in macfns.o "_NSDefaultRunLoopMode", referenced from: -[NSApplication(Emacs) runTemporarilyWithBlock:] in macappkit.o ___57-[EmacsController handleQueuedNSEventsWithHoldingQuitIn:]_block_invoke in macappkit.o _mac_run_loop_run_once in macappkit.o ___mac_run_loop_run_once_block_invoke in macappkit.o ___37-[EmacsController(Menu) trackMenuBar]_block_invoke in macappkit.o ___create_and_show_dialog_block_invoke.2445 in macappkit.o ___mac_select_block_invoke in macappkit.o ... "_NSURLAttributeModificationDateKey", referenced from: _mac_document_create_with_url in macappkit.o "_OBJC_CLASS_$_NSArray", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSData", referenced from: l_OBJC_$_CATEGORY_NSData_$_Emacs in macappkit.o objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSDate", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSDictionary", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSMethodSignature", referenced from: l_OBJC_$_CATEGORY_NSMethodSignature_$_Emacs in macappkit.o objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSMutableArray", referenced from: l_OBJC_$_CATEGORY_NSMutableArray_$_Emacs in macappkit.o objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSMutableData", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSMutableDictionary", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSMutableSet", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSNull", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSRunLoop", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSSet", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSTimer", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSURL", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSUserDefaults", referenced from: objc-class-ref in macappkit.o "_OBJC_EHTYPE_$_NSException", referenced from: GCC_except_table81 in macappkit.o GCC_except_table810 in macappkit.o "_kCFURLIsAliasFileKey", referenced from: _Fmac_file_alias_p in mac.o "_kCFURLIsSymbolicLinkKey", referenced from: _Fmac_file_alias_p in mac.o ld: symbol(s) not found for architecture x86_64
2018-11-07 18:33:15 +00:00
, cf-private, AppKit, Carbon, Cocoa, IOKit, OSAKit, Quartz, QuartzCore, WebKit
, ImageCaptureCore, GSS, ImageIO # These may be optional
}:
stdenv.mkDerivation rec {
2018-05-31 02:39:14 +01:00
emacsVersion = "26.1";
emacsName = "emacs-${emacsVersion}";
2018-12-25 21:22:37 +00:00
macportVersion = "7.4";
name = "emacs-mac-${emacsVersion}-${macportVersion}";
src = fetchurl {
2018-05-31 02:39:14 +01:00
url = "mirror://gnu/emacs/${emacsName}.tar.xz";
sha256 = "0b6k1wq44rc8gkvxhi1bbjxbz3cwg29qbq8mklq2az6p1hjgrx0w";
};
macportSrc = fetchurl {
url = "ftp://ftp.math.s.chiba-u.ac.jp/emacs/${emacsName}-mac-${macportVersion}.tar.gz";
2018-12-25 21:22:37 +00:00
sha256 = "1xl3rfqw1f3jil20xf6iy0f1hdk9adj8rnv7xhcjq4pymj4w8ka6";
};
2017-01-23 23:49:39 +00:00
hiresSrc = fetchurl {
2018-05-31 02:39:14 +01:00
url = "ftp://ftp.math.s.chiba-u.ac.jp/emacs/emacs-hires-icons-3.0.tar.gz";
sha256 = "0f2wzdw2a3ac581322b2y79rlj3c9f33ddrq9allj97r1si6v5xk";
2017-01-23 23:49:39 +00:00
};
2018-06-09 17:32:53 +01:00
patches = [ ./clean-env.patch ];
enableParallelBuilding = true;
nativeBuildInputs = [ pkgconfig autoconf automake ];
buildInputs = [ ncurses libxml2 gnutls texinfo gettext
AppKit Carbon Cocoa IOKit OSAKit Quartz QuartzCore WebKit
ImageCaptureCore GSS ImageIO # may be optional
emacsMacport: add cf-private Also remove incorrect emacs25Macport alias. Undefined symbols for architecture x86_64: "_CFNotificationCenterAddObserver", referenced from: _mac_term_init in macterm.o _macfont_copy_available_families_cache in macfont.o "_CFNotificationCenterGetDistributedCenter", referenced from: _mac_term_init in macterm.o "_CFNotificationCenterGetLocalCenter", referenced from: _macfont_copy_available_families_cache in macfont.o "_CFURLCopyResourcePropertyForKey", referenced from: _Fmac_file_alias_p in mac.o "_CFURLCreateBookmarkDataFromFile", referenced from: _Fmac_file_alias_p in mac.o "_CFURLCreateByResolvingBookmarkData", referenced from: _Fmac_file_alias_p in mac.o "_CFURLResourceIsReachable", referenced from: _mac_update_title_bar in macfns.o _mac_input_source_properties in macfns.o "_NSDefaultRunLoopMode", referenced from: -[NSApplication(Emacs) runTemporarilyWithBlock:] in macappkit.o ___57-[EmacsController handleQueuedNSEventsWithHoldingQuitIn:]_block_invoke in macappkit.o _mac_run_loop_run_once in macappkit.o ___mac_run_loop_run_once_block_invoke in macappkit.o ___37-[EmacsController(Menu) trackMenuBar]_block_invoke in macappkit.o ___create_and_show_dialog_block_invoke.2445 in macappkit.o ___mac_select_block_invoke in macappkit.o ... "_NSURLAttributeModificationDateKey", referenced from: _mac_document_create_with_url in macappkit.o "_OBJC_CLASS_$_NSArray", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSData", referenced from: l_OBJC_$_CATEGORY_NSData_$_Emacs in macappkit.o objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSDate", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSDictionary", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSMethodSignature", referenced from: l_OBJC_$_CATEGORY_NSMethodSignature_$_Emacs in macappkit.o objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSMutableArray", referenced from: l_OBJC_$_CATEGORY_NSMutableArray_$_Emacs in macappkit.o objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSMutableData", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSMutableDictionary", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSMutableSet", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSNull", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSRunLoop", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSSet", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSTimer", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSURL", referenced from: objc-class-ref in macappkit.o "_OBJC_CLASS_$_NSUserDefaults", referenced from: objc-class-ref in macappkit.o "_OBJC_EHTYPE_$_NSException", referenced from: GCC_except_table81 in macappkit.o GCC_except_table810 in macappkit.o "_kCFURLIsAliasFileKey", referenced from: _Fmac_file_alias_p in mac.o "_kCFURLIsSymbolicLinkKey", referenced from: _Fmac_file_alias_p in mac.o ld: symbol(s) not found for architecture x86_64
2018-11-07 18:33:15 +00:00
# Needed for CFNotificationCenterAddObserver symbols.
cf-private
];
postUnpack = ''
mv $sourceRoot $name
tar xzf $macportSrc -C $name --strip-components=1
mv $name $sourceRoot
2017-01-23 23:49:39 +00:00
# extract retina image resources
tar xzfv $hiresSrc --strip 1 -C $sourceRoot
'';
postPatch = ''
patch -p1 < patch-mac
substituteInPlace lisp/international/mule-cmds.el \
--replace /usr/share/locale ${gettext}/share/locale
2017-01-23 23:49:39 +00:00
# use newer emacs icon
cp nextstep/Cocoa/Emacs.base/Contents/Resources/Emacs.icns mac/Emacs.app/Contents/Resources/Emacs.icns
'';
configureFlags = [
"LDFLAGS=-L${ncurses.out}/lib"
"--with-xml2=yes"
"--with-gnutls=yes"
"--with-mac"
"--with-modules"
"--enable-mac-app=$$out/Applications"
];
CFLAGS = "-O3 -DMAC_OS_X_VERSION_MAX_ALLOWED=MAC_OS_X_VERSION_10_10 -DMAC_OS_X_VERSION_MIN_REQUIRED=MAC_OS_X_VERSION_10_10";
LDFLAGS = "-O3 -L${ncurses.out}/lib";
postInstall = ''
mkdir -p $out/share/emacs/site-lisp/
cp ${./site-start.el} $out/share/emacs/site-lisp/site-start.el
'';
doCheck = true;
meta = with stdenv.lib; {
description = "The extensible, customizable text editor";
homepage = https://www.gnu.org/software/emacs/;
license = licenses.gpl3Plus;
maintainers = with maintainers; [ jwiegley matthewbauer ];
platforms = platforms.darwin;
longDescription = ''
GNU Emacs is an extensible, customizable text editorand more. At its
core is an interpreter for Emacs Lisp, a dialect of the Lisp
programming language with extensions to support text editing.
The features of GNU Emacs include: content-sensitive editing modes,
including syntax coloring, for a wide variety of file types including
plain text, source code, and HTML; complete built-in documentation,
including a tutorial for new users; full Unicode support for nearly all
human languages and their scripts; highly customizable, using Emacs
Lisp code or a graphical interface; a large number of extensions that
add other functionality, including a project planner, mail and news
reader, debugger interface, calendar, and more. Many of these
extensions are distributed with GNU Emacs; others are available
separately.
This is the "Mac port" addition to GNU Emacs 26. This provides a native
2017-03-24 21:16:50 +00:00
GUI support for Mac OS X 10.6 - 10.12. Note that Emacs 23 and later
already contain the official GUI support via the NS (Cocoa) port for
Mac OS X 10.4 and later. So if it is good enough for you, then you
don't need to try this.
'';
};
}