Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 455956

Summary: app-editors/wxhexeditor-0.21 version bump
Product: Gentoo Linux Reporter: Dave Armstrong <dave0x01>
Component: Current packagesAssignee: Gentoo wxWidgets project <wxwidgets>
Status: RESOLVED FIXED    
Severity: normal Keywords: PATCH
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
URL: http://sourceforge.net/projects/wxhexeditor/
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: wxhexeditor-0.21-makefile.patch
wxhexeditor-0.21.ebuild

Description Dave Armstrong 2013-02-07 02:59:43 UTC
Created attachment 338184 [details, diff]
wxhexeditor-0.21-makefile.patch

The attached ebuild and patch are based on version .20.  They need review from an experienced packager/ebuilder.
Comment 1 Dave Armstrong 2013-02-07 03:00:56 UTC
Created attachment 338186 [details]
wxhexeditor-0.21.ebuild
Comment 2 Jeroen Roovers (RETIRED) gentoo-dev 2013-02-07 03:06:02 UTC
Comment on attachment 338186 [details]
wxhexeditor-0.21.ebuild

--- wxhexeditor-0.20.ebuild     2012-07-02 05:47:52.000000000 +0200
+++ -   2013-02-07 04:02:47.809744135 +0100
@@ -32,4 +32,17 @@
 
 src_prepare() {
        epatch "${FILESDIR}"/${P}-makefile.patch
+
+    for x in ./src/HexEditorGui.cpp ./src/HexEditorGui.h ./src/HexEditorCtrl/HexEditorCtrlGui.cpp \
+       ./src/HexEditorCtrl/HexEditorCtrlGui.h
+    do
+       sed -i 's/wxT(/_(/g' $x
+       sed -i "s/_('\\\t')/wxT('\\\t')/g" $x
+    done
+

sed is quite capable of processing multiple file arguments, so
     sed -i {your files} -e {your sed scripts}
should work just as good, and also quite a bit faster as every file gets opened just once and sed gets called just once too.

+}
+src_install(){
+
+emake DESTDIR="${D}" install
+
 }

This is the default, so it should not be in the ebuild.
Comment 3 Dave Armstrong 2013-02-07 11:28:22 UTC
(In reply to comment #2)
> Comment on attachment 338186 [details]
> wxhexeditor-0.21.ebuild
> 
> --- wxhexeditor-0.20.ebuild     2012-07-02 05:47:52.000000000 +0200
> +++ -   2013-02-07 04:02:47.809744135 +0100
> @@ -32,4 +32,17 @@
>  
>  src_prepare() {
>         epatch "${FILESDIR}"/${P}-makefile.patch
> +
> +    for x in ./src/HexEditorGui.cpp ./src/HexEditorGui.h
> ./src/HexEditorCtrl/HexEditorCtrlGui.cpp \
> +       ./src/HexEditorCtrl/HexEditorCtrlGui.h
> +    do
> +       sed -i 's/wxT(/_(/g' $x
> +       sed -i "s/_('\\\t')/wxT('\\\t')/g" $x
> +    done
> +
> 
> sed is quite capable of processing multiple file arguments, so
>      sed -i {your files} -e {your sed scripts}
> should work just as good, and also quite a bit faster as every file gets
> opened just once and sed gets called just once too.

I know. It's actually just a cut 'n paste from the shell script 'GUILocaleFix.sh' (found in the root directory of the tarball).  Upon further inspection, it doesn't actually do anything at all because the source files have apparently already been preprocessed, so the sed part can be dropped entirely.

For future reference, I'd assume it'd be 'best practice' (if not cleaner) to invoke the shell script (GUILocaleFix.sh in this case) from within src_prepare() instead of embedding the sed commands in the ebuild.  Please let me know if I'm mistaken.

FYI, the build now installs a Turkish locale (the only non-English translation available at this time) by default...

> +}
> +src_install(){
> +
> +emake DESTDIR="${D}" install
> +
>  }
> 
> This is the default, so it should not be in the ebuild.

Right.  Sorry, it's a 'leftover' from a test.  I did warn it needed a cleanup! ;-)

Thanks!