forked from pool/gnote
Accepting request 72288 from GNOME:Apps
Fix build (forwarded request 72287 from vuntz) OBS-URL: https://build.opensuse.org/request/show/72288 OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/gnote?expand=0&rev=8
This commit is contained in:
@@ -1,3 +0,0 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:4853315711baf7647cdae4c2f7d23e22e2b13322605efe3dd98796a06f928321
|
||||
size 1606926
|
3
gnote-0.7.4.tar.bz2
Normal file
3
gnote-0.7.4.tar.bz2
Normal file
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:19bf64397278b85703979fd4943692f6c44579e597bad27acf04a64d6813e6f2
|
||||
size 1787015
|
30
gnote-no-deprecated.patch
Normal file
30
gnote-no-deprecated.patch
Normal file
@@ -0,0 +1,30 @@
|
||||
commit 49cefcc356732b25f34e8b1badabbab079c8377b
|
||||
Author: Vincent Untz <vuntz@gnome.org>
|
||||
Date: Tue May 31 15:45:26 2011 +0200
|
||||
|
||||
Stop using some deprecated GdkDrawable API
|
||||
|
||||
https://bugzilla.gnome.org/show_bug.cgi?id=651551
|
||||
|
||||
diff --git a/libtomboy/tomboyutil.c b/libtomboy/tomboyutil.c
|
||||
index 77e71f9..661cb9f 100644
|
||||
--- a/libtomboy/tomboyutil.c
|
||||
+++ b/libtomboy/tomboyutil.c
|
||||
@@ -73,7 +73,7 @@ tomboy_window_move_to_current_workspace (GtkWindow *window)
|
||||
{
|
||||
GdkWindow *gdkwin = gtk_widget_get_window(GTK_WIDGET (window));
|
||||
GdkWindow *rootwin =
|
||||
- gdk_screen_get_root_window (gdk_drawable_get_screen (gdkwin));
|
||||
+ gdk_screen_get_root_window (gdk_window_get_screen (gdkwin));
|
||||
|
||||
GdkAtom current_desktop =
|
||||
gdk_atom_intern ("_NET_CURRENT_DESKTOP", FALSE);
|
||||
@@ -107,7 +107,7 @@ tomboy_window_move_to_current_workspace (GtkWindow *window)
|
||||
xev.xclient.window = GDK_WINDOW_XID (gdkwin);
|
||||
xev.xclient.message_type =
|
||||
gdk_x11_atom_to_xatom_for_display(
|
||||
- gdk_drawable_get_display (gdkwin),
|
||||
+ gdk_window_get_display (gdkwin),
|
||||
wm_desktop);
|
||||
xev.xclient.format = 32;
|
||||
xev.xclient.data.l[0] = workspace;
|
@@ -1,335 +0,0 @@
|
||||
From a52e9a93621f4df84c0c93b4b5367165778cc362 Mon Sep 17 00:00:00 2001
|
||||
From: Debarshi Ray <debarshir@src.gnome.org>
|
||||
Date: Tue, 08 Mar 2011 14:53:12 +0000
|
||||
Subject: Replace boost::filesystem::path with Glib equivalents
|
||||
|
||||
Added some tests to reduce chances of breakage and document edge-case
|
||||
behavior.
|
||||
|
||||
Changes from prior behavior:
|
||||
+ sharp::file_filename("/foo/bar/") == "bar" (not ".")
|
||||
Ditto for sharp::FileInfo::get_name.
|
||||
+ sharp::file_basename("/foo/bar/") == "bar" (not "")
|
||||
|
||||
Fixes: https://bugzilla.gnome.org/641416
|
||||
---
|
||||
diff --git a/src/Makefile.am b/src/Makefile.am
|
||||
index 141d923..19c8795 100644
|
||||
--- a/src/Makefile.am
|
||||
+++ b/src/Makefile.am
|
||||
@@ -28,9 +28,9 @@ GNOTE_LIBS = libgnote.a $(top_builddir)/libtomboy/libtomboy.la \
|
||||
noinst_LIBRARIES = libgnote.a
|
||||
bin_PROGRAMS = gnote
|
||||
check_PROGRAMS = trietest stringtest notetest dttest uritest filestest \
|
||||
- xmlreadertest
|
||||
+ fileinfotest xmlreadertest
|
||||
TESTS = trietest stringtest notetest dttest uritest filestest \
|
||||
- xmlreadertest
|
||||
+ fileinfotest xmlreadertest
|
||||
|
||||
|
||||
trietest_SOURCES = test/trietest.cpp \
|
||||
@@ -47,7 +47,11 @@ stringtest_LDADD = @PCRE_LIBS@ @LIBGLIBMM_LIBS@
|
||||
|
||||
filestest_SOURCES = test/filestest.cpp \
|
||||
sharp/files.cpp
|
||||
-filestest_LDADD = @BOOST_FILESYSTEM_LIBS@ -lboost_system-mt
|
||||
+filestest_LDADD = @BOOST_FILESYSTEM_LIBS@ @LIBGLIBMM_LIBS@ -lboost_system-mt
|
||||
+
|
||||
+fileinfotest_SOURCES = test/fileinfotest.cpp \
|
||||
+ sharp/fileinfo.cpp
|
||||
+fileinfotest_LDADD = @BOOST_FILESYSTEM_LIBS@ @LIBGLIBMM_LIBS@ -lboost_system-mt
|
||||
|
||||
uritest_SOURCES = test/uritest.cpp \
|
||||
sharp/string.cpp sharp/uri.cpp debug.cpp
|
||||
diff --git a/src/sharp/directory.cpp b/src/sharp/directory.cpp
|
||||
index 8a38f43..d9ee931 100644
|
||||
--- a/src/sharp/directory.cpp
|
||||
+++ b/src/sharp/directory.cpp
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* gnote
|
||||
*
|
||||
+ * Copyright (C) 2011 Debarshi Ray
|
||||
* Copyright (C) 2009 Hubert Figuiere
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
@@ -27,8 +28,10 @@
|
||||
#include <boost/filesystem/convenience.hpp>
|
||||
#include <boost/filesystem/path.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
+#include <glibmm.h>
|
||||
|
||||
#include "sharp/directory.hpp"
|
||||
+#include "sharp/fileinfo.hpp"
|
||||
#include "sharp/string.hpp"
|
||||
|
||||
namespace sharp {
|
||||
@@ -38,20 +41,21 @@ namespace sharp {
|
||||
const std::string & ext,
|
||||
std::list<std::string> & list)
|
||||
{
|
||||
- boost::filesystem::path p(dir);
|
||||
-
|
||||
- if(!exists(p)) {
|
||||
+ if (!Glib::file_test(dir, Glib::FILE_TEST_EXISTS))
|
||||
return;
|
||||
- }
|
||||
- boost::filesystem::directory_iterator end_itr;
|
||||
- for ( boost::filesystem::directory_iterator itr( p );
|
||||
- itr != end_itr;
|
||||
- ++itr )
|
||||
- {
|
||||
- // is_regular() is deprecated but is_regular_file isn't in 1.34.
|
||||
- if ( is_regular(*itr) && (ext.empty() || (sharp::string_to_lower(extension(*itr)) == ext)) )
|
||||
- {
|
||||
- list.push_back(itr->string());
|
||||
+
|
||||
+ if (!Glib::file_test(dir, Glib::FILE_TEST_IS_DIR))
|
||||
+ return;
|
||||
+
|
||||
+ Glib::Dir d(dir);
|
||||
+
|
||||
+ for (Glib::Dir::iterator itr = d.begin(); itr != d.end(); ++itr) {
|
||||
+ const sharp::FileInfo file_info(*itr);
|
||||
+ const std::string & extension = file_info.get_extension();
|
||||
+
|
||||
+ if (Glib::file_test(*itr, Glib::FILE_TEST_IS_REGULAR)
|
||||
+ && (ext.empty() || (sharp::string_to_lower(extension) == ext))) {
|
||||
+ list.push_back(*itr);
|
||||
}
|
||||
}
|
||||
}
|
||||
diff --git a/src/sharp/fileinfo.cpp b/src/sharp/fileinfo.cpp
|
||||
index 52d2760..a53d570 100644
|
||||
--- a/src/sharp/fileinfo.cpp
|
||||
+++ b/src/sharp/fileinfo.cpp
|
||||
@@ -23,8 +23,7 @@
|
||||
*/
|
||||
|
||||
|
||||
-#include <boost/filesystem/path.hpp>
|
||||
-#include <boost/filesystem/convenience.hpp>
|
||||
+#include <glibmm.h>
|
||||
#include "sharp/fileinfo.hpp"
|
||||
|
||||
|
||||
@@ -42,17 +41,19 @@ namespace sharp {
|
||||
|
||||
std::string FileInfo::get_name() const
|
||||
{
|
||||
-#if BOOST_VERSION >= 103600
|
||||
- return boost::filesystem::path(m_path).filename();
|
||||
-#else
|
||||
- return boost::filesystem::path(m_path).leaf();
|
||||
-#endif
|
||||
+ return Glib::path_get_basename(m_path);
|
||||
}
|
||||
|
||||
|
||||
std::string FileInfo::get_extension() const
|
||||
{
|
||||
- return boost::filesystem::extension(m_path);
|
||||
+ const std::string & name = get_name();
|
||||
+
|
||||
+ if ("." == name || ".." == name)
|
||||
+ return "";
|
||||
+
|
||||
+ const std::string::size_type pos = name.find_last_of('.');
|
||||
+ return (std::string::npos == pos) ? "" : std::string(name, pos);
|
||||
}
|
||||
|
||||
|
||||
diff --git a/src/sharp/files.cpp b/src/sharp/files.cpp
|
||||
index d15cb32..f1a1e4b 100644
|
||||
--- a/src/sharp/files.cpp
|
||||
+++ b/src/sharp/files.cpp
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <boost/version.hpp>
|
||||
#include <boost/filesystem/operations.hpp>
|
||||
-#include <boost/filesystem/convenience.hpp>
|
||||
+#include <glibmm.h>
|
||||
|
||||
#include "files.hpp"
|
||||
|
||||
@@ -34,30 +34,28 @@ namespace sharp {
|
||||
|
||||
bool file_exists(const std::string & file)
|
||||
{
|
||||
- boost::filesystem::path p(file);
|
||||
- // is_regular_file isn't in 1.34. is_regular is deprecated.
|
||||
- return (exists(p) && is_regular(p));
|
||||
+ return Glib::file_test(file, Glib::FILE_TEST_EXISTS)
|
||||
+ && Glib::file_test(file, Glib::FILE_TEST_IS_REGULAR);
|
||||
}
|
||||
|
||||
|
||||
std::string file_basename(const std::string & p)
|
||||
{
|
||||
-#if BOOST_VERSION >= 103600
|
||||
- return boost::filesystem::path(p).stem();
|
||||
-#else
|
||||
- return boost::filesystem::basename(boost::filesystem::path(p));
|
||||
-#endif
|
||||
+ const std::string & filename = Glib::path_get_basename(p);
|
||||
+ const std::string::size_type pos = filename.find_last_of('.');
|
||||
+
|
||||
+ return std::string(filename, 0, pos);
|
||||
}
|
||||
|
||||
std::string file_dirname(const std::string & p)
|
||||
{
|
||||
- return boost::filesystem::path(p).branch_path().string();
|
||||
+ return Glib::path_get_dirname(p);
|
||||
}
|
||||
|
||||
|
||||
std::string file_filename(const std::string & p)
|
||||
{
|
||||
- return boost::filesystem::path(p).leaf();
|
||||
+ return Glib::path_get_basename(p);
|
||||
}
|
||||
|
||||
void file_delete(const std::string & p)
|
||||
diff --git a/src/test/fileinfotest.cpp b/src/test/fileinfotest.cpp
|
||||
new file mode 100644
|
||||
index 0000000..c4c5931
|
||||
--- a/dev/null
|
||||
+++ b/src/test/fileinfotest.cpp
|
||||
@@ -0,0 +1,62 @@
|
||||
+/*
|
||||
+ * gnote
|
||||
+ *
|
||||
+ * Copyright (C) 2011 Debarshi Ray
|
||||
+ *
|
||||
+ * 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 <boost/test/minimal.hpp>
|
||||
+
|
||||
+#include "sharp/fileinfo.hpp"
|
||||
+
|
||||
+int test_main(int /*argc*/, char ** /*argv*/)
|
||||
+{
|
||||
+ {
|
||||
+ sharp::FileInfo file_info("/foo/bar/baz.txt");
|
||||
+
|
||||
+ BOOST_CHECK(file_info.get_name() == "baz.txt");
|
||||
+ BOOST_CHECK(file_info.get_extension() == ".txt");
|
||||
+ }
|
||||
+
|
||||
+ {
|
||||
+ sharp::FileInfo file_info("/foo/bar/baz.");
|
||||
+
|
||||
+ BOOST_CHECK(file_info.get_name() == "baz.");
|
||||
+ BOOST_CHECK(file_info.get_extension() == ".");
|
||||
+ }
|
||||
+
|
||||
+ {
|
||||
+ sharp::FileInfo file_info("/foo/bar/baz");
|
||||
+
|
||||
+ BOOST_CHECK(file_info.get_name() == "baz");
|
||||
+ BOOST_CHECK(file_info.get_extension() == "");
|
||||
+ }
|
||||
+
|
||||
+ {
|
||||
+ sharp::FileInfo file_info("/foo/bar/..");
|
||||
+
|
||||
+ BOOST_CHECK(file_info.get_name() == "..");
|
||||
+ BOOST_CHECK(file_info.get_extension() == "");
|
||||
+ }
|
||||
+
|
||||
+ {
|
||||
+ sharp::FileInfo file_info("/foo/bar/");
|
||||
+
|
||||
+ BOOST_CHECK(file_info.get_name() == "bar");
|
||||
+ BOOST_CHECK(file_info.get_extension() == "");
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
diff --git a/src/test/filestest.cpp b/src/test/filestest.cpp
|
||||
index d11e54c..7579dba 100644
|
||||
--- a/src/test/filestest.cpp
|
||||
+++ b/src/test/filestest.cpp
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* gnote
|
||||
*
|
||||
+ * Copyright (C) 2011 Debarshi Ray
|
||||
* Copyright (C) 2009 Hubert Figuiere
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
@@ -20,6 +21,7 @@
|
||||
#include <iostream>
|
||||
|
||||
#include <boost/test/minimal.hpp>
|
||||
+#include <glibmm.h>
|
||||
|
||||
#include "sharp/files.hpp"
|
||||
|
||||
@@ -27,10 +29,46 @@ using namespace sharp;
|
||||
|
||||
int test_main(int /*argc*/, char ** /*argv*/)
|
||||
{
|
||||
- std::string path = "/foo/bar/baz.txt";
|
||||
+ {
|
||||
+ std::string path = "/foo/bar/baz.txt";
|
||||
|
||||
- BOOST_CHECK(file_basename(path) == "baz");
|
||||
- BOOST_CHECK(file_dirname(path) == "/foo/bar");
|
||||
+ BOOST_CHECK(file_basename(path) == "baz");
|
||||
+ BOOST_CHECK(file_dirname(path) == "/foo/bar");
|
||||
+ BOOST_CHECK(file_filename(path) == "baz.txt");
|
||||
+ }
|
||||
+
|
||||
+ {
|
||||
+ std::string path = "/foo/bar/baz";
|
||||
+
|
||||
+ BOOST_CHECK(file_basename(path) == "baz");
|
||||
+ BOOST_CHECK(file_dirname(path) == "/foo/bar");
|
||||
+ BOOST_CHECK(file_filename(path) == "baz");
|
||||
+ }
|
||||
+
|
||||
+ {
|
||||
+ std::string path = "/foo/bar/..";
|
||||
+
|
||||
+ BOOST_CHECK(file_basename(path) == ".");
|
||||
+ BOOST_CHECK(file_dirname(path) == "/foo/bar");
|
||||
+ BOOST_CHECK(file_filename(path) == "..");
|
||||
+ }
|
||||
+
|
||||
+ {
|
||||
+ std::string path = "/foo/bar/";
|
||||
+
|
||||
+ BOOST_CHECK(file_basename(path) == "bar");
|
||||
+ BOOST_CHECK(file_dirname(path) == "/foo/bar");
|
||||
+ BOOST_CHECK(file_filename(path) == "bar");
|
||||
+ }
|
||||
+
|
||||
+ {
|
||||
+ std::string dir = Glib::get_current_dir();
|
||||
+
|
||||
+ BOOST_CHECK(file_exists(dir) == false);
|
||||
+ // Very unlikely to exist.
|
||||
+ BOOST_CHECK(file_exists(__FILE__ __FILE__) == false);
|
||||
+ BOOST_CHECK(file_exists(__FILE__) == true);
|
||||
+ }
|
||||
|
||||
return 0;
|
||||
}
|
||||
--
|
||||
cgit v0.8.3.4
|
||||
|
@@ -1,3 +1,26 @@
|
||||
-------------------------------------------------------------------
|
||||
Tue May 31 14:55:17 CEST 2011 - vuntz@opensuse.org
|
||||
|
||||
- Disable the build of the applet with a %build_applet define,
|
||||
unless %favor_gtk2 is set (which means we don't build against
|
||||
GNOME 3).
|
||||
- Add gnote-no-deprecated.patch to not use some deprecated APIs
|
||||
that break the build.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Thu May 12 10:09:32 UTC 2011 - feeyo@cronosproject.org
|
||||
|
||||
- Update to version 0.7.4:
|
||||
+ bgo#620402: Show addin categories and versions in addin
|
||||
preferences tab
|
||||
+ bgo#610194: Implemented notebook rename
|
||||
+ bgo#641416: Drop dependency on Boost filesystem
|
||||
+ Bugs fixed: bgo#631408, bgo#633976, bgo#637051, bgo#594932,
|
||||
bgo#585048, bgo#608713, bgo#633951, bgo#634026, bgo#627539,
|
||||
bgo#588098, bgo#641545, bgo#638321, bgo#627073, bgo#627075,
|
||||
bgo#627418, bgo#627417, bgo#646051.
|
||||
- Drop gnote-replace_boost_with_glib.patch: fixed upstream.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sun Mar 20 21:53:18 UTC 2011 - dimstar@opensuse.org
|
||||
|
||||
|
16
gnote.spec
16
gnote.spec
@@ -15,19 +15,19 @@
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
|
||||
# norootforbuild
|
||||
|
||||
%define build_applet %{?favor_gtk2}
|
||||
|
||||
Name: gnote
|
||||
Version: 0.7.3
|
||||
Release: 8
|
||||
Version: 0.7.4
|
||||
Release: 1
|
||||
# FIXME: on version upgrade, check if build_applet is still needed (last checked: 0.7.4)
|
||||
License: GNU GPL v3 or later
|
||||
Summary: A Port of Tomboy to C++
|
||||
Group: Productivity/Text/Editors
|
||||
Url: http://live.gnome.org/Gnote
|
||||
Source: %{name}-%{version}.tar.bz2
|
||||
# PATCH-FIX-UPSTREAM gnote-replace_boost_with_glib.patch dimstar@opensuse.org -- Replace Boost with glib equivalent. Taken from git, commit a52e9a
|
||||
Patch0: gnote-replace_boost_with_glib.patch
|
||||
# PATCH-FIX-UPSTREAM gnote-no-deprecated.patch bgo#651551 vuntz@opensuse.org -- Do not use deprecated API
|
||||
Patch0: gnote-no-deprecated.patch
|
||||
BuildRequires: boost-devel >= 1.34
|
||||
BuildRequires: fdupes
|
||||
BuildRequires: gcc-c++
|
||||
@@ -36,7 +36,9 @@ BuildRequires: gnome-doc-utils-devel
|
||||
BuildRequires: gtkmm2-devel >= 2.20
|
||||
BuildRequires: gtkspell-devel
|
||||
BuildRequires: intltool
|
||||
%if 0%{?build_applet}
|
||||
BuildRequires: libpanelappletmm-devel
|
||||
%endif
|
||||
BuildRequires: libuuid-devel
|
||||
BuildRequires: libxml2-devel
|
||||
BuildRequires: libxslt-devel
|
||||
@@ -98,8 +100,10 @@ test "%{buildroot}" != "/" && %__rm -rf %{buildroot}
|
||||
%dir %{_datadir}/omf/%{name}/
|
||||
%doc %{_datadir}/omf/%{name}/%{name}-C.omf
|
||||
%{_bindir}/gnote
|
||||
%if 0%{?build_applet}
|
||||
%{_prefix}/lib/gnote-applet
|
||||
%{_libdir}/bonobo/servers/GNOME_GnoteApplet.server
|
||||
%endif
|
||||
%{_libdir}/gnote/
|
||||
%{_datadir}/applications/gnote.desktop
|
||||
%{_datadir}/gnote/
|
||||
|
Reference in New Issue
Block a user