1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 fetchpatch,
6 autoreconfHook,
7 gdbm,
8 gmp,
9 libffi,
10 pkg-config,
11 readline,
12 texinfo,
13 versionCheckHook,
14}:
15
16stdenv.mkDerivation (finalAttrs: {
17 pname = "librep";
18 version = "0.92.7";
19
20 src = fetchFromGitHub {
21 owner = "SawfishWM";
22 repo = "librep";
23 tag = "librep-${finalAttrs.version}";
24 hash = "sha256-0Ltysy+ilNhlXmvzSCMfF1n3x7F1idCRrhBFX/+n9uU=";
25 };
26
27 patches = [
28 # build: fix -Wimplicit-int, -Wimplicit-function-declaration (Clang 16)
29 (fetchpatch {
30 name = "fix-implicit-int";
31 url = "https://github.com/SawfishWM/librep/commit/48f557ab34d47a7a1fd9e8425542f720be40946e.patch";
32 hash = "sha256-MbFBNCgjEU1/QnjOe3uCWKVhpxo/E8c9q2TT3+CwPfY=";
33 })
34 ];
35
36 nativeBuildInputs = [
37 autoreconfHook
38 pkg-config
39 texinfo
40 ];
41
42 buildInputs = [
43 gdbm
44 gmp
45 libffi
46 readline
47 ];
48
49 strictDeps = true;
50 enableParallelBuilding = true;
51
52 # ensure libsystem/ctype functions don't get duplicated when using clang
53 configureFlags = lib.optionals stdenv.hostPlatform.isDarwin [ "CFLAGS=-std=gnu89" ];
54
55 setupHook = ./setup-hook.sh;
56
57 nativeInstallCheckInputs = [
58 versionCheckHook
59 ];
60 doInstallCheck = true;
61 versionCheckProgramArg = "--version";
62 versionCheckProgram = "${placeholder "out"}/bin/${finalAttrs.meta.mainProgram}";
63
64 meta = {
65 homepage = "http://sawfish.tuxfamily.org/";
66 description = "Fast, lightweight, and versatile Lisp environment";
67 longDescription = ''
68 librep is a Lisp system for UNIX, comprising an interpreter, a byte-code
69 compiler, and a virtual machine. It can serve as an application extension
70 language but is also suitable for standalone scripts.
71 '';
72 license = lib.licenses.gpl2Plus;
73 maintainers = [ ];
74 platforms = lib.platforms.unix;
75 mainProgram = "rep";
76 };
77})