From ac911fce6876b19d21bc4472814a24b20cb330c2 Mon Sep 17 00:00:00 2001 From: "Yury G. Kudryashov" <urkud.urkud@gmail.com> Date: Fri, 6 Jan 2012 18:13:11 +0000 Subject: [PATCH] Fix XaraLX, add debian-patches.sh svn path=/nixpkgs/trunk/; revision=31358 --- maintainers/scripts/debian-patches.sh | 32 ++++++++++++++++ .../graphics/xara/debian-patches.nix | 30 +++++++++++++++ .../graphics/xara/debian-patches.txt | 7 ++++ pkgs/applications/graphics/xara/default.nix | 37 ++++++------------- .../graphics/xara/gtk_cflags.patch | 20 ---------- pkgs/top-level/all-packages.nix | 4 +- 6 files changed, 81 insertions(+), 49 deletions(-) create mode 100755 maintainers/scripts/debian-patches.sh create mode 100644 pkgs/applications/graphics/xara/debian-patches.nix create mode 100644 pkgs/applications/graphics/xara/debian-patches.txt delete mode 100644 pkgs/applications/graphics/xara/gtk_cflags.patch diff --git a/maintainers/scripts/debian-patches.sh b/maintainers/scripts/debian-patches.sh new file mode 100755 index 000000000000..78678473a49f --- /dev/null +++ b/maintainers/scripts/debian-patches.sh @@ -0,0 +1,32 @@ +#!/bin/sh + +# Download patches from debian project +# Usage $0 debian-patches.txt debian-patches.nix +# An example input and output files can be found in applications/graphics/xara/ + +DEB_URL=http://patch-tracker.debian.org/patch/series/dl +declare -a deb_patches +mapfile -t deb_patches < $1 + +prefix="${DEB_URL}/${deb_patches[0]}" + +if [[ -n "$2" ]]; then + exec 1> $2 +fi + +cat <<EOF +# Generated by $(basename $0) from $(basename $1) +let + prefix = "${prefix}"; +in +[ +EOF +for ((i=1;i < ${#deb_patches[@]}; ++i)); do + url="${prefix}/${deb_patches[$i]}" + sha256=$(nix-prefetch-url $url) + echo " {" + echo " url = \"\${prefix}/${deb_patches[$i]}\";" + echo " sha256 = \"$sha256\";" + echo " }" +done +echo "]" diff --git a/pkgs/applications/graphics/xara/debian-patches.nix b/pkgs/applications/graphics/xara/debian-patches.nix new file mode 100644 index 000000000000..dd3061461868 --- /dev/null +++ b/pkgs/applications/graphics/xara/debian-patches.nix @@ -0,0 +1,30 @@ +# Generated by debian-patches.sh from debian-patches.txt +let + prefix = "http://patch-tracker.debian.org/patch/series/dl/xaralx/0.7r1785-5"; +in +[ + { + url = "${prefix}/30_gtk_wxwidgets_symbol_clash"; + sha256 = "1rc9dh9mnp93mad96dkp7idyhhcw7h6w0g5s92mqgzj79hqgaziz"; + } + { + url = "${prefix}/40_algorithm_include"; + sha256 = "03jhl1qnxj7nl8malf6v1y24aldfz87x1p2jxp04mrr35nzvyyc0"; + } + { + url = "${prefix}/50_update_imagemagick_version_parser"; + sha256 = "1nilsqghlr649sc14n1aqkhdx7f66rq91gqccdpi17jwijs27497"; + } + { + url = "${prefix}/remove-icon-suffix"; + sha256 = "160zmkgwlsanqivnip89558yvd9zvqp8ks2wbyr2aigl2rafin22"; + } + { + url = "${prefix}/45_fix_gcc4"; + sha256 = "06zsj0z9v5n557gj8337v6xd26clbvm4dc0qhvpvzbisq81l9jyi"; + } + { + url = "${prefix}/55_fix_contstuctor_call"; + sha256 = "0b14glrcwhv0ja960h56n5jm4f9563ladap2pgaywihq485ql1c1"; + } +] diff --git a/pkgs/applications/graphics/xara/debian-patches.txt b/pkgs/applications/graphics/xara/debian-patches.txt new file mode 100644 index 000000000000..5c95d401a323 --- /dev/null +++ b/pkgs/applications/graphics/xara/debian-patches.txt @@ -0,0 +1,7 @@ +xaralx/0.7r1785-5 +30_gtk_wxwidgets_symbol_clash +40_algorithm_include +50_update_imagemagick_version_parser +remove-icon-suffix +45_fix_gcc4 +55_fix_contstuctor_call diff --git a/pkgs/applications/graphics/xara/default.nix b/pkgs/applications/graphics/xara/default.nix index 89ba789524fb..8a6bac4db2b9 100644 --- a/pkgs/applications/graphics/xara/default.nix +++ b/pkgs/applications/graphics/xara/default.nix @@ -1,35 +1,20 @@ -{stdenv, fetchurl, autoconf, automake, gettext, libtool, cvs, wxGTK, gtk, -pkgconfig, libxml2, zip, libpng, libjpeg, shebangfix, perl, freetype}: +{stdenv, fetchurl, automake, gettext, freetype, libxml2, pango, pkgconfig +, wxGTK, gtk, perl, zip}: stdenv.mkDerivation { - name = "xaralx-0.7r1766"; + name = "xaralx-0.7r1785"; + src = fetchurl { - url = http://downloads2.xara.com/opensource/XaraLX-0.7r1766.tar.bz2; - sha256 = "1rcl7hqvcai586jky7hvzxhnq8q0ka2rsmgiq5ijwclgr5d4ah7n"; + url = http://downloads2.xara.com/opensource/XaraLX-0.7r1785.tar.bz2; + sha256 = "05xbzq1i1vw2mdsv7zjqfpxfv3g1j0g5kks0gq6sh373xd6y8lyh"; }; - buildInputs = [automake autoconf gettext libtool cvs wxGTK gtk pkgconfig libxml2 zip libpng libjpeg shebangfix perl]; + buildNativeInputs = [ automake pkgconfig gettext perl zip ]; + buildInputs = [ wxGTK gtk libxml2 freetype pango ]; - inherit freetype libpng libjpeg libxml2; - configureFlags = "--with-wx-config --disable-svnversion --disable-international"; + configureFlags = "--disable-svnversion"; - patches = [./gtk_cflags.patch]; + patches = map fetchurl (import ./debian-patches.nix); - # Why do I need to add library path for freetype ? - installPhase = " - make install - ensureDir \$out/lib - mv \$out/{bin,lib}/XaraLX -cat >> \$out/bin/XaraLX << EOF -#!/bin/sh -LD_LIBRARY_PATH=\$freetype/lib:\$libpng/lib:\$libjpeg/lib:\$libxml2/lib: -\$out/lib/XaraLX \"\\$@\" -EOF -chmod +x \$out/bin/XaraLX -"; - - patchPhase = " - find . -iname \"*.pl\" | xargs shebangfix; - unset patchPhase; patchPhase - "; + prePatch = "patchShebangs Scripts"; } diff --git a/pkgs/applications/graphics/xara/gtk_cflags.patch b/pkgs/applications/graphics/xara/gtk_cflags.patch deleted file mode 100644 index 842236073996..000000000000 --- a/pkgs/applications/graphics/xara/gtk_cflags.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -rc XaraLX-0.7r1766/Makefile.in XaraLX-0.7r1766.new/Makefile.in -*** XaraLX-0.7r1766/Makefile.in 2007-01-31 13:43:04.000000000 +0100 ---- XaraLX-0.7r1766.new/Makefile.in 2007-05-15 00:19:36.000000000 +0200 -*************** -*** 256,262 **** - @DARWIN_LINK_TRUE@XaraLX_SOURCES = Kernel/*.o wxOil/*.o tools/*.o wxXtra/*.o - @DARWIN_LINK_FALSE@XaraLX_LDSOURCE = -Wl,--start-group $(XaraLX_SOURCES) -Wl,--end-group - @DARWIN_LINK_TRUE@XaraLX_LDSOURCE = $(XaraLX_SOURCES) -! XaraLX_LDFLAGS = --debug -L$(srcdir)/$(CDRAW_LIB_DIR) $(WX_LIBS) $(LIBS) $(LIBXML2_LIBS) -lCDraw - UNZIP = unzip - ACLOCAL_AMFLAGS = -I m4 - all: all-recursive ---- 256,262 ---- - @DARWIN_LINK_TRUE@XaraLX_SOURCES = Kernel/*.o wxOil/*.o tools/*.o wxXtra/*.o - @DARWIN_LINK_FALSE@XaraLX_LDSOURCE = -Wl,--start-group $(XaraLX_SOURCES) -Wl,--end-group - @DARWIN_LINK_TRUE@XaraLX_LDSOURCE = $(XaraLX_SOURCES) -! XaraLX_LDFLAGS = --debug -L$(srcdir)/$(CDRAW_LIB_DIR) $(GTK_LIBS) $(WX_LIBS) $(LIBS) $(LIBXML2_LIBS) -lCDraw - UNZIP = unzip - ACLOCAL_AMFLAGS = -I m4 - all: all-recursive diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index c56683a9f8d4..6b1d91432649 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -7631,9 +7631,7 @@ let inherit gsl aalib zlib libpng intltool gettext perl; }; - xara = callPackage ../applications/graphics/xara { - wxGTK = wxGTK26; - }; + xara = callPackage ../applications/graphics/xara { }; xawtv = callPackage ../applications/video/xawtv { };