summary refs log tree commit diff
path: root/pkgs/applications/graphics/xfig/builder.sh
blob: 9d95eca01226315a332b55a3559cd82d5c7c641d (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
source $stdenv/setup

makeFlags="XAWLIB=-lXaw3d BINDIR=$out/bin XAPPLOADDIR=$out/etc/X11/app-defaults LIBDIR=$out/lib/X11 XFIGDOCDIR=$out/share/doc/xfig MANPATH=$out/man"

# We need chmod +wx on dirs, not just chmod +w
dontMakeSourcesWritable=1
postUnpack() {
    find . -type d -exec chmod +x '{}' \;
}

preBuild() {
    echo "#define XAW3D" >> Imakefile.tmp
    echo "#define XAW3D1_5E" >> Imakefile.tmp
    cat Imakefile >> Imakefile.tmp
    mv Imakefile.tmp Imakefile
    xmkmf

    sed -e 's@[$][$]m@-- &@g' -i Makefile
}

installPhase() {
    make install.all $makeFlags

    wrapProgram $out/bin/xfig \
        --set XAPPLRESDIR $out/etc/X11/app-defaults
}

genericBuild