Skip to content

Commit

Permalink
media-gfx/scantailor: Fix BOOST_JOIN with >=dev-libs/boost-1.58.0
Browse files Browse the repository at this point in the history
Gentoo-Bug: 574634
* Also fix namespace clashes between boost::lambda and
  boost::placeholder.

Package-Manager: portage-2.2.28
  • Loading branch information
SoapGentoo committed Mar 28, 2016
1 parent 834f09d commit c471ffa
Show file tree
Hide file tree
Showing 3 changed files with 154 additions and 2 deletions.
1 change: 1 addition & 0 deletions media-gfx/scantailor/Manifest
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
DIST scantailor-0.9.10.tar.gz 1124348 SHA256 0b574eabfb65e4dcf3915d00ad3da31d464060458ffaeb49e4257e97301f93a0 SHA512 e2221a381c7c19ea2f7f5a791fec8ed3fd21e9065418e8cadb6ec34e95f9c9a4ec94effe6543087bb06b483c0cb08d40fd6cce63b065e91d97f756d1afa458b1 WHIRLPOOL 261ea78474fd644a407140dfb535d282d4413fbf79eba1b36ccf032b247f57d55560fc5c3a14db2f6fdbcb7351fba9aad64612950151422a88d77395d9ab03ee
DIST scantailor-0.9.11.1-boost-join-moc.patch 53044 SHA256 c00772facafdb696bf0e36ba216050cf3ec5b45c15e0099e6ef4935bffa9ba00 SHA512 77c6ee7988834c8694f9c09182fcdf87bdba64f3e69c9cc9b8347c4980a56c484a4368643f1c608ebbaeb469d4d6bc8d1a62f95fce18bc41dfce68137a457a61 WHIRLPOOL 0e5b04a65a5c47deeea6b3ec192549e50b22825df506bda2b87fbc1aa0254993a33c7c7907af1520c7e0ae4264a9a00b9e92d6114b1aee664408c69bb9bdcf00
DIST scantailor-0.9.11.1.tar.gz 1190198 SHA256 881647a4172c55a067a7b6687965441cf21176d79d93075b22a373ea9accd8d3 SHA512 cec327fd12144f7cee5043adfee3880c75fb147474e4c3b5166385f7a8f47cb5650ed2df930bbe1f4b8ac2c7229a887ecba1ca105b47b1023f5d3d7d7b54bdb4 WHIRLPOOL c064837bd4d5f4c3fbfa260493f3eccecff59910c934005148975f2f00511539ae0e66535d0a57bbf0458022c8ec249faa7f3df40ed8d89b2683530b885e4f6b
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
Namespace qualify bind, in order to avoid clashes with boost::placeholder
Patches taken from FreeBSD:
https://svnweb.freebsd.org/ports?view=revision&revision=408592

--- scantailor-0.9.11.1/filters/deskew/Filter.cpp
+++ scantailor-0.9.11.1/filters/deskew/Filter.cpp
@@ -85,9 +85,9 @@

QDomElement filter_el(doc.createElement("deskew"));
writer.enumPages(
- bind(
+ boost::lambda::bind(
&Filter::writePageSettings,
- this, boost::ref(doc), var(filter_el), _1, _2
+ this, boost::ref(doc), var(filter_el), boost::lambda::_1, boost::lambda::_2
)
);

--- scantailor-0.9.11.1/filters/fix_orientation/Filter.cpp
+++ scantailor-0.9.11.1/filters/fix_orientation/Filter.cpp
@@ -100,9 +100,9 @@

QDomElement filter_el(doc.createElement("fix-orientation"));
writer.enumImages(
- bind(
+ boost::lambda::bind(
&Filter::writeImageSettings,
- this, boost::ref(doc), var(filter_el), _1, _2
+ this, boost::ref(doc), var(filter_el), boost::lambda::_1, boost::lambda::_2
)
);

--- scantailor-0.9.11.1/filters/output/Filter.cpp
+++ scantailor-0.9.11.1/filters/output/Filter.cpp
@@ -93,9 +93,9 @@

QDomElement filter_el(doc.createElement("output"));
writer.enumPages(
- bind(
+ boost::lambda::bind(
&Filter::writePageSettings,
- this, boost::ref(doc), var(filter_el), _1, _2
+ this, boost::ref(doc), var(filter_el), boost::lambda::_1, boost::lambda::_2
)
);

--- scantailor-0.9.11.1/filters/page_layout/Filter.cpp
+++ scantailor-0.9.11.1/filters/page_layout/Filter.cpp
@@ -136,9 +136,9 @@

QDomElement filter_el(doc.createElement("page-layout"));
writer.enumPages(
- bind(
+ boost::lambda::bind(
&Filter::writePageSettings,
- this, boost::ref(doc), var(filter_el), _1, _2
+ this, boost::ref(doc), var(filter_el), boost::lambda::_1, boost::lambda::_2
)
);

--- scantailor-0.9.11.1/filters/page_split/Filter.cpp
+++ scantailor-0.9.11.1/filters/page_split/Filter.cpp
@@ -110,9 +110,9 @@
);

writer.enumImages(
- bind(
+ boost::lambda::bind(
&Filter::writeImageSettings,
- this, boost::ref(doc), var(filter_el), _1, _2
+ this, boost::ref(doc), var(filter_el), boost::lambda::_1, boost::lambda::_2
)
);

--- scantailor-0.9.11.1/filters/select_content/Filter.cpp
+++ scantailor-0.9.11.1/filters/select_content/Filter.cpp
@@ -119,9 +119,9 @@

QDomElement filter_el(doc.createElement("select-content"));
writer.enumPages(
- bind(
+ boost::lambda::bind(
&Filter::writePageSettings,
- this, boost::ref(doc), var(filter_el), _1, _2
+ this, boost::ref(doc), var(filter_el), boost::lambda::_1, boost::lambda::_2
)
);

--- scantailor-0.9.11.1/MainWindow.cpp
+++ scantailor-0.9.11.1/MainWindow.cpp
@@ -1898,8 +1898,8 @@
ImageFileInfo image_file_info(file_info, std::vector<ImageMetadata>());

ImageMetadataLoader::Status const status = ImageMetadataLoader::load(
- files.at(i), bind(&std::vector<ImageMetadata>::push_back,
- boost::ref(image_file_info.imageInfo()), _1)
+ files.at(i), boost::lambda::bind(&std::vector<ImageMetadata>::push_back,
+ boost::ref(image_file_info.imageInfo()), boost::lambda::_1)
);

if (status == ImageMetadataLoader::LOADED) {
@@ -1921,7 +1921,7 @@
}

// Check if there is at least one DPI that's not OK.
- if (std::find_if(new_files.begin(), new_files.end(), !bind(&ImageFileInfo::isDpiOK, _1)) != new_files.end()) {
+ if (std::find_if(new_files.begin(), new_files.end(), !boost::lambda::bind(&ImageFileInfo::isDpiOK, boost::lambda::_1)) != new_files.end()) {

std::auto_ptr<FixDpiDialog> dpi_dialog(new FixDpiDialog(new_files, this));
dpi_dialog->setWindowModality(Qt::WindowModal);
--- scantailor-0.9.11.1/ThumbnailSequence.cpp
+++ scantailor-0.9.11.1/ThumbnailSequence.cpp
@@ -491,7 +491,7 @@
m_pSelectionLeader(0)
{
m_graphicsScene.setContextMenuEventCallback(
- bind(&Impl::sceneContextMenuEvent, this, _1)
+ boost::lambda::bind(&Impl::sceneContextMenuEvent, this, boost::lambda::_1)
);
}

@@ -605,7 +605,7 @@
{
ItemsById::iterator const id_it(m_itemsById.find(page_info.id()));
if (id_it != m_itemsById.end()) {
- m_itemsById.modify(id_it, bind(&Item::pageInfo, _1) = page_info);
+ m_itemsById.modify(id_it, boost::lambda::bind(&Item::pageInfo, boost::lambda::_1) = page_info);
invalidateThumbnailImpl(id_it);
}
}
@@ -725,10 +725,10 @@
// Sort pages in m_itemsInOrder using m_ptrOrderProvider.
if (m_ptrOrderProvider.get()) {
m_itemsInOrder.sort(
- bind(
+ boost::lambda::bind(
&PageOrderProvider::precedes, m_ptrOrderProvider.get(),
- bind(&Item::pageId, _1), bind(&Item::incompleteThumbnail, _1),
- bind(&Item::pageId, _2), bind(&Item::incompleteThumbnail, _2)
+ boost::lambda::bind(&Item::pageId, boost::lambda::_1), bind(&Item::incompleteThumbnail, boost::lambda::_1),
+ boost::lambda::bind(&Item::pageId, boost::lambda::_2), bind(&Item::incompleteThumbnail, boost::lambda::_2)
)
);
}
11 changes: 9 additions & 2 deletions media-gfx/scantailor/scantailor-0.9.11.1.ebuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright 1999-2015 Gentoo Foundation
# Copyright 1999-2016 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Id$

Expand All @@ -7,7 +7,8 @@ inherit cmake-utils eutils virtualx toolchain-funcs

DESCRIPTION="A interactive post-processing tool for scanned pages"
HOMEPAGE="http://scantailor.sourceforge.net/"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz"
SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz
https://dev.gentoo.org/~soap/distfiles/${P}-boost-join-moc.patch"

LICENSE="GPL-2 GPL-3 public-domain"
SLOT="0"
Expand All @@ -24,6 +25,12 @@ RDEPEND=">=media-libs/libpng-1.2.43
DEPEND="${RDEPEND}
dev-libs/boost"

src_prepare() {
epatch -p1 \
"${DISTDIR}/${P}-boost-join-moc.patch" \
"${FILESDIR}/${P}-boost-lambda-namespace.patch"
}

src_configure() {
tc-export CXX

Expand Down

0 comments on commit c471ffa

Please sign in to comment.