-
Notifications
You must be signed in to change notification settings - Fork 53
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8fe4676
commit e99a7e9
Showing
9 changed files
with
1,689 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,19 +3,51 @@ lib_LTLIBRARIES = libmodulemd-@[email protected] | |
libmodulemd_@API_VERSION@_la_SOURCES = \ | ||
modulemd-version.h \ | ||
modulemd.h \ | ||
modulemd.c \ | ||
modulemd-modulemetadata.h \ | ||
modulemd-modulemetadata.c \ | ||
$(NULL) | ||
|
||
libmodulemd_@API_VERSION@_la_CFLAGS = \ | ||
$(MODULEMD_CFLAGS) \ | ||
$(GOBJECT_CFLAGS) \ | ||
$(WARN_CFLAGS) \ | ||
$(NULL) | ||
|
||
libmodulemd_@API_VERSION@_la_LIBADD = \ | ||
$(MODULEMD_LIBS) \ | ||
$(GOBJECT_LIBS) \ | ||
$(NULL) | ||
|
||
libmodulemd_@API_VERSION@_la_LDFLAGS = \ | ||
$(WARN_LDFLAGS) \ | ||
$(NULL) | ||
|
||
-include $(top_srcdir)/git.mk | ||
|
||
CLEANFILES = | ||
|
||
-include $(INTROSPECTION_MAKEFILE) | ||
INTROSPECTION_GIRS = | ||
INTROSPECTION_SCANNER_ARGS = --add-include-path=$(srcdir) --warn-all | ||
INTROSPECTION_COMPILER_ARGS = --includedir=$(srcdir) | ||
|
||
if HAVE_INTROSPECTION | ||
introspection_sources = modulemd.h \ | ||
modulemd.c \ | ||
modulemd-modulemetadata.h \ | ||
modulemd-modulemetadata.c | ||
|
||
modulemd-@[email protected]: libmodulemd-@[email protected] | ||
modulemd_@API_VERSION@_gir_INCLUDES = GObject-2.0 | ||
modulemd_@API_VERSION@_gir_CFLAGS = $(INCLUDES) | ||
modulemd_@API_VERSION@_gir_LIBS = libmodulemd-@[email protected] | ||
modulemd_@API_VERSION@_gir_FILES = $(introspection_sources) | ||
INTROSPECTION_GIRS += modulemd-@[email protected] | ||
|
||
girdir = $(datadir)/gir-1.0 | ||
gir_DATA = $(INTROSPECTION_GIRS) | ||
|
||
typelibdir = $(libdir)/girepository-1.0 | ||
typelib_DATA = $(INTROSPECTION_GIRS:.gir=.typelib) | ||
|
||
CLEANFILES += $(gir_DATA) $(typelib_DATA) | ||
endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,169 @@ | ||
/* modulemd-modulemetadata.c | ||
* | ||
* Copyright (C) 2017 Stephen Gallagher | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY | ||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
#include "modulemd-modulemetadata.h" | ||
#include <glib.h> | ||
#include <yaml.h> | ||
|
||
enum | ||
{ | ||
MD_PROP_0, | ||
|
||
MD_PROP_NAME, | ||
|
||
MD_N_PROPERTIES | ||
}; | ||
|
||
static GParamSpec *md_properties[MD_N_PROPERTIES] = { NULL, }; | ||
|
||
struct module_dep_ref { | ||
char *name; | ||
char *ref; /* the stream, git tag or other commit-ish */ | ||
}; | ||
|
||
struct modulemd_component { | ||
gchar *rationale; | ||
gchar *repository; | ||
gchar *cache; | ||
gchar *ref; | ||
gchar **arches; | ||
gchar **multilib; | ||
guint buildorder; | ||
|
||
}; | ||
|
||
struct _ModuleMetadata | ||
{ | ||
GObject parent_instance; | ||
|
||
gchar *name; | ||
gchar *stream; | ||
gchar *version; | ||
gchar *summary; | ||
gchar *description; | ||
gchar *community; | ||
gchar *documentation; | ||
gchar *tracker; | ||
gchar **module_licenses; | ||
gchar **content_licenses; | ||
GHashTable *xmd; | ||
struct module_dep_ref **build_deps; | ||
struct module_dep_ref **runtime_deps; | ||
GHashTable *profiles; | ||
GHashTable *api; | ||
GHashTable *filter; | ||
GHashTable *buildopts; | ||
GHashTable *components; | ||
}; | ||
|
||
G_DEFINE_TYPE (ModuleMetadata, modulemd_modulemetadata, G_TYPE_OBJECT) | ||
|
||
static void | ||
modulemd_modulemetadata_set_property (GObject *gobject, | ||
guint property_id, | ||
const GValue *value, | ||
GParamSpec *pspec) | ||
{ | ||
ModuleMetadata *self = MODULEMD_MODULEMETADATA(gobject); | ||
|
||
switch (property_id) { | ||
case MD_PROP_NAME: | ||
g_clear_pointer (&self->name, g_free); | ||
self->name = g_value_dup_string (value); | ||
break; | ||
|
||
default: | ||
G_OBJECT_WARN_INVALID_PROPERTY_ID (gobject, property_id, pspec); | ||
break; | ||
} | ||
} | ||
|
||
static void | ||
modulemd_modulemetadata_get_property (GObject *gobject, | ||
guint property_id, | ||
GValue *value, | ||
GParamSpec *pspec) | ||
{ | ||
} | ||
|
||
static void | ||
modulemd_modulemetadata_dispose (GObject *gobject) | ||
{ | ||
G_OBJECT_CLASS (modulemd_modulemetadata_parent_class)->dispose (gobject); | ||
} | ||
|
||
static void | ||
modulemd_modulemetadata_finalize (GObject *gobject) | ||
{ | ||
ModuleMetadata *self = MODULEMD_MODULEMETADATA(gobject); | ||
g_clear_pointer (&self->name, g_free); | ||
|
||
G_OBJECT_CLASS (modulemd_modulemetadata_parent_class)->finalize (gobject); | ||
} | ||
|
||
static void | ||
modulemd_modulemetadata_class_init (ModuleMetadataClass *klass) | ||
{ | ||
GObjectClass *object_class = G_OBJECT_CLASS (klass); | ||
|
||
object_class->set_property = modulemd_modulemetadata_set_property; | ||
object_class->get_property = modulemd_modulemetadata_get_property; | ||
|
||
object_class->dispose = modulemd_modulemetadata_dispose; | ||
object_class->finalize = modulemd_modulemetadata_finalize; | ||
|
||
md_properties[MD_PROP_NAME] = | ||
g_param_spec_string ("name", | ||
"Module Name", | ||
"A string property representing the name of " | ||
"the module.", | ||
"", | ||
G_PARAM_READWRITE | G_PARAM_CONSTRUCT); | ||
|
||
g_object_class_install_properties ( | ||
object_class, | ||
MD_N_PROPERTIES, | ||
md_properties); | ||
} | ||
|
||
static void | ||
modulemd_modulemetadata_init (ModuleMetadata *self) | ||
{ | ||
} | ||
|
||
/** | ||
* modulemd_modulemetadata_new: | ||
* | ||
* Allocates a new #ModuleMetadata. | ||
* | ||
* Return value: a new #ModuleMetadata. | ||
*/ | ||
ModuleMetadata * | ||
modulemd_modulemetadata_new (void) | ||
{ | ||
ModuleMetadata *md; | ||
|
||
md = g_object_new (modulemd_modulemetadata_get_type(), NULL); | ||
return md; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/* modulemd-modulemetadata.h | ||
* | ||
* Copyright (C) 2017 Stephen Gallagher | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY | ||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
#ifndef MODULEMD_MODULEMETADATA_H | ||
#define MODULEMD_MODULEMETADATA_H | ||
|
||
#include <glib-object.h> | ||
|
||
G_BEGIN_DECLS | ||
|
||
#define MODULEMD_TYPE_MODULEMETADATA modulemd_modulemetadata_get_type () | ||
G_DECLARE_FINAL_TYPE (ModuleMetadata, modulemd_modulemetadata, MODULEMD, MODULEMETADATA, GObject) | ||
|
||
ModuleMetadata *modulemd_modulemetadata_new (void); | ||
|
||
G_END_DECLS | ||
|
||
#endif /* MODULEMD_MODULEMETADATA_H */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/* modulemd.c | ||
* | ||
* Copyright (C) 2017 Stephen Gallagher | ||
* | ||
* Permission is hereby granted, free of charge, to any person obtaining | ||
* a copy of this software and associated documentation files (the | ||
* "Software"), to deal in the Software without restriction, including | ||
* without limitation the rights to use, copy, modify, merge, publish, | ||
* distribute, sublicense, and/or sell copies of the Software, and to | ||
* permit persons to whom the Software is furnished to do so, subject to | ||
* the following conditions: | ||
* | ||
* The above copyright notice and this permission notice shall be | ||
* included in all copies or substantial portions of the Software. | ||
* | ||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
* NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY | ||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, | ||
* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE | ||
* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
*/ | ||
|
||
#include "modulemd.h" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,8 @@ G_BEGIN_DECLS | |
# include "modulemd-version.h" | ||
#undef MODULEMD_INSIDE | ||
|
||
|
||
|
||
G_END_DECLS | ||
|
||
#endif /* MODULEMD_H */ |