From a24960d2146e3c15eb56401293605ca3cbc45047 Mon Sep 17 00:00:00 2001 From: Chris Hodapp Date: Tue, 23 May 2017 13:23:01 -0400 Subject: [PATCH 1/2] autotrace: init at 0.31.1 Add ApplicationServices for Darwin build Clean up comments --- .../graphics/autotrace/autofig.nix | 10 +++ .../graphics/autotrace/default.nix | 61 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 73 insertions(+) create mode 100644 pkgs/applications/graphics/autotrace/autofig.nix create mode 100644 pkgs/applications/graphics/autotrace/default.nix diff --git a/pkgs/applications/graphics/autotrace/autofig.nix b/pkgs/applications/graphics/autotrace/autofig.nix new file mode 100644 index 00000000000..31ee0ff0d07 --- /dev/null +++ b/pkgs/applications/graphics/autotrace/autofig.nix @@ -0,0 +1,10 @@ +{ stdenv, fetchurl }: + +stdenv.mkDerivation rec { + name = "autofig-0.1"; + + src = fetchurl { + url = "http://autotrace.sourceforge.net/tools/autofig.tar.gz"; + sha256 = "11cs9hdbgcl3aamcs3149i8kvyyldmnjf6yq81kbcf8fdmfk2zdq"; + }; +} diff --git a/pkgs/applications/graphics/autotrace/default.nix b/pkgs/applications/graphics/autotrace/default.nix new file mode 100644 index 00000000000..f5f81a262f3 --- /dev/null +++ b/pkgs/applications/graphics/autotrace/default.nix @@ -0,0 +1,61 @@ +{ stdenv, fetchurl, callPackage, libpng12, imagemagick, + autoreconfHook, glib, pstoedit, pkgconfig, gettext, darwin }: + +# TODO: Solve that it cannot find pstoedit (as it is unable to find +# pstoedit-config) + +# TODO: Figure out why the resultant binary is somehow linked against +# libpng16.so.16 rather than libpng12. + +stdenv.mkDerivation rec { + name = "autotrace-${version}"; + version = "0.31.1"; + + src = fetchurl { + url = "mirror://sourceforge/autotrace/AutoTrace/0.31.1/${name}.tar.gz"; + sha256 = "1xmgja5fv48mdbsa51inf7ksz36nqd6bsaybrk5xgprm6cy946js"; + }; + + # The below commented out part is for an identically-named project + # on GitHub which appears to derive somehow from the Sourceforge + # version, but I have no idea what the lineage is of this project. + # It will build, but it segfaults when I attempt to run -centerline. + # Someone may need this for some reason, so I've left it here. + # + #src = fetchFromGitHub { + # owner = "autotrace"; + # repo = "autotrace"; + # rev = "b3ac8818d86943102cb4f13734e0b527c42dc45a"; + # sha256 = "0z5h2mvxwckk2msi361zk1nc9fdcvxyimyc2hlyqd6h8k3p7zdi4"; + #}; + #postConfigure = '' + # sed -i -e "s/at_string/gchar */g" *.c + # sed -i -e "s/at_address/gpointer/g" *.c + # sed -i -e "s/at_bitmap_type/struct _at_bitmap/g" *.c + # sed -i -e "s/AT_BITMAP_BITS(bitmap)/AT_BITMAP_BITS(\&bitmap)/g" input-magick.c + #''; + + autofig = callPackage ./autofig.nix {}; + nativeBuildInputs = [ autoreconfHook glib autofig pkgconfig gettext ]; + buildInputs = [ libpng12 imagemagick pstoedit ] + ++ stdenv.lib.optionals stdenv.isDarwin + (with darwin.apple_sdk.frameworks; [ApplicationServices]); + + postUnpack = '' + pushd $sourceRoot + autofig autotrace-config.af + popd + ''; + + # This complains about various m4 files, but it appears to not be an + # actual error. + preConfigure = "glib-gettextize --copy --force"; + + meta = with stdenv.lib; { + homepage = http://autotrace.sourceforge.net/; + description = "Utility for converting bitmap into vector graphics"; + platforms = platforms.unix; + maintainers = with maintainers; [ hodapp ]; + license = licenses.gpl2; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 4d666b87626..827ee2bfb63 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -13181,6 +13181,8 @@ with pkgs; audio-recorder = callPackage ../applications/audio/audio-recorder { }; + autotrace = callPackage ../applications/graphics/autotrace {}; + milkytracker = callPackage ../applications/audio/milkytracker { }; schismtracker = callPackage ../applications/audio/schismtracker { }; From 98bd25a02e140ac65ff1ef1fb5339fc04d839db5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benno=20F=C3=BCnfst=C3=BCck?= Date: Fri, 30 Jun 2017 16:30:12 +0200 Subject: [PATCH 2/2] autotrace: build with pstoedit --- .../applications/graphics/autotrace/default.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pkgs/applications/graphics/autotrace/default.nix b/pkgs/applications/graphics/autotrace/default.nix index f5f81a262f3..2131589339c 100644 --- a/pkgs/applications/graphics/autotrace/default.nix +++ b/pkgs/applications/graphics/autotrace/default.nix @@ -1,9 +1,6 @@ { stdenv, fetchurl, callPackage, libpng12, imagemagick, autoreconfHook, glib, pstoedit, pkgconfig, gettext, darwin }: -# TODO: Solve that it cannot find pstoedit (as it is unable to find -# pstoedit-config) - # TODO: Figure out why the resultant binary is somehow linked against # libpng16.so.16 rather than libpng12. @@ -49,7 +46,19 @@ stdenv.mkDerivation rec { # This complains about various m4 files, but it appears to not be an # actual error. - preConfigure = "glib-gettextize --copy --force"; + preConfigure = '' + glib-gettextize --copy --force + # pstoedit-config no longer exists, it was replaced with pkg-config + mkdir wrappers + cat >wrappers/pstoedit-config <<'EOF' + #!${stdenv.shell} + # replace --version with --modversion for pkg-config + args=''${@/--version/--modversion} + exec pkg-config pstoedit "''${args[@]}" + EOF + chmod +x wrappers/pstoedit-config + export PATH="$PATH:$PWD/wrappers" + ''; meta = with stdenv.lib; { homepage = http://autotrace.sourceforge.net/;