GNU/Linux >> LINUX-Kenntnisse >  >> Linux

Minimale emacs24-Installation auf Ubuntu

Ich benötige eine minimale Emacs 24-Installation für die Verteilung in einer virtuellen Box. Wenn ich versuche, emacs zu installieren ...

Ich kenne das Gefühl... Wenn ich emacs-nox installiere es kann über 100 MB betragen. Das ist für einige ressourcenbeschränkte Geräte, wie ein BeagleBoard oder Banana Pro, die nur ein paar hundert MB freien Speicherplatz haben, nicht akzeptabel.

Sie können die neuesten Emacs abrufen und entpacken mit (für die Vollständigkeit des Rezepts):

wget http://mirrors.syringanetworks.net/gnu/emacs/emacs-24.5.tar.gz
tar xzf emacs-24.5.tar.gz 
cd emacs-24.5/

Das Folgende ist die Konfiguration, die ich für emacs-24.5 verwendet habe. Es erzeugte eine Binärdatei von 25,4 MB:

./configure --with-xml2 --with-zlib --without-x --without-sound --without-xpm \
  --without-jpeg --without-tiff --without-gif --without-png --without-rsvg \
  --without-imagemagick --without-xft --without-libotf --without-m17n-flt \
  --without-xaw3d --without-toolkit-scroll-bars --without-gpm --without-dbus \
  --without-gconf --without-gsettings --without-makeinfo \
  --without-compress-install

Und:

$ ls -l /usr/local/bin/
total 26648
...
lrwxrwxrwx 1 root staff        4 Jan  8  2015 bin2fex -> fexc
-rwxr-xr-x 1 root staff   580105 Jan 19 23:10 ctags
-rwxr-xr-x 1 root staff   251350 Jan 19 23:10 ebrowse
lrwxrwxrwx 1 root staff       10 Jan 19 23:10 emacs -> emacs-24.5
-rwxr-xr-t 1 root staff 25453742 Jan 19 23:10 emacs-24.5
-rwxr-xr-x 1 root staff   260328 Jan 19 23:10 emacsclient
-rwxr-xr-x 1 root staff   578307 Jan 19 23:10 etags
lrwxrwxrwx 1 root staff        4 Jan  8  2015 fex2bin -> fexc
-rwxr-xr-x 1 root staff    49726 Jan  8  2015 fexc
...

Das Bauen aus Quellen erfordert Dinge wie einen Compiler und einen Linker, aber ich installiere sie trotzdem über build-essential Paket. Die einzige fehlende Abhängigkeit war ncurses Paket (ncurses-dev ).

Selbst wenn all das zusätzliche GUI-Zeug entfernt wurde, erhalten Sie immer noch Nag-Screens mit Hyperlinks. Aber die Binärdatei ist 1/4 so groß, also nenne ich es einen Gewinn.

$ ./configure ...

  Where should the build process find the source code?    .
  What compiler should emacs be built with?               gcc -std=gnu99 -g3 -O2
  Should Emacs use the GNU version of malloc?             yes
      (Using Doug Lea's new malloc from the GNU C Library.)
  Should Emacs use a relocating allocator for buffers?    no
  Should Emacs use mmap(2) for buffer allocation?         no
  What window system should Emacs use?                    none
  What toolkit should Emacs use?                          none
  Where do we find X Windows header files?                NONE
  Where do we find X Windows libraries?                   NONE
  Does Emacs use -lXaw3d?                                 no
  Does Emacs use -lXpm?                                   no
  Does Emacs use -ljpeg?                                  no
  Does Emacs use -ltiff?                                  no
  Does Emacs use a gif library?                           no 
  Does Emacs use a png library?                           no 
  Does Emacs use -lrsvg-2?                                no
  Does Emacs use imagemagick?                             no
  Does Emacs support sound?                               no
  Does Emacs use -lgpm?                                   no
  Does Emacs use -ldbus?                                  no
  Does Emacs use -lgconf?                                 no
  Does Emacs use GSettings?                               no
  Does Emacs use a file notification library?             yes -lglibc (inotify)
  Does Emacs use access control lists?                    no
  Does Emacs use -lselinux?                               no
  Does Emacs use -lgnutls?                                no
  Does Emacs use -lxml2?                                  no
  Does Emacs use -lfreetype?                              no
  Does Emacs use -lm17n-flt?                              no
  Does Emacs use -lotf?                                   no
  Does Emacs use -lxft?                                   no
  Does Emacs directly use zlib?                           no
  Does Emacs use toolkit scroll bars?                     no

Sie brauchen sie, wenn Sie die Funktionalität benötigen, die sie verkörpern; Beispielsweise wird die Ghostscript-Bibliothek für die Handhabung von Postscript im Drucksystem von Emacs verwendet, und die Bibliothek imagemagick ist stark an der Bildunterstützung von Emacs beteiligt.

Das heißt, wenn Sie Ihren Emacs nicht brauchen, um Postscript zu generieren oder Bilder anzuzeigen usw., dann ist der beste Weg, die Notwendigkeit dieser Bibliotheken zu umgehen, den Emacs-Quellcode zu beschaffen und zu erstellen und nur die Fähigkeiten zu aktivieren, die Sie tatsächlich benötigen um die Anzahl externer Bibliotheken zu minimieren, gegen die Emacs gelinkt wird.

Sie können die Emacs-Quellen von der GNU-Projekt-Website beziehen. Sobald Sie es heruntergeladen und entpackt haben, folgt der Build dem üblichen configure <options> && make && make install Konvention.

Hier ist die vollständige Liste der Konfigurationsoptionen (die Ausgabe von configure --help ) für Emacs 24.3:

`configure' configures emacs 24.3 to adapt to many kinds of systems.

Usage: ./configure [OPTION]... [VAR=VALUE]...

To assign environment variables (e.g., CC, CFLAGS...), specify them as
VAR=VALUE.  See below for descriptions of some of the useful variables.

Defaults for the options are specified in brackets.

Configuration:
  -h, --help              display this help and exit
      --help=short        display options specific to this package
      --help=recursive    display the short help of all the included packages
  -V, --version           display version information and exit
  -q, --quiet, --silent   do not print `checking ...' messages
      --cache-file=FILE   cache test results in FILE [disabled]
  -C, --config-cache      alias for `--cache-file=config.cache'
  -n, --no-create         do not create output files
      --srcdir=DIR        find the sources in DIR [configure dir or `..']

Installation directories:
  --prefix=PREFIX         install architecture-independent files in PREFIX
                          [/usr/local]
  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
                          [PREFIX]

By default, `make install' will install all the files in
`/usr/local/bin', `/usr/local/lib' etc.  You can specify
an installation prefix other than `/usr/local' using `--prefix',
for instance `--prefix=$HOME'.

For better control, use the options below.

Fine tuning of the installation directories:
  --bindir=DIR            user executables [EPREFIX/bin]
  --sbindir=DIR           system admin executables [EPREFIX/sbin]
  --libexecdir=DIR        program executables [EPREFIX/libexec]
  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
  --libdir=DIR            object code libraries [EPREFIX/lib]
  --includedir=DIR        C header files [PREFIX/include]
  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
  --infodir=DIR           info documentation [DATAROOTDIR/info]
  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
  --mandir=DIR            man documentation [DATAROOTDIR/man]
  --docdir=DIR            documentation root [DATAROOTDIR/doc/emacs]
  --htmldir=DIR           html documentation [DOCDIR]
  --dvidir=DIR            dvi documentation [DOCDIR]
  --pdfdir=DIR            pdf documentation [DOCDIR]
  --psdir=DIR             ps documentation [DOCDIR]

Program names:
  --program-prefix=PREFIX            prepend PREFIX to installed program names
  --program-suffix=SUFFIX            append SUFFIX to installed program names
  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names

X features:
  --x-includes=DIR    X include files are in DIR
  --x-libraries=DIR   X library files are in DIR

System types:
  --build=BUILD     configure for building on BUILD [guessed]
  --host=HOST       cross-compile to build programs to run on HOST [BUILD]

Optional Features:
  --disable-option-checking  ignore unrecognized --enable/--with options
  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
  --disable-ns-self-contained
                          disable self contained build under NeXTstep
  --enable-locallisppath=PATH
                          directories Emacs should search for lisp files
                          specific to this site
  --enable-checking[=LIST]
                          enable expensive run-time checks. With LIST, enable
                          only specific categories of checks. Categories are:
                          all,yes,no. Flags are: stringbytes, stringoverrun,
                          stringfreelist, xmallocoverrun, conslist, glyphs
  --enable-check-lisp-object-type
                          enable compile time checks for the Lisp_Object data
                          type. This is useful for development for catching
                          certain types of bugs.
  --enable-profiling      build emacs with low-level, gprof profiling support.
                          Mainly useful for debugging Emacs itself. May not
                          work on all platforms. Stops profiler.el working.
  --enable-autodepend     automatically generate dependencies to .h-files.
                          Requires GNU Make and Gcc. Enabled if GNU Make and
                          Gcc is found
  --disable-dependency-tracking  speeds up one-time build
  --enable-dependency-tracking   do not reject slow dependency extractors
  --disable-largefile     omit support for large files
  --enable-gcc-warnings   turn on lots of GCC warnings/errors. This is
                          intended for developers, and may generate false
                          alarms when used with older or non-GNU development
                          tools.
  --enable-link-time-optimization
                          build emacs with link-time optimization. This is
                          supported only for GCC since 4.5.0.

Optional Packages:
  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
  --without-all           omit almost all features and build small executable
                          with minimal dependencies
  --without-pop           don't support POP mail retrieval with movemail
  --with-kerberos         support Kerberos-authenticated POP
  --with-kerberos5        support Kerberos version 5 authenticated POP
  --with-hesiod           support Hesiod to get the POP server host
  --with-mmdf             support MMDF mailboxes
  --with-mail-unlink      unlink, rather than empty, mail spool after reading
  --with-mailhost=HOSTNAME
                          string giving default POP mail host
  --without-sound         don't compile with sound support
  --with-x-toolkit=KIT    use an X toolkit (KIT one of: yes or gtk, gtk2,
                          gtk3, lucid or athena, motif, no)
  --with-wide-int         prefer wide Emacs integers (typically 62-bit)
  --without-xpm           don't compile with XPM image support
  --without-jpeg          don't compile with JPEG image support
  --without-tiff          don't compile with TIFF image support
  --without-gif           don't compile with GIF image support
  --without-png           don't compile with PNG image support
  --without-rsvg          don't compile with SVG image support
  --without-xml2          don't compile with XML parsing support
  --without-imagemagick   don't compile with ImageMagick image support
  --without-xft           don't use XFT for anti aliased fonts
  --without-libotf        don't use libotf for OpenType font support
  --without-m17n-flt      don't use m17n-flt for text shaping
  --without-toolkit-scroll-bars
                          don't use Motif or Xaw3d scroll bars
  --without-xaw3d         don't use Xaw3d
  --without-xim           don't use X11 XIM
  --with-ns               use NeXTstep (Cocoa or GNUstep) windowing system
  --with-w32              use native MS Windows GUI
  --without-gpm           don't use -lgpm for mouse support on a GNU/Linux
                          console
  --without-dbus          don't compile with D-Bus support
  --without-gconf         don't compile with GConf support
  --without-gsettings     don't compile with GSettings support
  --without-selinux       don't compile with SELinux support
  --without-gnutls        don't use -lgnutls for SSL/TLS support
  --without-makeinfo      don't require makeinfo for building manuals
  --without-compress-info don't compress the installed Info pages
  --with-pkg-config-prog=PATH
                          path to pkg-config for finding GTK and librsvg
  --with-crt-dir=DIR      directory containing crtn.o etc. The default is
                          /usr/lib, or /usr/lib64 on some platforms.
  --with-gameuser=USER    user for shared game score files
  --with-gnustep-conf=PATH
                          path to GNUstep.conf; default $GNUSTEP_CONFIG_FILE,
                          or /etc/GNUstep/GNUstep.conf
  --with-x                use the X Window System

Some influential environment variables:
  CC          C compiler command
  CFLAGS      C compiler flags
  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
              nonstandard directory <lib dir>
  LIBS        libraries to pass to the linker, e.g. -l<library>
  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
              you have headers in a nonstandard directory <include dir>
  CPP         C preprocessor
  XMKMF       Path to xmkmf, Makefile generator for X Window System

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to the package provider.

Optionen, deren Namen mit "aktivieren", "deaktivieren", "mit" und "ohne" beginnen, steuern, welche Funktionalität in die resultierenden Binärdateien eingebaut wird, und sollten hier von primärem Interesse für Sie sein.

Nachdem ich kürzlich meinen eigenen Emacs 24.3 erstellt habe, kann ich bestätigen, dass der Erstellungsprozess sehr einfach ist; Wenn Sie überhaupt mit dem Erstellen von Linux-Software aus dem Quellcode vertraut sind, sollten Sie auf keine anderen Schwierigkeiten stoßen, als vielleicht ein oder zwei Bibliotheken installieren zu müssen, und wenn Sie mit dem Prozess nicht vertraut sind, ist dies ein guter Ort, um damit anzufangen es.


Linux
  1. Ubuntu 22.04 Cinnamon Desktop-Installation

  2. Ubuntu 20.04-Installation von USB

  3. Minimale Serverinstallation?

  4. WKHTMLTOPDF Installationsfehler auf Ubuntu

  5. Wo ist vmlinux auf meiner Ubuntu-Installation?

Ubuntu 20.04 GUI-Installation

Ubuntu 22.04 LAMP-Installation

Ubuntu 14.10 (Utopic Unicorn) Tutorial zur minimalen Serverinstallation

Ubuntu 15.04 (Vivid Vervet) Tutorial zur minimalen Serverinstallation

Ubuntu 18.04 LTS Überprüfung der minimalen Installationsoption

Minimale Ubuntu-Installation