I won't have gentoo CVS access until Monday at the earliest, so here's an ebuild for ion-devel-20031211, including a few patches from Tuesday's snapshot.

You'll need to:
mkdir -p /usr/local/portage/x11-wm/ion-devel/files
cp ion-devel-20031211.ebuild /usr/local/portage/x11-wm/ion-devel
cp ion-devel-20031211-miscellaneous.patch /usr/local/portage/x11-wm/ion-devel/files
emerge ion-devel


I'm particularly keen to get feedback on the automatic config update code in pkg_config in the ebuild.

Cheers,

Tom
# Copyright 1999-2003 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /home/cvsroot/gentoo-x86/x11-wm/ion-devel/ion-devel-20031121.ebuild,v 1.1 
2003/12/07 16:07:28 twp Exp $

inherit eutils

DESCRIPTION="A tiling tabbed window manager designed with keyboard users in mind"
HOMEPAGE="http://www.iki.fi/tuomov/ion/";
SRC_URI="http://modeemi.fi/~tuomov/dl/${P}.tar.gz";
LICENSE="Clarified-Artistic"
SLOT="0"
KEYWORDS="~alpha ~arm ~hppa ~mips ~ppc ~sparc ~x86"
IUSE="xinerama"
DEPEND="virtual/x11
        app-misc/run-mailcap
        >=dev-lang/lua-5.0.1_beta20031003"
S=${WORKDIR}/${P/_p/-}

src_unpack() {

        unpack ${P}.tar.gz

        cat >${T}/system.mk.patch <<EOP
--- ion-devel-20031211/system.mk        2003-12-11 18:16:16.000000000 +0100
+++ ion-devel/system.mk 2003-12-17 18:05:02.000000000 +0100
@@ -7,7 +7,7 @@
 ## Installation paths
 ##
 
-PREFIX=/usr/local
+PREFIX=/usr
 
 # Unless you are creating a package conforming to some OS's standards, you
 # probably do not want to modify the following directories:
@@ -15,13 +15,13 @@
 # Main binaries
 BINDIR=\$(PREFIX)/bin
 # Configuration .lua files
-ETCDIR=\$(PREFIX)/etc/ion
+ETCDIR=/etc/X11/ion
 # Some .lua files and ion-* shell scripts
 SHAREDIR=\$(PREFIX)/share/ion
 # Manual pages
-MANDIR=\$(PREFIX)/man
+MANDIR=\$(PREFIX)/share/man
 # Some documents
-DOCDIR=\$(PREFIX)/doc/ion
+DOCDIR=\$(PREFIX)/share/doc/${PF}
 # Nothing at the moment
 INCDIR=\$(PREFIX)/include/ion
 # Nothing at the moment
@@ -68,7 +68,7 @@
 
 # If you have installed Lua 5.0 from the official tarball without changing
 # paths, this so do it.
-LUA_DIR=/usr/local
+LUA_DIR=/usr
 LUA_LIBS = -L\$(LUA_DIR)/lib -R\$(LUA_DIR)/lib -llua -llualib
 LUA_INCLUDES = -I\$(LUA_DIR)/include
 LUA=\$(LUA_DIR)/bin/lua
@@ -116,7 +116,7 @@
 # asprintf and vasprintf in the c library. (gnu libc has.)
 # If HAS_SYSTEM_ASPRINTF is not defined, an implementation
 # in sprintf_2.2/ is used.
-#HAS_SYSTEM_ASPRINTF=1
+HAS_SYSTEM_ASPRINTF=1
 
 
 ##
@@ -139,7 +139,7 @@
 # it so it is perhaps better not using anything at all.
 
 # Most systems
-#XOPEN_SOURCE=-ansi -D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
+XOPEN_SOURCE=-D_XOPEN_SOURCE -D_XOPEN_SOURCE_EXTENDED
 # sunos, (irix)
 #XOPEN_SOURCE=-ansi -D__EXTENSIONS__
 
@@ -153,8 +153,8 @@
 # following should optimize function calls to Lua a little.
 #C99_SOURCE=-std=c99 -DCF_HAS_VA_COPY
 
-CFLAGS=-g -Os \$(WARN) \$(DEFINES) \$(INCLUDES) \$(EXTRA_INCLUDES)
-LDFLAGS=-g -Os \$(LIBS) \$(EXTRA_LIBS)
+CFLAGS=${CFLAGS} \$(WARN) \$(DEFINES) \$(INCLUDES) \$(EXTRA_INCLUDES)
+LDFLAGS=${CFLAGS} \$(LIBS) \$(EXTRA_LIBS)
 
 
 ##
EOP
        epatch ${T}/system.mk.patch

        epatch ${FILESDIR}/${P}-miscellaneous.patch

        cd ${S}

        if [ `use xinerama` ]; then
                einfo Enabling Xinerama support
                eend 0
        else
                einfo Disabling Xinerama support
                sed -i system.mk \
                        -e 's/\(XINERAMA_LIBS=-lXinerama\)/#\1/' \
                        -e 's/#\(DEFINES += -DCF_NO_XINERAMA\)/\1/'
                eend $?
        fi

        if has_version '<x11-base/xfree-4.3.0'; then
                einfo Enabling Xfree\<4.3.0/Opera/UTF-8 bug workaround
                eend 0
        else
                einfo Disabling Xfree\<4.3.0/Opera/UTF-8 bug workaround
                sed -i system.mk \
                        -e 's/\(DEFINES += -DCF_XFREE86_TEXTPROP_BUG_WORKAROUND\)/#\1/'
                eend $?
        fi

        if has_version '>=sys-devel/gcc-3'; then
                einfo Enabling Lua function call optimizations
                sed -i system.mk \
                        -e 's/#\(C99_SOURCE=-std=c99 -DCF_HAS_VA_COPY\)/\1/'
                eend $?
        fi

}

src_compile() {
        emake || die
}

src_install() {

        make PREFIX=${D}/usr ETCDIR=${D}/etc/X11/ion install || die

        echo -e "#!/bin/sh\n/usr/bin/ion" > ${T}/ion
        echo -e "#!/bin/sh\n/usr/bin/pwm" > ${T}/pwm
        exeinto /etc/X11/Sessions
        doexe ${T}/ion ${T}/pwm

}

pkg_postinst() {
        einfo "The configuration files have moved and some have been renamed."
        einfo "To remove stale system-wide files and update user configurations run"
        einfo "    ebuild /var/db/pkg/${CATEGORY}/${PF}/${PF}.ebuild config"
}

pkg_config() {

        einfo "Removing stale system-wide configuration files"
        rm -Rf ${R}/etc/X11/ion-devel ${R}/etc/X11/Sessions/ion-devel
        eend 0

        einfo "Updating user configurations..."
        for h in $(cut -d: -f6 ${R}/etc/passwd); do
                if test -d ${R}${h}/.ion-devel; then
                        test -d ${R}${h}/.ion2 && break
                        einfo ${h}
                        cp -a ${R}${h}/.ion-devel ${R}${h}/.ion2
                        for i in ${R}${h}/.ion2/ioncore*.lua; do
                                sed -i ${i} -e 's/ioncore/ion/g'
                                mv ${i} ${i/ioncore/ion}
                        done
                        rm -f ${R}${h}/.ion2/ioncore*.lua
                        eend 0
                fi
        done

}
--- ion-devel-20031211/ion/ion.c        2003-12-09 20:05:34.000000000 +0100
+++ ion/ion/ion.c       2003-12-11 19:03:07.000000000 +0100
@@ -101,7 +101,7 @@
         * but that would mean yet another script...
         */
        mkdir(userdir, 0700);
-       if(open(oldbeard, O_CREAT|O_RDWR)<0)
+       if(open(oldbeard, O_CREAT|O_RDWR, 0600)<0)
                warn_err_obj(oldbeard);
 }
 
--- ion-devel-20031211/ioncore/eventh.c 2003-12-01 20:09:50.000000000 +0100
+++ ion/ioncore/eventh.c        2003-12-14 12:52:23.000000000 +0100
@@ -412,10 +412,10 @@
                return;
 
        do{
-               /*if(eev->mode!=NotifyNormal && !wglobal.warp_enabled)
-            return;*/
+               if(eev->mode!=NotifyNormal && !wglobal.warp_enabled)
+            continue;
                /*if(eev->detail==NotifyNonlinearVirtual)
-                   return;*/
+                   continue;*/
 
                reg=FIND_WINDOW_T(eev->window, WRegion);
                
--- ion-devel-20031211/query/querylib.lua       2003-12-07 23:01:37.000000000 +0100
+++ ion/query/querylib.lua      2003-12-11 22:31:54.000000000 +0100
@@ -152,20 +152,23 @@
 -- Parameter & Description \\
 -- \hline
 -- \var{prompt} & The prompt \\
--- \var{init} & A function that returns initial input when called. \\
+-- \var{dflt} & Default value to call \var{prog} with \\
 -- \var{prog} & Program name or a function that returns it when called. \\
 -- \var{completor} & A completor function. \\
 -- \end{tabularx}
-function querylib.make_execwith_fn(prompt, init, prog, completor)
+function querylib.make_execwith_fn(prompt, dflt, prog, completor)
     local function handle_execwith(frame, str)
         local p, err=getprog(prog)
         if p then
+            if not str or str=="" then
+                str=dflt
+            end
             exec_in(frame, p.." "..string.shell_safe(str))
         else
             query_fwarn(frame, err)
         end
     end
-    return querylib.make_frame_fn(prompt, init, handle_execwith, completor)
+    return querylib.make_frame_fn(prompt, nil, handle_execwith, completor)
 end
 
 --DOC
@@ -554,7 +557,7 @@
 --}
 --\end{verbatim}
 querylib.query_man=querylib.make_execwith_fn(
-    "Manual page (ion):", nil,
+    "Manual page (ion):", "ion",
     querylib.make_script_lookup_fn("ion-man"),
     querylib.man_completor
 )

Reply via email to