app-editors/scite: Tidy ebuild
authorChris Mayo <aklhfex@gmail.com>
Thu, 16 Nov 2017 19:27:12 +0000 (19:27 +0000)
committerJonas Stein <jstein@gentoo.org>
Thu, 16 Nov 2017 22:10:20 +0000 (23:10 +0100)
- eutils.eclass not needed
- one sed not two for gtk/makefile
- consistent sed paths and error messages
- Encoding now removed from desktop file
- ensure variable declared in src_compile is local
- dodir's in src_install not needed

Closes: https://bugs.gentoo.org/637518

Package-Manager: Portage-2.3.13, Repoman-2.3.3

app-editors/scite/scite-4.0.2.ebuild

index e8a034593e4bfb086670a7c8ed75636a8767dfd0..0134016bc35c798f0fdd5b2c3672012a6fbe7e8d 100644 (file)
@@ -3,7 +3,7 @@
 
 EAPI=6
 
-inherit toolchain-funcs eutils flag-o-matic gnome2-utils xdg-utils
+inherit toolchain-funcs flag-o-matic gnome2-utils xdg-utils
 
 MY_PV=${PV//./}
 DESCRIPTION="A very powerful, highly configurable, small editor with syntax
@@ -35,25 +35,10 @@ src_prepare() {
                -e "s#^CC =\(.*\)#CC = $(tc-getCXX)#" \
                -e "s#^CCOMP =\(.*\)#CCOMP = $(tc-getCC)#" \
                -e "s#-Os##" \
-               || die "error patching /scintilla/gtk/makefile"
-
-       sed -i "${WORKDIR}/scite/gtk/makefile" \
-               -e "s#-rdynamic#-rdynamic ${LDFLAGS}#" \
-               || die "error patching /scite/gtk/makefile"
-
-       #  add the ebuild suffix as shell type for working with ebuilds
-       sed -i "${WORKDIR}/scite/src/perl.properties" \
-               -e "s#\*.sh;\*.bsh;#\*.ebuild;\*.sh;\*.bsh;#" \
-               || die "error patching /scite/src/perl.prperties"
-
-       # repair and enhance the .desktop file
-       sed -i "${WORKDIR}/scite/gtk/SciTE.desktop" \
-               -e "s/^Encoding/#Encoding/" \
-               -e "s#text/plain#text/\*;application/xhtml+xml#" \
-               -e "s#^Categories=\(.*\)#Categories=Development;#" \
-               || die "error patching /scite/gtk/SciTe.desktop"
+               || die "error patching scintilla/gtk/makefile"
 
        sed -i "${S}/makefile" \
+               -e "s#-rdynamic#-rdynamic ${LDFLAGS}#" \
                -e 's#usr/local#usr#g' \
                -e 's#/gnome/apps/Applications#/applications#' \
                -e "s#^CXXFLAGS=#CXXFLAGS=${CXXFLAGS} #" \
@@ -63,7 +48,18 @@ src_prepare() {
                -e 's#${D}##' \
                -e 's#-g root#-g 0#' \
                -e "s#-Os##" \
-               || die "error patching gtk/makefile"
+               || die "error patching scite/gtk/makefile"
+
+       # repair and enhance the .desktop file
+       sed -i "${S}/SciTE.desktop" \
+               -e "s#text/plain#text/\*;application/xhtml+xml#" \
+               -e "s#^Categories=\(.*\)#Categories=Development;#" \
+               || die "error patching scite/gtk/SciTe.desktop"
+
+       #  add the ebuild suffix as shell type for working with ebuilds
+       sed -i "${WORKDIR}/scite/src/perl.properties" \
+               -e "s#\*.sh;\*.bsh;#\*.ebuild;\*.sh;\*.bsh;#" \
+               || die "error patching scite/src/perl.properties"
 
        # it seems that pwd here is ${S}, but user patches are relative to ${workdir}
        # Bug #576162
@@ -74,10 +70,10 @@ src_prepare() {
 
 src_compile() {
        # prepare make options
-       emake_pars="GTK3=1"
+       local emake_pars="GTK3=1"
        if ! use lua; then
                emake_pars+=" NO_LUA=1"
-       fi;
+       fi
 
        emake CC="$(tc-getCC)" LD="$(tc-getLD)" \
                        LDFLAGS="$(raw-ldflags)" AR="$(tc-getAR)" \
@@ -86,14 +82,11 @@ src_compile() {
 }
 
 src_install() {
-       dodir /usr/bin
-       dodir /usr/share/{pixmaps,applications}
-
        emake DESTDIR="${ED}" install
 
        # we have to keep this because otherwise it'll break upgrading
        mv "${ED}/usr/bin/SciTE" "${ED}/usr/bin/scite" || die
-       dosym "scite" "/usr/bin/SciTE"
+       dosym scite /usr/bin/SciTE
 
        doman ../doc/scite.1
        dodoc ../README