Remove MacOS GUI related calls (#298698)
authorStanislav Ochotnicky <sochotnicky@gentoo.org>
Fri, 18 Jun 2010 21:10:52 +0000 (21:10 +0000)
committerStanislav Ochotnicky <sochotnicky@gentoo.org>
Fri, 18 Jun 2010 21:10:52 +0000 (21:10 +0000)
Package-Manager: portage-2.1.8.3/cvs/Linux i686

net-p2p/phex/ChangeLog
net-p2p/phex/Manifest
net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch [new file with mode: 0644]
net-p2p/phex/phex-3.2.0.102-r1.ebuild [new file with mode: 0644]

index 5841b8e88765453667738cd94e0cf1d746b5f7db..e24429c22a59a7af0b74331ff59e245dd9775f4e 100644 (file)
@@ -1,6 +1,12 @@
 # ChangeLog for net-p2p/phex
-# Copyright 1999-2008 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/net-p2p/phex/ChangeLog,v 1.14 2008/01/22 22:09:48 betelgeuse Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/phex/ChangeLog,v 1.15 2010/06/18 21:10:52 sochotnicky Exp $
+
+*phex-3.2.0.102-r1 (18 Jun 2010)
+
+  18 Jun 2010; Stanislav Ochotnicky <sochotnicky@gentoo.org>
+  +files/0001-Remove-MacOS-GUI-references.patch, +phex-3.2.0.102-r1.ebuild:
+  Remove MacOS GUI related calls (#298698)
 
   22 Jan 2008; Petteri Räty <betelgeuse@gentoo.org> phex-3.2.0.102.ebuild:
   Migrate to EAPI=1 slot deps.
index dd35d13252a94f38b5e491e5c1248580b5bb2483..371981338002bb97fec70dcee7cbdb88eca49da3 100644 (file)
@@ -1,5 +1,7 @@
+AUX 0001-Remove-MacOS-GUI-references.patch 9676 RMD160 593c38ed333fa183ed68bb993372b701bd02616d SHA1 0ebf3c1600f6a917013ae50a18ebd56da0454016 SHA256 88c8a4ad4a475f74eb6608bcab77b7ca4413c3dd3ac1036110ca7ffe933f42b7
 AUX phex-3.0.0.99.sh 350 RMD160 5a765fd7949407bf56bc2475921c0d163f7e8989 SHA1 bf7be4177fc77e18a1fb3d04ed9f2da63c572efc SHA256 169579d431b2eecfd2de9a711d4c9c6fc6838b9066e4ab73f7060d7a6aca5ddc
 DIST phex_3.2.0.102_src.zip 5416827 RMD160 6c9e359aac0b1786333b25f20699a4e6bd61a782 SHA1 0ab7974309375f1e69e6cdc242eaf63eec7b0d58 SHA256 e5b6316a3e60c68949ca33321804ae9473858f7d65d5fb59275a4f0e7a64eda9
+EBUILD phex-3.2.0.102-r1.ebuild 1808 RMD160 9393c5bcdcfb42242ab217763581daa11207da97 SHA1 1ac625a6bf9d70b8f31ef75596e8b6f4a3d5ef11 SHA256 5ad390c6e82ba75ce2db5bb3d6bc126f993041065c09bb0350965a41a3b9e0d7
 EBUILD phex-3.2.0.102.ebuild 1901 RMD160 f4d586815ce8b17845aee07a539664339f419d25 SHA1 9542eff32a52645cea342b07ec1c9cfd1257c3a8 SHA256 ed8a88b7343bc72356e29261f33a92a246926db6196ee7178d4092a93650a5a6
-MISC ChangeLog 2429 RMD160 da50bd6ad7d85e9e3c45fa310498e5e2c00ac1fe SHA1 13860d6139cfaafd896d0512d7742f441501c43b SHA256 5aa6178c62569871a5e38dd076df3d84f0d4cada2544da6b1ed69bc23d8becdc
+MISC ChangeLog 2645 RMD160 dfb7b880a511627e3997509d413447ac2efd38ff SHA1 515f933a3d2d26a9ed7bf27c42c12897680f4210 SHA256 16eff287506fc4d9ae24009f2dac1240ce3bce8d06fde1f3148781815fb4fa03
 MISC metadata.xml 178 RMD160 762e91a039aed240aa7272e8be70f778d701e15f SHA1 2b364810ae0765d67cdde794f001cceede7e3b93 SHA256 7f865bd96e898370f7e6181794cd523e888a60371a1536ce422ff1f2b4b7db23
diff --git a/net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch b/net-p2p/phex/files/0001-Remove-MacOS-GUI-references.patch
new file mode 100644 (file)
index 0000000..06791af
--- /dev/null
@@ -0,0 +1,261 @@
+From 49f223f74e5557321afdefebd48cdec4f625b97d Mon Sep 17 00:00:00 2001
+From: Stanislav Ochotnicky <sochotnicky@gmail.com>
+Date: Fri, 18 Jun 2010 23:01:32 +0200
+Subject: [PATCH] Remove MacOS GUI references
+
+---
+ src/phex/gui/common/FileDialogHandler.java |   45 +---------
+ src/phex/gui/common/GUIRegistry.java       |    5 -
+ src/phex/gui/macosx/MacOsxGUIUtils.java    |  140 ----------------------------
+ 3 files changed, 2 insertions(+), 188 deletions(-)
+ delete mode 100644 src/phex/gui/macosx/MacOsxGUIUtils.java
+
+diff --git a/src/phex/gui/common/FileDialogHandler.java b/src/phex/gui/common/FileDialogHandler.java
+index a5ee4f7..530f374 100644
+--- a/src/phex/gui/common/FileDialogHandler.java
++++ b/src/phex/gui/common/FileDialogHandler.java
+@@ -34,7 +34,6 @@ import javax.swing.filechooser.FileFilter;
+ \r
+ import org.apache.commons.lang.SystemUtils;\r
+ \r
+-import phex.gui.macosx.MacOsxGUIUtils;\r
+ import phex.utils.DirectoryOnlyFileFilter;\r
+ \r
+ public class FileDialogHandler\r
+@@ -45,7 +44,7 @@ public class FileDialogHandler
+     {\r
+         if ( SystemUtils.IS_OS_MAC_OSX )\r
+         {\r
+-            return openMacDirectoryChooser( title, null, null );\r
++            return null;\r
+         }\r
+         else\r
+         {\r
+@@ -71,10 +70,7 @@ public class FileDialogHandler
+     {\r
+         if ( SystemUtils.IS_OS_MAC_OSX )\r
+         {\r
+-            return new File[]\r
+-            {\r
+-                openMacDirectoryChooser( title, notifyPopupTitle, notifyPopupShortMessage )\r
+-            };\r
++            return null;\r
+         }\r
+         else\r
+         {\r
+@@ -85,43 +81,6 @@ public class FileDialogHandler
+         }\r
+     }\r
+     \r
+-    private static File openMacDirectoryChooser( String title,\r
+-        String notifyPopupTitle, String notifyPopupShortMessage )\r
+-    {\r
+-        // create folder dialog through other class this prevents \r
+-        // NoClassDefFoundError on Windows systems since the import of the\r
+-        // required OS X classes is elsewhere.\r
+-        FileDialog dia = MacOsxGUIUtils.createFolderDialog(); \r
+-        dia.setTitle(title);\r
+-        \r
+-        // unfortunatly its not possible to display notification popup\r
+-        // besides heavy weight dialog.\r
+-        //if ( notifyPopupTitle != null || notifyPopupShortMessage != null )\r
+-        //{\r
+-            //displayMacNotificationPopup( dia, notifyPopupTitle, \r
+-            //    notifyPopupShortMessage );\r
+-        //}\r
+-        \r
+-        DirectoryOnlyFileFilter filter = new DirectoryOnlyFileFilter();\r
+-        dia.setFilenameFilter( new FileFilterWrapper(\r
+-            filter) );\r
+-        dia.setVisible( true );\r
+-        String dirStr = dia.getDirectory();\r
+-        String fileStr = dia.getFile();\r
+-        \r
+-        if( dirStr == null || fileStr == null )\r
+-        {\r
+-            return null;\r
+-        }\r
+-        File file = new File(dirStr, fileStr);\r
+-        // validate filter\r
+-        if( !filter.accept(file) )\r
+-        {\r
+-            return null;\r
+-        }\r
+-        return file;\r
+-    }\r
+-    \r
+     private static JFileChooser initDefaultChooser( String title,\r
+         String approveBtnText, char approveBtnMnemonic, FileFilter filter,\r
+         int mode, File currentDirectory, String notifyPopupTitle,\r
+diff --git a/src/phex/gui/common/GUIRegistry.java b/src/phex/gui/common/GUIRegistry.java
+index 852722e..3c28f2e 100644
+--- a/src/phex/gui/common/GUIRegistry.java
++++ b/src/phex/gui/common/GUIRegistry.java
+@@ -47,7 +47,6 @@ import phex.gui.actions.FWAction;
+ import phex.gui.actions.NewDownloadAction;\r
+ import phex.gui.actions.SwitchNetworkAction;\r
+ import phex.gui.chat.ChatFrameManager;\r
+-import phex.gui.macosx.MacOsxGUIUtils;\r
+ import phex.gui.prefs.InterfacePrefs;\r
+ import phex.update.UpdateCheckRunner;\r
+ import phex.utils.Localizer;\r
+@@ -119,10 +118,6 @@ public final class GUIRegistry implements GUIRegistryConstants
+             }\r
+         }\r
+         \r
+-        if ( SystemUtils.IS_OS_MAC_OSX )\r
+-        {\r
+-            MacOsxGUIUtils.installEventHandlers();\r
+-        }\r
+         initializeGlobalActions();\r
+         chatFrameManager = new ChatFrameManager();\r
+         try \r
+diff --git a/src/phex/gui/macosx/MacOsxGUIUtils.java b/src/phex/gui/macosx/MacOsxGUIUtils.java
+deleted file mode 100644
+index bc6f1d9..0000000
+--- a/src/phex/gui/macosx/MacOsxGUIUtils.java
++++ /dev/null
+@@ -1,140 +0,0 @@
+-/*\r
+- *  PHEX - The pure-java Gnutella-servent.\r
+- *  Copyright (C) 2001 - 2006 Phex Development Group\r
+- *\r
+- *  This program is free software; you can redistribute it and/or modify\r
+- *  it under the terms of the GNU General Public License as published by\r
+- *  the Free Software Foundation; either version 2 of the License, or\r
+- *  (at your option) any later version.\r
+- *\r
+- *  This program is distributed in the hope that it will be useful,\r
+- *  but WITHOUT ANY WARRANTY; without even the implied warranty of\r
+- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\r
+- *  GNU General Public License for more details.\r
+- *\r
+- *  You should have received a copy of the GNU General Public License\r
+- *  along with this program; if not, write to the Free Software\r
+- *  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA\r
+- * \r
+- *  Created on 28.08.2005\r
+- *  --- CVS Information ---\r
+- *  $Id: 0001-Remove-MacOS-GUI-references.patch,v 1.1 2010/06/18 21:10:52 sochotnicky Exp $\r
+- */\r
+-package phex.gui.macosx;\r
+-\r
+-import java.awt.FileDialog;\r
+-import java.awt.event.ActionEvent;\r
+-import java.awt.event.ActionListener;\r
+-import java.io.File;\r
+-\r
+-import net.roydesign.event.ApplicationEvent;\r
+-import net.roydesign.mac.MRJAdapter;\r
+-import net.roydesign.ui.FolderDialog;\r
+-import phex.gui.actions.ExitPhexAction;\r
+-import phex.gui.actions.NewDownloadAction;\r
+-import phex.gui.common.GUIRegistry;\r
+-import phex.gui.dialogs.AboutDialog;\r
+-import phex.gui.dialogs.options.OptionsDialog;\r
+-import phex.utils.NLogger;\r
+-import phex.utils.NLoggerNames;\r
+-\r
+-public class MacOsxGUIUtils\r
+-{\r
+-    public static final void installEventHandlers()\r
+-    {\r
+-        MRJAdapter.addQuitApplicationListener( new ActionListener()\r
+-        {\r
+-            public void actionPerformed( ActionEvent evt )\r
+-            {\r
+-                try\r
+-                {\r
+-                    NLogger.debug( NLoggerNames.NATIV_MACOSX,\r
+-                        "Called MacOsX quit handler." );\r
+-                    ExitPhexAction.performCloseGUIAction();\r
+-                }\r
+-                catch (Throwable th)\r
+-                {\r
+-                    NLogger.error( NLoggerNames.USER_INTERFACE, th, th );\r
+-                }\r
+-            }\r
+-        } );\r
+-\r
+-        MRJAdapter.setPreferencesEnabled( true );\r
+-        MRJAdapter.addPreferencesListener( new ActionListener()\r
+-        {\r
+-            public void actionPerformed( ActionEvent evt )\r
+-            {\r
+-                try\r
+-                {\r
+-                    NLogger.debug( NLoggerNames.NATIV_MACOSX,\r
+-                        "Called MacOsX preferences handler." );\r
+-                    OptionsDialog dialog = new OptionsDialog();\r
+-                    dialog.show();\r
+-                }\r
+-                catch (Throwable th)\r
+-                {\r
+-                    NLogger.error( NLoggerNames.USER_INTERFACE, th, th );\r
+-                }\r
+-            }\r
+-        } );\r
+-\r
+-        MRJAdapter.addAboutListener( new ActionListener()\r
+-        {\r
+-            public void actionPerformed( ActionEvent evt )\r
+-            {\r
+-                try\r
+-                {\r
+-                    AboutDialog dialog = new AboutDialog();\r
+-                    dialog.setVisible( true );\r
+-                }\r
+-                catch (Throwable th)\r
+-                {\r
+-                    NLogger.error( NLoggerNames.USER_INTERFACE, th, th );\r
+-                }\r
+-            }\r
+-        } );\r
+-\r
+-        MRJAdapter.addOpenDocumentListener( new ActionListener()\r
+-        {\r
+-            public void actionPerformed( ActionEvent evt )\r
+-            {\r
+-                try\r
+-                {\r
+-                    File file = ((ApplicationEvent) evt).getFile();\r
+-                    NLogger.debug( NLoggerNames.NATIV_MACOSX,\r
+-                        "Called MacOsX open file handler: " + file );\r
+-\r
+-                    String absFileName = file.getAbsolutePath();\r
+-                    if ( absFileName.endsWith( ".magma" ) )\r
+-                    {\r
+-                        NewDownloadAction action = (NewDownloadAction) GUIRegistry\r
+-                            .getInstance().getGlobalAction(\r
+-                                GUIRegistry.NEW_DOWNLOAD_ACTION );\r
+-                        action.incommingMagmaDownload( absFileName );\r
+-                    }\r
+-                    if ( absFileName.endsWith( ".xml" ) )\r
+-                    {\r
+-                        NewDownloadAction action = (NewDownloadAction) GUIRegistry\r
+-                            .getInstance().getGlobalAction(\r
+-                                GUIRegistry.NEW_DOWNLOAD_ACTION );\r
+-                        action.incommingRSSDownload( absFileName );\r
+-                    }\r
+-                }\r
+-                catch (Throwable th)\r
+-                {\r
+-                    NLogger.error( NLoggerNames.USER_INTERFACE, th, th );\r
+-                }\r
+-            }\r
+-        } );\r
+-    }\r
+-\r
+-    /**\r
+-     * Create folder dialog here. This prevents \r
+-     * NoClassDefFoundError on Windows systems since the import of the\r
+-     * required OS X classes is elsewhere.\r
+-     */\r
+-    public static final FileDialog createFolderDialog()\r
+-    {\r
+-        return new FolderDialog( GUIRegistry.getInstance().getMainFrame() );\r
+-    }\r
+-}\r
+-- 
+1.7.1
+
diff --git a/net-p2p/phex/phex-3.2.0.102-r1.ebuild b/net-p2p/phex/phex-3.2.0.102-r1.ebuild
new file mode 100644 (file)
index 0000000..fcda329
--- /dev/null
@@ -0,0 +1,63 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-p2p/phex/phex-3.2.0.102-r1.ebuild,v 1.1 2010/06/18 21:10:52 sochotnicky Exp $
+
+EAPI=2
+
+inherit java-pkg-2 java-ant-2
+
+MY_P="${PN}_${PV}"
+
+DESCRIPTION="java gnutella file-sharing application"
+HOMEPAGE="http://phex.sourceforge.net/"
+SRC_URI="mirror://sourceforge/${PN}/${MY_P}_src.zip"
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~x86 ~amd64"
+IUSE=""
+COMMON_DEPEND="dev-java/commons-httpclient:3
+       dev-java/commons-logging:0
+       dev-java/jgoodies-forms:0
+       dev-java/jgoodies-looks:2.0
+       dev-java/log4j:0
+       dev-java/l2fprod-common:0
+       dev-java/commons-beanutils:1.7
+       dev-java/commons-codec:0
+       dev-java/commons-collections:0
+       dev-java/commons-lang:2.1"
+
+DEPEND="app-arch/unzip
+       >=virtual/jdk-1.5
+       ${COMMON_DEPEND}"
+RDEPEND=">=virtual/jre-1.5
+       ${COMMON_DEPEND}"
+
+S="${WORKDIR}/${MY_P}_src"
+
+JAVA_PKG_BSFIX="off"
+
+src_prepare() {
+       # remove parts related to MacOS gui classes
+       epatch "${FILESDIR}/0001-Remove-MacOS-GUI-references.patch"
+
+       rm -vf lib/*.jar || die
+       # avoid patches like plague
+       sed -i "s/createJar, copyThirdpartyJars/createJar/" build/buildJava.xml || die
+       JAVA_ANT_REWRITE_CLASSPATH="true" java-ant_bsfix_files build/*.xml
+       # remove bundled packages that we have - bug #176739
+       rm -rf src/com/l2fprod src/org/apache || die
+}
+
+src_compile() {
+       local gcp="$(java-pkg_getjars commons-httpclient-3,commons-logging,jgoodies-forms,jgoodies-looks-2.0,log4j,l2fprod-common,commons-beanutils-1.7,commons-codec,commons-collections,commons-lang-2.1)"
+       cd build
+       eant -Dgentoo.classpath="${gcp}:MRJAdapter.jar" -Dproject.buildtarget=build buildJava
+}
+
+src_install() {
+       java-pkg_dojar build/lib/${PN}.jar
+
+       java-pkg_dolauncher ${PN} --main phex.Main
+
+       dohtml docs/readme/* || die
+}