Skip to content

Instantly share code, notes, and snippets.

@aexoxea
Created June 22, 2021 09:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aexoxea/10523234353d07ca991cbe5eb8a3bd28 to your computer and use it in GitHub Desktop.
Save aexoxea/10523234353d07ca991cbe5eb8a3bd28 to your computer and use it in GitHub Desktop.
FVWM3 1.0.3 for NixOS
diff --git a/modules/FvwmMFL/FvwmMFL.c b/modules/FvwmMFL/FvwmMFL.c
index c0b15df1..b4559367 100644
--- a/modules/FvwmMFL/FvwmMFL.c
+++ b/modules/FvwmMFL/FvwmMFL.c
@@ -30,11 +30,7 @@
#include <stdbool.h>
#include <unistd.h>
-#if defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__sun__)
#include <libbson-1.0/bson.h>
-#else
-#include <bson/bson.h>
-#endif
#include <event2/event.h>
/* FIXME: including event_struct.h won't be binary comaptible with future
...
environment.systemPackages = [ (import ./fvwm3.nix) ];
...
services.xserver.windowManager.session = with lib; singleton {
name = "fvwm3";
start = ''
/run/current-system/sw/bin/fvwm3 &
waitPID=$!
'';
};
...
with import <nixpkgs> {};
stdenv.mkDerivation rec {
pname = "fvwm3";
version = "1.0.3";
src = fetchFromGitHub {
owner = "fvwmorg";
repo = pname;
rev = version;
sha256 = "12z5vvv17jg36h7ncid9lmwnzp774fcs64v4slp5bmh420jz8xwp";
};
configureFlags = [ "--disable-htmldoc" "--enable-mandoc" ];
patches = [ ./0001-FvwmMFL-libbson.patch ];
nativeBuildInputs = [ asciidoctor autoreconfHook pkg-config ];
buildInputs = with xorg; [
libbson libevent libX11 libXrandr libXrender libXt
fontconfig freetype fribidi libpng librsvg libSM libXcursor libXext libXft libXi libXpm ncurses5 readline sharutils
];
meta = with lib; {
description = "F? Virtual Window Manager";
homepage = "https://www.fvwm.org/";
license = licenses.gpl2;
platforms = platforms.linux;
maintainers = [ ];
};
}
@aexoxea
Copy link
Author

aexoxea commented Jun 22, 2021

I wanted to play around with FVWM a bit, and being new, it seemed prudent to start with the newer package since it's gone past v1.0 now.

Fortunately it was easy to get this working, using a combination of the install instructions provided in the FVWM3 repo and the existing FVWM2 derivation (my thanks all the contributors on that).

The patch is to address issue FVWM3#375 with detecting libbson. Crude, but it does get the job done and nothing seems broken from my limited use thusfar.

This can be manually added locally by saving the fvwm3.nix and 0001-FvwmMFL-libbson.patch files to your NixOS config directory, and amending configuration.nix (or equivalent) as above, noting again the working crudeness of this approach.

I haven't made this an overlay or made a PR for nixpkgs (yet) for two reasons:

  1. I'm a git neophyte 😄.
  2. I don't know if I'm going to use FVWM3 long term, and don't want to inadvertently create dumped code.

I'm happy to take any feedback on this (including lectures on the crude bits 😄) here or on NixOS Discourse. Also, anyone who wants to copy or reuse these files for any purpose should feel free: Insofar as any law, regulation or rule deems me to hold copyright on the files in this gist, I release my rights to them under CC0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment