diff mbox

[2/4] gnu: Add steghide.

Message ID 20160823061512.13024-2-ericbavier@openmailbox.org
State New
Headers show

Commit Message

Eric Bavier Aug. 23, 2016, 6:15 a.m. UTC
From: Eric Bavier <bavier@member.fsf.org>

* gnu/packages/image.scm (steghide): New variable.
* gnu/packages/patches/steghide-fixes.patch: New patch.
* gnu/local.mk (dist_patch_DATA): Add it.
---
 gnu/local.mk                              |  1 +
 gnu/packages/image.scm                    | 36 ++++++++++++++++
 gnu/packages/patches/steghide-fixes.patch | 71 +++++++++++++++++++++++++++++++
 3 files changed, 108 insertions(+)
 create mode 100644 gnu/packages/patches/steghide-fixes.patch

Comments

Leo Famulari Aug. 23, 2016, 8:16 p.m. UTC | #1
On Tue, Aug 23, 2016 at 01:15:10AM -0500, Eric Bavier wrote:
> * gnu/packages/image.scm (steghide): New variable.
> * gnu/packages/patches/steghide-fixes.patch: New patch.
> * gnu/local.mk (dist_patch_DATA): Add it.

> +    (arguments
> +     `(#:make-flags '("CXXFLAGS=-fpermissive"))) ;required for MHashPP.cc

My understanding is that '-fpermissive' downgrades some compiler errors
to warnings. Is that correct?

> diff --git a/gnu/packages/patches/steghide-fixes.patch b/gnu/packages/patches/steghide-fixes.patch

I don't understand what this patch does (I don't know any C++). Can you
add some comments explaining it? Should we try to get the upstream
maintainers to apply it?
Eric Bavier Aug. 23, 2016, 10:19 p.m. UTC | #2
On Tue, 23 Aug 2016 16:16:11 -0400
Leo Famulari <leo@famulari.name> wrote:

> On Tue, Aug 23, 2016 at 01:15:10AM -0500, Eric Bavier wrote:
> > * gnu/packages/image.scm (steghide): New variable.
> > * gnu/packages/patches/steghide-fixes.patch: New patch.
> > * gnu/local.mk (dist_patch_DATA): Add it.  
> 
> > +    (arguments
> > +     `(#:make-flags '("CXXFLAGS=-fpermissive"))) ;required for MHashPP.cc  
> 
> My understanding is that '-fpermissive' downgrades some compiler errors
> to warnings. Is that correct?

Correct.  Specifically, this is to avoid:

MHashPP.cc:123:38: error: invalid conversion from ‘uint8_t* {aka unsigned char*}’ to ‘char*’ [-fpermissive]

which I'm not comfortable developing a better fix for.

> 
> > diff --git a/gnu/packages/patches/steghide-fixes.patch b/gnu/packages/patches/steghide-fixes.patch  
> 
> I don't understand what this patch does (I don't know any C++). Can you
> add some comments explaining it? Should we try to get the upstream
> maintainers to apply it?  

This patch fixes an "undefined ULONG_MAX" error and "specializing
member ‘...’ requires ‘template<>’ syntax" errors.

Upstream appears to currently be in limbo, but I just sent the patch to
the mailing list.

`~Eric
Leo Famulari Aug. 23, 2016, 11:53 p.m. UTC | #3
On Tue, Aug 23, 2016 at 05:19:49PM -0500, Eric Bavier wrote:
> On Tue, 23 Aug 2016 16:16:11 -0400
> Leo Famulari <leo@famulari.name> wrote:
> > My understanding is that '-fpermissive' downgrades some compiler errors
> > to warnings. Is that correct?
> 
> Correct.  Specifically, this is to avoid:
> 
> MHashPP.cc:123:38: error: invalid conversion from ‘uint8_t* {aka unsigned char*}’ to ‘char*’ [-fpermissive]
> 
> which I'm not comfortable developing a better fix for.

Okay. Can you mention that specific error in a code comment? It seems
like valuable information to me.

> 
> > 
> > > diff --git a/gnu/packages/patches/steghide-fixes.patch b/gnu/packages/patches/steghide-fixes.patch  
> > 
> > I don't understand what this patch does (I don't know any C++). Can you
> > add some comments explaining it? Should we try to get the upstream
> > maintainers to apply it?  
> 
> This patch fixes an "undefined ULONG_MAX" error and "specializing
> member ‘...’ requires ‘template<>’ syntax" errors.
> 
> Upstream appears to currently be in limbo, but I just sent the patch to
> the mailing list.

Okay, maybe wait a couple days in case they respond?
diff mbox

Patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b8c5378..02a7cc4 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -777,6 +777,7 @@  dist_patch_DATA =						\
   %D%/packages/patches/slim-sigusr1.patch			\
   %D%/packages/patches/slurm-configure-remove-nonfree-contribs.patch \
   %D%/packages/patches/soprano-find-clucene.patch		\
+  %D%/packages/patches/steghide-fixes.patch			\
   %D%/packages/patches/superlu-dist-scotchmetis.patch		\
   %D%/packages/patches/synfig-build-fix.patch			\
   %D%/packages/patches/t1lib-CVE-2010-2642.patch		\
diff --git a/gnu/packages/image.scm b/gnu/packages/image.scm
index 7d72492..8d9f5a3 100644
--- a/gnu/packages/image.scm
+++ b/gnu/packages/image.scm
@@ -9,6 +9,7 @@ 
 ;;; Copyright © 2016 Leo Famulari <leo@famulari.name>
 ;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
 ;;; Copyright © 2016 Tobias Geerinckx-Rice <me@tobias.gr>
+;;; Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -33,10 +34,12 @@ 
   #:use-module (gnu packages compression)
   #:use-module (gnu packages documentation)
   #:use-module (gnu packages fontutils)
+  #:use-module (gnu packages gettext)
   #:use-module (gnu packages ghostscript)
   #:use-module (gnu packages gl)
   #:use-module (gnu packages graphics)
   #:use-module (gnu packages maths)
+  #:use-module (gnu packages mcrypt)
   #:use-module (gnu packages perl)
   #:use-module (gnu packages pkg-config)
   #:use-module (gnu packages python)
@@ -833,3 +836,36 @@  whether they look alike.  It uses a computational model of the human visual
 system to detect similarities.  This allows it too see beyond irrelevant
 differences in file encoding, image quality, and other small variations.")
     (license license:gpl2+)))
+
+(define-public steghide
+  (package
+    (name "steghide")
+    (version "0.5.1")
+    (source (origin
+              (method url-fetch)
+              (uri (string-append "mirror://sourceforge/steghide/steghide/"
+                                  version "/steghide-" version ".tar.bz2"))
+              (sha256
+               (base32
+                "18bxlhbdc3zsmxj84i417xjh0q28kv26q449k23n0a72ldwziix2"))
+              (patches (list (search-patch "steghide-fixes.patch")))))
+    (build-system gnu-build-system)
+    (native-inputs
+     `(("gettext" ,gnu-gettext)
+       ("libtool" ,libtool)
+       ("perl" ,perl)))                 ;for tests
+    (inputs
+     `(("libmhash" ,libmhash)
+       ("libmcrypt" ,libmcrypt)
+       ("libjpeg" ,libjpeg)
+       ("zlib" ,zlib)))
+    (arguments
+     `(#:make-flags '("CXXFLAGS=-fpermissive"))) ;required for MHashPP.cc
+    (home-page "http://steghide.sourceforge.net")
+    (synopsis "Image and audio steganography")
+    (description
+     "Steghide is a steganography program that is able to hide data in various
+kinds of image- and audio-files.  The color- respectivly sample-frequencies
+are not changed thus making the embedding resistant against first-order
+statistical tests.")
+    (license license:gpl2+)))
diff --git a/gnu/packages/patches/steghide-fixes.patch b/gnu/packages/patches/steghide-fixes.patch
new file mode 100644
index 0000000..4e7f447
--- /dev/null
+++ b/gnu/packages/patches/steghide-fixes.patch
@@ -0,0 +1,71 @@ 
+--- steghide-0.5.1/src/AuData.h
++++ steghide-0.5.1/src/AuData.h
+@@ -26,22 +26,22 @@
+ 
+ // AuMuLawAudioData
+ typedef AudioDataImpl<AuMuLaw,BYTE> AuMuLawAudioData ;
+-inline BYTE AuMuLawAudioData::readValue (BinaryIO* io) const { return (io->read8()) ; }
+-inline void AuMuLawAudioData::writeValue (BinaryIO* io, BYTE v) const { io->write8(v) ; }
++template<> inline BYTE AuMuLawAudioData::readValue (BinaryIO* io) const { return (io->read8()) ; }
++template<> inline void AuMuLawAudioData::writeValue (BinaryIO* io, BYTE v) const { io->write8(v) ; }
+ 
+ // AuPCM8AudioData
+ typedef AudioDataImpl<AuPCM8,SBYTE> AuPCM8AudioData ;
+-inline SBYTE AuPCM8AudioData::readValue (BinaryIO* io) const { return ((SBYTE) io->read8()) ; }
+-inline void AuPCM8AudioData::writeValue (BinaryIO* io, SBYTE v) const { io->write8((BYTE) v) ; }
++template<> inline SBYTE AuPCM8AudioData::readValue (BinaryIO* io) const { return ((SBYTE) io->read8()) ; }
++template<> inline void AuPCM8AudioData::writeValue (BinaryIO* io, SBYTE v) const { io->write8((BYTE) v) ; }
+ 
+ // AuPCM16AudioData
+ typedef AudioDataImpl<AuPCM16,SWORD16> AuPCM16AudioData ;
+-inline SWORD16 AuPCM16AudioData::readValue (BinaryIO* io) const { return ((SWORD16) io->read16_be()) ; }
+-inline void AuPCM16AudioData::writeValue (BinaryIO* io, SWORD16 v) const { io->write16_be((UWORD16) v) ; }
++template<> inline SWORD16 AuPCM16AudioData::readValue (BinaryIO* io) const { return ((SWORD16) io->read16_be()) ; }
++template<> inline void AuPCM16AudioData::writeValue (BinaryIO* io, SWORD16 v) const { io->write16_be((UWORD16) v) ; }
+ 
+ // AuPCM32AudioData
+ typedef AudioDataImpl<AuPCM32,SWORD32> AuPCM32AudioData ;
+-inline SWORD32 AuPCM32AudioData::readValue (BinaryIO* io) const { return ((SWORD32) io->read32_be()) ; }
+-inline void AuPCM32AudioData::writeValue (BinaryIO* io, SWORD32 v) const { io->write32_be((UWORD32) v) ; }
++template<> inline SWORD32 AuPCM32AudioData::readValue (BinaryIO* io) const { return ((SWORD32) io->read32_be()) ; }
++template<> inline void AuPCM32AudioData::writeValue (BinaryIO* io, SWORD32 v) const { io->write32_be((UWORD32) v) ; }
+ 
+ #endif // ndef SH_AUDATA_H
+--- steghide-0.5.1/src/AuSampleValues.cc
++++ steghide-0.5.1/src/AuSampleValues.cc
+@@ -21,17 +21,17 @@
+ #include "AuSampleValues.h"
+ 
+ // AuMuLawSampleValue
+-const BYTE AuMuLawSampleValue::MinValue = 0 ;
+-const BYTE AuMuLawSampleValue::MaxValue = BYTE_MAX ;
++template<> const BYTE AuMuLawSampleValue::MinValue = 0 ;
++template<> const BYTE AuMuLawSampleValue::MaxValue = BYTE_MAX ;
+ 
+ // AuPCM8SampleValue
+-const SBYTE AuPCM8SampleValue::MinValue = SBYTE_MIN ;
+-const SBYTE AuPCM8SampleValue::MaxValue = SBYTE_MAX ;
++template<> const SBYTE AuPCM8SampleValue::MinValue = SBYTE_MIN ;
++template<> const SBYTE AuPCM8SampleValue::MaxValue = SBYTE_MAX ;
+ 
+ // AuPCM16SampleValue
+-const SWORD16 AuPCM16SampleValue::MinValue = SWORD16_MIN ;
+-const SWORD16 AuPCM16SampleValue::MaxValue = SWORD16_MAX ;
++template<> const SWORD16 AuPCM16SampleValue::MinValue = SWORD16_MIN ;
++template<> const SWORD16 AuPCM16SampleValue::MaxValue = SWORD16_MAX ;
+ 
+ // AuPCM32SampleValue
+-const SWORD32 AuPCM32SampleValue::MinValue = SWORD32_MIN ;
+-const SWORD32 AuPCM32SampleValue::MaxValue = SWORD32_MAX ;
++template<> const SWORD32 AuPCM32SampleValue::MinValue = SWORD32_MIN ;
++template<> const SWORD32 AuPCM32SampleValue::MaxValue = SWORD32_MAX ;
+--- steghide-0.5.1/src/Graph.cc
++++ steghide-0.5.1/src/Graph.cc
+@@ -18,6 +18,7 @@
+  *
+  */
+ 
++#include <climits>
+ #include <ctime>
+ #include <list>
+ #include <map>