# Maintainer: stef # Contributor: Timo Teräs global pkgname := 'emacs' global pkgver := '25.3' global pkgrel := '0' global pkgdesc := '"The extensible, customizable, self-documenting real-time display editor'" global arch := '"all !aarch64'" global depends := '"emacs-nox'" global url := '"http://www.gnu.org/software/emacs/emacs.html'" global license := '"GPL3'" global makedepends := '"autoconf automake linux-headers paxmark gawk librsvg-dev giflib-dev libxpm-dev gtk+2.0-dev gconf-dev alsa-lib-dev glib-dev fontconfig-dev libpng-dev libxml2-dev pango-dev tiff-dev libjpeg-turbo-dev ncurses-dev ncurses-libs gnutls-dev libxaw-dev'" global subpackages := ""$pkgname-doc $pkgname-nox $pkgname-x11 $pkgname-gtk2"" global source := ""ftp://ftp.gnu.org/gnu/emacs/emacs-$pkgver.tar.xz gamedir.patch noaslr-dump.patch musl.patch"" proc prepare { cd "$builddir/$1" default_prepare || return 1 ./autogen.sh || return 1 } global builddir := ""$srcdir/emacs-$pkgver"" proc _build_variant { cd "$builddir/$1" shift env CFLAGS=-fno-pie \ LDFLAGS=-no-pie \ ./configure \ --build=$CBUILD \ --host=$CHOST \ --prefix=/usr \ --sysconfdir=/etc \ --libexecdir=/usr/lib \ --localstatedir=/var \ --without-makeinfo \ --with-gameuser=:games \ $(@) \ || return 1 make } proc _build_x11 { _build_variant x11 \ --with-x-toolkit=athena \ --without-toolkit-scroll-bars \ --without-dbus \ --with-xft \ --with-jpeg=yes \ --with-tiff=yes } proc _build_gtk2 { _build_variant gtk2 \ --with-x-toolkit=gtk2 \ --with-xft \ --with-jpeg=yes \ --with-tiff=no } proc _build_nox { _build_variant nox \ --without-sound \ --without-x \ --without-file-notification } proc build { cd $builddir mkdir -p nox mv * nox || true cp -a nox gtk2 cp -a nox x11 _build_x11 || return 1 _build_nox || return 1 _build_gtk2 } proc package { mkdir -p $pkgdir } proc doc { mkdir -p $subpkgdir cd "$builddir/gtk2" make DESTDIR="$subpkgdir" install # remove conflict with ctags package mv "$subpkgdir"/usr/share/man/man1/ctags.1.gz "$subpkgdir"/usr/share/man/man1/ctags.emacs.1.gz # only keep info and man directories, all other is in the specific package rm -rf "$subpkgdir"/usr/bin \ "$subpkgdir"/usr/lib \ "$subpkgdir"/usr/share/appdata \ "$subpkgdir"/usr/share/applications \ "$subpkgdir"/usr/share/emacs \ "$subpkgdir"/usr/share/icons \ "$subpkgdir"/var } proc _subpackage { cd "$builddir/$1" make DESTDIR="$subpkgdir" install # remove conflict with ctags package mv "$subpkgdir"/usr/bin/ctags "$subpkgdir"/usr/bin/ctags.emacs rm -rf "$subpkgdir"/usr/share/info \ "$subpkgdir"/usr/share/man # fix user/root permissions on usr/share files find "$subpkgdir"/usr/share/emacs/ -exec chown root:root {} ';' find "$subpkgdir"/usr/lib -perm -g+s,g+x ! -type d -exec chmod g-s {} ';' # fix perms on /var/games chmod 775 "$subpkgdir"/var/games chmod 775 "$subpkgdir"/var/games/emacs chmod 664 "$subpkgdir"/var/games/emacs/* chown -R root:games "$subpkgdir"/var/games } proc nox { global pkgdesc := ""$pkgdesc - without X11"" global depends := '"!emacs-x11 !emacs-gtk2'" _subpackage nox } proc x11 { global pkgdesc := ""$pkgdesc - with X11"" global depends := '"!emacs-nox !emacs-gtk2 hicolor-icon-theme desktop-file-utils'" _subpackage x11 } proc gtk2 { global pkgdesc := ""$pkgdesc - with GTK2"" global depends := '"!emacs-nox !emacs-x11 hicolor-icon-theme desktop-file-utils'" _subpackage gtk2 } global sha512sums := '"1cce656451b6ca8502ebb229e88bd3ef48b7f9444a10eeac4ea43bd5491b2efacd641dfa35227a33362c3866493d3449cf1df81606563eef44bba0ed668e457f emacs-25.3.tar.xz 8898f309aeaf274366849bd5c56c8e2a1be94dfee2f01b20f1700bf26203f49b9600237e5090fc3d8eaad3ea246f803ffd493d0c04cb3512084a4e3bf58f8f5e gamedir.patch d3a30a9bf7ef7349806a75ee919d6683a8000eb70f4c3040d149bd8911dc95b931a05c7cbf9f5b93176940ad87520dbb2ddef3b4136b0d5b140de0cdbc4b7a8f noaslr-dump.patch 4ec078f970c2d0ad9b082a613e7c7e64e40f37eaee96e67ab9b2e467595c74533f94ced74f6753e393a9c0ead88fad75adcfdd31be4295f5763292a6dd846fe8 musl.patch'" (CommandList children: [ (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgname) op:Equal rhs:{(emacs)} spids:[7])] spids: [7] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgver) op:Equal rhs:{(25.3)} spids:[10])] spids: [10] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:pkgrel) op:Equal rhs:{(0)} spids:[13])] spids: [13] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ("The extensible, customizable, self-documenting real-time display editor"))} spids: [16] ) ] spids: [16] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:arch) op:Equal rhs:{(DQ ("all !aarch64"))} spids:[21])] spids: [21] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:depends) op:Equal rhs:{(DQ (emacs-nox))} spids:[26])] spids: [26] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:url) op: Equal rhs: {(DQ ("http://www.gnu.org/software/emacs/emacs.html"))} spids: [31] ) ] spids: [31] ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:license) op:Equal rhs:{(DQ (GPL3))} spids:[36])] spids: [36] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:makedepends) op: Equal rhs: { (DQ ("autoconf automake linux-headers paxmark gawk\n") ("\tlibrsvg-dev giflib-dev libxpm-dev gtk+2.0-dev gconf-dev alsa-lib-dev\n") ("\tglib-dev fontconfig-dev libpng-dev\n") ("\tlibxml2-dev pango-dev tiff-dev libjpeg-turbo-dev ncurses-dev\n") ("\tncurses-libs gnutls-dev libxaw-dev") ) } spids: [41] ) ] spids: [41] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:subpackages) op: Equal rhs: { (DQ ($ VSub_Name "$pkgname") ("-doc ") ($ VSub_Name "$pkgname") ("-nox ") ($ VSub_Name "$pkgname") ("-x11 ") ($ VSub_Name "$pkgname") (-gtk2) ) } spids: [50] ) ] spids: [50] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:source) op: Equal rhs: { (DQ ("ftp://ftp.gnu.org/gnu/emacs/emacs-") ($ VSub_Name "$pkgver") (".tar.xz\n") ("\tgamedir.patch\n") ("\tnoaslr-dump.patch\n") ("\tmusl.patch") ) } spids: [62] ) ] spids: [62] ) (FuncDef name: prepare body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir") (/) ($ VSub_Number "$1"))}) (AndOr children: [ (C {(default_prepare)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(./autogen.sh)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) ] spids: [77] ) spids: [73 76] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:builddir) op: Equal rhs: {(DQ ($ VSub_Name "$srcdir") (/emacs-) ($ VSub_Name "$pkgver"))} spids: [109] ) ] spids: [109] ) (FuncDef name: _build_variant body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir") (/) ($ VSub_Number "$1"))}) (C {(shift)}) (AndOr children: [ (SimpleCommand words: [ {(./configure)} {(--build) (Lit_Other "=") ($ VSub_Name "$CBUILD")} {(--host) (Lit_Other "=") ($ VSub_Name "$CHOST")} {(--prefix) (Lit_Other "=") (/usr)} {(--sysconfdir) (Lit_Other "=") (/etc)} {(--libexecdir) (Lit_Other "=") (/usr/lib)} {(--localstatedir) (Lit_Other "=") (/var)} {(--without-makeinfo)} {(--with-gameuser) (Lit_Other "=") (Lit_Other ":") (games)} {(DQ (${ VSub_At "@"))} ] more_env: [ (env_pair name:CFLAGS val:{(-fno-pie)} spids:[135]) (env_pair name:LDFLAGS val:{(-no-pie)} spids:[140]) ] ) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(make)}) ] spids: [120] ) spids: [116 119] ) (FuncDef name: _build_x11 body: (BraceGroup children: [ (C {(_build_variant)} {(x11)} {(--with-x-toolkit) (Lit_Other "=") (athena)} {(--without-toolkit-scroll-bars)} {(--without-dbus)} {(--with-xft)} {(--with-jpeg) (Lit_Other "=") (yes)} {(--with-tiff) (Lit_Other "=") (yes)} ) ] spids: [220] ) spids: [216 219] ) (FuncDef name: _build_gtk2 body: (BraceGroup children: [ (C {(_build_variant)} {(gtk2)} {(--with-x-toolkit) (Lit_Other "=") (gtk2)} {(--with-xft)} {(--with-jpeg) (Lit_Other "=") (yes)} {(--with-tiff) (Lit_Other "=") (no)} ) ] spids: [264] ) spids: [260 263] ) (FuncDef name: _build_nox body: (BraceGroup children: [ (C {(_build_variant)} {(nox)} {(--without-sound)} {(--without-x)} {(--without-file-notification)} ) ] spids: [300] ) spids: [296 299] ) (FuncDef name: build body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir"))}) (C {(mkdir)} {(-p)} {(nox)}) (AndOr children: [(C {(mv)} {(Lit_Other "*")} {(nox)}) (C {(true)})] op_id: Op_DPipe ) (C {(cp)} {(-a)} {(nox)} {(gtk2)}) (C {(cp)} {(-a)} {(nox)} {(x11)}) (AndOr children: [ (C {(_build_x11)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (AndOr children: [ (C {(_build_nox)}) (ControlFlow token: arg_word:{(1)}) ] op_id: Op_DPipe ) (C {(_build_gtk2)}) ] spids: [326] ) spids: [322 325] ) (FuncDef name: package body: (BraceGroup children:[(C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$pkgdir"))})] spids:[399]) spids: [395 398] ) (FuncDef name: doc body: (BraceGroup children: [ (C {(mkdir)} {(-p)} {(DQ ($ VSub_Name "$subpkgdir"))}) (C {(cd)} {(DQ ($ VSub_Name "$builddir") (/gtk2))}) (C {(make)} {(Lit_VarLike "DESTDIR=") (DQ ($ VSub_Name "$subpkgdir"))} {(install)}) (C {(mv)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/man/man1/ctags.1.gz)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/man/man1/ctags.emacs.1.gz)} ) (C {(rm)} {(-rf)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/bin)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/lib)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/appdata)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/applications)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/emacs)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/icons)} {(DQ ($ VSub_Name "$subpkgdir")) (/var)} ) ] spids: [417] ) spids: [413 416] ) (FuncDef name: _subpackage body: (BraceGroup children: [ (C {(cd)} {(DQ ($ VSub_Name "$builddir") (/) ($ VSub_Number "$1"))}) (C {(make)} {(Lit_VarLike "DESTDIR=") (DQ ($ VSub_Name "$subpkgdir"))} {(install)}) (C {(mv)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/bin/ctags)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/bin/ctags.emacs)} ) (C {(rm)} {(-rf)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/info)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/man)} ) (C {(find)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/share/emacs/)} {(-exec)} {(chown)} {(root) (Lit_Other ":") (root)} {(Lit_LBrace "{") (Lit_RBrace "}")} {(EscapedLiteralPart token:)} ) (C {(find)} {(DQ ($ VSub_Name "$subpkgdir")) (/usr/lib)} {(-perm)} {(-g) (Lit_Other "+") (s) (Lit_Comma ",") (g) (Lit_Other "+") (x)} {(KW_Bang "!")} {(-type)} {(d)} {(-exec)} {(chmod)} {(g-s)} {(Lit_LBrace "{") (Lit_RBrace "}")} {(EscapedLiteralPart token:)} ) (C {(chmod)} {(775)} {(DQ ($ VSub_Name "$subpkgdir")) (/var/games)}) (C {(chmod)} {(775)} {(DQ ($ VSub_Name "$subpkgdir")) (/var/games/emacs)}) (C {(chmod)} {(664)} {(DQ ($ VSub_Name "$subpkgdir")) (/var/games/emacs/) (Lit_Other "*")}) (C {(chown)} {(-R)} {(root) (Lit_Other ":") (games)} {(DQ ($ VSub_Name "$subpkgdir")) (/var/games)} ) ] spids: [526] ) spids: [522 525] ) (FuncDef name: nox body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ($ VSub_Name "$pkgdesc") (" - without X11"))} spids: [702] ) ] spids: [702] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: {(DQ ("!emacs-x11 !emacs-gtk2"))} spids: [709] ) ] spids: [709] ) (C {(_subpackage)} {(nox)}) ] spids: [699] ) spids: [695 698] ) (FuncDef name: x11 body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ($ VSub_Name "$pkgdesc") (" - with X11"))} spids: [729] ) ] spids: [729] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: {(DQ ("!emacs-nox !emacs-gtk2 hicolor-icon-theme desktop-file-utils"))} spids: [736] ) ] spids: [736] ) (C {(_subpackage)} {(x11)}) ] spids: [726] ) spids: [722 725] ) (FuncDef name: gtk2 body: (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:pkgdesc) op: Equal rhs: {(DQ ($ VSub_Name "$pkgdesc") (" - with GTK2"))} spids: [756] ) ] spids: [756] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:depends) op: Equal rhs: {(DQ ("!emacs-nox !emacs-x11 hicolor-icon-theme desktop-file-utils"))} spids: [763] ) ] spids: [763] ) (C {(_subpackage)} {(gtk2)}) ] spids: [753] ) spids: [749 752] ) (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:sha512sums) op: Equal rhs: { (DQ ( "1cce656451b6ca8502ebb229e88bd3ef48b7f9444a10eeac4ea43bd5491b2efacd641dfa35227a33362c3866493d3449cf1df81606563eef44bba0ed668e457f emacs-25.3.tar.xz\n" ) ( "8898f309aeaf274366849bd5c56c8e2a1be94dfee2f01b20f1700bf26203f49b9600237e5090fc3d8eaad3ea246f803ffd493d0c04cb3512084a4e3bf58f8f5e gamedir.patch\n" ) ( "d3a30a9bf7ef7349806a75ee919d6683a8000eb70f4c3040d149bd8911dc95b931a05c7cbf9f5b93176940ad87520dbb2ddef3b4136b0d5b140de0cdbc4b7a8f noaslr-dump.patch\n" ) ( "4ec078f970c2d0ad9b082a613e7c7e64e40f37eaee96e67ab9b2e467595c74533f94ced74f6753e393a9c0ead88fad75adcfdd31be4295f5763292a6dd846fe8 musl.patch" ) ) } spids: [776] ) ] spids: [776] ) ] )