pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/emulators/rpcemu emulators/rpcemu: Add a patchset that...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/26ca254b4a6e
branches:  trunk
changeset: 441031:26ca254b4a6e
user:      js <js%pkgsrc.org@localhost>
date:      Sat Oct 24 16:53:41 2020 +0000

description:
emulators/rpcemu: Add a patchset that adds macOS support

This makes the keyboard work, among others.

diffstat:

 emulators/rpcemu/Makefile                        |     8 +-
 emulators/rpcemu/files/rpcemu-0.9.1-mac-v1.patch |  1800 ++++++++++++++++++++++
 2 files changed, 1807 insertions(+), 1 deletions(-)

diffs (truncated from 1832 to 300 lines):

diff -r e980cd166d41 -r 26ca254b4a6e emulators/rpcemu/Makefile
--- a/emulators/rpcemu/Makefile Sat Oct 24 16:51:49 2020 +0000
+++ b/emulators/rpcemu/Makefile Sat Oct 24 16:53:41 2020 +0000
@@ -1,6 +1,7 @@
-# $NetBSD: Makefile,v 1.1 2020/10/24 16:33:34 js Exp $
+# $NetBSD: Makefile,v 1.2 2020/10/24 16:53:41 js Exp $
 
 DISTNAME=      rpcemu-0.9.3
+PKGREVISION=   1
 CATEGORIES=    emulators
 MASTER_SITES=  http://www.marutan.net/rpcemu/cgi/download.php?sFName=${PKGVERSION_NOREV}/
 
@@ -10,10 +11,15 @@
 LICENSE=       gnu-gpl-v2
 
 USE_LANGUAGES= c c++
+USE_TOOLS+=    patch
 TOOL_DEPENDS+= qt5-qttools-[0-9]*:../../x11/qt5-qttools
 
 INSTALLATION_DIRS+=    bin
 
+post-patch:
+       ${RUN} cd ${WRKSRC}/src && \
+               ${PATCH} -p0 <${FILESDIR}/rpcemu-0.9.1-mac-v1.patch
+
 do-configure:
        cd ${WRKSRC} && ${QTDIR}/bin/qmake src/qt5/rpcemu.pro
 
diff -r e980cd166d41 -r 26ca254b4a6e emulators/rpcemu/files/rpcemu-0.9.1-mac-v1.patch
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/emulators/rpcemu/files/rpcemu-0.9.1-mac-v1.patch  Sat Oct 24 16:53:41 2020 +0000
@@ -0,0 +1,1800 @@
+Patchset from http://www.riscos.info/pipermail/rpcemu/2018-November/002703.html
+to add macOS support.
+
+--- /dev/null  2018-11-18 20:18:48.000000000 +0000
++++ macosx/Info.plist  2018-11-18 20:18:14.000000000 +0000
+@@ -0,0 +1,26 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
++<plist version="1.0">
++<dict>
++      <key>CFBundleExecutable</key>
++      <string>${EXECUTABLE_NAME}</string>
++      <key>CFBundleGetInfoString</key>
++      <string>Created by Qt/QMake</string>
++      <key>CFBundleIconFile</key>
++      <string>${ASSETCATALOG_COMPILER_APPICON_NAME}</string>
++      <key>CFBundleIdentifier</key>
++      <string>org.marutan.rpcemu</string>
++      <key>CFBundlePackageType</key>
++      <string>APPL</string>
++      <key>CFBundleSignature</key>
++      <string>${QMAKE_PKGINFO_TYPEINFO}</string>
++      <key>LSMinimumSystemVersion</key>
++      <string>${MACOSX_DEPLOYMENT_TARGET}</string>
++      <key>NOTE</key>
++      <string>This file was generated by Qt/QMake.</string>
++      <key>NSPrincipalClass</key>
++      <string>NSApplication</string>
++      <key>NSSupportsAutomaticGraphicsSwitching</key>
++      <true/>
++</dict>
++</plist>
+--- /dev/null  2018-11-18 19:57:31.000000000 +0000
++++ qt5/choose_dialog.cpp      2018-11-04 16:40:30.000000000 +0000
+@@ -0,0 +1,107 @@
++/*
++ RPCEmu - An Acorn system emulator
++ 
++ Copyright (C) 2016-2017 Matthew Howkins
++ 
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++ 
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ GNU General Public License for more details.
++ 
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++
++#include <QFileDialog>
++#include "choose_dialog.h"
++#include "preferences-macosx.h"
++
++ChooseDialog::ChooseDialog(QWidget *parent) : QDialog(parent)
++{
++  setWindowTitle("RPCEmu - Choose Data Directory");
++  
++  buttons_box = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
++  
++  // Create preamble label.
++  QString str = QString("<p>Before using RPCEmu for the first time, you must select the directory <br/>"
++                        "that contains the folders and files required by the emulator, such as <br>"
++                        "ROMs, hard drive images and the HostFS share.</p>"
++                        "<p>You can show this dialogue again by holding down the Command key <br/>"
++                        "whilst the application is loading.</p>");
++
++  preamble_label = new QLabel(str);
++  
++  // Create choose label.
++  choose_label = new QLabel();
++  choose_label->setText("Please choose a directory below:");
++  
++  // Create directory line edit.
++  directory_edit = new QLineEdit();
++  directory_edit->setMaxLength(511);
++  directory_edit->setReadOnly(true);
++  
++  // Create directory button.
++  directory_button = new QPushButton("Select...", this);
++  
++  // Create box for line edit and button.
++  directory_hbox = new QHBoxLayout();
++  directory_hbox->setSpacing(16);
++  directory_hbox->addWidget(directory_edit);
++  directory_hbox->addWidget(directory_button);
++  
++  grid = new QGridLayout(this);
++  grid->addWidget(preamble_label, 0, 0);
++  grid->addWidget(choose_label, 1, 0);
++  grid->addLayout(directory_hbox, 2, 0);
++  grid->addWidget(buttons_box, 3, 0);
++  
++  // Connect actions to widgets.
++  connect(directory_button, &QPushButton::pressed, this, &ChooseDialog::directory_button_pressed);
++  
++  connect(buttons_box, &QDialogButtonBox::accepted, this, &QDialog::accept);
++  connect(buttons_box, &QDialogButtonBox::rejected, this, &QDialog::reject);
++  
++  connect(this, &QDialog::accepted, this, &ChooseDialog::dialog_accepted);
++  connect(this, &QDialog::accepted, this, &ChooseDialog::dialog_rejected);
++
++  this->setFixedSize(this->sizeHint());
++}
++
++ChooseDialog::~ChooseDialog()
++{
++}
++
++void ChooseDialog::directory_button_pressed()
++{
++  QFileDialog folderDialog;
++  folderDialog.setWindowTitle("Choose Data Directory");
++  folderDialog.setFileMode(QFileDialog::Directory);
++  
++  if (folderDialog.exec())
++  {
++    QStringList selection = folderDialog.selectedFiles();
++    QString folderName = selection.at(0);
++    
++    directory_edit->setText(folderName);
++  }
++}
++
++void ChooseDialog::dialog_accepted()
++{
++  QString selectedFolder = directory_edit->text();
++  QByteArray ba = selectedFolder.toUtf8();
++  
++  char *ptr = ba.data();
++  preferences_set_data_directory(ptr);
++}
++
++void ChooseDialog::dialog_rejected()
++{
++}
++
+--- /dev/null  2018-11-18 19:57:31.000000000 +0000
++++ qt5/choose_dialog.h        2018-11-04 16:34:31.000000000 +0000
+@@ -0,0 +1,64 @@
++/*
++ RPCEmu - An Acorn system emulator
++ 
++ Copyright (C) 2016-2017 Matthew Howkins
++ 
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++ 
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ GNU General Public License for more details.
++ 
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++
++#ifndef CHOOSE_DIALOG_H
++#define CHOOSE_DIALOG_H
++
++#include <QDialog>
++#include <QDialogButtonBox>
++#include <QGridLayout>
++#include <QLabel>
++#include <QLineEdit>
++#include <QPushButton>
++
++#include "rpc-qt5.h"
++#include "rpcemu.h"
++
++class ChooseDialog : public QDialog
++{
++  
++  Q_OBJECT
++  
++public:
++  ChooseDialog(QWidget *parent = 0);
++  virtual ~ChooseDialog();
++  
++private slots:
++  void directory_button_pressed();
++  
++  void dialog_accepted();
++  void dialog_rejected();
++  
++private:
++  
++  QLabel *preamble_label;
++  QLabel *choose_label;
++  
++  QHBoxLayout *directory_hbox;
++  QLineEdit *directory_edit;
++  QPushButton *directory_button;
++  
++  QDialogButtonBox *buttons_box;
++  
++  QGridLayout *grid;
++  
++};
++
++#endif
+--- /dev/null  2018-11-18 19:56:31.000000000 +0000
++++ macosx/events-macosx.h     2018-11-02 19:57:29.000000000 +0000
+@@ -0,0 +1,45 @@
++/*
++ RPCEmu - An Acorn system emulator
++ 
++ Copyright (C) 2017 Peter Howkins
++ 
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or
++ (at your option) any later version.
++ 
++ This program is distributed in the hope that it will be useful,
++ but WITHOUT ANY WARRANTY; without even the implied warranty of
++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ GNU General Public License for more details.
++ 
++ You should have received a copy of the GNU General Public License
++ along with this program; if not, write to the Free Software
++ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
++ */
++
++#ifndef __EVENTS_MACOSX_H__
++#define __EVENTS_MACOSX_H__
++
++#ifdef __cplusplus
++extern "C" {
++#endif
++    
++typedef enum {
++    nativeEventTypeModifiersChanged = 1
++} NativeEventType;
++    
++typedef struct
++{
++    bool processed;
++    int eventType;
++    uint modifierMask;
++} NativeEvent;
++    
++extern NativeEvent* handle_native_event(void *message);
++    
++#ifdef __cplusplus
++}
++#endif
++
++#endif // __EVENTS_MACOSX_H__
+--- /dev/null  2018-11-18 19:56:31.000000000 +0000
++++ macosx/events-macosx.m     2018-11-02 19:57:31.000000000 +0000
+@@ -0,0 +1,56 @@
++/*
++ RPCEmu - An Acorn system emulator
++ 
++ Copyright (C) 2017 Matthew Howkins
++ 
++ This program is free software; you can redistribute it and/or modify
++ it under the terms of the GNU General Public License as published by
++ the Free Software Foundation; either version 2 of the License, or



Home | Main Index | Thread Index | Old Index