Gmail Notifier is a Linux/Windows alternative for the notifier program released by Google, it is written in Python and provides an attractive and simple way to check for new mail messages. gmail-notify provides a linux-depend pytrayicon library. To run gmail-notify on FreeBSD, I have included the source code of this library to build it locally.
I'm not sure for ${FILESDIR}/eggtrayicon dir. From Makefile: # Gmail-notify provides a linux-depend library for trayicon # We provide its source code to compile it locally. Who are 'we'? And where do you get the code? -- Sem.
Second: the port use py-gtk, but has no dependency on it: pygtk-codegen-2.0 --prefix pytrayicon \ --register /usr/local/share/pygtk/2.0/defs//gdk-types.defs \ --register /usr/local/share/pygtk/2.0/defs//gtk-types.defs \ --override trayicon.override \ trayicon.defs > trayicon.c pygtk-codegen-2.0: not found gmake: *** [trayicon.c] Error 127 *** Error code 2 Stop in /usr/home/sem/prs/gmail-notify. -- Sem.
I found this code while searching how to compile a trayicon library for python. There is an article on this subject at IBM http://www-106.ibm.com/developerworks/linux/library/l-wrap/ Their code does not work anymore but I found modified versions. However URLs which provide these source codes are not usable (html web pages, forum messages). I thought later that I can provide diff files from the original source code instead of a directory, but size of the directory (30ko) is only twice the size of diff files (13 ko) so ... I can use py-gnome-extras (available since 31 may 2005) which seems to provide this library. But it requires to install a lot of things for only a small function ... What do you suggests ? -- David On 6/20/05, Sergey Matveychuk <sem@freebsd.org> wrote: > I'm not sure for ${FILESDIR}/eggtrayicon dir. > From Makefile: > # Gmail-notify provides a linux-depend library for trayicon > # We provide its source code to compile it locally. >=20 > Who are 'we'? And where do you get the code? > -- > Sem. >
Maybe it's because I wrote RUN_DEPENDS instead of BUILD_DEPENDS. On 6/20/05, Sergey Matveychuk <sem@freebsd.org> wrote: > Second: the port use py-gtk, but has no dependency on it: > pygtk-codegen-2.0 --prefix pytrayicon \ > --register /usr/local/share/pygtk/2.0/defs//gdk-types.defs \ > --register /usr/local/share/pygtk/2.0/defs//gtk-types.defs \ > --override trayicon.override \ > trayicon.defs > trayicon.c > pygtk-codegen-2.0: not found > gmake: *** [trayicon.c] Error 127 > *** Error code 2 >=20 > Stop in /usr/home/sem/prs/gmail-notify. >=20 > -- > Sem. >
David Julien wrote: > I found this code while searching how to compile a trayicon library > for python. There is an article on this subject at IBM > http://www-106.ibm.com/developerworks/linux/library/l-wrap/ > > Their code does not work anymore but I found modified versions. > However URLs which provide these source codes are not usable (html web > pages, forum messages). > > I thought later that I can provide diff files from the original source > code instead of a directory, but size of the directory (30ko) is only > twice the size of diff files (13 ko) so ... We should be sure about license here. > > I can use py-gnome-extras (available since 31 may 2005) which seems to > provide this library. But it requires to install a lot of things for > only a small function ... > > What do you suggests ? We can do a little trick here: BUILD_DEPENDS= ${NONEXISTENT}:${PORTSDIR}x11-toolkits/py-gnome-extras:patch (or extract here) ${CP} ${WRKDIR}/../../../x11-toolkits/py-gnome-extras/work/what_we_want ${WRKSRC} It's hacky, but clean. -- Sem.
David Julien wrote: > Maybe it's because I wrote RUN_DEPENDS instead of BUILD_DEPENDS. The best way is: USE_GNOME= pygtk -- Sem.
OK. I made a new version according to your suggestion. They use approximately the same code. I just have to include a specific Makefile and some patches. Do I have to open a new PR or can I include here a new shar file to replace the first one ? -- David
Here is a new shar. I hope it will arrive correctly formated. -- David # This is a shell archive. Save it in a file, remove anything before # this line, and then unpack it by entering "sh file". Note, it may # create directories; files and directories will be owned by you and # have default permissions. # # This archive contains: # # gmail-notify # gmail-notify/Makefile # gmail-notify/distinfo # gmail-notify/pkg-descr # gmail-notify/pkg-plist # gmail-notify/files # gmail-notify/files/patch-GmailConfig.py # gmail-notify/files/patch-notifier.py # gmail-notify/files/patch-langs.xml # gmail-notify/files/patch-notifier.conf.sample # gmail-notify/files/Makefile # gmail-notify/files/gmail-notifier # gmail-notify/files/config.h # echo c - gmail-notify mkdir -p gmail-notify > /dev/null 2>&1 echo x - gmail-notify/Makefile sed 's/^X//' >gmail-notify/Makefile << 'END-of-gmail-notify/Makefile' X# New ports collection makefile for: gmail-notify X# Date created: 07 June 2005 X# Whom: David X# X# $FreeBSD$ X# X XPORTNAME= gmail-notify XPORTVERSION= 1.6 XCATEGORIES= mail python XMASTER_SITES= ${MASTER_SITE_SOURCEFORGE} XMASTER_SITE_SUBDIR= ${PORTNAME} X XMAINTAINER= djulien.bsd@gmail.com XCOMMENT= GMail Notifier X XBUILD_DEPENDS= ${NONEXISTENT}:${PORTSDIR}/x11-toolkits/py-gnome-extras:extract X XUSE_GNOME= pygtk2 XUSE_PYTHON= yes XUSE_REINPLACE= yes XUSE_GMAKE= yes X XWRKSRC= ${WRKDIR}/${DISTNAME} X XGMAIL_EXTRA_PATH=${PORTSDIR}/x11-toolkits/py-gnome-extras/work/gnome-python-extras-2.10.2/egg/tray X Xpre-configure: X ${CP} ${GMAIL_EXTRA_PATH}/eggtrayicon.[ch] ${GMAIL_EXTRA_PATH}/trayicon* ${WRKSRC} X ${CP} ${FILESDIR}/gmail-notifier ${FILESDIR}/config.h ${FILESDIR}/Makefile ${WRKSRC} X ${RM} ${WRKSRC}/pytrayicon.so X Xdo-install: X ${MKDIR} ${DATADIR} X ${REINPLACE_CMD} -e 's,@DATADIR@,${DATADIR},g' ${WRKSRC}/gmail-notifier X ${INSTALL_SCRIPT} ${WRKSRC}/gmail-notifier ${PREFIX}/bin/ X ${INSTALL_DATA} ${WRKSRC}/*.py ${DATADIR} X ${INSTALL_DATA} ${WRKSRC}/*.pyc ${DATADIR} X ${INSTALL_DATA} ${WRKSRC}/*.png ${DATADIR} X ${INSTALL_DATA} ${WRKSRC}/*.jpg ${DATADIR} X ${INSTALL_DATA} ${WRKSRC}/*.so ${DATADIR} X ${INSTALL_DATA} ${WRKSRC}/README ${DATADIR} X ${INSTALL_DATA} ${WRKSRC}/langs.xml ${DATADIR} X X.include <bsd.port.mk> END-of-gmail-notify/Makefile echo x - gmail-notify/distinfo sed 's/^X//' >gmail-notify/distinfo << 'END-of-gmail-notify/distinfo' XMD5 (gmail-notify-1.6.tar.gz) = 1d448d3c4423dd1b5d4cdad10279b974 XSIZE (gmail-notify-1.6.tar.gz) = 57214 END-of-gmail-notify/distinfo echo x - gmail-notify/pkg-descr sed 's/^X//' >gmail-notify/pkg-descr << 'END-of-gmail-notify/pkg-descr' XGmail Notifier is a Linux/Windows alternative for the notifier program released Xby Google. It is written in Python and provides an attractive and simple way to Xcheck for new mail messages. X XWWW: http://sourceforge.net/projects/gmail-notify X X- David X <djulien.bsd@gmail.com> END-of-gmail-notify/pkg-descr echo x - gmail-notify/pkg-plist sed 's/^X//' >gmail-notify/pkg-plist << 'END-of-gmail-notify/pkg-plist' Xbin/gmail-notifier X%%DATADIR%%/GmailConfig.py X%%DATADIR%%/GmailConfig.pyc X%%DATADIR%%/GmailPopupMenu.py X%%DATADIR%%/GmailPopupMenu.pyc X%%DATADIR%%/README X%%DATADIR%%/constants.py X%%DATADIR%%/constants.pyc X%%DATADIR%%/gmail-notify-icon.png X%%DATADIR%%/background.jpg X%%DATADIR%%/icon.jpg X%%DATADIR%%/icon.png X%%DATADIR%%/icon2.jpg X%%DATADIR%%/icon2.png X%%DATADIR%%/langs.xml X%%DATADIR%%/libgmail.py X%%DATADIR%%/libgmail.pyc X%%DATADIR%%/mkconstants.py X%%DATADIR%%/notifier.py X%%DATADIR%%/trayicon.so X%%DATADIR%%/xmllangs.py X%%DATADIR%%/xmllangs.pyc X@dirrm %%DATADIR%% END-of-gmail-notify/pkg-plist echo c - gmail-notify/files mkdir -p gmail-notify/files > /dev/null 2>&1 echo x - gmail-notify/files/patch-GmailConfig.py sed 's/^X//' >gmail-notify/files/patch-GmailConfig.py << 'END-of-gmail-notify/files/patch-GmailConfig.py' X*** GmailConfig.py.orig Tue May 3 10:02:32 2005 X--- GmailConfig.py Tue Jun 7 15:27:30 2005 X*************** X*** 18,24 **** X configElements = None X X # Declare global variables for configuration as dictionary X! options = { "gmailusername":None, "gmailpassword":None, "browserpath":"firefox", "lang":"English", X "voffset":0, "hoffset":0, "checkinterval":20000, X "animationdelay":15, "popuptimespan":5000} X X--- 18,24 ---- X configElements = None X X # Declare global variables for configuration as dictionary X! options = { "gmailusername":None, "gmailpassword":None, "browserpath":"firefox", "lang":"English", "actionpath":"play", X "voffset":0, "hoffset":0, "checkinterval":20000, X "animationdelay":15, "popuptimespan":5000} X X*************** X*** 36,43 **** X self.window.set_title( self.lang.get_string(1) ) X self.window.set_border_width( 5 ) X self.window.set_position( gtk.WIN_POS_CENTER ) X! self.window.set_modal( gtk.TRUE ) X! self.window.set_resizable(gtk.FALSE) X icon = gtk.gdk.pixbuf_new_from_file(ICON_PATH) X gtk.window_set_default_icon_list( (icon) ) X X--- 36,43 ---- X self.window.set_title( self.lang.get_string(1) ) X self.window.set_border_width( 5 ) X self.window.set_position( gtk.WIN_POS_CENTER ) X! self.window.set_modal( True ) X! self.window.set_resizable(False) X icon = gtk.gdk.pixbuf_new_from_file(ICON_PATH) X gtk.window_set_default_icon_list( (icon) ) X X*************** X*** 49,54 **** X--- 49,55 ---- X ["gmailusername",2,None,None], X ["gmailpassword",22,None,None], X ["browserpath",3,None,None], X+ ["actionpath",99,None,None], X ["voffset",28,None,None], X ["hoffset",27,None,None], X ["checkinterval",31,None,None], X*************** X*** 57,63 **** X ] X X # Create table and attach to window X! table = gtk.Table( rows=11, columns=2, homogeneous=gtk.FALSE ) X X self.window.add(table) X X--- 58,64 ---- X ] X X # Create table and attach to window X! table = gtk.Table( rows=12, columns=2, homogeneous=False ) X X self.window.add(table) X X*************** X*** 74,80 **** X textbox.set_text( str( self.options[curVar] ) ) X X if ( curVar == "gmailpassword" ): X! textbox.set_visibility( gtk.FALSE ) X textbox.set_invisible_char( '*' ) X X # Store widget in element array X--- 75,81 ---- X textbox.set_text( str( self.options[curVar] ) ) X X if ( curVar == "gmailpassword" ): X! textbox.set_visibility( False ) X textbox.set_invisible_char( '*' ) X X # Store widget in element array X*************** X*** 109,120 **** X X X if ( self.readLoginFromFile ): X! self.savePassword.set_active( gtk.TRUE ) X else: X! self.savePassword.set_active( gtk.FALSE ) X X self.savePassword.show() X! table.attach( alignment, 0, 2, 9, 10 ) X alignment.show() X X # Add combobox to select language X--- 110,121 ---- X X X if ( self.readLoginFromFile ): X! self.savePassword.set_active( True ) X else: X! self.savePassword.set_active( False ) X X self.savePassword.show() X! table.attach( alignment, 0, 2, 10, 11 ) X alignment.show() X X # Add combobox to select language X*************** X*** 129,142 **** X self.cbo_langs.append_text( one_lang.get_name()) X self.cbo_langs.set_active(0) X # Attach combobox and label X! table.attach( self.lbl_langs, 0, 1, 8, 9 ) X self.lbl_langs.show() X! table.attach( self.cbo_langs, 1, 2, 8, 9, ypadding=5 ) X self.cbo_langs.show() X X # Add 'Close' button X button = gtk.Button( stock=gtk.STOCK_OK ) X! table.attach( button, 0, 2, 10, 11, ypadding=2 ) X button.connect( "clicked", self.onOkay ) X button.show() X X--- 130,143 ---- X self.cbo_langs.append_text( one_lang.get_name()) X self.cbo_langs.set_active(0) X # Attach combobox and label X! table.attach( self.lbl_langs, 0, 1, 9, 10 ) X self.lbl_langs.show() X! table.attach( self.cbo_langs, 1, 2, 9, 10, xpadding=0, ypadding=5 ) X self.cbo_langs.show() X X # Add 'Close' button X button = gtk.Button( stock=gtk.STOCK_OK ) X! table.attach( button, 0, 2, 11, 12, xpadding=0, ypadding=2 ) X button.connect( "clicked", self.onOkay ) X button.show() X X*************** X*** 206,212 **** X def onDelete( self, widget, data=None ): X gtk.main_quit() X self.hide() X! return gtk.TRUE X X def onOkay( self, widget, callback_data=None ): X errorString = "" X--- 207,213 ---- X def onDelete( self, widget, data=None ): X gtk.main_quit() X self.hide() X! return True X X def onOkay( self, widget, callback_data=None ): X errorString = "" END-of-gmail-notify/files/patch-GmailConfig.py echo x - gmail-notify/files/patch-notifier.py sed 's/^X//' >gmail-notify/files/patch-notifier.py << 'END-of-gmail-notify/files/patch-notifier.py' X*** notifier.py.orig Tue May 3 10:02:33 2005 X--- notifier.py Thu Jun 23 23:30:03 2005 X*************** X*** 7,13 **** X import time X import libgmail X import os X! import pytrayicon X import sys X import warnings X import ConfigParser X--- 7,13 ---- X import time X import libgmail X import os X! import trayicon X import sys X import warnings X import ConfigParser X*************** X*** 82,88 **** X self.popuptimer=0 X self.waittimer=0 X # Create the tray icon object X! self.tray = pytrayicon.TrayIcon(self.lang.get_string(21)); X self.eventbox = gtk.EventBox() X self.tray.add(self.eventbox) X self.eventbox.connect("button_press_event", self.tray_icon_clicked) X--- 82,88 ---- X self.popuptimer=0 X self.waittimer=0 X # Create the tray icon object X! self.tray = trayicon.TrayIcon(self.lang.get_string(21)); X self.eventbox = gtk.EventBox() X self.tray.add(self.eventbox) X self.eventbox.connect("button_press_event", self.tray_icon_clicked) X*************** X*** 205,210 **** X--- 205,211 ---- X self.imageicon = gtk.Image() X X if attrs[1]>0: X+ os.system(self.options['actionpath']+" &") X print str(attrs[1])+" new messages" X sender = attrs[2] X subject= attrs[3] END-of-gmail-notify/files/patch-notifier.py echo x - gmail-notify/files/patch-langs.xml sed 's/^X//' >gmail-notify/files/patch-langs.xml << 'END-of-gmail-notify/files/patch-langs.xml' X*** langs.xml.orig Tue May 3 10:02:33 2005 X--- langs.xml Tue Jun 7 15:28:53 2005 X*************** X*** 33,38 **** X--- 33,39 ---- X <string id="32">Conns time span</string> X <string id="33">Some value is missing</string> X <string id="34">Save username and password</string> X+ <string id="99" >Action path:</string> X </lang> X <lang name="Español"> X <string id="1" >Configuración de Gmail Notifier</string> X*************** X*** 67,71 **** X--- 68,73 ---- X <string id="32">Intervalo e/conexiones</string> X <string id="33">Falta completar algún valor</string> X <string id="34">Guardar nombre de usuario y contraseña</string> X+ <string id="99" >Acción</string> X </lang> X </langs> END-of-gmail-notify/files/patch-langs.xml echo x - gmail-notify/files/patch-notifier.conf.sample sed 's/^X//' >gmail-notify/files/patch-notifier.conf.sample << 'END-of-gmail-notify/files/patch-notifier.conf.sample' X*** notifier.conf.sample.ori Tue Jun 7 13:29:16 2005 X--- notifier.conf.sample Tue Jun 7 13:35:44 2005 X*************** X*** 7,12 **** X--- 7,14 ---- X X browserpath="your_browser_path" X X+ actionpath="action_to_do_when_new_mails" X+ X voffset=48 X hoffset=128 X END-of-gmail-notify/files/patch-notifier.conf.sample echo x - gmail-notify/files/Makefile sed 's/^X//' >gmail-notify/files/Makefile << 'END-of-gmail-notify/files/Makefile' X# Makefile to build trayicon.so X XCFLAGS = `pkg-config --cflags gtk+-2.0 pygtk-2.0` -I${PREFIX}/include/python2.4/ -I. -Wall -I${PREFIX}/share/pygtk/2.0 -I${PREFIX}/libdata/pkgconfig -DEGG_COMPILATION XLDFLAGS = `pkg-config --libs gtk+-2.0 pygtk-2.0` X XDEFS_DIR= ${PREFIX}/share/pygtk/2.0/defs/ X XCODEGEN = pygtk-codegen-2.0 X Xall: trayicon.so X Xtrayicon.so: trayicon.o eggtrayicon.o trayiconmodule.o X $(CC) $(LDFLAGS) -shared $^ -o $@ X Xtrayicon.c: trayicon.defs eggtrayicon.h trayicon.override X $(CODEGEN) --prefix pytrayicon \ X --register $(DEFS_DIR)/gdk-types.defs \ X --register $(DEFS_DIR)/gtk-types.defs \ X --override trayicon.override \ X trayicon.defs > $@ X Xclean: X rm -f *.o *.so trayicon.c *~ END-of-gmail-notify/files/Makefile echo x - gmail-notify/files/gmail-notifier sed 's/^X//' >gmail-notify/files/gmail-notifier << 'END-of-gmail-notify/files/gmail-notifier' X#! /bin/sh X# Launch notifier X# X# David <djulien.bsd@gmail.com> Xcd @DATADIR@ ; python notifier.py END-of-gmail-notify/files/gmail-notifier echo x - gmail-notify/files/config.h sed 's/^X//' >gmail-notify/files/config.h << 'END-of-gmail-notify/files/config.h' X/* X * This file is empty. eggtrayicon.c includes a <config.h> even if it appears to X * be useless. X * X * David <djulien.bsd@gmail.com> X */ END-of-gmail-notify/files/config.h exit
All tabs was broken with spaces. -- Sem.
I hope it will work better this time -- David
State Changed From-To: open->closed New port added, thank you!