Commit 1ab2c5eb authored by Christian Hergert's avatar Christian Hergert

mingw: remove mingw plugin

This device abstraction has not fit in well ever since we started on
runtimes, so it needs to be done differently in the future.

In particular, we need to ensure that we have a way to setup a toolchain
for a given project, and different build systems do that differently.
Meson, for example, will want a cross-build file describing the toolchain.
parent ad7c893a
......@@ -53,7 +53,6 @@ option('with_jhbuild', type: 'boolean')
option('with_make', type: 'boolean')
option('with_meson', type: 'boolean')
option('with_meson_templates', type: 'boolean')
option('with_mingw', type: 'boolean')
option('with_mono', type: 'boolean')
option('with_notification', type: 'boolean')
option('with_newcomers', type: 'boolean')
......
......@@ -188,7 +188,6 @@ src/plugins/meson/gbp-meson-build-system.c
src/plugins/meson/gbp-meson-pipeline-addin.c
src/plugins/meson-templates/meson_templates.py
src/plugins/messages/gbp-messages-panel.ui
src/plugins/mingw/ide-mingw-device-provider.c
src/plugins/newcomers/gbp-newcomers-section.ui
src/plugins/notification/ide-notification-addin.c
src/plugins/npm/npm_plugin.py
......
......@@ -46,7 +46,6 @@ subdir('make')
subdir('meson')
subdir('meson-templates')
subdir('messages')
subdir('mingw')
subdir('mono')
subdir('newcomers')
subdir('notification')
......@@ -123,7 +122,6 @@ status += [
'JHBuild ............... : @0@'.format(get_option('with_jhbuild')),
'Make .................. : @0@'.format(get_option('with_make')),
'Meson ................. : @0@'.format(get_option('with_meson')),
'MinGW ................. : @0@'.format(get_option('with_mingw')),
'Mono .................. : @0@'.format(get_option('with_mono')),
'Notifications ......... : @0@'.format(get_option('with_notification')),
'Node Package Manager .. : @0@'.format(get_option('with_npm')),
......
/* ide-mingw-device-provider.c
*
* Copyright © 2015 Christian Hergert <christian@hergert.me>
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#define G_LOG_DOMAIN "ide-mingw-device-provider"
#include <glib/gi18n.h>
#include "ide-mingw-device.h"
#include "ide-mingw-device-provider.h"
struct _IdeMingwDeviceProvider
{
IdeDeviceProvider parent_instance;
};
G_DEFINE_TYPE (IdeMingwDeviceProvider, ide_mingw_device_provider, IDE_TYPE_DEVICE_PROVIDER)
static void
ide_mingw_device_provider_load_worker (GTask *task,
gpointer source_object,
gpointer task_data,
GCancellable *cancellable)
{
IdeMingwDeviceProvider *self = source_object;
g_autoptr(GPtrArray) devices = NULL;
g_autofree gchar *x32 = NULL;
g_autofree gchar *x64 = NULL;
IdeContext *context;
IDE_ENTRY;
g_assert (G_IS_TASK (task));
g_assert (IDE_IS_MINGW_DEVICE_PROVIDER (self));
g_assert (!cancellable || G_IS_CANCELLABLE (cancellable));
context = ide_object_get_context (IDE_OBJECT (self));
devices = g_ptr_array_new_with_free_func (g_object_unref);
if (NULL != (x64 = g_find_program_in_path ("x86_64-w64-mingw32-gcc")))
g_ptr_array_add (devices,
ide_mingw_device_new (context,
_("MinGW 64-bit"),
"local-x86_64-w64-mingw32",
"x86_64-w64-mingw32"));
if (NULL != (x32 = g_find_program_in_path ("i686-w64-mingw32-gcc")))
g_ptr_array_add (devices,
ide_mingw_device_new (context,
_("MinGW 32-bit"),
"local-i686-w64-mingw32",
"i686-w64-mingw32"));
g_task_return_pointer (task,
g_steal_pointer (&devices),
(GDestroyNotify)g_ptr_array_unref);
IDE_EXIT;
}
static void
ide_mingw_device_provider_load_async (IdeDeviceProvider *provider,
GCancellable *cancellable,
GAsyncReadyCallback callback,
gpointer user_data)
{
IdeMingwDeviceProvider *self = (IdeMingwDeviceProvider *)provider;
g_autoptr(GTask) task = NULL;
IDE_ENTRY;
g_assert (IDE_IS_MINGW_DEVICE_PROVIDER (self));
g_assert (IDE_IS_DEVICE_PROVIDER (provider));
task = g_task_new (self, cancellable, callback, user_data);
g_task_set_source_tag (task, ide_mingw_device_provider_load_async);
ide_context_hold_for_object (ide_object_get_context (IDE_OBJECT (self)), task);
g_task_run_in_thread (task, ide_mingw_device_provider_load_worker);
IDE_EXIT;
}
static gboolean
ide_mingw_device_provider_load_finish (IdeDeviceProvider *provider,
GAsyncResult *result,
GError **error)
{
g_autoptr(GPtrArray) devices = NULL;
IDE_ENTRY;
g_assert (IDE_IS_MINGW_DEVICE_PROVIDER (provider));
g_assert (G_IS_TASK (result));
if (NULL != (devices = g_task_propagate_pointer (G_TASK (result), error)))
{
for (guint i = 0; i < devices->len; i++)
{
IdeDevice *device = g_ptr_array_index (devices, i);
g_assert (IDE_IS_DEVICE (device));
ide_device_provider_emit_device_added (provider, device);
}
}
IDE_RETURN (TRUE);
}
static void
ide_mingw_device_provider_class_init (IdeMingwDeviceProviderClass *klass)
{
IdeDeviceProviderClass *provider_class = IDE_DEVICE_PROVIDER_CLASS (klass);
provider_class->load_async = ide_mingw_device_provider_load_async;
provider_class->load_finish = ide_mingw_device_provider_load_finish;
}
static void
ide_mingw_device_provider_init (IdeMingwDeviceProvider *self)
{
}
/* ide-mingw-device-provider.h
*
* Copyright © 2015 Christian Hergert <christian@hergert.me>
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <ide.h>
G_BEGIN_DECLS
#define IDE_TYPE_MINGW_DEVICE_PROVIDER (ide_mingw_device_provider_get_type())
G_DECLARE_FINAL_TYPE (IdeMingwDeviceProvider,ide_mingw_device_provider, IDE, MINGW_DEVICE_PROVIDER, IdeDeviceProvider)
G_END_DECLS
/* ide-mingw-device.c
*
* Copyright © 2015 Christian Hergert <christian@hergert.me>
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#define G_LOG_DOMAIN "ide-mingw-device"
#include "ide-mingw-device.h"
struct _IdeMingwDevice
{
IdeDevice parent_instance;
gchar *system_type;
};
G_DEFINE_TYPE (IdeMingwDevice, ide_mingw_device, IDE_TYPE_DEVICE)
IdeDevice *
ide_mingw_device_new (IdeContext *context,
const gchar *display_name,
const gchar *id,
const gchar *system_type)
{
IdeMingwDevice *self;
self = g_object_new (IDE_TYPE_MINGW_DEVICE,
"context", context,
"display-name", display_name,
"id", id,
NULL);
self->system_type = g_strdup (system_type);
return IDE_DEVICE (self);
}
static const gchar *
ide_mingw_device_get_system_type (IdeDevice *device)
{
IdeMingwDevice *self = (IdeMingwDevice *)device;
g_assert (IDE_IS_MINGW_DEVICE (self));
return self->system_type;
}
static void
ide_mingw_device_finalize (GObject *object)
{
IdeMingwDevice *self = (IdeMingwDevice *)object;
g_clear_pointer (&self->system_type, g_free);
G_OBJECT_CLASS (ide_mingw_device_parent_class)->finalize (object);
}
static void
ide_mingw_device_class_init (IdeMingwDeviceClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
IdeDeviceClass *device_class = IDE_DEVICE_CLASS (klass);
object_class->finalize = ide_mingw_device_finalize;
device_class->get_system_type = ide_mingw_device_get_system_type;
}
static void
ide_mingw_device_init (IdeMingwDevice *self)
{
}
/* ide-mingw-device.h
*
* Copyright © 2015 Christian Hergert <christian@hergert.me>
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#pragma once
#include <ide.h>
G_BEGIN_DECLS
#define IDE_TYPE_MINGW_DEVICE (ide_mingw_device_get_type())
G_DECLARE_FINAL_TYPE (IdeMingwDevice, ide_mingw_device, IDE, MINGW_DEVICE, IdeDevice)
IdeDevice *ide_mingw_device_new (IdeContext *context,
const gchar *display_name,
const gchar *id,
const gchar *system_type);
G_END_DECLS
if get_option('with_mingw')
mingw_resources = gnome.compile_resources(
'mingw-resources',
'mingw.gresource.xml',
c_name: 'ide_mingw',
)
mingw_sources = [
'mingw-plugin.c',
'ide-mingw-device.c',
'ide-mingw-device.h',
'ide-mingw-device-provider.c',
'ide-mingw-device-provider.h',
]
gnome_builder_plugins_sources += files(mingw_sources)
gnome_builder_plugins_sources += mingw_resources[0]
endif
/* mingw-plugin.c
*
* Copyright © 2015 Christian Hergert <christian@hergert.me>
*
* 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 3 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, see <http://www.gnu.org/licenses/>.
*/
#include <libpeas/peas.h>
#include "ide-mingw-device-provider.h"
void
ide_mingw_register_types (PeasObjectModule *module)
{
peas_object_module_register_extension_type (module, IDE_TYPE_DEVICE_PROVIDER, IDE_TYPE_MINGW_DEVICE_PROVIDER);
}
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/gnome/builder/plugins">
<file>mingw.plugin</file>
</gresource>
</gresources>
[Plugin]
Module=mingw-plugin
Name=MinGW Support
Description=Provides cross-compilation support using MinGW
Authors=Christian Hergert <christian@hergert.me>
Copyright=Copyright © 2015 Christian Hergert
Builtin=true
Embedded=ide_mingw_register_types
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment