reddit / emacs

Help a beginner out with building from source 馃槶

A-wannabe-DEV 路 2022-09-30 07:29
can anyone give some pointers on how to build emacs from source, i'm on arch and there is a couple of prebuild packages in the aur but what i'm after is building version 28.2 with `--with-cairo` and `--with-x-toolkit=gtk3` . and also add the alpha-background patch. i installed multiple builds from the aur but they're all version 29 and doom-emacs doesn't work properly with that version yet, any help is welcome. Thanks in advance
anaumann 路 2022-09-30 07:52
Why all the effort when the regular package in extra pretty much is what you're looking for: [https://archlinux.org/packages/extra/x86\_64/emacs/](https://archlinux.org/packages/extra/x86_64/emacs/) ? If anything, you can use that PKGBUILD file to base your own build off of.
A-wannabe-DEV 路 2022-09-30 08:40
this was not built with cairo though. >If anything, you can use that PKGBUILD file to base your own build off of. that is my question though, i want to know how to build it or use a PKGBUILD file
anaumann 路 2022-09-30 08:44
By reading the documentation: [https://wiki.archlinux.org/title/creating\_packages](https://wiki.archlinux.org/title/creating_packages)
anaumann 路 2022-09-30 08:46
Also: Did you look at the pkgbuild? It pretty clearly says build() { ... --with-cairo
arthurno1 路 2022-09-30 14:43
There are quite clear instructions on how to build Emacs in Emacs documentation, elsewhere on the Internet and even in this Reddit. If you have done the simplest web search, you would have found it. Anyway: 1. https://savannah.gnu.org/git/?group=emacs 2. cd emacs 3. ./autogen.sh 4. ./configure --with-cairo --with-x-toolkit=gtk3 5. make bootstrap -jN (N = number of cores you have in your cpu) 6. sudo make install Be sure you have all the needed libraries and tools installed. Also, instead of building in the master, before you do ./autogen (step 3.), create a worktree and build in the worktree instead: 1. https://savannah.gnu.org/git/?group=emacs 2. cd emacs 3. git worktree add ../my-custom-build (choose name you prefer) 4. cd ../my-custom-build 5. ./autogen.sh 6. ./configure --with-cairo --with-x-toolkit=gtk3 7. make bootstrap -jN (N = number of cores you have in your cpu) 8. sudo make install.sh By using git worktrees, you can experiment with different builds, have different configuration options, different branches checked out etc. By using a worktree you don't risk accidentally polluting the main Emacs directory, so git won't scream for unsaved changes when you do a pull to update the sources, if you plan to build from the sources some other time later. Search and read on working with git worktrees elsewhere. Few tips how I like to configure my Emacs:: --without-compress-install, will not compress sources, so when you ask for help in Emacs, you will not wait for Emacs to do decompress files first. I don't run make install! I compile Emacs often (once in a two-free weeks or so from the master),, I do pull every time before, so I don't want to check out sources from the scratch, but keep sources around. Instead of copying duplicate binaries to a system directory, I just run them automatically from the worktree where I have compiled Emacs. That also means I don't need to enter a sudo password when I install Emacs, so I can automate everything with a lisp script.
A-wannabe-DEV 路 2022-09-30 17:47
thank you so much for the detailed instructions, i've read the emacs install file and did exactly as it instructed but never actually worked, turns out i didn't have all the base-devel installed which you reminded me about, so thanks. one question though that's the 29 source though, i was looking to build the 28.2. does these instructions work for that too? and is the alpha-background patch added to the 28.2 or should i use TheVaffel/emacs version?
ivan_linux 路 2022-09-30 18:03
The build instructions haven't really changed in a while. If you're curious about the alpha-background stuff you should read the change logs.
cuttle_codes 路 2022-09-30 19:46
Fwiw I've been using doom on emacs 29 since it became available, and it's stable enough to be my daily driver.
A-wannabe-DEV 路 2022-09-30 19:49
really?? you don't have any problems with wrong icons, packages breaking or anything?
arthurno1 路 2022-09-30 22:30
> one question though that's the 29 source though, i was looking to build the 28.2. By default you checkout master (29.0.50), but you can either checkout 28.2 bransch, worktree is really good in this case, or you can downloud tar.bz2 from their ftp, unzip and untar those and work from there. The building process is same. > is the alpha-background patch added to the 28.2 or should i use TheVaffel/emacs version? Honestly, I don't remembe forr sure, but I think that patch is in 29 only. Don't know. I do not recommend building his version from the github, it should probably be outdated by now. I suggest building 29, and seeing how well it works for you first. It is usually quite stable, I myself use it everyday, as my main Emacs, and it works fine.
arthurno1 路 2022-09-30 22:31
No such problems here..
A-wannabe-DEV 路 2022-09-30 23:34
that's weird, coz that's how it looks for me on fresh install of doom and already installed all-the-icons. would you happen to know a reason for that [https://imgur.com/a/s4VYyIS](https://imgur.com/a/s4VYyIS)
A-wannabe-DEV 路 2022-09-30 23:37
>By default you checkout master (29.0.50), but you can either checkout 28.2 branch yeah, just figured that out. >Honestly, I don't remember for sure, but I think that patch is in 29 only. i built 28.2 and it doesn't have the patch installed, i already built 29 with native-comp so i think I'll stick with that. thank you so much for the detailed answer though, it was very helpful
arthurno1 路 2022-10-01 00:02
You are welcome. Glad it worked out in the end.