about summary refs log tree commit diff
path: root/pkgs/desktops/cdesktopenv/default.nix
blob: fd8de27b2fde59d7211d7a10767759189c038240 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
{ lib, stdenv, fetchurl
, libX11, bison, ksh, perl
, libXinerama, libXt, libXext, libtirpc, motif, libXft, xbitmaps
, libjpeg, libXmu, libXdmcp, libXScrnSaver, bdftopcf
, ncompress, mkfontdir, tcl, libXaw, libxcrypt, glibcLocales
, autoPatchelfHook, makeWrapper, xset, xrdb
, autoreconfHook, opensp, flex, libXpm
, rpcsvc-proto }:

stdenv.mkDerivation rec {
  pname = "cde";
  version = "2.5.1";

  src = fetchurl {
    url = "mirror://sourceforge/cdesktopenv/cde-${version}.tar.gz";
    hash = "sha256-caslezz2kbljwApv5igDPH345PK2YqQUTi1YZgvM1Dw=";
  };

  postPatch = ''
    for f in $(find . -type f ! -path doc/common); do
      sed -i \
        -e "s|/usr/dt|$out|g" \
        -e "s|/etc/dt|$out/etc|g" \
        -e "s|\$(DESTDIR)/var|$out/var|g" \
        "$f"
    done

    for f in $(find . -type f -name "Makefile.am"); do
      sed -i \
        -e "/chown /d" \
        -e "/chgrp /d" \
        -e "s/chmod 4755/chmod 755/g" \
        "$f"
    done

    substituteInPlace configure.ac \
      --replace "-I/usr/include/tirpc" "-I${libtirpc.dev}/include/tirpc"

    patchShebangs autogen.sh config.rpath contrib programs
  '';

  buildInputs = [
    libX11 libXinerama libXt libXext libtirpc motif libXft xbitmaps
    libjpeg libXmu libXdmcp libXScrnSaver tcl libXaw ksh libxcrypt
    libXpm
  ];
  nativeBuildInputs = [
    bison ncompress autoPatchelfHook makeWrapper
    autoreconfHook bdftopcf mkfontdir xset xrdb opensp perl flex
    rpcsvc-proto
  ];

  enableParallelBuilding = true;

  preConfigure = ''
    export LOCALE_ARCHIVE="${glibcLocales}/lib/locale/locale-archive"
  '';

  configureFlags = [
    "--with-tcl=${tcl}/lib"
  ];

  preInstall = ''
    mkdir -p $out/opt/dt/bin
  '';

  meta = with lib; {
    description = "Common Desktop Environment";
    homepage = "https://sourceforge.net/projects/cdesktopenv/";
    license = licenses.lgpl2;
    maintainers = [ ];
    platforms = platforms.linux;
  };
}