From 26a152653db6f04752aeabb99600f5aa8d834bf5 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 17 Mar 2008 13:45:50 +0000 Subject: * Adde xpra. Doesn't quite work yet. * Removed python_alts. svn path=/nixpkgs/trunk/; revision=11161 --- pkgs/development/interpreters/pyrex/0.9.5.nix | 26 +++++++++++ pkgs/development/interpreters/pyrex/0.9.6.nix | 44 +++++++++--------- pkgs/development/interpreters/python/2.4.nix | 52 ---------------------- .../interpreters/python/2.4/default.nix | 52 ++++++++++++++++++++++ .../interpreters/python/2.4/search-path.patch | 27 +++++++++++ .../interpreters/python/2.4/setup-hook.sh | 15 +++++++ pkgs/development/interpreters/python/default.nix | 6 --- .../interpreters/python/search-path.patch | 27 ----------- pkgs/development/interpreters/python/setup-hook.sh | 15 ------- pkgs/development/python-modules/pygtk/default.nix | 7 +-- pkgs/tools/X11/xpra/default.nix | 39 ++++++++++++++++ pkgs/top-level/all-packages.nix | 29 ++++++++---- 12 files changed, 208 insertions(+), 131 deletions(-) create mode 100644 pkgs/development/interpreters/pyrex/0.9.5.nix delete mode 100644 pkgs/development/interpreters/python/2.4.nix create mode 100644 pkgs/development/interpreters/python/2.4/default.nix create mode 100644 pkgs/development/interpreters/python/2.4/search-path.patch create mode 100644 pkgs/development/interpreters/python/2.4/setup-hook.sh delete mode 100644 pkgs/development/interpreters/python/default.nix delete mode 100644 pkgs/development/interpreters/python/search-path.patch delete mode 100644 pkgs/development/interpreters/python/setup-hook.sh create mode 100644 pkgs/tools/X11/xpra/default.nix diff --git a/pkgs/development/interpreters/pyrex/0.9.5.nix b/pkgs/development/interpreters/pyrex/0.9.5.nix new file mode 100644 index 000000000000..d494b5a15394 --- /dev/null +++ b/pkgs/development/interpreters/pyrex/0.9.5.nix @@ -0,0 +1,26 @@ +args: with args; + +let + + localDefs = builderDefs { + + src = fetchurl { + url = http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/oldtar/Pyrex-0.9.5.1.1.tar.gz; + sha256 = "0lxxvn4mjfb83swcbqb5908q4iy53w4ip5i0f9angm2va1jyhd3z"; + }; + + buildInputs = [python]; + + } null; /* null is a terminator for sumArgs */ + +in with localDefs; + +stdenv.mkDerivation rec { + name = "pyrex-0.9.5.1.1"; + builder = writeScript (name + "-builder") + (textClosure localDefs [installPythonPackage doForceShare]); + meta = { + description = "Python package compiler or something like that"; + inherit src; + }; +} diff --git a/pkgs/development/interpreters/pyrex/0.9.6.nix b/pkgs/development/interpreters/pyrex/0.9.6.nix index 3747bbed4c30..02c1d532abb3 100644 --- a/pkgs/development/interpreters/pyrex/0.9.6.nix +++ b/pkgs/development/interpreters/pyrex/0.9.6.nix @@ -1,22 +1,26 @@ -args : with args; - let localDefs = builderDefs { - src = /* put a fetchurl here */ - fetchurl { - url = http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/oldtar/Pyrex-0.9.6.tar.gz; - sha256 = "1i0mrv2a3ihnj5mjf07aic7nlps9qap57j477m8ajwhhwx9vwlxy"; - }; - buildInputs = [python]; - configureFlags = []; - } null; /* null is a terminator for sumArgs */ - in with localDefs; +args: with args; + +let + + localDefs = builderDefs { + + src = fetchurl { + url = http://www.cosc.canterbury.ac.nz/greg.ewing/python/Pyrex/oldtar/Pyrex-0.9.6.4.tar.gz; + sha256 = "18pd9f8al3l6i27cc0ddhgg7hxf28lnfs75x4a8jzscydxgiq5a8"; + }; + + buildInputs = [python]; + + } null; /* null is a terminator for sumArgs */ + +in with localDefs; + stdenv.mkDerivation rec { - name = "Pyrex-"+version; - builder = writeScript (name + "-builder") - (textClosure localDefs [installPythonPackage doForceShare]); - meta = { - description = " - Python package compiler or something like that. -"; - inherit src; - }; + name = "pyrex-0.9.6.4"; + builder = writeScript (name + "-builder") + (textClosure localDefs [installPythonPackage doForceShare]); + meta = { + description = "Python package compiler or something like that"; + inherit src; + }; } diff --git a/pkgs/development/interpreters/python/2.4.nix b/pkgs/development/interpreters/python/2.4.nix deleted file mode 100644 index 726d2ac4aa96..000000000000 --- a/pkgs/development/interpreters/python/2.4.nix +++ /dev/null @@ -1,52 +0,0 @@ -{stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2}: - -assert zlibSupport -> zlib != null; - -with stdenv.lib; - -let - - buildInputs = - optional (stdenv ? gcc && stdenv.gcc.libc != null) stdenv.gcc.libc ++ - [bzip2] ++ - optional zlibSupport zlib; - -in - -stdenv.mkDerivation { - name = "python-2.4.4"; - - src = fetchurl { - url = http://www.python.org/ftp/python/2.4.4/Python-2.4.4.tar.bz2; - md5 = "0ba90c79175c017101100ebf5978e906"; - }; - - patches = [ - # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff. - ./search-path.patch - ]; - - inherit buildInputs; - C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); - LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); - - configureFlags = "--enable-shared"; - - preConfigure = " - # Purity. - for i in /usr /sw /opt /pkg; do - substituteInPlace ./setup.py --replace $i /no-such-path - done - "; - - postInstall = " - ensureDir $out/nix-support - cp ${./setup-hook.sh} $out/nix-support/setup-hook - rm -rf $out/lib/python2.4/test - "; - - passthru = { - inherit zlibSupport; - libPrefix = "python2.4"; - }; -} diff --git a/pkgs/development/interpreters/python/2.4/default.nix b/pkgs/development/interpreters/python/2.4/default.nix new file mode 100644 index 000000000000..726d2ac4aa96 --- /dev/null +++ b/pkgs/development/interpreters/python/2.4/default.nix @@ -0,0 +1,52 @@ +{stdenv, fetchurl, zlib ? null, zlibSupport ? true, bzip2}: + +assert zlibSupport -> zlib != null; + +with stdenv.lib; + +let + + buildInputs = + optional (stdenv ? gcc && stdenv.gcc.libc != null) stdenv.gcc.libc ++ + [bzip2] ++ + optional zlibSupport zlib; + +in + +stdenv.mkDerivation { + name = "python-2.4.4"; + + src = fetchurl { + url = http://www.python.org/ftp/python/2.4.4/Python-2.4.4.tar.bz2; + md5 = "0ba90c79175c017101100ebf5978e906"; + }; + + patches = [ + # Look in C_INCLUDE_PATH and LIBRARY_PATH for stuff. + ./search-path.patch + ]; + + inherit buildInputs; + C_INCLUDE_PATH = concatStringsSep ":" (map (p: "${p}/include") buildInputs); + LIBRARY_PATH = concatStringsSep ":" (map (p: "${p}/lib") buildInputs); + + configureFlags = "--enable-shared"; + + preConfigure = " + # Purity. + for i in /usr /sw /opt /pkg; do + substituteInPlace ./setup.py --replace $i /no-such-path + done + "; + + postInstall = " + ensureDir $out/nix-support + cp ${./setup-hook.sh} $out/nix-support/setup-hook + rm -rf $out/lib/python2.4/test + "; + + passthru = { + inherit zlibSupport; + libPrefix = "python2.4"; + }; +} diff --git a/pkgs/development/interpreters/python/2.4/search-path.patch b/pkgs/development/interpreters/python/2.4/search-path.patch new file mode 100644 index 000000000000..2e7b7526c0ce --- /dev/null +++ b/pkgs/development/interpreters/python/2.4/search-path.patch @@ -0,0 +1,27 @@ +diff -rc Python-2.4.4-orig/setup.py Python-2.4.4/setup.py +*** Python-2.4.4-orig/setup.py 2006-10-08 19:41:25.000000000 +0200 +--- Python-2.4.4/setup.py 2007-05-27 16:04:54.000000000 +0200 +*************** +*** 279,288 **** + # Check for AtheOS which has libraries in non-standard locations + if platform == 'atheos': + lib_dirs += ['/system/libs', '/atheos/autolnk/lib'] +- lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) + inc_dirs += ['/system/include', '/atheos/autolnk/include'] +- inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) + + # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) + if platform in ['osf1', 'unixware7', 'openunix8']: + lib_dirs += ['/usr/ccs/lib'] +--- 279,289 ---- + # Check for AtheOS which has libraries in non-standard locations + if platform == 'atheos': + lib_dirs += ['/system/libs', '/atheos/autolnk/lib'] + inc_dirs += ['/system/include', '/atheos/autolnk/include'] + ++ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) ++ inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) ++ + # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) + if platform in ['osf1', 'unixware7', 'openunix8']: + lib_dirs += ['/usr/ccs/lib'] diff --git a/pkgs/development/interpreters/python/2.4/setup-hook.sh b/pkgs/development/interpreters/python/2.4/setup-hook.sh new file mode 100644 index 000000000000..58b8d1cab760 --- /dev/null +++ b/pkgs/development/interpreters/python/2.4/setup-hook.sh @@ -0,0 +1,15 @@ +addPythonPath() { + addToSearchPathWithCustomDelimiter : PYTHONPATH /lib/python2.4/site-packages "" $1 +} + +toPythonPath() { + local paths="$1" + local result= + for i in $paths; do + p="$i/lib/python2.4/site-packages" + result="${result}${result:+:}$p" + done + echo $result +} + +envHooks=(${envHooks[@]} addPythonPath) diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix deleted file mode 100644 index af90018870fb..000000000000 --- a/pkgs/development/interpreters/python/default.nix +++ /dev/null @@ -1,6 +0,0 @@ -args: -args.stdenv.lib.listOfListsToAttrs [ - [ "default" (import ./2.4.nix args) ] - [ "2.4" (import ./2.4.nix args) ] - [ "2.5" (import ./2.5 args) ] -] diff --git a/pkgs/development/interpreters/python/search-path.patch b/pkgs/development/interpreters/python/search-path.patch deleted file mode 100644 index 2e7b7526c0ce..000000000000 --- a/pkgs/development/interpreters/python/search-path.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff -rc Python-2.4.4-orig/setup.py Python-2.4.4/setup.py -*** Python-2.4.4-orig/setup.py 2006-10-08 19:41:25.000000000 +0200 ---- Python-2.4.4/setup.py 2007-05-27 16:04:54.000000000 +0200 -*************** -*** 279,288 **** - # Check for AtheOS which has libraries in non-standard locations - if platform == 'atheos': - lib_dirs += ['/system/libs', '/atheos/autolnk/lib'] -- lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) - inc_dirs += ['/system/include', '/atheos/autolnk/include'] -- inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) - - # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) - if platform in ['osf1', 'unixware7', 'openunix8']: - lib_dirs += ['/usr/ccs/lib'] ---- 279,289 ---- - # Check for AtheOS which has libraries in non-standard locations - if platform == 'atheos': - lib_dirs += ['/system/libs', '/atheos/autolnk/lib'] - inc_dirs += ['/system/include', '/atheos/autolnk/include'] - -+ lib_dirs += os.getenv('LIBRARY_PATH', '').split(os.pathsep) -+ inc_dirs += os.getenv('C_INCLUDE_PATH', '').split(os.pathsep) -+ - # OSF/1 and Unixware have some stuff in /usr/ccs/lib (like -ldb) - if platform in ['osf1', 'unixware7', 'openunix8']: - lib_dirs += ['/usr/ccs/lib'] diff --git a/pkgs/development/interpreters/python/setup-hook.sh b/pkgs/development/interpreters/python/setup-hook.sh deleted file mode 100644 index 58b8d1cab760..000000000000 --- a/pkgs/development/interpreters/python/setup-hook.sh +++ /dev/null @@ -1,15 +0,0 @@ -addPythonPath() { - addToSearchPathWithCustomDelimiter : PYTHONPATH /lib/python2.4/site-packages "" $1 -} - -toPythonPath() { - local paths="$1" - local result= - for i in $paths; do - p="$i/lib/python2.4/site-packages" - result="${result}${result:+:}$p" - done - echo $result -} - -envHooks=(${envHooks[@]} addPythonPath) diff --git a/pkgs/development/python-modules/pygtk/default.nix b/pkgs/development/python-modules/pygtk/default.nix index e8a66817013e..9d487db5dd03 100644 --- a/pkgs/development/python-modules/pygtk/default.nix +++ b/pkgs/development/python-modules/pygtk/default.nix @@ -2,12 +2,13 @@ stdenv.mkDerivation { name = "pygtk-2.10.4"; -# builder = ./builder.sh; + src = fetchurl { url = http://ftp.gnome.org/pub/GNOME/sources/pygtk/2.10/pygtk-2.10.4.tar.bz2; sha256 = "1xg8vng42lql29aa5ryva8icc8dwdc7h2y3yn96qjdgl394d96mb"; }; - buildInputs = [python pkgconfig glib gtk pycairo]; + + buildInputs = [python pkgconfig glib gtk]; - propagatedBuildInputs = [pygobject]; + propagatedBuildInputs = [pygobject pycairo]; } diff --git a/pkgs/tools/X11/xpra/default.nix b/pkgs/tools/X11/xpra/default.nix new file mode 100644 index 000000000000..0691521e44cf --- /dev/null +++ b/pkgs/tools/X11/xpra/default.nix @@ -0,0 +1,39 @@ +{stdenv, fetchurl, pkgconfig, python, pyrex, pygtk, xlibs, gtk, makeWrapper}: + +stdenv.mkDerivation { + name = "xpra-0.0.3"; + + src = fetchurl { + url = http://partiwm.org/static/downloads/parti-all-0.0.3.tar.gz; + sha256 = "17inksd4cc7mba2vfs17gz1yk3h6x6wf06pm3hcbs5scq8rr5bkp"; + }; + + #src = /home/eelco/Dev/nixpkgs/parti-all-0.0.3; + + buildInputs = [ + pkgconfig python pyrex pygtk gtk makeWrapper + xlibs.inputproto xlibs.libXcomposite xlibs.libXdamage xlibs.libXtst + ]; + + buildPhase = '' + NIX_CFLAGS_COMPILE="$NIX_CFLAGS_COMPILE $(pkg-config --cflags gtk+-2.0) $(pkg-config --cflags pygtk-2.0)" + NIX_LDFLAGS="$NIX_LDFLAGS -lXcomposite -lXdamage" + ./do-build + ''; + + installPhase = '' + ensureDir $out + cp -r install/* $out + + for i in $(cd $out/bin && ls); do + wrapProgram $out/bin/$i \ + --set PYTHONPATH "$out/lib/python:$(toPythonPath ${pygtk})/gtk-2.0:$PYTHONPATH" \ + --prefix PATH : "${xlibs.xauth}/bin:${xlibs.xorgserver}/bin:${xlibs.xmodmap}/bin" + done + ''; + + meta = { + homepage = http://partiwm.org/wiki/xpra; + description = "Persistent remote applications for X"; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 04675a9463f1..02434f5936f8 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -1703,18 +1703,25 @@ rec { flags = [ "xdebug" "mysql" "mysqli" "pdo_mysql" "libxml2" "apxs2" ]; }; - python = getVersion "python" python_alts; + python = python24; - python_alts = import ../development/interpreters/python { + python24 = import ../development/interpreters/python/2.4 { inherit fetchurl stdenv zlib bzip2; }; - pyrexFun = lib.sumArgs (selectVersion ../development/interpreters/pyrex "0.9.6") { - inherit fetchurl stdenv stringsWithDeps lib builderDefs; - python = builtins.getAttr "2.5" python_alts; + python25 = import ../development/interpreters/python/2.5 { + inherit fetchurl stdenv zlib bzip2; + }; + + pyrex = pyrex095; + + pyrex095 = import ../development/interpreters/pyrex/0.9.5.nix { + inherit fetchurl stdenv stringsWithDeps lib builderDefs python; }; - pyrex = pyrexFun null; + pyrex096 = import ../development/interpreters/pyrex/0.9.6.nix { + inherit fetchurl stdenv stringsWithDeps lib builderDefs python; + }; QiFun = lib.sumArgs (selectVersion ../development/compilers/qi "9.1") { inherit clisp stdenv fetchurl builderDefs unzip; @@ -4684,7 +4691,7 @@ rec { inherit stdenv cmake mesa gettext freetype SDL libtiff fetchurl glibc scons x11 lib libjpeg libpng zlib /* smpeg sdl */; inherit (xlibs) inputproto libXi; - python = builtins.getAttr "2.5" python_alts; + python = python25; freealut = freealut_soft; openal = openalSoft; openexr = openexr_1_4_0; @@ -5334,7 +5341,7 @@ rec { pythonmagick = import ../applications/graphics/PythonMagick { inherit fetchurl stdenv pkgconfig imagemagick boost; - python = builtins.getAttr "2.5" python_alts; + python = python25; }; qemuFun = lib.sumArgs (selectVersion ../applications/virtualization/qemu "0.9.1") { @@ -5684,6 +5691,12 @@ rec { base14Fonts = "${ghostscript}/share/ghostscript/fonts"; }; + xpra = import ../tools/X11/xpra { + inherit stdenv fetchurl pkgconfig python pygtk xlibs makeWrapper; + inherit (gtkLibs) gtk; + pyrex = pyrex095; + }; + xscreensaverFun = lib.sumArgs (selectVersion ../applications/graphics/xscreensaver "5.04") { inherit stdenv fetchurl builderDefs lib pkgconfig bc perl intltool; inherit (xlibs) libX11 libXmu; -- cgit 1.4.1