├── .gitignore ├── .github └── workflows │ ├── deploy.yml │ └── deploy_manually.yml ├── LICENSE ├── README.org └── Dockerfile /.gitignore: -------------------------------------------------------------------------------- 1 | /deploy/ 2 | *.deb 3 | -------------------------------------------------------------------------------- /.github/workflows/deploy.yml: -------------------------------------------------------------------------------- 1 | name: Schedule build deb package 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | schedule: 9 | - cron: "0 0 * * *" 10 | 11 | jobs: 12 | build: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - uses: actions/checkout@v3 16 | - name: Build and deploy 17 | run: ./build.sh 18 | 19 | - name: Archive artifacs 20 | uses: actions/upload-artifact@v3 21 | with: 22 | name: emacs-gcc-pgtk 23 | path: ./deploy/emacs-gcc-pgtk_*.deb 24 | -------------------------------------------------------------------------------- /.github/workflows/deploy_manually.yml: -------------------------------------------------------------------------------- 1 | name: Manually build deb package with Docker image 2 | 3 | on: 4 | push: 5 | branches: [ main ] 6 | pull_request: 7 | branches: [ main ] 8 | workflow_dispatch: 9 | 10 | jobs: 11 | build: 12 | runs-on: ubuntu-latest 13 | steps: 14 | - uses: actions/checkout@v3 15 | - name: Build and deploy 16 | run: ./build.sh 17 | 18 | - name: Archive artifacs 19 | uses: actions/upload-artifact@v3 20 | with: 21 | name: emacs-gcc-pgtk 22 | path: ./deploy/emacs-gcc-pgtk_*.deb 23 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 konstare 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.org: -------------------------------------------------------------------------------- 1 | #+TITLE: emacs-gcc-pgtk - Dockerfile for building emacs.deb with native-comp and pure GTK 2 | 3 | * Summary 4 | This repository shows a Dockerfile to create a emacs-29 deb package with native compilation and pure GTK for Ubuntu >=20.04. 5 | 6 | ** Notes: 7 | 1. The deb package can be found in [[https://github.com/konstare/emacs-gcc-pgtk/actions/workflows/deploy.yml?query=is%3Acompleted][GitHub Action]]. 8 | 2. The emacs source files are [[https://git.savannah.gnu.org/cgit/emacs.git/log/?h=emacs-29][here]]. 9 | 3. no xwidgets 10 | 4. no imagemagick. Emacs now supports resizing and rotating of images without ImageMagick. 11 | 5. all =.el= files are compiled ahead of time. 12 | 6. The emacs is built with sqlite, webp, tree-sitter 13 | ** The package is compiled with flags: 14 | + --with-pgtk 15 | + --with-json 16 | + --with-gnutls 17 | + --with-rsvg 18 | + --without-xwidgets 19 | + --without-xaw3d 20 | + --with-mailutils 21 | + --with-native-compilation=aot 22 | + CFLAGS="-O2 -pipe" 23 | 24 | * Installation 1: Use [[https://github.com/konstare/emacs-gcc-pgtk/actions][GitHub Actions]] 25 | The deb package with this recipe is built by =github= every day and can be found in [[https://github.com/konstare/emacs-gcc-pgtk/actions/workflows/deploy.yml?query=is%3Acompleted][GitHub Action]]. 26 | 27 | * Installation 2: Compile on your own computer 28 | ** Requirements 29 | 1. docker 30 | ** Compilation 31 | #+begin_src bash 32 | git clone https://github.com/konstare/emacs-gcc-pgtk 33 | cd emacs-gcc-pgtk 34 | ./build.sh 35 | #+end_src 36 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM ubuntu:22.04 2 | WORKDIR /opt 3 | ENV DEBIAN_FRONTEND=noninteractive 4 | 5 | RUN sed -i 's/# deb-src/deb-src/' /etc/apt/sources.list &&\ 6 | apt-get update && apt-get install --yes --no-install-recommends \ 7 | apt-transport-https\ 8 | ca-certificates\ 9 | build-essential \ 10 | autoconf \ 11 | git \ 12 | pkg-config \ 13 | libgnutls28-dev \ 14 | libasound2-dev \ 15 | libacl1-dev \ 16 | libgtk-3-dev \ 17 | libgpm-dev \ 18 | liblockfile-dev \ 19 | libotf-dev \ 20 | libsystemd-dev \ 21 | libjansson-dev \ 22 | libgccjit-11-dev \ 23 | libgif-dev \ 24 | librsvg2-dev \ 25 | libxml2-dev \ 26 | libxpm-dev \ 27 | libtiff-dev \ 28 | libjbig-dev \ 29 | libncurses-dev\ 30 | liblcms2-dev\ 31 | libwebp-dev\ 32 | libsqlite3-dev\ 33 | texinfo\ 34 | libtree-sitter-dev 35 | 36 | 37 | # Clone emacs 38 | RUN update-ca-certificates \ 39 | && git clone --depth 1 https://git.savannah.gnu.org/git/emacs.git -b emacs-29 emacs \ 40 | && mv emacs/* . 41 | 42 | # Build 43 | ENV CC="gcc-11" 44 | RUN ./autogen.sh && ./configure \ 45 | --prefix "/usr/local" \ 46 | --with-pgtk \ 47 | --with-json \ 48 | --with-gnutls \ 49 | --with-rsvg \ 50 | --without-xwidgets \ 51 | --without-xaw3d \ 52 | --with-mailutils \ 53 | --with-native-compilation=aot \ 54 | CFLAGS="-O2 -pipe" 55 | 56 | 57 | 58 | RUN make -j $(nproc) 59 | 60 | # Create package 61 | RUN EMACS_VERSION=$(sed -ne 's/AC_INIT(\[GNU Emacs\], \[\([0-9.]\+\)\], .*/\1/p' configure.ac).$(date +%y.%m.%d.%H) \ 62 | && make install prefix=/opt/emacs-gcc-pgtk_${EMACS_VERSION}/usr/local \ 63 | && mkdir emacs-gcc-pgtk_${EMACS_VERSION}/DEBIAN && echo "Package: emacs-gcc-pgtk\n\ 64 | Version: ${EMACS_VERSION}\n\ 65 | Section: base\n\ 66 | Priority: optional\n\ 67 | Architecture: amd64\n\ 68 | Depends: libtree-sitter0, libgif7, libotf1, libgccjit0, libgtk-3-0, librsvg2-2, libtiff5, libjansson4, libacl1, libgmp10, libwebp7, libsqlite3-0\n\ 69 | Conflicts: emacs\n\ 70 | Maintainer: konstare\n\ 71 | Description: Emacs with native compilation, pure GTK and tree-sitter\n\ 72 | --with-pgtk \ 73 | --with-json \ 74 | --with-gnutls \ 75 | --with-rsvg \ 76 | --without-xwidgets \ 77 | --without-xaw3d \ 78 | --with-mailutils \ 79 | --with-native-compilation=aot\ 80 | CFLAGS='-O2 -pipe'" \ 81 | >> emacs-gcc-pgtk_${EMACS_VERSION}/DEBIAN/control \ 82 | && echo "activate-noawait ldconfig" >> emacs-gcc-pgtk_${EMACS_VERSION}/DEBIAN/triggers \ 83 | && cd /opt \ 84 | && dpkg-deb --build emacs-gcc-pgtk_${EMACS_VERSION} \ 85 | && mkdir /opt/deploy \ 86 | && mv /opt/emacs-gcc-pgtk_*.deb /opt/deploy 87 | --------------------------------------------------------------------------------