about summary refs log tree commit diff
path: root/pkgs/tools/graphics
diff options
context:
space:
mode:
authorMatt McHenry <github@matt.mchenryfamily.org>2016-05-06 22:38:39 -0400
committerRobert Helgesson <robert@rycee.net>2016-05-29 21:48:28 +0200
commit7fe0c342a3388ba9d46e49c18b8ebf8c50481569 (patch)
treee8defaf75cab60da3ef6961f7f4582f480868164 /pkgs/tools/graphics
parente5ea52e1eb1a848d561b51bd94ccf3651ebfe7b9 (diff)
downloadnixlib-7fe0c342a3388ba9d46e49c18b8ebf8c50481569.tar
nixlib-7fe0c342a3388ba9d46e49c18b8ebf8c50481569.tar.gz
nixlib-7fe0c342a3388ba9d46e49c18b8ebf8c50481569.tar.bz2
nixlib-7fe0c342a3388ba9d46e49c18b8ebf8c50481569.tar.lz
nixlib-7fe0c342a3388ba9d46e49c18b8ebf8c50481569.tar.xz
nixlib-7fe0c342a3388ba9d46e49c18b8ebf8c50481569.tar.zst
nixlib-7fe0c342a3388ba9d46e49c18b8ebf8c50481569.zip
bins: init at 1.1.29
Diffstat (limited to 'pkgs/tools/graphics')
-rw-r--r--pkgs/tools/graphics/bins/bins_edit-isa.patch20
-rw-r--r--pkgs/tools/graphics/bins/default.nix48
-rw-r--r--pkgs/tools/graphics/bins/hashref.patch13
3 files changed, 81 insertions, 0 deletions
diff --git a/pkgs/tools/graphics/bins/bins_edit-isa.patch b/pkgs/tools/graphics/bins/bins_edit-isa.patch
new file mode 100644
index 000000000000..68aad10ddff4
--- /dev/null
+++ b/pkgs/tools/graphics/bins/bins_edit-isa.patch
@@ -0,0 +1,20 @@
+--- a/bins_edit	2005-08-25 14:34:39.000000000 -0400
++++ b/bins_edit	2016-05-18 20:25:40.913460314 -0400
+@@ -26,7 +26,7 @@
+ 
+ use Getopt::Long;
+ use IO::File;
+-use UNIVERSAL qw(isa);
++use Scalar::Util 'reftype';
+ 
+ # XML parsing & writing
+ use XML::Grove;
+@@ -198,7 +198,7 @@
+   my $fieldValue;
+   foreach my $element
+     (@{$document->at_path('/'.$fileType.'/description')->{Contents}}) {
+-      if (isa($element, 'XML::Grove::Element') && $element->{Name} eq "field") {
++      if (reftype($element) eq 'XML::Grove::Element' && $element->{Name} eq "field") {
+ 	$fieldName = $element->{Attributes}{'name'};
+ 	$fieldValue = "";
+ 	if ($fieldName eq $field) {
diff --git a/pkgs/tools/graphics/bins/default.nix b/pkgs/tools/graphics/bins/default.nix
new file mode 100644
index 000000000000..579ec802e092
--- /dev/null
+++ b/pkgs/tools/graphics/bins/default.nix
@@ -0,0 +1,48 @@
+{ stdenv, fetchurl, makeWrapper, perl, perlPackages }:
+
+let
+  version = "1.1.29";
+
+in
+
+#note: bins-edit-gui does not work
+
+stdenv.mkDerivation {
+  name = "bins-${version}";
+
+  src = fetchurl {
+    url = "http://download.gna.org/bins/bins-${version}.tar.gz";
+    sha256 = "0n4pcssyaic4xbk25aal0b3g0ibmi2f3gpv0gsnaq61sqipyjl94";
+  };
+
+  buildInputs = with perlPackages; [ makeWrapper perl
+                                     ImageSize ImageInfo PerlMagick
+                                     URI HTMLParser HTMLTemplate HTMLClean
+                                     XMLGrove XMLHandlerYAWriter
+                                     TextIconv TextUnaccent
+                                     DateTimeFormatDateParse ]; #TODO need Gtk (not Gtk2?) for bins-edit-gui
+
+  patches = [ ./bins_edit-isa.patch
+              ./hashref.patch ];
+
+  installPhase = ''
+    export DESTDIR=$out;
+    export PREFIX=.;
+
+    echo | ./install.sh
+
+    for f in bins bins_edit bins-edit-gui; do
+      substituteInPlace $out/bin/$f \
+        --replace /usr/bin/perl ${perl}/bin/perl \
+        --replace /etc/bins $out/etc/bins \
+        --replace /usr/local/share $out/share;
+      wrapProgram $out/bin/$f --set PERL5LIB "$PERL5LIB";
+    done
+  '';
+
+  meta = {
+    description = "generates static HTML photo albums";
+    homepage = http://bins.sautret.org;
+    license = stdenv.lib.licenses.gpl2;
+  };
+}
\ No newline at end of file
diff --git a/pkgs/tools/graphics/bins/hashref.patch b/pkgs/tools/graphics/bins/hashref.patch
new file mode 100644
index 000000000000..e16d3a78c52d
--- /dev/null
+++ b/pkgs/tools/graphics/bins/hashref.patch
@@ -0,0 +1,13 @@
+--- a/bins	2016-05-18 20:45:49.513330005 -0400
++++ b/bins	2016-05-18 20:58:58.957830874 -0400
+@@ -3643,8 +3643,8 @@
+ 
+     my @descTable;
+     foreach my $tagName (@mainFields) {
+-        if (${%$hashref}{$tagName}) {
+-            my $value=${%$hashref}{$tagName};
++        if (${$hashref}{$tagName}) {
++            my $value=${$hashref}{$tagName};
+             $value =~ s/'/&#39;/g  ; # in case it's used in javascript code
+             push @descTable, {DESC_FIELD_NAME => getFields($configHash)->{$tagName}->{'Name'},
+                               DESC_FIELD_VALUE => $value,