|
| 1 | +FROM ubuntu:22.10 |
| 2 | + |
| 3 | +# Minimum necessary to add source ppa and build emacs broadway+nativecomp |
| 4 | +RUN apt-get update && \ |
| 5 | + DEBIAN_FRONTEND="noninteractive" apt-get install --yes \ |
| 6 | + software-properties-common \ |
| 7 | + dpkg-dev \ |
| 8 | + devscripts \ |
| 9 | + libgccjit-12-dev \ |
| 10 | + libgtk-3-bin |
| 11 | + |
| 12 | +# Install latest Git using their official PPA |
| 13 | +RUN add-apt-repository ppa:git-core/ppa && \ |
| 14 | + DEBIAN_FRONTEND="noninteractive" apt-get install --yes git |
| 15 | + |
| 16 | +# Need to setup GPG key... note it MUST be RSA, |
| 17 | +# there is a known bug with the default EC keys |
| 18 | +# gpg --list-keys |
| 19 | +# /root/.gnupg/pubring.kbx |
| 20 | +# ------------------------ |
| 21 | +# pub rsa4096 2022-11-06 [SC] [expires: 2024-11-05] |
| 22 | +# 70933F81146364F45C9BC7AF3F265859EC6F4FBA |
| 23 | +# uid [ultimate] Hippie Hacker <[email protected]> |
| 24 | + |
| 25 | +# I'd also prefer to build from upstream savanna git, |
| 26 | +# but more research is needed to understand launchpad / debian build-from-git |
| 27 | +# RUN git clone --depth=1 git://git.sv.gnu.org/emacs.git |
| 28 | +# for now we'll use the ubuntu-elisp ppa for emacs-snapshot |
| 29 | + |
| 30 | +# Add-apt-repo for emacs-src snapshot using the unofficial PPA |
| 31 | +RUN add-apt-repository ppa:ubuntu-elisp/ppa --yes && \ |
| 32 | + sed -i -e 's/^#\ //' /etc/apt/sources.list.d/ubuntu-elisp-ubuntu-ppa-kinetic.list && \ |
| 33 | + DEBIAN_FRONTEND="noninteractive" apt-get update |
| 34 | + |
| 35 | +# Retrieve source and install build dependencies |
| 36 | +RUN DEBIAN_FRONTEND="noninteractive" apt-get source emacs-snapshot && \ |
| 37 | + DEBIAN_FRONTEND="noninteractive" apt-get -y build-dep emacs-snapshot |
| 38 | + |
| 39 | +# I copied the gpg.tgz in manually and untarred |
| 40 | + |
| 41 | + echo some steps to setup GPG |
| 42 | + |
| 43 | +# Setup ~/.dput.cf |
| 44 | +COPY .dput.cf /root/.dput.cf |
| 45 | + |
| 46 | +# Could Add with sed OR figure out launchpad / bzr |
| 47 | +# https://help.launchpad.net/Code/FindingAndDownloading |
| 48 | +# https://code.launchpad.net/~ubuntu-elisp/emacs/+git/master/+new-recipe |
| 49 | +# https://help.launchpad.net/Packaging/SourceBuilds/GettingStarted |
| 50 | +# https://git.launchpad.net/~ubuntu-elisp/emacs/ # look at the snapshot-packaging branch |
| 51 | +# https://git.launchpad.net/~ubuntu-elisp/emacs/log/ |
| 52 | +# The actual debian folder appears here: |
| 53 | +# https://git.launchpad.net/~ubuntu-elisp/emacs/tree/debian |
| 54 | +# But this might not be long-lived, we just want to add |
| 55 | +# `--with-json=yes --with-modules=yes --with-native-compilation=yes --with-pgtk=yes --with-cairo=yes` |
| 56 | + |
| 57 | +# We need to make the following changes to debian/control |
| 58 | +# Add the three lines with + |
| 59 | +# # common configure flags |
| 60 | +# confflags += --prefix=/usr |
| 61 | +# confflags += --sharedstatedir=/var/lib |
| 62 | +# confflags += --program-suffix="$(suffix)" |
| 63 | +#+ confflags += --with-modules=yes |
| 64 | +#+ confflags += --with-json=yes |
| 65 | +#+ confflags += --with-native-compilation=yes |
| 66 | + |
| 67 | +# Add the two final lines with + in debian/control |
| 68 | +# # Gtk config options |
| 69 | +# confflags_gtk += $(confflags) |
| 70 | +# confflags_gtk += --with-x=yes |
| 71 | +# confflags_gtk += --with-x-toolkit=gtk3 |
| 72 | +# confflags_gtk += --with-xwidgets=yes |
| 73 | +#+ confflags_gtk += --with-pgtk=yes |
| 74 | +#+ confflags_gtk += --with-cairo=yes |
| 75 | + |
| 76 | +# The actual build process, signed changes, and upload |
| 77 | +RUN cd emacs-snapshot-* && \ |
| 78 | + debuild -k70933F81146364F45C9BC7AF3F265859EC6F4FBA -S -sa && \ |
| 79 | + dput ppa:hippiehacker/emacs-broadway ./emacs-snapshot_*source.changes |
| 80 | + |
| 81 | +# Using this build |
0 commit comments