[nautilus/wip/ernestask/meson] general: add support for Meson



commit bfa91fa5acfd5bcd3f20e161c4627bf942f2fe23
Author: Ernestas Kulik <ernestask src gnome org>
Date:   Wed Sep 28 09:16:11 2016 +0300

    general: add support for Meson
    
    https://bugzilla.gnome.org/show_bug.cgi?id=778167

 .gitattributes                                   |   13 +
 config.h.meson                                   |   11 +
 data/icons/meson.build                           |    2 +
 data/meson.build                                 |   67 +++++
 docs/meson.build                                 |    3 +
 docs/reference/libnautilus-extension/meson.build |   13 +
 docs/reference/meson.build                       |    1 +
 eel/meson.build                                  |   47 ++++
 libgd                                            |    2 +-
 libnautilus-extension/meson.build                |   67 +++++
 make_release.sh                                  |   17 ++
 meson.build                                      |  137 ++++++++++
 meson_options.txt                                |   32 +++
 nautilus-desktop/meson.build                     |   30 ++
 nautilus-sendto-extension/meson.build            |   11 +
 po/meson.build                                   |    1 +
 scripts/git-archive-all.sh                       |  310 ++++++++++++++++++++++
 src/meson.build                                  |  293 ++++++++++++++++++++
 src/nautilus-search-provider.c                   |    2 +-
 subprojects/libgd                                |    1 +
 test/meson.build                                 |   32 +++
 21 files changed, 1090 insertions(+), 2 deletions(-)
---
diff --git a/.gitattributes b/.gitattributes
new file mode 100644
index 0000000..219cbdf
--- /dev/null
+++ b/.gitattributes
@@ -0,0 +1,13 @@
+/scripts                       export-ignore
+/git.mk                        export-ignore
+/.gitattributes                export-ignore
+/.gitmodules                   export-ignore
+/nautilus.doap                 export-ignore
+/.buildconfig                  export-ignore
+/OVERVIEW.md                   export-ignore
+/org.gnome.Nautilus.json       export-ignore
+/test/file-torture.py          export-ignore
+/src/gtk/gtk-code-generator.sh export-ignore
+/data/run-uncrustify.sh        export-ignore
+/data/uncrustify.cfg           export-ignore
+/eel/README.canvas             export-ignore
diff --git a/config.h.meson b/config.h.meson
new file mode 100644
index 0000000..9bedac6
--- /dev/null
+++ b/config.h.meson
@@ -0,0 +1,11 @@
+#mesondefine VERSION
+#mesondefine PACKAGE_VERSION
+#mesondefine GETTEXT_PACKAGE
+#mesondefine HAVE_SELINUX
+#mesondefine ENABLE_EMPTY_VIEW
+#mesondefine ENABLE_DESKTOP
+#mesondefine ENABLE_PACKAGEKIT
+#mesondefine ENABLE_TRACKER
+#mesondefine LOCALEDIR
+#mesondefine NAUTILUS_DATADIR
+#mesondefine NAUTILUS_EXTENSIONDIR
diff --git a/data/icons/meson.build b/data/icons/meson.build
new file mode 100644
index 0000000..9a918f4
--- /dev/null
+++ b/data/icons/meson.build
@@ -0,0 +1,2 @@
+install_subdir ('hicolor',
+                install_dir: icondir)
diff --git a/data/meson.build b/data/meson.build
new file mode 100644
index 0000000..92dec21
--- /dev/null
+++ b/data/meson.build
@@ -0,0 +1,67 @@
+subdir ('icons')
+
+po_dir = join_paths (meson.source_root (), 'po')
+
+line_up_parameters = executable ('lineup-parameters',
+                                 'lineup-parameters.c',
+                                 dependencies: [gio, gio_unix])
+
+i18n.merge_file ('desktop',
+                 input: 'org.gnome.Nautilus.desktop.in',
+                 output: 'org.gnome.Nautilus.desktop',
+                 install: true,
+                 install_dir: desktopdir,
+                 po_dir: po_dir,
+                 type: 'desktop')
+
+i18n.merge_file ('desktop-autorun-software',
+                 input: 'nautilus-autorun-software.desktop.in',
+                 output: 'nautilus-autorun-software.desktop',
+                 install: true,
+                 install_dir: desktopdir,
+                 po_dir: po_dir,
+                 type: 'desktop')
+
+i18n.merge_file ('desktop-autostart',
+                 input: 'nautilus-autostart.desktop.in',
+                 output: 'nautilus-autostart.desktop',
+                 install: true,
+                 install_dir: join_paths (sysconfdir, 'xdg', 'autostart'),
+                 po_dir: po_dir,
+                 type: 'desktop')
+
+if get_option ('enable-desktop')
+    i18n.merge_file ('desktop',
+                     input: 'nautilus-classic.desktop.in',
+                     output: 'nautilus-classic.desktop',
+                     install: true,
+                     install_dir: desktopdir,
+                     po_dir: po_dir,
+                     type: 'desktop')
+endif
+
+i18n.merge_file ('desktop',
+                 input: 'org.gnome.Nautilus.appdata.xml.in',
+                 output: 'org.gnome.Nautilus.appdata.xml',
+                 install: true,
+                 install_dir: appdatadir,
+                 po_dir: po_dir,)
+
+service_conf = configuration_data ()
+service_conf.set ('bindir', join_paths (prefix, bindir))
+
+configure_file (input: 'org.gnome.Nautilus.service.in',
+                output: 'org.gnome.Nautilus.service',
+                configuration: service_conf,
+                install_dir: servicedir)
+
+configure_file (input: 'org.freedesktop.FileManager1.service.in',
+                output: 'org.freedesktop.FileManager1.service',
+                configuration: service_conf,
+                install_dir: servicedir)
+
+install_data ('nautilus-search-provider.ini',
+              install_dir: searchproviderdir)
+
+install_data ('org.gnome.nautilus.gschema.xml',
+              install_dir: schemadir)
diff --git a/docs/meson.build b/docs/meson.build
new file mode 100644
index 0000000..036ecd4
--- /dev/null
+++ b/docs/meson.build
@@ -0,0 +1,3 @@
+install_man ('nautilus.1')
+
+subdir ('reference')
diff --git a/docs/reference/libnautilus-extension/meson.build 
b/docs/reference/libnautilus-extension/meson.build
new file mode 100644
index 0000000..3cb53d8
--- /dev/null
+++ b/docs/reference/libnautilus-extension/meson.build
@@ -0,0 +1,13 @@
+docs_conf = configuration_data ()
+docs_conf.set ('NAUTILUS_EXTENSION_VERSION_INFO', nautilus_extension_version)
+
+docs_version = configure_file (input: 'version.xml.in',
+                               output: 'version.xml',
+                               configuration: docs_conf)
+
+gnome.gtkdoc ('libnautilus-extension',
+              main_xml: 'libnautilus-extension-docs.xml',
+              src_dir: join_paths (meson.source_root (), 'libnautilus-extension'),
+              dependencies: nautilus_extension,
+              install: true,
+              scan_args: ['--ignore-headers=nautilus-extension-private.h'])
diff --git a/docs/reference/meson.build b/docs/reference/meson.build
new file mode 100644
index 0000000..46b5382
--- /dev/null
+++ b/docs/reference/meson.build
@@ -0,0 +1 @@
+subdir ('libnautilus-extension')
diff --git a/eel/meson.build b/eel/meson.build
new file mode 100644
index 0000000..ac2edea
--- /dev/null
+++ b/eel/meson.build
@@ -0,0 +1,47 @@
+libeel_2_sources = [
+    'eel-accessibility.h',
+    'eel-accessibility.c',
+    'eel-art-extensions.h',
+    'eel-art-extensions.c',
+    'eel-canvas.h',
+    'eel-canvas.c',
+    'eel-debug.h',
+    'eel-debug.c',
+    'eel-gdk-extensions.h',
+    'eel-gdk-extensions.c',
+    'eel-glib-extensions.h',
+    'eel-glib-extensions.c',
+    'eel-gnome-extensions.h',
+    'eel-gnome-extensions.c',
+    'eel-graphic-effects.h',
+    'eel-graphic-effects.c',
+    'eel-gtk-extensions.h',
+    'eel-self-checks.h',
+    'eel-self-checks.c',
+    'eel-stock-dialogs.h',
+    'eel-stock-dialogs.c',
+    'eel-string.h',
+    'eel-string.c',
+    'eel-vfs-extensions.h',
+    'eel-vfs-extensions.c',
+    'eel.h',
+    'eel-gtk-extensions.c',
+    'eel-lib-self-check-functions.h',
+    'eel-lib-self-check-functions.c',
+]
+
+libeel_2_deps = [glib, gtk, gail, libm, x11]
+
+libeel_2 = static_library ('eel-2', libeel_2_sources,
+                           dependencies: libeel_2_deps,
+                           include_directories: nautilus_include_dirs)
+
+eel_2 = declare_dependency (link_with: libeel_2,
+                            include_directories: nautilus_include_dirs,
+                            dependencies: libeel_2_deps)
+
+check_eel = executable ('check-eel',
+                        'check-program.c',
+                        dependencies: [eel_2, xml])
+
+test ('check-eel', check_eel)
diff --git a/libgd b/libgd
index 752f65e..1bd7f34 160000
--- a/libgd
+++ b/libgd
@@ -1 +1 @@
-Subproject commit 752f65e91ea0d9a2ee8a2d21343bbd97bd0d038a
+Subproject commit 1bd7f34a58f11f4bdebcbe5ca3371b89c6c2c83c
diff --git a/libnautilus-extension/meson.build b/libnautilus-extension/meson.build
new file mode 100644
index 0000000..6da5a10
--- /dev/null
+++ b/libnautilus-extension/meson.build
@@ -0,0 +1,67 @@
+nautilus_extension_version = '1.4.0'
+
+libnautilus_extension_headers = [
+    'nautilus-column-provider.h',
+    'nautilus-column.h',
+    'nautilus-extension-types.h',
+    'nautilus-file-info.h',
+    'nautilus-info-provider.h',
+    'nautilus-location-widget-provider.h',
+    'nautilus-menu-item.h',
+    'nautilus-menu-provider.h',
+    'nautilus-property-page-provider.h',
+    'nautilus-property-page.h',
+    'nautilus-menu.h'
+]
+
+install_headers (libnautilus_extension_headers,
+                 subdir: join_paths ('nautilus', 'libnautilus-extension'))
+
+libnautilus_extension_sources = [
+    'nautilus-column-provider.c',
+    'nautilus-column.c',
+    'nautilus-extension-types.c',
+    'nautilus-extension-private.h',
+    'nautilus-file-info.c',
+    'nautilus-info-provider.c',
+    'nautilus-location-widget-provider.c',
+    'nautilus-menu-item.c',
+    'nautilus-menu-provider.c',
+    'nautilus-property-page-provider.c',
+    'nautilus-property-page.c',
+    'nautilus-menu.c'
+]
+
+libnautilus_extension_deps = [glib, gtk]
+
+libnautilus_extension = shared_library ('nautilus-extension',
+                                        libnautilus_extension_sources,
+                                        dependencies: libnautilus_extension_deps,
+                                        include_directories: nautilus_include_dirs,
+                                        version: nautilus_extension_version,
+                                        install: true)
+
+gnome.generate_gir (libnautilus_extension,
+                    sources: libnautilus_extension_headers + libnautilus_extension_sources,
+                    nsversion: '3.0',
+                    namespace: 'Nautilus',
+                    includes: ['Gtk-3.0', 'Gio-2.0', 'GLib-2.0'],
+                    install: true)
+
+nautilus_extension = declare_dependency (link_with: libnautilus_extension,
+                                         dependencies: libnautilus_extension_deps,
+                                         include_directories: nautilus_include_dirs)
+
+pkgconfig_data = configuration_data ()
+
+pkgconfig_data.set ('prefix', prefix)
+pkgconfig_data.set ('exec_prefix', '${prefix}')
+pkgconfig_data.set ('libdir', join_paths ('${exec_prefix}', libdir))
+pkgconfig_data.set ('includedir', join_paths ('${prefix}', includedir))
+pkgconfig_data.set ('extensiondir', join_paths ('${exec_prefix}', extensiondir))
+pkgconfig_data.set ('VERSION', nautilus_extension_version)
+
+configure_file (input: 'libnautilus-extension.pc.in',
+                output: 'libnautilus-extension.pc',
+                configuration: pkgconfig_data,
+                install_dir: join_paths (libdir, 'pkgconfig'))
diff --git a/make_release.sh b/make_release.sh
new file mode 100755
index 0000000..f6a9674
--- /dev/null
+++ b/make_release.sh
@@ -0,0 +1,17 @@
+#!/bin/sh
+test -n "$srcdir" || srcdir=$(dirname "$0")
+test -n "$srcdir" || srcdir=.
+
+cd $srcdir
+
+VERSION=$(git describe --abbrev=0)
+NAME="nautilus-$VERSION"
+
+echo "Updating submodules…"
+git submodule update --init
+
+echo "Creating git tree archive…"
+scripts/git-archive-all.sh --prefix "$NAME/" "$NAME.tar"
+
+echo "Compressing archive…"
+xz -f "$NAME.tar"
diff --git a/meson.build b/meson.build
new file mode 100644
index 0000000..f6a8a6d
--- /dev/null
+++ b/meson.build
@@ -0,0 +1,137 @@
+project ('nautilus', 'c',
+         version: '3.22.2',
+         meson_version: '>=0.37.0',
+         license: 'GPL2+')
+
+bindir = get_option ('bindir')
+datadir = get_option ('datadir')
+appdatadir = join_paths (datadir, 'appdata')
+desktopdir = join_paths (datadir, 'applications')
+icondir = join_paths (datadir, 'icons')
+includedir = get_option ('includedir')
+libdir = get_option ('libdir')
+extensiondir = join_paths (libdir, 'nautilus', 'extensions-3.0')
+localedir = get_option ('localedir')
+prefix = get_option ('prefix')
+schemadir = join_paths (datadir, 'glib-2.0', 'schemas')
+searchproviderdir = join_paths (datadir, 'gnome-shell', 'search-providers')
+servicedir = join_paths (datadir, 'dbus-1', 'services')
+sysconfdir = get_option ('sysconfdir')
+
+glib_ver = '>=2.49.1'
+gnome_desktop_ver = '>=3.0.0'
+pango_ver = '1.28.3'
+gtk_ver = '>=3.21.6'
+xml_ver = '>=2.7.8'
+exif_ver = '>=0.6.20'
+exempi_ver = '>=2.1.0'
+notify_ver = '0.7.0'
+schemas_ver = '>=3.8.0'
+autoar_ver = '>=0.1'
+selinux_ver = '>=2.0'
+
+cc = meson.get_compiler ('c')
+
+gnome = import ('gnome')
+i18n = import ('i18n')
+
+glib = dependency ('glib-2.0', version: glib_ver)
+gtk = dependency ('gtk+-3.0', version: gtk_ver)
+autoar = dependency ('gnome-autoar-0', version: autoar_ver)
+
+gail = dependency ('gail-3.0')
+gnome_desktop = dependency ('gnome-desktop-3.0', version: gnome_desktop_ver)
+xml = dependency ('libxml-2.0', version: xml_ver)
+x11 = dependency ('x11')
+
+gthread = dependency ('gthread-2.0', version: glib_ver)
+gmodule_no_export = dependency ('gmodule-no-export-2.0', version: glib_ver)
+gio = dependency ('gio-2.0', version: glib_ver)
+gio_unix = dependency ('gio-unix-2.0', version: glib_ver)
+gsettings_desktop_schemas = dependency ('gsettings-desktop-schemas',
+                                        version: schemas_ver)
+
+libm = cc.find_library ('libm')
+
+if get_option ('enable-update-mimedb')
+    update_mime_database = find_program ('update-mime-database', required: true)
+endif
+
+exif = dependency ('libexif',
+                   version: exif_ver,
+                   required: get_option ('enable-exif'))
+exempi = dependency ('exempi-2.0',
+                     version: exempi_ver,
+                     required: get_option ('enable-xmp'))
+selinux = dependency ('libselinux',
+                      version: selinux_ver,
+                      required: get_option ('enable-selinux'))
+
+if get_option ('enable-tracker')
+    tracker_sparql = dependency ('tracker-sparql-1.0', required: false)
+
+    if tracker_sparql.found () == false
+        tracker_sparql = dependency ('tracker-sparql-0.18')
+    endif
+endif
+
+conf = configuration_data ()
+conf.set_quoted ('VERSION', meson.project_version ())
+conf.set_quoted ('PACKAGE_VERSION', meson.project_version ())
+conf.set_quoted ('GETTEXT_PACKAGE', 'nautilus')
+conf.set_quoted ('LOCALEDIR', join_paths (prefix, localedir))
+conf.set_quoted ('NAUTILUS_DATADIR', join_paths (datadir, 'nautilus'))
+conf.set_quoted ('NAUTILUS_EXTENSIONDIR', join_paths (prefix, extensiondir))
+
+if get_option ('enable-selinux')
+    conf.set10 ('HAVE_SELINUX', true)
+endif
+
+if get_option ('enable-empty-view')
+    conf.set10 ('ENABLE_EMPTY_VIEW', true)
+endif
+
+if get_option ('enable-desktop')
+    conf.set10 ('ENABLE_DESKTOP', true)
+endif
+
+if get_option ('enable-packagekit')
+    conf.set10 ('ENABLE_PACKAGEKIT', true)
+endif
+
+if get_option ('enable-tracker')
+    conf.set10 ('ENABLE_TRACKER', true)
+endif
+
+configure_file (input: 'config.h.meson',
+                output: 'config.h',
+                configuration: conf)
+
+nautilus_include_dirs = include_directories ('.')
+
+subdir ('eel')
+subdir ('libnautilus-extension')
+
+message ('Updating libgd submodule…')
+run_command ('git', '--git-dir="$MESON_SOURCE_ROOT/.git"', 'submodule', 'update', '--init', 'libgd')
+
+libgd_options = ['static=true',
+                 'with-gtk-hacks=true',
+                 'with-main-view=true',
+                 'with-tagged-entry=true']
+libgd = subproject('libgd', default_options: libgd_options)
+libgd_dep = libgd.get_variable ('libgd_dep')
+
+subdir ('src')
+subdir ('test')
+subdir ('data')
+subdir ('po')
+subdir ('docs')
+
+if get_option ('enable-desktop')
+    subdir ('nautilus-desktop')
+endif
+
+if get_option ('enable-nst-extension')
+    subdir ('nautilus-sendto-extension')
+endif
diff --git a/meson_options.txt b/meson_options.txt
new file mode 100644
index 0000000..99d1989
--- /dev/null
+++ b/meson_options.txt
@@ -0,0 +1,32 @@
+option ('enable-profiling',
+        type: 'boolean',
+        value: false)
+option ('enable-nst-extension',
+        type: 'boolean',
+        value: true)
+option ('enable-exif',
+        type: 'boolean',
+        value: false,
+        description: 'enable EXIF support')
+option ('enable-xmp',
+        type: 'boolean',
+        value: false,
+        description: 'enable XMP support')
+option ('enable-selinux',
+        type: 'boolean',
+        value: true)
+option ('enable-empty-view',
+        type: 'boolean',
+        value: false)
+option ('enable-desktop',
+        type: 'boolean',
+        value: true)
+option ('enable-packagekit',
+        type: 'boolean',
+        value: true)
+option ('enable-tracker',
+        type: 'boolean',
+        value: true)
+option ('enable-update-mimedb',
+        type: 'boolean',
+        value: true)
diff --git a/nautilus-desktop/meson.build b/nautilus-desktop/meson.build
new file mode 100644
index 0000000..a5e207d
--- /dev/null
+++ b/nautilus-desktop/meson.build
@@ -0,0 +1,30 @@
+nautilus_desktop_sources = [
+    'main-desktop.c',
+    'nautilus-desktop-application.c',
+    'nautilus-desktop-application.h',
+    'nautilus-desktop-canvas-view.c',
+    'nautilus-desktop-canvas-view.h',
+    'nautilus-desktop-canvas-view-container.c',
+    'nautilus-desktop-canvas-view-container.h',
+    'nautilus-desktop-directory.c',
+    'nautilus-desktop-directory.h',
+    'nautilus-desktop-directory-file.c',
+    'nautilus-desktop-directory-file.h',
+    'nautilus-desktop-icon-file.c',
+    'nautilus-desktop-icon-file.h',
+    'nautilus-desktop-link.c',
+    'nautilus-desktop-link.h',
+    'nautilus-desktop-link-monitor.c',
+    'nautilus-desktop-link-monitor.h',
+    'nautilus-desktop-metadata.c',
+    'nautilus-desktop-metadata.h',
+    'nautilus-desktop-window.c',
+    'nautilus-desktop-window.h',
+    'nautilus-desktop-window-slot.c',
+    'nautilus-desktop-window-slot.h'
+]
+
+nautilus_desktop = executable ('nautilus-desktop',
+                               nautilus_desktop_sources,
+                               dependencies: libnautilus_dep,
+                               install: true)
diff --git a/nautilus-sendto-extension/meson.build b/nautilus-sendto-extension/meson.build
new file mode 100644
index 0000000..4464625
--- /dev/null
+++ b/nautilus-sendto-extension/meson.build
@@ -0,0 +1,11 @@
+libnautilus_sendto_sources = [
+    'nautilus-nste.c',
+    'nautilus-nste.h',
+    'nautilus-sendto-module.c'
+]
+
+libnautilus_sendto = shared_library ('nautilus-sendto',
+                                     libnautilus_sendto_sources,
+                                     dependencies: nautilus_extension,
+                                     install: true,
+                                     install_dir: extensiondir)
diff --git a/po/meson.build b/po/meson.build
new file mode 100644
index 0000000..08c40c1
--- /dev/null
+++ b/po/meson.build
@@ -0,0 +1 @@
+i18n.gettext ('nautilus')
diff --git a/scripts/git-archive-all.sh b/scripts/git-archive-all.sh
new file mode 100755
index 0000000..fc3be07
--- /dev/null
+++ b/scripts/git-archive-all.sh
@@ -0,0 +1,310 @@
+#!/bin/bash -
+#
+# File:        git-archive-all.sh
+#
+# Description: A utility script that builds an archive file(s) of all
+#              git repositories and submodules in the current path.
+#              Useful for creating a single tarfile of a git super-
+#              project that contains other submodules.
+#
+# Examples:    Use git-archive-all.sh to create archive distributions
+#              from git repositories. To use, simply do:
+#
+#                  cd $GIT_DIR; git-archive-all.sh
+#
+#              where $GIT_DIR is the root of your git superproject.
+#
+# License:     GPL3+
+#
+###############################################################################
+#
+# 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, write to the Free Software
+# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+#
+###############################################################################
+
+# DEBUGGING
+set -e
+set -C # noclobber
+
+# TRAP SIGNALS
+trap 'cleanup' QUIT EXIT
+
+# For security reasons, explicitly set the internal field separator
+# to newline, space, tab
+OLD_IFS=$IFS
+IFS="$(printf '\n \t')"
+
+function cleanup () {
+    rm -f $TMPFILE
+    rm -f $TOARCHIVE
+    IFS="$OLD_IFS"
+}
+
+function usage () {
+    echo "Usage is as follows:"
+    echo
+    echo "$PROGRAM <--version>"
+    echo "    Prints the program version number on a line by itself and exits."
+    echo
+    echo "$PROGRAM <--usage|--help|-?>"
+    echo "    Prints this usage output and exits."
+    echo
+    echo "$PROGRAM [--format <fmt>] [--prefix <path>] [--verbose|-v] [--separate|-s]"
+    echo "         [--worktree-attributes] [--tree-ish|-t <tree-ish>] [output_file]"
+    echo "    Creates an archive for the entire git superproject, and its submodules"
+    echo "    using the passed parameters, described below."
+    echo
+    echo "    If '--format' is specified, the archive is created with the named"
+    echo "    git archiver backend. Obviously, this must be a backend that git archive"
+    echo "    understands. The format defaults to 'tar' if not specified."
+    echo
+    echo "    If '--prefix' is specified, the archive's superproject and all submodules"
+    echo "    are created with the <path> prefix named. The default is to not use one."
+    echo
+    echo "    If '--worktree-attributes' is specified, the invidual archive commands will"
+    echo "    look for attributes in .gitattributes in the working directory too."
+    echo
+    echo "    If '--separate' or '-s' is specified, individual archives will be created"
+    echo "    for each of the superproject itself and its submodules. The default is to"
+    echo "    concatenate individual archives into one larger archive."
+    echo
+    echo "    If '--tree-ish' is specified, the archive will be created based on whatever"
+    echo "    you define the tree-ish to be. Branch names, commit hash, etc. are acceptable."
+    echo "    Defaults to HEAD if not specified. See git archive's documentation for more"
+    echo "    information on what a tree-ish is."
+    echo
+    echo "    If 'output_file' is specified, the resulting archive is created as the"
+    echo "    file named. This parameter is essentially a path that must be writeable."
+    echo "    When combined with '--separate' ('-s') this path must refer to a directory."
+    echo "    Without this parameter or when combined with '--separate' the resulting"
+    echo "    archive(s) are named with a dot-separated path of the archived directory and"
+    echo "    a file extension equal to their format (e.g., 'superdir.submodule1dir.tar')."
+    echo
+    echo "    The special value '-' (single dash) is treated as STDOUT and, when used, the"
+    echo "    --separate option is ignored. Use a double-dash to separate the outfile from"
+    echo "    the value of previous options. For example, to write a .zip file to STDOUT:"
+    echo
+    echo "        ./$PROGRAM --format zip -- -"
+    echo
+    echo "    If '--verbose' or '-v' is specified, progress will be printed."
+}
+
+function version () {
+    echo "$PROGRAM version $VERSION"
+}
+
+# Internal variables and initializations.
+readonly PROGRAM=`basename "$0"`
+readonly VERSION=0.3
+
+SEPARATE=0
+VERBOSE=0
+
+TARCMD=`command -v gnutar || command -v tar`
+FORMAT=tar
+PREFIX=
+TREEISH=HEAD
+ARCHIVE_OPTS=
+
+# RETURN VALUES/EXIT STATUS CODES
+readonly E_BAD_OPTION=254
+readonly E_UNKNOWN=255
+
+# Process command-line arguments.
+while test $# -gt 0; do
+    if [ x"$1" == x"--" ]; then
+        # detect argument termination
+        shift
+        break
+    fi
+    case $1 in
+        --format )
+            shift
+            FORMAT="$1"
+            shift
+            ;;
+
+        --prefix )
+            shift
+            PREFIX="$1"
+            shift
+            ;;
+
+        --worktree-attributes )
+            ARCHIVE_OPTS+=" $1"
+            shift
+            ;;
+
+        --separate | -s )
+            shift
+            SEPARATE=1
+            ;;
+
+        --tree-ish | -t )
+            shift
+            TREEISH="$1"
+            shift
+            ;;
+
+        --version )
+            version
+            exit
+            ;;
+
+        --verbose | -v )
+            shift
+            VERBOSE=1
+            ;;
+
+        -? | --usage | --help )
+            usage
+            exit
+            ;;
+
+        -* )
+            echo "Unrecognized option: $1" >&2
+            usage
+            exit $E_BAD_OPTION
+            ;;
+
+        * )
+            break
+            ;;
+    esac
+done
+
+OLD_PWD="`pwd`"
+TMPDIR=${TMPDIR:-/tmp}
+TMPFILE=`mktemp "$TMPDIR/$PROGRAM.XXXXXX"` # Create a place to store our work's progress
+TOARCHIVE=`mktemp "$TMPDIR/$PROGRAM.toarchive.XXXXXX"`
+OUT_FILE=$OLD_PWD # assume "this directory" without a name change by default
+
+if [ ! -z "$1" ]; then
+    OUT_FILE="$1"
+    if [ "-" == "$OUT_FILE" ]; then
+        SEPARATE=0
+    fi
+    shift
+fi
+
+# Validate parameters; error early, error often.
+if [ "-" == "$OUT_FILE" -o $SEPARATE -ne 1 ] && [ "$FORMAT" == "tar" -a `$TARCMD --help | grep -q -- 
"--concatenate"; echo $?` -ne 0 ]; then
+    echo "Your 'tar' does not support the '--concatenate' option, which we need"
+    echo "to produce a single tarfile. Either install a compatible tar (such as"
+    echo "gnutar), or invoke $PROGRAM with the '--separate' option."
+    exit
+elif [ $SEPARATE -eq 1 -a ! -d "$OUT_FILE" ]; then
+    echo "When creating multiple archives, your destination must be a directory."
+    echo "If it's not, you risk being surprised when your files are overwritten."
+    exit
+elif [ `git config -l | grep -q '^core\.bare=true'; echo $?` -eq 0 ]; then
+    echo "$PROGRAM must be run from a git working copy (i.e., not a bare repository)."
+    exit
+fi
+
+# Create the superproject's git-archive
+if [ $VERBOSE -eq 1 ]; then
+    echo -n "creating superproject archive..."
+fi
+git archive --format=$FORMAT --prefix="$PREFIX" $ARCHIVE_OPTS $TREEISH > $TMPDIR/$(basename "$(pwd)").$FORMAT
+if [ $VERBOSE -eq 1 ]; then
+    echo "done"
+fi
+echo $TMPDIR/$(basename "$(pwd)").$FORMAT >| $TMPFILE # clobber on purpose
+superfile=`head -n 1 $TMPFILE`
+
+if [ $VERBOSE -eq 1 ]; then
+    echo -n "looking for subprojects..."
+fi
+# find all '.git' dirs, these show us the remaining to-be-archived dirs
+# we only want directories that are below the current directory
+find . -mindepth 2 -name '.git' -type d -print | sed -e 's/^\.\///' -e 's/\.git$//' >> $TOARCHIVE
+# as of version 1.7.8, git places the submodule .git directories under the superprojects .git dir
+# the submodules get a .git file that points to their .git dir. we need to find all of these too
+find . -mindepth 2 -name '.git' -type f -print | xargs grep -l "gitdir" | sed -e 's/^\.\///' -e 's/\.git$//' 
$TOARCHIVE
+if [ $VERBOSE -eq 1 ]; then
+    echo "done"
+    echo "  found:"
+    cat $TOARCHIVE | while read arch
+    do
+      echo "    $arch"
+    done
+fi
+
+if [ $VERBOSE -eq 1 ]; then
+    echo -n "archiving submodules..."
+fi
+while read path; do
+    TREEISH=$(git submodule | grep "^ .*${path%/} " | cut -d ' ' -f 2) # git submodule does not list 
trailing slashes in $path
+    cd "$path"
+    git archive --format=$FORMAT --prefix="${PREFIX}$path" $ARCHIVE_OPTS ${TREEISH:-HEAD} > 
"$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT
+    if [ $FORMAT == 'zip' ]; then
+        # delete the empty directory entry; zipped submodules won't unzip if we don't do this
+        zip -d "$(tail -n 1 $TMPFILE)" "${PREFIX}${path%/}" >/dev/null # remove trailing '/'
+    fi
+    echo "$TMPDIR"/"$(echo "$path" | sed -e 's/\//./g')"$FORMAT >> $TMPFILE
+    cd "$OLD_PWD"
+done < $TOARCHIVE
+if [ $VERBOSE -eq 1 ]; then
+    echo "done"
+fi
+
+if [ $VERBOSE -eq 1 ]; then
+    echo -n "concatenating archives into single archive..."
+fi
+# Concatenate archives into a super-archive.
+if [ $SEPARATE -eq 0 -o "-" == "$OUT_FILE" ]; then
+    if [ $FORMAT == 'tar.gz' ]; then
+        gunzip $superfile
+        superfile=${superfile:0: -3} # Remove '.gz'
+        sed -e '1d' $TMPFILE | while read file; do
+            gunzip $file
+            file=${file:0: -3}
+            $TARCMD --concatenate -f "$superfile" "$file" && rm -f "$file"
+        done
+        gzip $superfile
+        superfile=$superfile.gz
+    elif [ $FORMAT == 'tar' ]; then
+        sed -e '1d' $TMPFILE | while read file; do
+            $TARCMD --concatenate -f "$superfile" "$file" && rm -f "$file"
+        done
+    elif [ $FORMAT == 'zip' ]; then
+        sed -e '1d' $TMPFILE | while read file; do
+            # zip incorrectly stores the full path, so cd and then grow
+            cd `dirname "$file"`
+            zip -g "$superfile" `basename "$file"` && rm -f "$file"
+        done
+        cd "$OLD_PWD"
+    fi
+
+    echo "$superfile" >| $TMPFILE # clobber on purpose
+fi
+if [ $VERBOSE -eq 1 ]; then
+    echo "done"
+fi
+
+if [ $VERBOSE -eq 1 ]; then
+    echo -n "moving archive to $OUT_FILE..."
+fi
+while read file; do
+    if [ "-" == "$OUT_FILE" ]; then
+        cat "$file" && rm -f "$file"
+    else
+        mv "$file" "$OUT_FILE"
+    fi
+done < $TMPFILE
+if [ $VERBOSE -eq 1 ]; then
+    echo "done"
+fi
diff --git a/src/meson.build b/src/meson.build
new file mode 100644
index 0000000..a1f69ca
--- /dev/null
+++ b/src/meson.build
@@ -0,0 +1,293 @@
+built_sources = []
+gdbus_sources = []
+enums = []
+
+gdbus_sources += gnome.gdbus_codegen ('nautilus-freedesktop-generated',
+                                      join_paths (meson.source_root (), 'data', 
'freedesktop-dbus-interfaces.xml'),
+                                      interface_prefix: 'org.freedesktop',
+                                      namespace: 'NautilusFreedesktop')
+# The header is used in nautilus-desktop.
+built_sources += gdbus_sources
+
+gdbus_sources += gnome.gdbus_codegen ('nautilus-generated',
+                                      join_paths (meson.source_root (), 'data', 'dbus-interfaces.xml'),
+                                      interface_prefix: 'org.gnome.Nautilus',
+                                      namespace: 'NautilusDBus')
+
+gdbus_sources += gnome.gdbus_codegen ('nautilus-shell-search-provider-generated',
+                                      join_paths (meson.source_root (), 'data', 
'shell-search-provider-dbus-interfaces.xml'),
+                                      interface_prefix: 'org.gnome',
+                                      namespace: 'Nautilus')
+
+enum_headers = [
+    'nautilus-search-popover.h',
+    'nautilus-special-location-bar.h',
+    'nautilus-query.h',
+    'nautilus-search-provider.h'
+]
+
+enums += gnome.mkenums ('nautilus-enum-types',
+                        c_template: 'nautilus-enum-types.c.template',
+                        h_template: 'nautilus-enum-types.h.template',
+                        sources: enum_headers)
+
+resources = gnome.compile_resources ('nautilus-resources',
+                                     'resources/nautilus.gresource.xml',
+                                     source_dir: 'resources',
+                                     c_name: 'nautilus',
+                                     extra_args: '--manual-register')
+built_sources += resources[1]
+
+libnautilus_sources = [
+    enums,
+    gdbus_sources,
+    resources[0],
+    'gtk/nautilusgtkplacesview.c',
+    'gtk/nautilusgtkplacesviewprivate.h',
+    'gtk/nautilusgtkplacesviewrow.c',
+    'gtk/nautilusgtkplacesviewrowprivate.h',
+    'nautilus-application.c',
+    'nautilus-application.h',
+    'nautilus-bookmark-list.c',
+    'nautilus-bookmark-list.h',
+    'nautilus-canvas-view.c',
+    'nautilus-canvas-view.h',
+    'nautilus-canvas-view-container.c',
+    'nautilus-canvas-view-container.h',
+    'nautilus-dbus-manager.c',
+    'nautilus-dbus-manager.h',
+    'nautilus-desktop-item-properties.c',
+    'nautilus-desktop-item-properties.h',
+    'nautilus-error-reporting.c',
+    'nautilus-error-reporting.h',
+    'nautilus-preferences-window.c',
+    'nautilus-preferences-window.h',
+    'nautilus-files-view.c',
+    'nautilus-files-view.h',
+    'nautilus-files-view-dnd.c',
+    'nautilus-files-view-dnd.h',
+    'nautilus-floating-bar.c',
+    'nautilus-floating-bar.h',
+    'nautilus-freedesktop-dbus.c',
+    'nautilus-freedesktop-dbus.h',
+    'nautilus-image-properties-page.c',
+    'nautilus-image-properties-page.h',
+    'nautilus-list-model.c',
+    'nautilus-list-model.h',
+    'nautilus-list-view.c',
+    'nautilus-list-view.h',
+    'nautilus-list-view-private.h',
+    'nautilus-list-view-dnd.c',
+    'nautilus-list-view-dnd.h',
+    'nautilus-location-entry.c',
+    'nautilus-location-entry.h',
+    'nautilus-mime-actions.c',
+    'nautilus-mime-actions.h',
+    'nautilus-notebook.c',
+    'nautilus-notebook.h',
+    'nautilus-other-locations-window-slot.c',
+    'nautilus-other-locations-window-slot.h',
+    'nautilus-pathbar.c',
+    'nautilus-pathbar.h',
+    'nautilus-places-view.c',
+    'nautilus-places-view.h',
+    'nautilus-previewer.c',
+    'nautilus-previewer.h',
+    'nautilus-progress-info-widget.c',
+    'nautilus-progress-info-widget.h',
+    'nautilus-progress-persistence-handler.c',
+    'nautilus-progress-persistence-handler.h',
+    'nautilus-properties-window.c',
+    'nautilus-properties-window.h',
+    'nautilus-query-editor.c',
+    'nautilus-query-editor.h',
+    'nautilus-search-popover.c',
+    'nautilus-self-check-functions.c',
+    'nautilus-self-check-functions.h',
+    'nautilus-shell-search-provider.c',
+    'nautilus-special-location-bar.c',
+    'nautilus-toolbar.c',
+    'nautilus-toolbar.h',
+    'nautilus-toolbar-menu-sections.h',
+    'nautilus-trash-bar.c',
+    'nautilus-trash-bar.h',
+    'nautilus-view.c',
+    'nautilus-view.h',
+    'nautilus-window-slot.c',
+    'nautilus-window-slot.h',
+    'nautilus-window-slot-dnd.c',
+    'nautilus-window-slot-dnd.h',
+    'nautilus-window.c',
+    'nautilus-window.h',
+    'nautilus-x-content-bar.c',
+    'nautilus-x-content-bar.h',
+    'nautilus-bookmark.c',
+    'nautilus-bookmark.h',
+    'nautilus-canvas-container.c',
+    'nautilus-canvas-container.h',
+    'nautilus-canvas-dnd.c',
+    'nautilus-canvas-dnd.h',
+    'nautilus-canvas-item.c',
+    'nautilus-canvas-item.h',
+    'nautilus-canvas-private.h',
+    'nautilus-clipboard.c',
+    'nautilus-clipboard.h',
+    'nautilus-column-chooser.c',
+    'nautilus-column-chooser.h',
+    'nautilus-column-utilities.c',
+    'nautilus-column-utilities.h',
+    'nautilus-debug.c',
+    'nautilus-debug.h',
+    'nautilus-default-file-icon.c',
+    'nautilus-default-file-icon.h',
+    'nautilus-directory-async.c',
+    'nautilus-directory-notify.h',
+    'nautilus-directory-private.h',
+    'nautilus-directory.c',
+    'nautilus-directory.h',
+    'nautilus-dnd.c',
+    'nautilus-dnd.h',
+    'nautilus-file-attributes.h',
+    'nautilus-file-changes-queue.c',
+    'nautilus-file-changes-queue.h',
+    'nautilus-file-conflict-dialog.c',
+    'nautilus-file-conflict-dialog.h',
+    'nautilus-file-name-widget-controller.c',
+    'nautilus-file-name-widget-controller.h',
+    'nautilus-rename-file-popover-controller.c',
+    'nautilus-rename-file-popover-controller.h',
+    'nautilus-new-folder-dialog-controller.c',
+    'nautilus-new-folder-dialog-controller.h',
+    'nautilus-compress-dialog-controller.c',
+    'nautilus-compress-dialog-controller.h',
+    'nautilus-operations-ui-manager.c',
+    'nautilus-operations-ui-manager.h',
+    'nautilus-file-operations.c',
+    'nautilus-file-operations.h',
+    'nautilus-file-private.h',
+    'nautilus-file-queue.c',
+    'nautilus-file-queue.h',
+    'nautilus-file-utilities.c',
+    'nautilus-file-utilities.h',
+    'nautilus-file.c',
+    'nautilus-file.h',
+    'nautilus-global-preferences.c',
+    'nautilus-global-preferences.h',
+    'nautilus-icon-info.c',
+    'nautilus-icon-info.h',
+    'nautilus-icon-names.h',
+    'nautilus-keyfile-metadata.c',
+    'nautilus-keyfile-metadata.h',
+    'nautilus-lib-self-check-functions.c',
+    'nautilus-lib-self-check-functions.h',
+    'nautilus-link.c',
+    'nautilus-link.h',
+    'nautilus-metadata.h',
+    'nautilus-metadata.c',
+    'nautilus-mime-application-chooser.c',
+    'nautilus-mime-application-chooser.h',
+    'nautilus-module.c',
+    'nautilus-module.h',
+    'nautilus-monitor.c',
+    'nautilus-monitor.h',
+    'nautilus-profile.c',
+    'nautilus-profile.h',
+    'nautilus-progress-info.c',
+    'nautilus-progress-info.h',
+    'nautilus-progress-info-manager.c',
+    'nautilus-progress-info-manager.h',
+    'nautilus-program-choosing.c',
+    'nautilus-program-choosing.h',
+    'nautilus-recent.c',
+    'nautilus-recent.h',
+    'nautilus-search-directory.c',
+    'nautilus-search-directory.h',
+    'nautilus-search-directory-file.c',
+    'nautilus-search-directory-file.h',
+    'nautilus-search-provider.c',
+    'nautilus-search-provider.h',
+    'nautilus-search-engine.c',
+    'nautilus-search-engine.h',
+    'nautilus-search-engine-model.c',
+    'nautilus-search-engine-model.h',
+    'nautilus-search-engine-simple.c',
+    'nautilus-search-engine-simple.h',
+    'nautilus-search-hit.c',
+    'nautilus-search-hit.h',
+    'nautilus-selection-canvas-item.c',
+    'nautilus-selection-canvas-item.h',
+    'nautilus-signaller.h',
+    'nautilus-signaller.c',
+    'nautilus-query.c',
+    'nautilus-thumbnails.c',
+    'nautilus-thumbnails.h',
+    'nautilus-trash-monitor.c',
+    'nautilus-trash-monitor.h',
+    'nautilus-tree-view-drag-dest.c',
+    'nautilus-tree-view-drag-dest.h',
+    'nautilus-ui-utilities.c',
+    'nautilus-ui-utilities.h',
+    'nautilus-video-mime-types.h',
+    'nautilus-vfs-directory.c',
+    'nautilus-vfs-directory.h',
+    'nautilus-vfs-file.c',
+    'nautilus-vfs-file.h',
+    'nautilus-file-undo-operations.c',
+    'nautilus-file-undo-operations.h',
+    'nautilus-file-undo-manager.c',
+    'nautilus-file-undo-manager.h'
+]
+
+if get_option ('enable-tracker')
+    libnautilus_sources += ['nautilus-batch-rename-dialog.c',
+                            'nautilus-batch-rename-dialog.h',
+                            'nautilus-batch-rename-utilities.c',
+                            'nautilus-batch-rename-utilities.h',
+                            'nautilus-search-engine-tracker.c',
+                            'nautilus-search-engine-tracker.h']
+endif
+
+nautilus_deps = [glib,
+                 gtk,
+                 autoar,
+                 xml,
+                 gsettings_desktop_schemas,
+                 libgd_dep,
+                 gail,
+                 gnome_desktop,
+                 eel_2,
+                 nautilus_extension,
+                 x11]
+
+if get_option ('enable-tracker')
+    nautilus_deps += tracker_sparql
+endif
+
+if get_option ('enable-selinux')
+    nautilus_deps += selinux
+endif
+
+libnautilus = static_library ('nautilus',
+                              libnautilus_sources,
+                              dependencies: nautilus_deps,
+                              include_directories: nautilus_include_dirs)
+
+libnautilus_include_dirs = include_directories ('.')
+
+libnautilus_dep = declare_dependency (link_with: libnautilus,
+                                      include_directories: [nautilus_include_dirs,
+                                                            libnautilus_include_dirs],
+                                      dependencies: nautilus_deps,
+                                      sources: built_sources)
+
+nautilus = executable ('nautilus',
+                       'nautilus-main.c',
+                       dependencies: libnautilus_dep,
+                       install: true)
+
+test ('nautilus', nautilus, args: ['--check', '--g-fatal-warnings'])
+
+nautilus_autorun_software = executable ('nautilus-autorun-software',
+                                        'nautilus-autorun-software.c',
+                                        dependencies: libnautilus_dep,
+                                        install: true)
diff --git a/src/nautilus-search-provider.c b/src/nautilus-search-provider.c
index eee91bc..9a4a655 100644
--- a/src/nautilus-search-provider.c
+++ b/src/nautilus-search-provider.c
@@ -18,7 +18,7 @@
 
 #include <config.h>
 #include "nautilus-search-provider.h"
-#include "nautilus-enum-types.c"
+#include "nautilus-enum-types.h"
 
 #include <glib-object.h>
 
diff --git a/subprojects/libgd b/subprojects/libgd
new file mode 120000
index 0000000..82fb691
--- /dev/null
+++ b/subprojects/libgd
@@ -0,0 +1 @@
+../libgd
\ No newline at end of file
diff --git a/test/meson.build b/test/meson.build
new file mode 100644
index 0000000..860c30e
--- /dev/null
+++ b/test/meson.build
@@ -0,0 +1,32 @@
+test_copy = executable ('test-copy',
+                        ['test-copy.c',
+                         'test.c',
+                         'test.h'],
+                        dependencies: libnautilus_dep)
+
+test_nautilus_search_engine = executable ('test-nautilus-search-engine',
+                                          'test-nautilus-search-engine.c',
+                                          dependencies: libnautilus_dep)
+
+test_nautilus_directory_async = executable ('test-nautilus-directory-async',
+                                            'test-nautilus-directory-async.c',
+                                            dependencies: libnautilus_dep)
+
+test_file_utilities_get_common_filename_prefix = executable 
('test-file-utilities-get-common-filename-prefix',
+                                                             
'test-file-utilities-get-common-filename-prefix.c',
+                                                             dependencies: libnautilus_dep)
+
+test_eel_string_rtrim_punctuation = executable ('test-eel-string-rtrim-punctuation',
+                                                'test-eel-string-rtrim-punctuation.c',
+                                                dependencies: libnautilus_dep)
+
+test_eel_string_get_common_prefix = executable ('test-eel-string-get-common-prefix',
+                                                'test-eel-string-get-common-prefix.c',
+                                                dependencies: libnautilus_dep)
+
+test ('test-copy', test_copy)
+test ('test-nautilus-search-engine', test_nautilus_search_engine)
+test ('test-nautilus-directory-async', test_nautilus_directory_async)
+test ('test-file-utilities-get-common-filename-prefix', test_file_utilities_get_common_filename_prefix)
+test ('test-eel-string-rtrim-punctuation', test_eel_string_rtrim_punctuation)
+test ('test-eel-string-get-common-prefix', test_eel_string_get_common_prefix)



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]