Skip to content

Commit

Permalink
app-editors/scite: Tidy ebuild
Browse files Browse the repository at this point in the history
- 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

Package-Manager: Portage-2.3.13, Repoman-2.3.3
  • Loading branch information
cjmayo committed Nov 14, 2017
1 parent bd8c9a5 commit 192f34a
Showing 1 changed file with 18 additions and 25 deletions.
43 changes: 18 additions & 25 deletions app-editors/scite/scite-4.0.2.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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} #" \
Expand All @@ -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
Expand All @@ -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)" \
Expand All @@ -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
Expand Down

0 comments on commit 192f34a

Please sign in to comment.