From 67d41efde183d84f967e350e3e75d8f8dedd165d Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" Date: Sun, 5 Aug 2007 13:54:42 +0000 Subject: [PATCH] Added some parts of kde-4. It doesn't work yet, but I need version control svn path=/nixpkgs/trunk/; revision=9049 --- pkgs/data/misc/shared-mime-info/default.nix | 12 ++++ pkgs/desktops/kde-4/kdebase/default.nix | 48 ++++++++++++++ pkgs/desktops/kde-4/kdelibs/default.nix | 48 ++++++++++++++ pkgs/desktops/kde-4/kdepimlibs/default.nix | 48 ++++++++++++++ .../libraries/clucene-contrib/default.nix | 18 ++++++ .../libraries/clucene-core/default.nix | 16 +++++ pkgs/development/libraries/strigi/default.nix | 20 ++++++ .../tools/build-managers/cmake/default.nix | 13 +++- .../tools/build-managers/cmake/setup-hook.sh | 54 ++++++++++++++++ pkgs/stdenv/generic/setup-new.sh | 34 +++++++++- pkgs/top-level/all-packages.nix | 63 +++++++++++++++++++ 11 files changed, 368 insertions(+), 6 deletions(-) create mode 100644 pkgs/data/misc/shared-mime-info/default.nix create mode 100644 pkgs/desktops/kde-4/kdebase/default.nix create mode 100644 pkgs/desktops/kde-4/kdelibs/default.nix create mode 100644 pkgs/desktops/kde-4/kdepimlibs/default.nix create mode 100644 pkgs/development/libraries/clucene-contrib/default.nix create mode 100644 pkgs/development/libraries/clucene-core/default.nix create mode 100644 pkgs/development/libraries/strigi/default.nix create mode 100755 pkgs/development/tools/build-managers/cmake/setup-hook.sh diff --git a/pkgs/data/misc/shared-mime-info/default.nix b/pkgs/data/misc/shared-mime-info/default.nix new file mode 100644 index 000000000000..c62488b2544e --- /dev/null +++ b/pkgs/data/misc/shared-mime-info/default.nix @@ -0,0 +1,12 @@ +{stdenv, fetchurl, perl, perlXMLParser, pkgconfig, gettext, libxml2, glib}: + +stdenv.mkDerivation { + name = "shared-mime-info-0.21"; + + src = fetchurl { + url = http://FIX_ME.org/shared-mime-info-0.21.tar.bz2; + sha256 = "050jyvnhwv0fdyfmdb8sdxkryw0vqnkkzz7ld6jl4ixiv2ikcnhk"; + }; + + buildInputs = [perl perlXMLParser pkgconfig gettext libxml2 glib]; +} diff --git a/pkgs/desktops/kde-4/kdebase/default.nix b/pkgs/desktops/kde-4/kdebase/default.nix new file mode 100644 index 000000000000..84fa718ec012 --- /dev/null +++ b/pkgs/desktops/kde-4/kdebase/default.nix @@ -0,0 +1,48 @@ +{ stdenv, fetchurl +, inputproto, kbproto, scrnsaverproto, xextproto, xf86miscproto +, xf86vidmodeproto, xineramaproto, xproto +, libICE +, libX11 +, libXau +, libXcomposite +, libXcursor +, libXdamage +, libXdmcp +, libXext +, libXfixes +, libXft +, libXi +, libXpm +, libXrandr +, libXrender +, libXScrnSaver +, libXt +, libXtst +, libXv +, libXxf86misc +, libxkbfile +, zlib, perl, qt, openssl, pcre +, pkgconfig, libjpeg, libpng, libtiff, libxml2, libxslt, libtool, expat +, freetype, bzip2, strigi, cmake, shared_mime_info, alsaLib, libungif +, cups, kdelibs +}: + +stdenv.mkDerivation { + name = "kdebase-3.91.0"; + + src = fetchurl { + url = http://ftp.scarlet.be/pub/kde/stable/3.91.0/src/kdebase-3.91.0.tar.bz2; + sha256 = "0p1lgmd0jbf87g1khyjr0g9hph4lr1jd3l992nfm6xv9zc5i39br"; + }; + + buildInputs = [ + inputproto kbproto scrnsaverproto xextproto xf86miscproto xf86vidmodeproto + xineramaproto xproto libICE libX11 libXau libXcomposite libXcursor + libXdamage libXdmcp libXext libXfixes libXft libXi libXpm libXrandr + libXrender libXScrnSaver libXt libXtst libXv libXxf86misc libxkbfile + zlib perl qt openssl pcre + pkgconfig libjpeg libpng libtiff libxml2 libxslt expat + libtool freetype bzip2 strigi cmake shared_mime_info alsaLib libungif cups + kdelibs + ]; +} diff --git a/pkgs/desktops/kde-4/kdelibs/default.nix b/pkgs/desktops/kde-4/kdelibs/default.nix new file mode 100644 index 000000000000..f7ef4caa5248 --- /dev/null +++ b/pkgs/desktops/kde-4/kdelibs/default.nix @@ -0,0 +1,48 @@ +{ stdenv, fetchurl +, inputproto, kbproto, scrnsaverproto, xextproto, xf86miscproto +, xf86vidmodeproto, xineramaproto, xproto +, libICE +, libX11 +, libXau +, libXcomposite +, libXcursor +, libXdamage +, libXdmcp +, libXext +, libXfixes +, libXft +, libXi +, libXpm +, libXrandr +, libXrender +, libXScrnSaver +, libXt +, libXtst +, libXv +, libXxf86misc +, libxkbfile +, zlib, perl, qt, openssl, pcre +, pkgconfig, libjpeg, libpng, libtiff, libxml2, libxslt, libtool, expat +, freetype, bzip2, strigi, cmake, shared_mime_info, alsaLib, libungif +, cups +}: + +stdenv.mkDerivation { + name = "kdelibs-3.91.0"; + + src = fetchurl { + url = http://ftp.scarlet.be/pub/kde/stable/3.91.0/src/kdelibs-3.91.0.tar.bz2; + sha256 = "14zi2wd1k116dvg996cfw53sihm0y7wcqpdxhc4y458mcrb2a8sz"; + }; + + buildInputs = [ + inputproto kbproto scrnsaverproto xextproto xf86miscproto xf86vidmodeproto + xineramaproto xproto libICE libX11 libXau libXcomposite libXcursor + libXdamage libXdmcp libXext libXfixes libXft libXi libXpm libXrandr + libXrender libXScrnSaver libXt libXtst libXv libXxf86misc libxkbfile + zlib perl qt openssl pcre + pkgconfig libjpeg libpng libtiff libxml2 libxslt expat + libtool freetype bzip2 strigi cmake shared_mime_info alsaLib libungif cups + ]; + patchPhase = "sed -e 's@ NO_SYSTEM_PATH@@g' -i ../cmake/modules/FindX11.cmake"; +} diff --git a/pkgs/desktops/kde-4/kdepimlibs/default.nix b/pkgs/desktops/kde-4/kdepimlibs/default.nix new file mode 100644 index 000000000000..4273bb665b95 --- /dev/null +++ b/pkgs/desktops/kde-4/kdepimlibs/default.nix @@ -0,0 +1,48 @@ +{ stdenv, fetchurl +, inputproto, kbproto, scrnsaverproto, xextproto, xf86miscproto +, xf86vidmodeproto, xineramaproto, xproto +, libICE +, libX11 +, libXau +, libXcomposite +, libXcursor +, libXdamage +, libXdmcp +, libXext +, libXfixes +, libXft +, libXi +, libXpm +, libXrandr +, libXrender +, libXScrnSaver +, libXt +, libXtst +, libXv +, libXxf86misc +, libxkbfile +, zlib, perl, qt, openssl, pcre +, pkgconfig, libjpeg, libpng, libtiff, libxml2, libxslt, libtool, expat +, freetype, bzip2, strigi, cmake, shared_mime_info, alsaLib, libungif +, cups, kdelibs, boost +}: + +stdenv.mkDerivation { + name = "kdepimlibs-3.91.0"; + + src = fetchurl { + url = http://ftp.scarlet.be/pub/kde/stable/3.91.0/src/kdepimlibs-3.91.0.tar.bz2; + sha256 = "0d9ir4xrbk9d1sm8551xac1v2bc0l1ssnqiqzjwni0mcavi6lpf5"; + }; + + buildInputs = [ + inputproto kbproto scrnsaverproto xextproto xf86miscproto xf86vidmodeproto + xineramaproto xproto libICE libX11 libXau libXcomposite libXcursor + libXdamage libXdmcp libXext libXfixes libXft libXi libXpm libXrandr + libXrender libXScrnSaver libXt libXtst libXv libXxf86misc libxkbfile + zlib perl qt openssl pcre + pkgconfig libjpeg libpng libtiff libxml2 libxslt expat + libtool freetype bzip2 strigi cmake shared_mime_info alsaLib libungif cups + kdelibs boost + ]; +} diff --git a/pkgs/development/libraries/clucene-contrib/default.nix b/pkgs/development/libraries/clucene-contrib/default.nix new file mode 100644 index 000000000000..8938256dec46 --- /dev/null +++ b/pkgs/development/libraries/clucene-contrib/default.nix @@ -0,0 +1,18 @@ +{ stdenv, fetchurl, cluceneCore}: + +stdenv.mkDerivation { + name = "clucene-contrib-0.9.16a"; + + src = fetchurl { + url = ftp://ftp.chg.ru/pub/sourceforge/c/cl/clucene/clucene-contrib-0.9.16a.tar.bz2; + sha256 = "1apk867pggxsflhgvsnhcmy5vz2cvc1b914g4inkcj6s5vn1a1jx"; + }; + inherit cluceneCore; + buildInputs=[cluceneCore]; + configureFlags = "--disable-static --with-clucene=${cluceneCore}"; + + meta = { + description = "CLucene is a port of the very popular Java Lucene text search engine API. Contrib package."; + homepage = http://clucene.sourceforge.net; + }; +} diff --git a/pkgs/development/libraries/clucene-core/default.nix b/pkgs/development/libraries/clucene-core/default.nix new file mode 100644 index 000000000000..3d5734d6c2d5 --- /dev/null +++ b/pkgs/development/libraries/clucene-core/default.nix @@ -0,0 +1,16 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation { + name = "clucene-core-0.9.16a"; + + src = fetchurl { + url = ftp://ftp.chg.ru/pub/sourceforge/c/cl/clucene/clucene-core-0.9.16a.tar.bz2; + sha256 = "0hv7sp1lbicnj2984hiki8qwrvz5zwn1zhj6azhavgjklanhihjr"; + }; + + meta = { + description = "CLucene is a port of the very popular Java Lucene text search engine API. Core package."; + homepage = http://clucene.sourceforge.net; + }; + configureFlags = "--disable-static"; +} diff --git a/pkgs/development/libraries/strigi/default.nix b/pkgs/development/libraries/strigi/default.nix new file mode 100644 index 000000000000..f6618bfae0db --- /dev/null +++ b/pkgs/development/libraries/strigi/default.nix @@ -0,0 +1,20 @@ +{ stdenv, fetchurl, zlib, bzip2, expat, pkgconfig, cluceneCore, cluceneContrib, +qt, cmake, dbus, libxml2 }: + +stdenv.mkDerivation { + name = "strigi-0.5.1"; + + src = fetchurl { + url = ftp://ftp.chg.ru/pub/sourceforge/s/st/strigi/strigi-0.5.1.tar.bz2; + sha256 = "0n9ffqxdmz6ibki8rmac298z27937jddp7khmg2q8p15pnl5dq7i"; + }; + + patchPhase="sed -e 's/ iconv / /' -i ../cmake/FindIconv.cmake; + export CLUCENE_HOME=${cluceneCore}"; + buildInputs = [zlib cluceneCore cluceneContrib expat bzip2 pkgconfig qt cmake + stdenv.gcc.libc dbus libxml2]; + + meta = { + description = "Strigi is a fast and light desktop search engine"; + }; +} diff --git a/pkgs/development/tools/build-managers/cmake/default.nix b/pkgs/development/tools/build-managers/cmake/default.nix index 7bba9cd8304f..c07fbc7f593f 100644 --- a/pkgs/development/tools/build-managers/cmake/default.nix +++ b/pkgs/development/tools/build-managers/cmake/default.nix @@ -1,6 +1,7 @@ {stdenv, fetchurl}: stdenv.mkDerivation { name = "cmake-2.4.6"; + setupHook = ./setup-hook.sh; src = fetchurl { url = http://www.cmake.org/files/v2.4/cmake-2.4.6.tar.gz; @@ -9,9 +10,15 @@ stdenv.mkDerivation { buildInputs = []; + preConfigure="find Modules -type f -name '*.cmake' | + xargs sed -e 's@/usr@/FOO@g' -e 's@ /\\(bin\\|sbin\\|lib\\)@ /FOO@g' -i"; + + postInstall="find \$out/share -type f -name '*.cmake' | + xargs sed -e 's@/usr@/FOO@g' -e 's@ /\\(bin\\|sbin\\|lib\\)@ /FOO@g' -i; + ensureDir \$out/nix-support; + cp -p $setupHook \$out/nix-support/setup-hook"; + meta = { - description = " -CMake. Make flavour used by cdrkit. -"; + description = "Cross-Platform Makefile Generator"; }; } diff --git a/pkgs/development/tools/build-managers/cmake/setup-hook.sh b/pkgs/development/tools/build-managers/cmake/setup-hook.sh new file mode 100755 index 000000000000..8765599d67d7 --- /dev/null +++ b/pkgs/development/tools/build-managers/cmake/setup-hook.sh @@ -0,0 +1,54 @@ +addCMakeParamsInclude() +{ + if [ -d $1/include ]; then + export CMAKE_INCLUDE_PATH="${CMAKE_INCLUDE_PATH}${CMAKE_INCLUDE_PATH:+:}$1/include" + fi +} + +addCMakeParamsLibs() +{ + if [ -d $1/lib ]; then + export CMAKE_LIBRARY_PATH="${CMAKE_LIBRARY_PATH}${CMAKE_LIBRARY_PATH:+:}$1/lib" + fi +} + +fixCmake() +{ + echo "fixing Cmake file $i" + sed -e 's@/usr@/FOO@g' -e 's@ /\(bin\|sbin\|lib\)@ /FOO@g' -i $i +} + +fixCmakeFiles() +{ + for i in $(find $1 -type f -name "*.cmake"); do + fixCmake $i; + done; +} + +cmakePostUnpack() +{ + sourceRoot=$sourceRoot/build + mkdir -v $sourceRoot + echo source root reset to $sourceRoot + + if [ -z "$dontFixCmake" ]; then + fixCmakeFiles . + fi +} + +cmakeTweaks() +{ + postUnpack="cmakePostUnpack${postUnpack:+; }${postUnpack}" + + if [ -z "$configureScript" ]; then + dontAddPrefix=1 + configureScript="cmake .." + configureFlags="-DCMAKE_INSTALL_PREFIX=$out $configureFlags" + fi +} + +if [ -z "$noCmakeTewaks" ]; then + cmakeTweaks +fi; + +envHooks=(${envHooks[@]} addCMakeParamsInclude addCMakeParamsLibs) diff --git a/pkgs/stdenv/generic/setup-new.sh b/pkgs/stdenv/generic/setup-new.sh index 252560a077c5..68812e428717 100644 --- a/pkgs/stdenv/generic/setup-new.sh +++ b/pkgs/stdenv/generic/setup-new.sh @@ -701,11 +701,39 @@ fixupW() { eval "$preFixup" - if test -z "$dontStrip" -a "$NIX_STRIP_DEBUG" = 1; then - find "$prefix" -name "*.a" -exec echo stripping {} \; \ - -exec strip -S {} \; || fail +# TODO : strip _only_ ELF executables, and return || fail here... + if test -z "$dontStrip"; then + test -d "$prefix/lib" && stripDebug="$prefix/lib" + + if test -n "$stripDebug"; then + find "$stripDebug" -type f -print0 | + xargs -0 strip --strip-debug --verbose || true + fi + + test -d "$prefix/bin" && stripAll="$prefix/bin" + test -d "$prefix/sbin" && stripAll="${stripAll} $prefix/sbin" + if test -n "$stripAll"; then + find "$prefix/bin" "$prefix/sbin" -type f -print0 | + xargs -0 strip --strip-all --verbose || true + fi fi + if test -z "$dontFixupShare"; then + for dir in doc info man; do + if test -d "$prefix/$dir"; then + if test -d "$prefix/share/$dir"; then + echo Both "$prefix/$dir" and "$prefix/share/$dir" exists! + fail + else + echo Fixing location of $dir/ subdirectory + ensureDir "$prefix/share" + mv -v "$prefix/$dir" "$prefix/share" + ln -sv "share/$dir" "$prefix" + fi + fi + done + fi + if test "$havePatchELF" = 1 -a -z "$dontPatchELF"; then patchELF "$prefix" fi diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a26f5460f1ab..c66a790297e0 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1304,6 +1304,14 @@ rec { inherit fetchurl stdenv python; }; + cluceneContrib = (import ../development/libraries/clucene-contrib) { + inherit fetchurl stdenv cluceneCore; + }; + + cluceneCore = (import ../development/libraries/clucene-core) { + inherit fetchurl stdenv; + }; + coredumper = import ../development/libraries/coredumper { inherit fetchurl stdenv; }; @@ -1763,6 +1771,12 @@ rec { inherit fetchurl stdenv; }; + strigi = import ../development/libraries/strigi { + inherit stdenv fetchurl zlib cluceneCore cluceneContrib expat bzip2 + pkgconfig cmake dbus libxml2; + qt = qt4; + }; + t1lib = import ../development/libraries/t1lib { inherit fetchurl stdenv x11; inherit (xlibs) libXaw; @@ -2742,6 +2756,11 @@ rec { inherit fetchurl stdenv; }; + shared_mime_info = import ../data/misc/shared-mime-info { + inherit fetchurl stdenv perl perlXMLParser pkgconfig gettext libxml2; + inherit (gtkLibs) glib; + }; + iana_etc = import ../data/misc/iana-etc { inherit fetchurl stdenv; }; @@ -3414,6 +3433,50 @@ rec { qt = qt3; }; + kdelibs4 = import ../desktops/kde-4/kdelibs { + inherit + fetchurl stdenv zlib perl openssl pcre pkgconfig + libjpeg libpng libtiff libxml2 libxslt libtool + expat freetype bzip2 cmake strigi shared_mime_info alsaLib libungif cups; + inherit (xlibs) + inputproto kbproto scrnsaverproto xextproto xf86miscproto + xf86vidmodeproto xineramaproto xproto libICE libX11 libXau libXcomposite + libXcursor libXdamage libXdmcp libXext libXfixes libXft libXi libXpm + libXrandr libXrender libXScrnSaver libXt libXtst libXv libXxf86misc + libxkbfile; + qt = qt4; + }; + + kdepimlibs4 = import ../desktops/kde-4/kdepimlibs { + inherit + fetchurl stdenv zlib perl openssl pcre pkgconfig + libjpeg libpng libtiff libxml2 libxslt libtool + expat freetype bzip2 cmake strigi shared_mime_info alsaLib libungif cups boost; + inherit (xlibs) + inputproto kbproto scrnsaverproto xextproto xf86miscproto + xf86vidmodeproto xineramaproto xproto libICE libX11 libXau libXcomposite + libXcursor libXdamage libXdmcp libXext libXfixes libXft libXi libXpm + libXrandr libXrender libXScrnSaver libXt libXtst libXv libXxf86misc + libxkbfile; + qt = qt4; + kdelibs = kdelibs4; + }; + + kdebase4 = import ../desktops/kde-4/kdebase { + inherit + fetchurl stdenv zlib perl openssl pcre pkgconfig + libjpeg libpng libtiff libxml2 libxslt libtool + expat freetype bzip2 cmake strigi shared_mime_info alsaLib libungif cups; + inherit (xlibs) + inputproto kbproto scrnsaverproto xextproto xf86miscproto + xf86vidmodeproto xineramaproto xproto libICE libX11 libXau libXcomposite + libXcursor libXdamage libXdmcp libXext libXfixes libXft libXi libXpm + libXrandr libXrender libXScrnSaver libXt libXtst libXv libXxf86misc + libxkbfile; + qt = qt4; + kdelibs = kdelibs4; + }; + kdebase = import ../desktops/kde/kdebase { inherit fetchurl stdenv pkgconfig x11 xlibs zlib libpng libjpeg perl