nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 stdenv,
4 fetchFromGitHub,
5 buildPackages,
6 which,
7 texi2html,
8 enableX11 ? true,
9 libX11,
10 libXext,
11 libXv,
12 libpng,
13}:
14
15stdenv.mkDerivation {
16 pname = "qemacs";
17 version = "6.3.2";
18
19 src = fetchFromGitHub {
20 owner = "qemacs";
21 repo = "qemacs";
22 rev = "0e90c181078f3d85d0d44d985d541184223668e1";
23 hash = "sha256-3kq89CoUi9ocR0q2SqYF8S/xNgBpInC4f2d/dJg/nEM=";
24 };
25
26 postPatch = ''
27 substituteInPlace Makefile --replace \
28 '$(INSTALL) -m 755 -s' \
29 '$(INSTALL) -m 755 -s --strip-program=${stdenv.cc.targetPrefix}strip'
30 '';
31
32 nativeBuildInputs = [
33 which
34 texi2html
35 ];
36 buildInputs = lib.optionals enableX11 [
37 libpng
38 libX11
39 libXext
40 libXv
41 ];
42
43 enableParallelBuilding = true;
44
45 configureFlags = [
46 "--cross-prefix=${stdenv.cc.targetPrefix}"
47 ]
48 ++ lib.optionals (!enableX11) [
49 "--disable-x11"
50 ];
51
52 makeFlags = [
53 # is actually used as BUILD_CC
54 "HOST_CC=${buildPackages.stdenv.cc}/bin/cc"
55 "CC=${stdenv.cc.targetPrefix}cc"
56 ];
57
58 preInstall = ''
59 mkdir -p $out/bin $out/man
60 '';
61
62 meta = with lib; {
63 homepage = "https://bellard.org/qemacs/";
64 description = "Very small but powerful UNIX editor";
65 license = licenses.mit;
66 maintainers = with maintainers; [ iblech ];
67 };
68}