![]() So while I think of the ability to easily patch Emacs as a superpower that Nix gave me, in reality I think it’s a superpower that a deep understanding of any system package manager would give you. You have to understand how to package software, how to fix problems with buggy packages, how to apply patches like this – things that you can happily ignore if you’re using Homebrew. You use Nix because it makes it easier to build software – because it lets you specify your systems dependencies in a cross-platform, computer-readable way.Īnd in order to use Nix at all, you have to understand quite a lot about how it works. When I was using Homebrew, there was a sharp line between “software I install with Homebrew” and “software I build from source” (which included any software I wrote myself).īut with Nix… well, you don’t use Nix because it lets you download binaries from the internet. I’ve never had to package something for Homebrew I’ve never tried to write formulae for my own software. I think of Homebrew as just a command line way to download binaries from the internet. But I never would have thought to do that. I’m sure there’s some way to fork the formula locally and figure out how to build it from source. Honestly, it would never have even occurred to me to use Homebrew to patch Emacs. ![]() If I wanted to change something about Emacs, why wouldn’t I start there? It specifies its dependencies it specifies the exact build invocation it uses. Like, if I were still using Homebrew, I could have looked at the Homebrew formula. I don’t need to struggle through a long document telling me in English words how to get it building – someone has already translated the build instructions into a Nix expression that describes exactly what dependencies I need and exactly what to do with them.īut of course… that’s true of any system package manager, right? I can just ask Nix how to build Emacs, and it will tell me. It was every bit as weird and complicated and difficult to learn as everyone said it was going to be, but I stuck with it, and I’m glad I did.īecause now I don’t need to figure out how to build Emacs. wait no come backĮarlier this year I spent some time learning how to use Nix. I want to make a little game.Ī secret weapon called Nix. ![]() That’s just… that’s not how I want to spend my weekend. 1Īctually, I probably wouldn’t have tried to make this change a year ago, because I’ve been using computers long enough to know that it would take me like six hours to actually figure out how to build Emacs, and this tiny little change is not worth six hours of fighting with autoconf. Okay, that was a walkthrough of what would have happened if I tried to make this change a year ago. I dunno we can go through this whole file and eventually get to a working incantation and we can finally build Emacs and start working on the image change.īut our build just immediately segfaults, so we give up. There’s no explicit list of dependencies that we need, but reading between the lines it seems like we definitely need the GCC toolchain, HarfBuzz, maybe something called intlfonts… and some subset of these libraries too, depending on which image formats we want to support: libXaw3dĪnd then maybe we want to compile… -with-imagemagick? But it says that’s not the default because of security reasons. ![]() The installation instructions span multiple pages. Should be a one-line change.īut, of course, that one line change carries with it a heavy price.īecause we’re going to have to figure out how to build Emacs. I’m just going to change Emacs to unconditionally use nearest-neighbor resampling instead of unconditionally using bilinear resampling. Seems like an easy fix, right? I’m not going to try to make this behavior configurable or alter the image API or something complicated. Quick refresher: I’m trying to write tests with pictures in them, but when I scale the pictures up, they get really blurry: But it’s also neat in a very concrete sense: we just ran into a problem with Emacs, and we can fix it. Which is neat in some abstract continuity of software freedom of rights sense.
0 Comments
Leave a Reply. |