@@ -1,23 +1,74 @@
1−{stdenv, fetchurl, xproto, motif, libX11, libXt, libXpm, bison, flex}:
1+{ stdenv, fetchurl
2+, xproto, motif, libX11, libXt, libXpm, bison
3+, flex, automake, autoconf, libtool
4+}:
25
3−stdenv.mkDerivation {
4− name = "alliance-5.0-20070718";
6+stdenv.mkDerivation rec {
7+ name = "alliance-${version}";
8+ version = "5.1.1";
59
610 src = fetchurl {
7− url = http://www-asim.lip6.fr/pub/alliance/distribution/5.0/alliance-5.0-20070718.tar.gz;
8− sha256 = "4e17c8f9f4d344061166856d47e58527c6ae870fda0c73b5ba0200967d23af9f";
11+ url = "http://www-asim.lip6.fr/pub/alliance/distribution/5.0/${name}.tar.bz2";
12+ sha256 = "046c9qwl1vbww0ljm4xyxf5jpz9nq62b2q0wdz9xjimgh4c207w1";
913 };
1014
11− buildInputs = [ xproto motif xproto libX11 libXt libXpm bison flex];
1215
13− patchPhase = ''
14− sed -i -e \
15− "s/private: static void operator delete/public: static void operator delete/" \
16− nero/src/ADefs.h
16+ nativeBuildInputs = [ libtool automake autoconf flex ];
17+ buildInputs = [ xproto motif xproto libX11 libXt libXpm bison ];
18+
19+ sourceRoot = "alliance/src/";
20+
21+ configureFlags = [
22+ "--prefix=$(out)"
23+ "--disable-static"
24+ ];
25+
26+ preConfigure = ''
27+ mkdir -p $out/etc
28+
29+ #texlive for docs seems extreme
30+ mkdir -p $out/share/alliance
31+ mv ./documentation $out/share/alliance
32+ substituteInPlace autostuff \
33+ --replace "$newdirs documentation" "$newdirs" \
34+ --replace documentation Solaris
35+
36+ substituteInPlace sea/src/DEF_grammar_lex.l \
37+ --replace "ifndef FLEX_BETA" "if (YY_FLEX_MAJOR_VERSION <= 2) && (YY_FLEX_MINOR_VERSION < 6)"
38+ ./autostuff
39+ '';
40+
41+ allianceInstaller = ''
42+ #!${stdenv.shell}
43+ cp -v -r -n --no-preserve=mode $out/etc/* /etc/ > /etc/alliance-install.log
44+ '';
45+
46+ allianceUnInstaller = ''
47+ #!${stdenv.shell}
48+ awk '{print \$3}' /etc/alliance-install.log | xargs rm
49+ awk '{print \$3}' /etc/alliance-install.log | xargs rmdir
50+ rm /etc/alliance-install.log
51+ '';
52+
53+ postInstall = ''
54+ sed -i "s|ALLIANCE_TOP|$out|" distrib/*.desktop
55+ mkdir -p $out/share/applications
56+ cp -p distrib/*.desktop $out/share/applications/
57+ mkdir -p $out/icons/hicolor/48x48/apps/
58+ cp -p distrib/*.png $out/icons/hicolor/48x48/apps/
59+
60+ echo "${allianceInstaller}" > $out/bin/alliance-install
61+ chmod +x $out/bin/alliance-install
62+
63+ echo "${allianceUnInstaller}" > $out/bin/alliance-uninstall
64+ chmod +x $out/bin/alliance-uninstall
1765 '';
1866
19− meta = {
20− description = "Complete set of free CAD tools and portable libraries for VLSI design";
21− homepage = http://www-asim.lip6.fr/recherche/alliance/;
67+ meta = with stdenv.lib; {
68+ description = "Complete set of free CAD tools and portable libraries for VLSI design";
69+ homepage = http://www-asim.lip6.fr/recherche/alliance/;
70+ license = with licenses; gpl2Plus;
71+ maintainers = with maintainers; [ ];
72+ platforms = with platforms; linux;
2273 };
2374}