1{
2 lib,
3 stdenv,
4 fetchurl,
5 tk,
6 makeWrapper,
7}:
8
9stdenv.mkDerivation rec {
10 pname = "dawn";
11 version = "3.91a";
12
13 src = fetchurl {
14 url = "https://geant4.kek.jp/~tanaka/src/dawn_${
15 builtins.replaceStrings [ "." ] [ "_" ] version
16 }.tgz";
17 hash = "sha256-gdhV6tERdoGxiCQt0L46JOAF2b1AY/0r2pp6eU689fQ=";
18 };
19
20 postPatch = ''
21 substituteInPlace Makefile \
22 --replace 'CC =' 'CC = $(CXX) #' \
23 --replace 'INSTALL_DIR =' "INSTALL_DIR = $out/bin#"
24 '';
25
26 nativeBuildInputs = [ makeWrapper ];
27
28 dontConfigure = true;
29
30 preInstall = ''
31 mkdir -p "$out/bin"
32 '';
33
34 postInstall = ''
35 wrapProgram "$out/bin/DAWN_GUI" \
36 --prefix PATH : ${lib.makeBinPath [ tk ]}
37 '';
38
39 meta = with lib; {
40 description = "Vectorized 3D PostScript processor with analytical hidden line/surface removal";
41 license = licenses.unfree;
42 homepage = "https://geant4.kek.jp/~tanaka/DAWN/About_DAWN.html";
43 platforms = platforms.unix;
44 maintainers = with maintainers; [ veprbl ];
45 };
46}