Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 55 additions & 13 deletions pkgs/applications/graphics/mypaint/default.nix
Original file line number Diff line number Diff line change
@@ -1,28 +1,70 @@
{ stdenv, fetchurl, gettext, glib, gtk, json_c, lcms2, libpng
, makeWrapper, pkgconfig, pygtk, python, pythonPackages, scons, swig
{ stdenv, fetchurl, fetchgit, gettext, glib, gtk, gtk3, json_c, lcms2, libpng
, makeWrapper, pkgconfig, pygtk, python, scons, swig

, pythonPackages, protobuf, gobjectIntrospection, cairo
, version ? "1.1.0"
}:

stdenv.mkDerivation rec {
name = "mypaint-${version}";
version = "1.1.0";
let
gtk_libs_old = [ glib gtk pygtk ];
gtk_libs_new = [ glib gtk3 pythonPackages.pygobject3 gobjectIntrospection ];
in

stdenv.mkDerivation (stdenv.lib.mergeAttrsByVersion "mypaint" version
{
"1.1.0" = rec {
name = "mypaint-${version}";
version = "1.1.0";

src = fetchurl {
url = "http://download.gna.org/mypaint/${name}.tar.bz2";
sha256 = "0f7848hr65h909c0jkcx616flc0r4qh53g3kd1cgs2nr1pjmf3bq";
};
buildInputs = gtk_libs_old;
};

"git" = {
# REGION AUTO UPDATE: { name="my-paint-git"; type="git"; url="git://gitorious.org/mypaint/mypaint.git"; groups = "mypaint"; }
src = (fetchurl { url = "http://mawercer.de/~nix/repos/my-paint-git-git-6993d.tar.bz2"; sha256 = "958eb83efbf2b18d5b26b850f416657d081d76008c80ef811352c94c991ca05d"; });
name = "my-paint-git-git-6993d";
# END

buildInputs = gtk_libs_new ++ [ pythonPackages.pycairo ];

src = fetchurl {
url = "http://download.gna.org/mypaint/${name}.tar.bz2";
sha256 = "0f7848hr65h909c0jkcx616flc0r4qh53g3kd1cgs2nr1pjmf3bq";
postInstall = ''
'';
};
"git-animation" = {
# while it works its based on a very old mypaint version ..

buildInputs = [
gettext glib gtk json_c lcms2 libpng makeWrapper pkgconfig pygtk
# REGION AUTO UPDATE: { name="my-paint-git-animation"; type="git"; url="git://gitorious.org/~charbelinho/mypaint/charbelinho-mypaint.git"; branch = "animation"; groups = "mypaint"; }
src = (fetchurl { url = "http://mawercer.de/~nix/repos/my-paint-git-animation-git-29a88.tar.bz2"; sha256 = "e36a5f843b7391a3a5f149a89b6f516f3c678d69eb855f59ad8fb612fc0efd01"; });
name = "my-paint-git-animation-git-29a88";
# END

buildInputs = gtk_libs_old ++ [ protobuf pythonPackages.pygobject pythonPackages.protobuf pythonPackages.setuptools ];

preConfigure = "sed -e 's/-WAll//' -e 's/-Wstrict-prototypes//' -i SConstruct";
};

} {

buildInputs = [
gettext json_c lcms2 libpng makeWrapper pkgconfig
python scons swig
];

propagatedBuildInputs = [ pythonPackages.numpy ];

buildPhase = "scons prefix=$out";

# 1.1.0 does not require XDG_DATA_DIRS, does not hurt either
installPhase = ''
scons prefix=$out install
wrapProgram $out/bin/mypaint --prefix PYTHONPATH : $PYTHONPATH
wrapProgram $out/bin/mypaint \
--prefix PYTHONPATH : "$PYTHONPATH" \
--prefix XDG_DATA_DIRS : "$XDG_DATA_DIRS" \
--prefix GI_TYPELIB_PATH : "$GI_TYPELIB_PATH"
'';

meta = with stdenv.lib; {
Expand All @@ -32,4 +74,4 @@ stdenv.mkDerivation rec {
platforms = platforms.linux;
maintainers = [ maintainers.goibhniu ];
};
}
})
9 changes: 8 additions & 1 deletion pkgs/desktops/gnome-2/platform/gnome-common/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl_gnome }:
{ stdenv, fetchurl, fetchurl_gnome, which }:

stdenv.mkDerivation rec {
name = src.pkgname;
Expand All @@ -8,4 +8,11 @@ stdenv.mkDerivation rec {
major = "2"; minor = "34"; patchlevel = "0";
sha256 = "1pz13mpp09q5s3bikm8ml92s1g0scihsm4iipqv1ql3mp6d4z73s";
};

propagatedBuildInputs = [ which ]; # autogen.sh which is using gnome_common tends to require which

patches = [(fetchurl {
url = "https://bug697543.bugzilla-attachments.gnome.org/attachment.cgi?id=240935";
sha256 = "17abp7czfzirjm7qsn2czd03hdv9kbyhk3lkjxg2xsf5fky7z7jl";
})];
}
2 changes: 1 addition & 1 deletion pkgs/desktops/gnome-3/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
rec {
inherit (pkgs) fetchurl_gnome glib gtk3 atk pango;
gtk = gtk3;
orbit = pkgs.gnome2.ORBit2;
inherit (pkgs.gnome2) gnome_common ORBit2;

inherit (lib) lowPrio hiPrio appendToName makeOverridable;

Expand Down
4 changes: 3 additions & 1 deletion pkgs/desktops/gnome-3/desktop/gnome-desktop/default.nix
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
{ stdenv, fetchurl, pkgconfig, python, libxml2Python, libxslt, which, libX11, gnome3
, intltool, gnome_doc_utils}:
, intltool, gnome_doc_utils, xorg, gsettings_desktop_schemas, xkeyboard_config}:

stdenv.mkDerivation rec {

majorVersion = "3.5";
minorVersion = "3";
name = "gnome-desktop-${majorVersion}.${minorVersion}";

enableParallelBuilding = true;

src = fetchurl {
url = "mirror://gnome/sources/gnome-desktop/${majorVersion}/${name}.tar.xz";
sha256 = "1nrqcp1p5cxhfjjy5hjpvkqmzsgl2353a08fg0b11c932v95bsba";
Expand Down
4 changes: 2 additions & 2 deletions pkgs/development/libraries/atk/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, perl, glib }:
{ stdenv, fetchurl, pkgconfig, perl, glib, gobjectIntrospection }:

stdenv.mkDerivation rec {
name = "atk-2.8.0";
Expand All @@ -10,7 +10,7 @@ stdenv.mkDerivation rec {

nativeBuildInputs = [ pkgconfig perl ];

propagatedBuildInputs = [ glib ];
propagatedBuildInputs = [ glib gobjectIntrospection ];

postInstall = "rm -rf $out/share/gtk-doc";

Expand Down
8 changes: 5 additions & 3 deletions pkgs/development/libraries/gdk-pixbuf/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig, glib, libtiff, libjpeg, libpng, libX11, xz
, jasper }:
, jasper, gobjectIntrospection }:

stdenv.mkDerivation rec {
name = "gdk-pixbuf-2.28.1";
Expand All @@ -12,11 +12,13 @@ stdenv.mkDerivation rec {
# !!! We might want to factor out the gdk-pixbuf-xlib subpackage.
buildInputs = [ libX11 ];

nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [ pkgconfig gobjectIntrospection ];

propagatedBuildInputs = [ glib libtiff libjpeg libpng jasper ];

configureFlags = "--with-libjasper --with-x11";
configureFlags = "--with-libjasper --with-x11"
+ stdenv.lib.optionalString (gobjectIntrospection != null) " --enable-introspection=yes"
;

postInstall = "rm -rf $out/share/gtk-doc";

Expand Down
19 changes: 15 additions & 4 deletions pkgs/development/libraries/gobject-introspection/default.nix
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
{ stdenv, fetchurl, glib, flex, bison, pkgconfig, libffi, python, gdk_pixbuf }:

# now that gobjectIntrospection creates large .gir files (eg gtk3 case)
# it may be worth thinking about using multiple derivation outputs
# In that case its about 6MB which could be separated

stdenv.mkDerivation rec {
name = "gobject-introspection-1.34.2";
name = "gobject-introspection-1.36.0";

buildInputs = [ flex bison glib pkgconfig python
# break cyclic dependency:
(gdk_pixbuf.override { gobjectIntrospection = null; })
];

buildInputs = [ flex bison glib pkgconfig python gdk_pixbuf ];
propagatedBuildInputs = [ libffi ];

# Tests depend on cairo, which is undesirable (it pulls in lots of
# other dependencies).
configureFlags = "--disable-tests";


src = fetchurl {
url = "mirror://gnome/sources/gobject-introspection/1.34/${name}.tar.xz";
sha256 = "0a9lq0y67sr3g37l1hy0biqn046jr9wnd05hvwi8j8g2bjilhydw";
url = "mirror://gnome/sources/gobject-introspection/1.36/${name}.tar.xz";
sha256 = "10v3idh489vra7pjn1g8f844nnl6719zgkgq3dv38xcf8afnvrz3";
};

postInstall = "rm -rf $out/share/gtk-doc";

setupHook = ./setup-hook.sh;

meta = with stdenv.lib; {
maintainers = [ maintainers.urkud ];
platforms = platforms.linux;
Expand Down
14 changes: 14 additions & 0 deletions pkgs/development/libraries/gobject-introspection/setup-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
make_gobject_introspection_find_gir_files() {

# required for .typelib files, eg mypaint git version
if [ -d "$1/lib/girepository-1.0" ]; then
addToSearchPath GI_TYPELIB_PATH $1/lib/girepository-1.0
fi

# XDG_DATA_DIRS: required for .gir files?
if [ -d "$1/share" ]; then
addToSearchPath XDG_DATA_DIRS $1/share
fi
}

envHooks+=(make_gobject_introspection_find_gir_files)
4 changes: 2 additions & 2 deletions pkgs/development/libraries/gtk+/3-default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ stdenv, fetchurl, pkgconfig
, expat, glib, cairo, pango, gdk_pixbuf, atk, at_spi2_atk, xlibs
, expat, glib, cairo, pango, gdk_pixbuf, atk, at_spi2_atk, xlibs, gobjectIntrospection
, xineramaSupport ? true
, cupsSupport ? true, cups ? null
}:
Expand All @@ -17,7 +17,7 @@ stdenv.mkDerivation rec {

enableParallelBuilding = true;

nativeBuildInputs = [ pkgconfig ];
nativeBuildInputs = [ pkgconfig gobjectIntrospection ];
propagatedBuildInputs = with xlibs; [
expat glib cairo pango gdk_pixbuf atk at_spi2_atk
libXrandr libXrender libXcomposite libXi libXcursor
Expand Down
30 changes: 30 additions & 0 deletions pkgs/development/libraries/gusb/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{stdenv, fetchurl, fetchgit
, automake, autoconf, libtool, which, gtkdoc, gettext, pkgconfig, gobjectIntrospection, libxslt
, glib, systemd, libusb1
}:
stdenv.mkDerivation {
name = "gusb-git";
enableParallelBuilding = true;

src = fetchgit {
url = git://gitorious.org/gusb/gusb.git;
rev = "01daf09f663e27bdd92532e3e2a3e87de895e9cc1f150d4e0fc75b0dc489fccf";
sha256 = "01daf09f663e27bdd92532e3e2a3e87de895e9cc1f150d4e0fc75b0dc489fccf";
};

preConfigure = "./autogen.sh";

buildInputs = [
pkgconfig autoconf automake libtool which gtkdoc gettext gobjectIntrospection libxslt
systemd libusb1
glib
];

meta = {
description = "GLib libusb wrapper";
homepage = http://gitorious.org/gusb;
license = stdenv.lib.licenses.lgpl21;
maintainers = [stdenv.lib.maintainers.marcweber];
platforms = stdenv.lib.platforms.linux;
};
}
5 changes: 3 additions & 2 deletions pkgs/development/libraries/pango/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchurl, pkgconfig, gettext, x11, glib, cairo, libpng, harfbuzz, fontconfig }:
{ stdenv, fetchurl, pkgconfig, gettext, x11, glib, cairo, libpng, harfbuzz, fontconfig, gobjectIntrospection }:

stdenv.mkDerivation rec {
name = "pango-1.32.5"; #.6 needs a not-yet-stable fontconfig
Expand All @@ -8,7 +8,8 @@ stdenv.mkDerivation rec {
sha256 = "08aqis6j8nd1lb4f2h4h9d9kjvp54iwf8zvqzss0qn4v7nfcjyvx";
};

buildInputs = stdenv.lib.optionals stdenv.isDarwin [ gettext fontconfig ];
buildInputs = [ gobjectIntrospection ]
++ stdenv.lib.optionals stdenv.isDarwin [ gettext fontconfig ];

nativeBuildInputs = [ pkgconfig ];

Expand Down
1 change: 1 addition & 0 deletions pkgs/development/libraries/wxGTK-2.8/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ stdenv.mkDerivation rec {
"--disable-precomp-headers"
(if unicode then "--enable-unicode" else "")
"--enable-mediactrl"
"--enable-graphics_ctx"
] ++ optional withMesa "--with-opengl";

# These variables are used by configure to find some dependencies.
Expand Down
36 changes: 35 additions & 1 deletion pkgs/lib/misc.nix
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,41 @@ rec {
mergeAttrsByFuncDefaults = foldl mergeAttrByFunc { inherit mergeAttrBy; };
mergeAttrsByFuncDefaultsClean = list: removeAttrs (mergeAttrsByFuncDefaults list) ["mergeAttrBy"];

# sane defaults (same name as attr name so that inherit can be used)
# merge attrs based on version key into mkDerivation args, see mergeAttrBy to learn about smart merge defaults
#
# This function is best explained by an example:
#
# {version ? "2.0"} :
#
# mkDerivation (mergeAttrsByVersion "package-name" version
# { # version specific settings
# "git" = { src = ..; preConfigre = "autogen.sh"; buildInputs = [automake autoconf libtool]; };
# "2.0" = { src = ..; };
# }
# { // shared settings
# buildInputs = [ common build inputs ];
# meta = { .. }
# }
# )
#
# Please note that e.g. Eelco Dolstra usually prefers having one file for
# each version. On the other hand there are valuable additional design goals
# - readability
# - do it once only
# - try to avoid duplication
#
# Marc Weber and Michael Raskin sometimes prefer keeping older
# versions around for testing and regression tests - as long as its cheap to
# do so.
#
# Very often it just happens that the "shared" code is the bigger part.
# Then using this function might be appropriate.
#
# Be aware that its easy to cause recompilations in all versions when using this function
mergeAttrsByVersion = name: version: attrsByVersion: base:
mergeAttrsByFuncDefaultsClean [ { name = "${name}-${version}"; } base (maybeAttr version (throw "bad version ${version} for ${name}") attrsByVersion)];


mergeAttrBy = # { buildInputs = concatList; [...]; passthru = mergeAttr; [..]; }
listToAttrs (map (n : nameValuePair n lib.concat)
[ "nativeBuildInputs" "buildInputs" "propagatedBuildInputs" "configureFlags" "prePhases" "postAll" "patches" ])
Expand Down
53 changes: 53 additions & 0 deletions pkgs/tools/graphics/dispcalgui/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{stdenv, fetchsvn, pythonPackages, xorg, pkgconfig, makeWrapper, argyllcms}:

/* is known to segfault when calibrating on ati proprietary hardware */

pythonPackages.buildPythonPackage {

name = "dispcal-gui";

src = fetchsvn {
url = "svn://svn.code.sf.net/p/dispcalgui/code/trunk";
rev = "HEAD";
sha256 = "1ky6iq2mddlz5bav9py45fcjmmh1d52sgk8974b2pngjm5ryamrp";
};

doCheck = false;

preConfigure = ''
mkdir home
export HOME=`pwd`/home
sed -i 's@X11/extensions/dpms.h@xcb/dpms.h@' dispcalGUI/RealDisplaySizeMM.c
sed -i "s@/etc/udev/rules.d@$out/etc/udev/rules.d@" setup.py dispcalGUI/setup.py

# make it always look for argyllcms binaries in the argyllcms/bin store path
sed -i 's@""" Find a single Argyll utility. Return the full path. """@return "'${argyllcms}'/bin/%s" % name@' dispcalGUI/worker.py
'';

buildInputs = [
pkgconfig
xorg.libX11
xorg.libXxf86vm
xorg.libxcb
xorg.libXinerama
xorg.libXrandr
xorg.libXrender

makeWrapper
pythonPackages.numpy
pythonPackages.wxPython
];

postInstall = ''
wrapProgram $out/bin/dispcalGUI \
--prefix PYTHONPATH ":" $PYTHONPATH
'';

# meta = {
# description = "<++>";
# homepage = <++>;
# license = stdenv.lib.licenses.;
# maintainers = [stdenv.lib.maintainers.marcweber];
# platforms = stdenv.lib.platforms.linux;
# };
}
Loading