nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 stdenv,
3 autoreconfHook,
4 fetchFromGitLab,
5 fetchpatch,
6 fetchurl,
7 fontconfig,
8 freetype,
9 gpm,
10 lib,
11 ncurses,
12 pkg-config,
13}:
14
15stdenv.mkDerivation (finalAttrs: {
16 version = "1.7-2";
17 pname = "fbterm";
18
19 src = fetchFromGitLab {
20 domain = "salsa.debian.org";
21 owner = "debian";
22 repo = "fbterm";
23 rev = "debian/${finalAttrs.version}";
24 hash = "sha256-vRUZgFpA1IkzkLzl7ImT+Yff5XqjFbUlkHmj/hd7XDE=";
25 };
26
27 nativeBuildInputs = [
28 autoreconfHook
29 pkg-config
30 ncurses
31 ];
32 buildInputs = [
33 gpm
34 freetype
35 fontconfig
36 ncurses
37 ];
38
39 makeFlags = [
40 "AR:=$(AR)"
41 ];
42
43 # preConfigure = ''
44 # sed -e '/ifdef SYS_signalfd/atypedef long long loff_t;' -i src/fbterm.cpp
45 # sed -e '/install-exec-hook:/,/^[^\t]/{d}; /.NOEXPORT/iinstall-exec-hook:\
46 # ' -i src/Makefile.in
47 # export HOME=$PWD;
48 # export NIX_LDFLAGS="$NIX_LDFLAGS -lfreetype"
49 # '';
50
51 preInstall = ''
52 export HOME=$PWD
53 '';
54
55 postInstall =
56 let
57 fbtermrc = fetchurl {
58 url = "https://aur.archlinux.org/cgit/aur.git/plain/fbtermrc?h=fbterm";
59 hash = "sha256-zNIfi2ZjEGc5PLdOIirKGTXESb5Wm5XBAI1sfHa31LY=";
60 };
61 in
62 ''
63 mkdir -p "$out/share/terminfo"
64 tic -a -v2 -o"$out/share/terminfo" terminfo/fbterm
65
66 mkdir -p "$out/etc/fbterm"
67 cp "${fbtermrc}" "$out/etc/fbterm"
68 '';
69
70 # Patches from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=fbterm
71 patches = [
72 (fetchpatch {
73 url = "https://aur.archlinux.org/cgit/aur.git/plain/fbconfig.patch?h=fbterm";
74 hash = "sha256-skCdUqyMkkqxS1YUI7cofsfnNNo3SL/qe4WEIXlhm/s=";
75 })
76 (fetchpatch {
77 url = "https://aur.archlinux.org/cgit/aur.git/plain/color_palette.patch?h=fbterm";
78 hash = "sha256-SkWxzfapyBTtMpTXkiFHRAw8/uXw7cAWwg5Q3TqWlk8=";
79 })
80 (fetchpatch {
81 url = "https://aur.archlinux.org/cgit/aur.git/plain/fbterm.patch?h=fbterm";
82 hash = "sha256-XNHBTGQGeaQPip2XgcKlr123VDwils2pnyiGqkBGhzU=";
83 })
84 (fetchpatch {
85 url = "https://aur.archlinux.org/cgit/aur.git/plain/0001-Fix-build-with-gcc-6.patch?h=fbterm";
86 hash = "sha256-3d3zBvr5upICVVkd6tn63IhuB0sF67f62aKnf8KvOwg=";
87 })
88 (fetchpatch {
89 url = "https://aur.archlinux.org/cgit/aur.git/plain/fix_ftbfs_crosscompile.patch?h=fbterm";
90 hash = "sha256-jv/FSG6dHR0jKjPXQIfqsvpiT/XYzwv/VwuV+qUSovM=";
91 })
92 (fetchpatch {
93 url = "https://aur.archlinux.org/cgit/aur.git/plain/fix_ftbfs_epoll.patch?h=fbterm";
94 hash = "sha256-wkhfG0uY/5ZApcXTERkaKqz5IDpnilxUEcxull4645A=";
95 })
96 ];
97
98 meta = {
99 description = "Framebuffer terminal emulator";
100 mainProgram = "fbterm";
101 homepage = "https://salsa.debian.org/debian/fbterm";
102 maintainers = with lib.maintainers; [
103 lovesegfault
104 raskin
105 ];
106 license = lib.licenses.gpl2Plus;
107 platforms = lib.platforms.linux;
108 };
109})