2021-11-30 20:10:07 +01:00
|
|
|
{ lib, stdenv, fetchurl
|
|
|
|
, fetchpatch
|
|
|
|
, xorgproto, libX11, bison, ksh, perl, gnum4
|
2019-12-07 11:19:10 +01:00
|
|
|
, libXinerama, libXt, libXext, libtirpc, motif, libXft, xbitmaps
|
|
|
|
, libjpeg, libXmu, libXdmcp, libXScrnSaver, symlinkJoin, bdftopcf
|
2022-03-31 20:11:26 +02:00
|
|
|
, ncompress, mkfontdir, tcl, libXaw, gcc, glibcLocales
|
2020-11-02 17:15:50 +01:00
|
|
|
, autoPatchelfHook, libredirect, makeWrapper, xset, xrdb, fakeroot
|
|
|
|
, rpcsvc-proto }:
|
2019-12-07 11:19:10 +01:00
|
|
|
|
|
|
|
let
|
|
|
|
x11ProjectRoot = symlinkJoin {
|
|
|
|
name = "x11ProjectRoot";
|
|
|
|
paths = [
|
|
|
|
bdftopcf mkfontdir
|
|
|
|
xset # fonts
|
|
|
|
xrdb # session load
|
|
|
|
];
|
|
|
|
};
|
|
|
|
in stdenv.mkDerivation rec {
|
2020-02-15 05:56:48 +01:00
|
|
|
version = "2.3.2";
|
2022-03-01 11:39:32 +01:00
|
|
|
pname = "cde";
|
2019-12-07 11:19:10 +01:00
|
|
|
|
2020-02-15 05:56:48 +01:00
|
|
|
src = fetchurl {
|
2022-03-01 11:39:32 +01:00
|
|
|
url = "mirror://sourceforge/cdesktopenv/cde-${version}.tar.gz";
|
2020-02-15 05:56:48 +01:00
|
|
|
sha256 = "029rljhi5r483x8rzdpl8625z0wx8r7k2m0364nbw66h5pig9lbx";
|
2019-12-07 11:19:10 +01:00
|
|
|
};
|
2020-02-15 05:56:48 +01:00
|
|
|
|
|
|
|
# remove with next release
|
|
|
|
patches = [
|
|
|
|
./2.3.2.patch
|
2020-11-02 17:15:50 +01:00
|
|
|
./0001-all-remove-deprecated-sys_errlist-and-replace-with-A.patch
|
2021-11-30 20:10:07 +01:00
|
|
|
|
|
|
|
(fetchpatch {
|
|
|
|
name = "binutils-2.36.patch";
|
|
|
|
url = "https://github.com/cdesktopenv/cde/commit/0b7849e210a99a413ddeb52a0eb5aef9a08504a0.patch";
|
|
|
|
sha256 = "0wlhs617hws3rwln9v74y1nw27n3pp7jkpnxlala7k5y64506ipj";
|
|
|
|
stripLen = 1;
|
|
|
|
})
|
2020-02-15 05:56:48 +01:00
|
|
|
];
|
2019-12-07 11:19:10 +01:00
|
|
|
|
|
|
|
buildInputs = [
|
|
|
|
libX11 libXinerama libXt libXext libtirpc motif libXft xbitmaps
|
|
|
|
libjpeg libXmu libXdmcp libXScrnSaver tcl libXaw ksh
|
|
|
|
];
|
|
|
|
nativeBuildInputs = [
|
2022-03-31 20:11:26 +02:00
|
|
|
bison ncompress autoPatchelfHook makeWrapper fakeroot
|
2020-11-02 17:15:50 +01:00
|
|
|
rpcsvc-proto
|
2019-12-07 11:19:10 +01:00
|
|
|
];
|
2022-02-02 12:03:03 +01:00
|
|
|
# build fails otherwise
|
|
|
|
enableParallelBuilding = false;
|
2019-12-07 11:19:10 +01:00
|
|
|
|
2022-06-05 19:14:56 +02:00
|
|
|
# Workaround build failure on -fno-common toolchains:
|
|
|
|
# ld: raima/startup.o:/build/cde-2.3.2/lib/DtSearch/raima/dbtype.h:408: multiple definition of
|
|
|
|
# `__SK__'; raima/alloc.o:/build/cde-2.3.2/lib/DtSearch/raima/dbtype.h:408: first defined here
|
|
|
|
NIX_CFLAGS_COMPILE = "-fcommon";
|
|
|
|
|
2019-12-07 11:19:10 +01:00
|
|
|
makeFlags = [
|
|
|
|
"World"
|
|
|
|
"BOOTSTRAPCFLAGS=-I${xorgproto}/include/X11"
|
|
|
|
"IMAKECPP=cpp"
|
|
|
|
"LOCALE_ARCHIVE=${glibcLocales}/lib/locale/locale-archive"
|
|
|
|
];
|
|
|
|
|
2021-08-21 23:05:48 +02:00
|
|
|
preConfigure = ''
|
|
|
|
# binutils 2.37 fix
|
|
|
|
fixupList=(
|
|
|
|
"config/cf/Imake.tmpl"
|
|
|
|
"config/util/crayar.sh"
|
|
|
|
"config/util/crayar.sh"
|
|
|
|
"programs/dtwm/Makefile.tmpl"
|
|
|
|
)
|
|
|
|
for toFix in "''${fixupList[@]}"; do
|
|
|
|
substituteInPlace "$toFix" --replace "clq" "cq"
|
|
|
|
done
|
|
|
|
'';
|
|
|
|
|
2019-12-07 11:19:10 +01:00
|
|
|
preBuild = ''
|
|
|
|
while IFS= read -r -d ''$'\0' i; do
|
|
|
|
substituteInPlace "$i" --replace /usr/dt $out/opt/dt
|
|
|
|
done < <(find "." -type f -exec grep -Iq /usr/dt {} \; -and -print0)
|
|
|
|
|
|
|
|
cat >> config/cf/site.def << EOF
|
|
|
|
#define MakeFlagsToShellFlags(makeflags,shellcmd) set -e
|
|
|
|
#define KornShell ${ksh}/bin/ksh
|
|
|
|
#define PerlCmd ${perl}/bin/perl
|
|
|
|
#define M4Cmd ${gnum4}/bin/m4
|
|
|
|
#define X11ProjectRoot ${x11ProjectRoot}
|
|
|
|
#define CppCmd ${gcc}/bin/cpp
|
|
|
|
TIRPCINC = -I${libtirpc.dev}/include/tirpc
|
|
|
|
EOF
|
|
|
|
|
|
|
|
patchShebangs .
|
|
|
|
unset AR
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
fakeroot admin/IntegTools/dbTools/installCDE -s . -DontRunScripts
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
mv $out/opt/dt/bin/dtmail $out/bin
|
|
|
|
'';
|
|
|
|
|
2021-01-11 08:54:33 +01:00
|
|
|
meta = with lib; {
|
2019-12-07 11:19:10 +01:00
|
|
|
description = "Common Desktop Environment";
|
2020-04-01 03:11:51 +02:00
|
|
|
homepage = "https://sourceforge.net/projects/cdesktopenv/";
|
2019-12-07 11:19:10 +01:00
|
|
|
license = licenses.lgpl2;
|
2021-04-29 07:21:13 +02:00
|
|
|
maintainers = [ ];
|
2019-12-07 11:19:10 +01:00
|
|
|
platforms = [ "i686-linux" "x86_64-linux" ];
|
|
|
|
};
|
|
|
|
}
|