code:
From 43af3c117b0b3220b15c2fe2895b94bbd83d3a60 Mon Sep 17 00:00:00 2001
From: Claudio Fernandes <claudiosf.claudio@gmail.com>
Date: Sun, 15 Jan 2017 21:23:39 -0200
Subject: [PATCH] Adapt Avogadro to Eigen 3.3

---
 CMakeLists.txt                                     |  9 +------
 avogadro/src/mainwindow.cpp                        |  5 ++--
 libavogadro/src/camera.cpp                         | 10 ++++----
 libavogadro/src/camera.h                           | 14 +++++------
 libavogadro/src/engines/wireengine.cpp             |  4 ++--
 .../crystallography/crystallographyextension.cpp   |  2 +-
 .../crystallography/ui/ceviewoptionswidget.cpp     |  2 +-
 .../src/extensions/orca/orcaanalysedialog.cpp      |  1 -
 .../src/extensions/orca/orcainputdialog.cpp        |  1 -
 .../src/extensions/qtaim/qtaimmathutilities.cpp    |  1 +
 .../qtaim/qtaimwavefunctionevaluator.cpp           | 28 +++++++++++-----------
 .../extensions/surfaces/openqube/gamessukout.cpp   |  1 +
 .../src/extensions/surfaces/openqube/slaterset.cpp |  6 +++--
 libavogadro/src/glpainter_p.cpp                    | 14 +++++------
 libavogadro/src/glwidget.cpp                       |  4 ++--
 libavogadro/src/molecule.cpp                       | 26 ++++++++++++++++++--
 libavogadro/src/navigate.cpp                       |  2 +-
 libavogadro/src/tools/bondcentrictool.cpp          | 28 +++++++++++-----------
 libavogadro/src/tools/manipulatetool.cpp           | 17 +++++++------
 libavogadro/src/tools/navigatetool.cpp             |  3 ++-
 libavogadro/src/tools/skeletontree.cpp             |  7 +++---
 libavogadro/src/tools/skeletontree.h               |  2 +-
 22 files changed, 102 insertions(+), 85 deletions(-)

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -231,14 +231,7 @@ if(NOT Linguist_FOUND)
   message(WARNING " Qt4 Linguist not found, please install it if you want Avogadro translations")
 endif()

-find_package(Eigen3) # find and setup Eigen3 if available
-if(NOT EIGEN3_FOUND)
-   message(STATUS "Cannot find Eigen3, trying Eigen2")
-   find_package(Eigen2 REQUIRED) # Some version is required
-else()
-# Use Stage10 Eigen3 support
-   set (EIGEN2_SUPPORT_STAGE10_FULL_EIGEN2_API TRUE)
-endif()
+find_package(Eigen3 REQUIRED) # find and setup Eigen3 if available

 find_package(ZLIB REQUIRED)
 find_package(OpenBabel2 REQUIRED) # find and setup OpenBabel
--- a/avogadro/src/mainwindow.cpp
+++ b/avogadro/src/mainwindow.cpp
@@ -115,7 +115,6 @@
 #include <QDebug>

 #include <Eigen/Geometry>
-#include <Eigen/Array>
 #define USEQUAT
 // This is a "hidden" exported Qt function on the Mac for Qt-4.x.
 #ifdef Q_WS_MAC
@@ -2775,7 +2774,7 @@ protected:
     linearGoal.row(1) = linearGoal.row(2).cross(linearGoal.row(0));

     // calculate the translation matrix
-    Transform3d goal(linearGoal);
+    Projective3d goal(linearGoal);

     goal.pretranslate(- 3.0 * (d->glWidget->radius() + CAMERA_NEAR_DISTANCE) * Vector3d::UnitZ());

@@ -2840,7 +2839,7 @@ protected:
     Matrix3d linearGoal = Matrix3d::Identity();

     // calculate the translation matrix
-    Transform3d goal(linearGoal);
+    Projective3d goal(linearGoal);

     goal.pretranslate(- 3.0 * (d->glWidget->radius() + CAMERA_NEAR_DISTANCE) * Vector3d::UnitZ());

--- a/libavogadro/src/camera.cpp
+++ b/libavogadro/src/camera.cpp
@@ -47,7 +47,7 @@ namespace Avogadro

       CameraPrivate() {};

-      Eigen::Transform3d modelview, projection;
+      Eigen::Projective3d modelview, projection;
       const GLWidget *parent;
       double angleOfViewY;
       double orthoScale;
@@ -169,20 +169,20 @@ namespace Avogadro

   double Camera::distance(const Eigen::Vector3d & point) const
   {
-    return ( d->modelview * point ).norm();
+    return ( d->modelview * point.homogeneous() ).head<3>().norm();
   }

-  void Camera::setModelview(const Eigen::Transform3d &matrix)
+  void Camera::setModelview(const Eigen::Projective3d &matrix)
   {
     d->modelview = matrix;
   }

-  const Eigen::Transform3d & Camera::modelview() const
+  const Eigen::Projective3d & Camera::modelview() const
   {
     return d->modelview;
   }

-  Eigen::Transform3d & Camera::modelview()
+  Eigen::Projective3d & Camera::modelview()
   {
     return d->modelview;
   }
--- a/libavogadro/src/camera.h
+++ b/libavogadro/src/camera.h
@@ -101,16 +101,16 @@ namespace Avogadro {
       double angleOfViewY() const;
       /** Sets 4x4 "modelview" matrix representing the camera orientation and position.
         * @param matrix the matrix to copy from
-        * @sa Eigen::Transform3d & modelview(), applyModelview() */
-      void setModelview(const Eigen::Transform3d &matrix);
+        * @sa Eigen::Projective3d & modelview(), applyModelview() */
+      void setModelview(const Eigen::Projective3d &matrix);
       /** @return a constant reference to the 4x4 "modelview" matrix representing
         *         the camera orientation and position
-        * @sa setModelview(), Eigen::Transform3d & modelview() */
-      const Eigen::Transform3d & modelview() const;
+        * @sa setModelview(), Eigen::Projective3d & modelview() */
+      const Eigen::Projective3d & modelview() const;
       /** @return a non-constant reference to the 4x4 "modelview" matrix representing
         *         the camera orientation and position
-        * @sa setModelview(), const Eigen::Transform3d & modelview() const */
-      Eigen::Transform3d & modelview();
+        * @sa setModelview(), const Eigen::Projective3d & modelview() const */
+      Eigen::Projective3d & modelview();
       /** Calls gluPerspective() or glOrtho() with parameters automatically chosen
         * for rendering the GLWidget's molecule with this camera. Should be called
         * only in GL_PROJECTION matrix mode. Example code is given
@@ -342,7 +342,7 @@ namespace Avogadro {
        * @return {x/w, y/w, z/w} vector
        */
       Eigen::Vector3d V4toV3DivW(const Eigen::Vector4d & v4) {
-        return v4.start<3>()/v4.w();
+        return v4.head<3>()/v4.w();
       }
   };

--- a/libavogadro/src/engines/wireengine.cpp
+++ b/libavogadro/src/engines/wireengine.cpp
@@ -109,7 +109,7 @@ namespace Avogadro {
     const Camera *camera = pd->camera();

     // perform a rough form of frustum culling
-    Eigen::Vector3d transformedPos = pd->camera()->modelview() * v;
+    Eigen::Vector3d transformedPos = (pd->camera()->modelview() * v.homogeneous()).head<3>();
     double dot = transformedPos.z() / transformedPos.norm();
     if(dot > -0.8)
       return true;
@@ -167,7 +167,7 @@ namespace Avogadro {
       map = pd->colorMap(); // fall back to global color map

     // perform a rough form of frustum culling
-    Eigen::Vector3d transformedEnd1 = pd->camera()->modelview() * v1;
+    Eigen::Vector3d transformedEnd1 = (pd->camera()->modelview() * v1.homogeneous()).head<3>();
     double dot = transformedEnd1.z() / transformedEnd1.norm();
     if(dot > -0.8)
       return true; // i.e., don't bother rendering
--- a/libavogadro/src/extensions/crystallography/crystallographyextension.cpp
+++ b/libavogadro/src/extensions/crystallography/crystallographyextension.cpp
@@ -1989,7 +1989,7 @@ namespace Avogadro
     // fix coordinates
     // Apply COB matrix:
     Eigen::Matrix3d invCob;
-    cob.computeInverse(&invCob);
+    invCob = cob.inverse();
     for (QList<Eigen::Vector3d>::iterator
            it = fcoords.begin(),
            it_end = fcoords.end();
--- a/libavogadro/src/extensions/crystallography/ui/ceviewoptionswidget.cpp
+++ b/libavogadro/src/extensions/crystallography/ui/ceviewoptionswidget.cpp
@@ -139,7 +139,7 @@ namespace Avogadro
   {
     // View into a Miller plane
     Camera *camera = m_glWidget->camera();
-    Eigen::Transform3d modelView;
+    Eigen::Projective3d modelView;
     modelView.setIdentity();

     // OK, so we want to rotate to look along the normal at the plane
--- a/libavogadro/src/extensions/orca/orcaanalysedialog.cpp
+++ b/libavogadro/src/extensions/orca/orcaanalysedialog.cpp
@@ -41,7 +41,6 @@
 #include <openbabel/mol.h>

 #include <Eigen/Geometry>
-#include <Eigen/LeastSquares>

 #include <vector>

--- a/libavogadro/src/extensions/orca/orcainputdialog.cpp
+++ b/libavogadro/src/extensions/orca/orcainputdialog.cpp
@@ -33,7 +33,6 @@
 #include <openbabel/mol.h>

 #include <Eigen/Geometry>
-#include <Eigen/LeastSquares>

 #include <vector>

--- a/libavogadro/src/extensions/qtaim/qtaimmathutilities.cpp
+++ b/libavogadro/src/extensions/qtaim/qtaimmathutilities.cpp
@@ -28,6 +28,7 @@

 #include <cmath>
 #include <Eigen/QR>
+#include <Eigen/Eigenvalues>

 namespace Avogadro {
   namespace QTAIMMathUtilities {
--- a/libavogadro/src/extensions/qtaim/qtaimwavefunctionevaluator.cpp
+++ b/libavogadro/src/extensions/qtaim/qtaimwavefunctionevaluator.cpp
@@ -35,21 +35,21 @@ namespace Avogadro
     m_nprim=wfn.numberOfGaussianPrimitives();
     m_nnuc=wfn.numberOfNuclei();

-    m_nucxcoord=Map<Matrix<qreal,Dynamic,1> >(wfn.xNuclearCoordinates(),m_nnuc);
-    m_nucycoord=Map<Matrix<qreal,Dynamic,1> >(wfn.yNuclearCoordinates(),m_nnuc);
-    m_nuczcoord=Map<Matrix<qreal,Dynamic,1> >(wfn.zNuclearCoordinates(),m_nnuc);
-    m_nucz=Map<Matrix<qint64,Dynamic,1> >(wfn.nuclearCharges(),m_nnuc);
-    m_X0=Map<Matrix<qreal,Dynamic,1> >(wfn.xGaussianPrimitiveCenterCoordinates(),m_nprim,1);
-    m_Y0=Map<Matrix<qreal,Dynamic,1> >(wfn.yGaussianPrimitiveCenterCoordinates(),m_nprim,1);
-    m_Z0=Map<Matrix<qreal,Dynamic,1> >(wfn.zGaussianPrimitiveCenterCoordinates(),m_nprim,1);
-    m_xamom=Map<Matrix<qint64,Dynamic,1> >(wfn.xGaussianPrimitiveAngularMomenta(),m_nprim,1);
-    m_yamom=Map<Matrix<qint64,Dynamic,1> >(wfn.yGaussianPrimitiveAngularMomenta(),m_nprim,1);
-    m_zamom=Map<Matrix<qint64,Dynamic,1> >(wfn.zGaussianPrimitiveAngularMomenta(),m_nprim,1);
-    m_alpha=Map<Matrix<qreal,Dynamic,1> >(wfn.gaussianPrimitiveExponentCoefficients(),m_nprim,1);
+    m_nucxcoord=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.xNuclearCoordinates()),m_nnuc);
+    m_nucycoord=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.yNuclearCoordinates()),m_nnuc);
+    m_nuczcoord=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.zNuclearCoordinates()),m_nnuc);
+    m_nucz=Map<Matrix<qint64,Dynamic,1> >(const_cast<qint64*>(wfn.nuclearCharges()),m_nnuc);
+    m_X0=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.xGaussianPrimitiveCenterCoordinates()),m_nprim,1);
+    m_Y0=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.yGaussianPrimitiveCenterCoordinates()),m_nprim,1);
+    m_Z0=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.zGaussianPrimitiveCenterCoordinates()),m_nprim,1);
+    m_xamom=Map<Matrix<qint64,Dynamic,1> >(const_cast<qint64*>(wfn.xGaussianPrimitiveAngularMomenta()),m_nprim,1);
+    m_yamom=Map<Matrix<qint64,Dynamic,1> >(const_cast<qint64*>(wfn.yGaussianPrimitiveAngularMomenta()),m_nprim,1);
+    m_zamom=Map<Matrix<qint64,Dynamic,1> >(const_cast<qint64*>(wfn.zGaussianPrimitiveAngularMomenta()),m_nprim,1);
+    m_alpha=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.gaussianPrimitiveExponentCoefficients()),m_nprim,1);
     // TODO Implement screening for unoccupied molecular orbitals.
-    m_occno=Map<Matrix<qreal,Dynamic,1> >(wfn.molecularOrbitalOccupationNumbers(),m_nmo,1);
-    m_orbe=Map<Matrix<qreal,Dynamic,1> >(wfn.molecularOrbitalEigenvalues(),m_nmo,1);
-    m_coef=Map<Matrix<qreal,Dynamic,Dynamic,RowMajor> >(wfn.molecularOrbitalCoefficients(),m_nmo,m_nprim);
+    m_occno=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.molecularOrbitalOccupationNumbers()),m_nmo,1);
+    m_orbe=Map<Matrix<qreal,Dynamic,1> >(const_cast<qreal*>(wfn.molecularOrbitalEigenvalues()),m_nmo,1);
+    m_coef=Map<Matrix<qreal,Dynamic,Dynamic,RowMajor> >(const_cast<qreal*>(wfn.molecularOrbitalCoefficients()),m_nmo,m_nprim);
     m_totalEnergy=wfn.totalEnergy();
     m_virialRatio=wfn.virialRatio();

--- a/libavogadro/src/extensions/surfaces/openqube/gamessukout.cpp
+++ b/libavogadro/src/extensions/surfaces/openqube/gamessukout.cpp
@@ -19,6 +19,7 @@
 using Eigen::Vector3d;
 using std::vector;

+#include <iostream>
 #include <fstream>

 namespace OpenQube
--- a/libavogadro/src/extensions/surfaces/openqube/slaterset.cpp
+++ b/libavogadro/src/extensions/surfaces/openqube/slaterset.cpp
@@ -25,9 +25,9 @@

 #include "cube.h"

-#include <Eigen/Array>
 #include <Eigen/LU>
 #include <Eigen/QR>
+#include <Eigen/Eigenvalues>

 #include <cmath>

@@ -250,7 +250,9 @@ bool SlaterSet::initialize()

   SelfAdjointEigenSolver<MatrixXd> s(m_overlap);
   MatrixXd p = s.eigenvectors();
-  MatrixXd m = p * s.eigenvalues().cwise().inverse().cwise().sqrt().asDiagonal() * p.inverse();
+  // TODO check if this is correct
+  MatrixXd m1 = (s.eigenvalues().array().inverse().sqrt());
+  MatrixXd m = p.array()*(m1.diagonal().array())*p.inverse().array();
   m_normalized = m * m_eigenVectors;

   if (!(m_overlap*m*m).isIdentity())
--- a/libavogadro/src/glpainter_p.cpp
+++ b/libavogadro/src/glpainter_p.cpp
@@ -789,13 +789,13 @@ namespace Avogadro
         } else {
           points[theta-1] = Eigen::AngleAxisd(theta * (M_PI / 180.0) / 2, n) * u;
         }
-        points[theta-1] = d->widget->camera()->modelview() * (origin + points[theta-1]);
+        points[theta-1] = (d->widget->camera()->modelview() * (origin + points[theta-1]).homogeneous()).head<3>();
       }

     // Get vectors representing the points' positions in terms of the model view.
-    Eigen::Vector3d _origin = d->widget->camera()->modelview() * origin;
-    Eigen::Vector3d _direction1 = d->widget->camera()->modelview() * (origin+u);
-    Eigen::Vector3d _direction2 = d->widget->camera()->modelview() * (origin+v);
+    Eigen::Vector3d _origin = (d->widget->camera()->modelview() * origin.homogeneous()).head<3>();
+    Eigen::Vector3d _direction1 = (d->widget->camera()->modelview() * (origin+u).homogeneous()).head<3>();
+    Eigen::Vector3d _direction2 = (d->widget->camera()->modelview() * (origin+v).homogeneous()).head<3>();

     glPushAttrib(GL_ALL_ATTRIB_BITS);
     glPushMatrix();
@@ -880,12 +880,12 @@ namespace Avogadro
         } else {
           points[theta-1] = Eigen::AngleAxisd(theta * (M_PI / 180.0) / 2, n) * u;
         }
-        points[theta-1] = d->widget->camera()->modelview() * (origin + points[theta-1]);
+        points[theta-1] = (d->widget->camera()->modelview() * (origin + points[theta-1]).homogeneous()).head<3>();
       }

     // Get vectors representing the points' positions in terms of the model view.
-    Eigen::Vector3d _direction1 = d->widget->camera()->modelview() * (origin + u);
-    Eigen::Vector3d _direction2 = d->widget->camera()->modelview() * (origin + v);
+    Eigen::Vector3d _direction1 = (d->widget->camera()->modelview() * (origin + u).homogeneous()).head<3>();
+    Eigen::Vector3d _direction2 = (d->widget->camera()->modelview() * (origin + v).homogeneous()).head<3>();

     glPushAttrib(GL_ALL_ATTRIB_BITS);
     glPushMatrix();
--- a/libavogadro/src/glwidget.cpp
+++ b/libavogadro/src/glwidget.cpp
@@ -765,7 +765,7 @@ namespace Avogadro {
       GLfloat fogColor[4]= {static_cast<GLfloat>(d->background.redF()), static_cast<GLfloat>(d->background.greenF()),
                             static_cast<GLfloat>(d->background.blueF()), static_cast<GLfloat>(d->background.alphaF())};
       glFogfv(GL_FOG_COLOR, fogColor);
-      Vector3d distance = camera()->modelview() * d->center;
+      Vector3d distance = (camera()->modelview() * d->center.homogeneous()).head<3>();
       double distanceToCenter = distance.norm();
       glFogf(GL_FOG_DENSITY, 1.0);
       glHint(GL_FOG_HINT, GL_NICEST);
@@ -1711,7 +1711,7 @@ namespace Avogadro {

       if (d->renderModelViewDebug) {
         // Model view matrix:
-        const Eigen::Transform3d &modelview = d->camera->modelview();
+        const Eigen::Projective3d &modelview = d->camera->modelview();
         y += d->pd->painter()->drawText
             (x, y, tr("ModelView row 1: %L1 %L2 %L3 %L4")
              .arg(modelview(0, 0), 6, 'f', 2, ' ')
--- a/libavogadro/src/molecule.cpp
+++ b/libavogadro/src/molecule.cpp
@@ -38,7 +38,7 @@
 #include "zmatrix.h"

 #include <Eigen/Geometry>
-#include <Eigen/LeastSquares>
+#include <Eigen/Eigenvalues>

 #include <vector>

@@ -1907,7 +1907,29 @@ namespace Avogadro{
         }
         d->center /= static_cast<double>(nAtoms);
         Eigen::Hyperplane<double, 3> planeCoeffs;
-        Eigen::fitHyperplane(numAtoms(), atomPositions, &planeCoeffs);
+        //Eigen::fitHyperplane(numAtoms(), atomPositions, &planeCoeffs);
+
+        // TODO check if this is OK
+        /************************/
+        typedef Eigen::Matrix<double,3,3> CovMatrixType;
+        typedef Eigen::Vector3d VectorType;
+
+        VectorType mean = d->center;
+        int size=3;
+        int numPoints=numAtoms();
+        VectorType ** points=atomPositions;
+        CovMatrixType covMat = CovMatrixType::Zero(size, size);
+        VectorType remean = VectorType::Zero(size);
+        for(int i = 0; i < numPoints; ++i)
+        {
+          VectorType diff = (*(points[i]) - mean).conjugate();
+          covMat += diff * diff.adjoint();
+        }
+        Eigen::SelfAdjointEigenSolver<CovMatrixType> eig(covMat);
+        planeCoeffs.normal() = eig.eigenvectors().col(0);
+        /************************/
+
+
         delete[] atomPositions;
         d->normalVector = planeCoeffs.normal();
       }
--- a/libavogadro/src/navigate.cpp
+++ b/libavogadro/src/navigate.cpp
@@ -40,7 +40,7 @@ namespace Avogadro {
   void Navigate::zoom(GLWidget *widget, const Eigen::Vector3d &goal,
                       double delta)
   {
-    Vector3d transformedGoal = widget->camera()->modelview() * goal;
+    Vector3d transformedGoal = (widget->camera()->modelview() * goal.homogeneous()).head<3>();
     double distanceToGoal = transformedGoal.norm();

     double t = ZOOM_SPEED * delta;
--- a/libavogadro/src/tools/bondcentrictool.cpp
+++ b/libavogadro/src/tools/bondcentrictool.cpp
@@ -578,8 +578,8 @@ namespace Avogadro {

           Vector3d clicked = *m_clickedAtom->pos();

-          Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other).z() >=
-                (widget->camera()->modelview() * center).z() ? -1 : 1));
+          Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other.homogeneous()).z() >=
+                (widget->camera()->modelview() * center.homogeneous()).z() ? -1 : 1));

           Vector3d centerProj = widget->camera()->project(center);
           centerProj -= Vector3d(0,0,centerProj.z());
@@ -673,8 +673,8 @@ namespace Avogadro {

           Vector3d clicked = *m_clickedAtom->pos();

-          Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other).z() >=
-                (widget->camera()->modelview() * center).z() ? -1 : 1));
+          Vector3d axis = Vector3d(0, 0, ((widget->camera()->modelview() * other.homogeneous()).z() >=
+                (widget->camera()->modelview() * center.homogeneous()).z() ? -1 : 1));

           Vector3d centerProj = widget->camera()->project(center);
           centerProj -= Vector3d(0,0,centerProj.z());
@@ -1362,10 +1362,10 @@ namespace Avogadro {

     planeVec = length * (planeVec / planeVec.norm());

-    Vector3d topLeft = widget->camera()->modelview() * (left + planeVec);
-    Vector3d topRight = widget->camera()->modelview() * (right + planeVec);
-    Vector3d botRight = widget->camera()->modelview() * (right - planeVec);
-    Vector3d botLeft = widget->camera()->modelview() * (left - planeVec);
+    Vector3d topLeft = (widget->camera()->modelview() * (left + planeVec).homogeneous()).head<3>();
+    Vector3d topRight = (widget->camera()->modelview() * (right + planeVec).homogeneous()).head<3>();
+    Vector3d botRight = (widget->camera()->modelview() * (right - planeVec).homogeneous()).head<3>();
+    Vector3d botLeft = (widget->camera()->modelview() * (left - planeVec).homogeneous()).head<3>();

     float alpha = 0.4;
     double lineWidth = 1.5;
@@ -1444,10 +1444,10 @@ namespace Avogadro {
       C = D + ((C-D).normalized() * minWidth);
     }

-    Vector3d topLeft = widget->camera()->modelview() * D;
-    Vector3d topRight = widget->camera()->modelview() * C;
-    Vector3d botRight = widget->camera()->modelview() * B;
-    Vector3d botLeft = widget->camera()->modelview() * A;
+    Vector3d topLeft = (widget->camera()->modelview() * D.homogeneous()).head<3>();
+    Vector3d topRight = (widget->camera()->modelview() * C.homogeneous()).head<3>();
+    Vector3d botRight = (widget->camera()->modelview() * B.homogeneous()).head<3>();
+    Vector3d botLeft = (widget->camera()->modelview() * A.homogeneous()).head<3>();

     float alpha = 0.4;
     double lineWidth = 1.5;
@@ -1506,12 +1506,12 @@ namespace Avogadro {
       Vector3d positionVector)
   {
     //Rotate skeleton around a particular axis and center point
-    Eigen::Transform3d rotation;
+    Eigen::Projective3d rotation;
     rotation = Eigen::AngleAxisd(angle, rotationVector);
     rotation.pretranslate(centerVector);
     rotation.translate(-centerVector);

-    return rotation*positionVector;
+    return (rotation*positionVector.homogeneous()).head<3>();
   }

   // ##########  showAnglesChanged  ##########
--- a/libavogadro/src/tools/manipulatetool.cpp
+++ b/libavogadro/src/tools/manipulatetool.cpp
@@ -40,7 +40,6 @@
 #include <QAbstractButton>

 using Eigen::Vector3d;
-using Eigen::Transform3d;
 using Eigen::AngleAxisd;

 namespace Avogadro {
@@ -138,7 +137,7 @@ namespace Avogadro {
     double yRotate = m_settingsWidget->yRotateSpinBox->value() * DEG_TO_RAD;
     double zRotate = m_settingsWidget->zRotateSpinBox->value() * DEG_TO_RAD;

-    Eigen::Transform3d rotation;
+    Eigen::Projective3d rotation;
     rotation.matrix().setIdentity();
     rotation.translation() = center;
     rotation.rotate(AngleAxisd(xRotate, Vector3d::UnitX())
@@ -152,12 +151,12 @@ namespace Avogadro {
         if (p->type() == Primitive::AtomType) {
           Atom *atom = static_cast<Atom*>(p);
           tempPos = translate + *(atom->pos());
-          atom->setPos(rotation * tempPos);
+          atom->setPos((rotation * tempPos.homogeneous()).head<3>());
         }
     } else {
       foreach(Atom *atom, widget->molecule()->atoms()) {
         tempPos = translate + *(atom->pos());
-        atom->setPos(rotation * tempPos);
+        atom->setPos((rotation * tempPos.homogeneous()).head<3>());
       }
     }

@@ -199,7 +198,7 @@ namespace Avogadro {
     widget->setCursor(Qt::SizeVerCursor);

     // Move the selected atom(s) in to or out of the screen
-    Vector3d transformedGoal = widget->camera()->modelview() * *goal;
+    Vector3d transformedGoal = (widget->camera()->modelview() * goal->homogeneous()).head<3>();
     double distanceToGoal = transformedGoal.norm();

     double t = ZOOM_SPEED * delta;
@@ -255,7 +254,7 @@ namespace Avogadro {

     // Rotate the selected atoms about the center
     // rotate only selected primitives
-    Transform3d fragmentRotation;
+    Eigen::Projective3d fragmentRotation;
     fragmentRotation.matrix().setIdentity();
     fragmentRotation.translation() = *center;
     fragmentRotation.rotate(
@@ -266,7 +265,7 @@ namespace Avogadro {

     foreach(Primitive *p, widget->selectedPrimitives())
       if (p->type() == Primitive::AtomType)
-        static_cast<Atom *>(p)->setPos(fragmentRotation * *static_cast<Atom *>(p)->pos());
+        static_cast<Atom *>(p)->setPos((fragmentRotation * static_cast<Atom *>(p)->pos()->homogeneous()).head<3>());
     widget->molecule()->update();
   }

@@ -274,7 +273,7 @@ namespace Avogadro {
                             double delta) const
   {
     // Tilt the selected atoms about the center
-    Transform3d fragmentRotation;
+    Eigen::Projective3d fragmentRotation;
     fragmentRotation.matrix().setIdentity();
     fragmentRotation.translation() = *center;
     fragmentRotation.rotate(AngleAxisd(delta * ROTATION_SPEED, widget->camera()->backTransformedZAxis()));
@@ -282,7 +281,7 @@ namespace Avogadro {

     foreach(Primitive *p, widget->selectedPrimitives())
       if (p->type() == Primitive::AtomType)
-        static_cast<Atom *>(p)->setPos(fragmentRotation * *static_cast<Atom *>(p)->pos());
+        static_cast<Atom *>(p)->setPos((fragmentRotation * static_cast<Atom *>(p)->pos()->homogeneous()).head<3>());
     widget->molecule()->update();
   }

--- a/libavogadro/src/tools/navigatetool.cpp
+++ b/libavogadro/src/tools/navigatetool.cpp
@@ -92,7 +92,8 @@ namespace Avogadro {
       double sumOfWeights = 0.;
       QList<Atom*> atoms = widget->molecule()->atoms();
       foreach (Atom *atom, atoms) {
-        Vector3d transformedAtomPos = widget->camera()->modelview() * *atom->pos();
+        Vector3d transformedAtomPos = (widget->camera()->modelview() *
+                                       atom->pos()->homogeneous()).head<3>();
         double atomDistance = transformedAtomPos.norm();
         double dot = transformedAtomPos.z() / atomDistance;
         double weight = exp(-30. * (1. + dot));
--- a/libavogadro/src/tools/skeletontree.cpp
+++ b/libavogadro/src/tools/skeletontree.cpp
@@ -29,6 +29,7 @@
 #include <avogadro/atom.h>
 #include <avogadro/bond.h>
 #include <avogadro/molecule.h>
+#include <iostream>

 using namespace Eigen;
 using namespace std;
@@ -221,7 +222,7 @@ namespace Avogadro {
   {
     if (m_rootNode) {
       //Rotate skeleton around a particular axis and center point
-      Eigen::Transform3d rotation;
+      Eigen::Projective3d rotation;
       rotation = Eigen::AngleAxisd(angle, rotationAxis);
       rotation.pretranslate(centerVector);
       rotation.translate(-centerVector);
@@ -248,11 +249,11 @@ namespace Avogadro {
   // ##########  recursiveRotate  ##########

   void SkeletonTree::recursiveRotate(Node* n,
-                                     const Eigen::Transform3d &rotationMatrix)
+                                     const Eigen::Projective3d &rotationMatrix)
   {
     // Update the root node with the new position
     Atom* a = n->atom();
-    a->setPos(rotationMatrix * (*a->pos()));
+    a->setPos((rotationMatrix * (*a->pos()).homogeneous()).head<3>());
     a->update();

     // Now update the children
--- a/libavogadro/src/tools/skeletontree.h
+++ b/libavogadro/src/tools/skeletontree.h
@@ -230,6 +230,6 @@ namespace Avogadro {
        * @param centerVector Center location to rotate around.
        */
       void recursiveRotate(Node* n,
-                           const Eigen::Transform3d &rotationMatrix);
+                           const Eigen::Projective3d &rotationMatrix);

   };
 } // End namespace Avogadro


code:
From 2d4be7ede177a8df7340fe3b209698d591ee8a04 Mon Sep 17 00:00:00 2001
From: Claudio Fernandes <claudiosf.claudio@gmail.com>
Date: Mon, 16 Jan 2017 19:48:23 -0200
Subject: [PATCH] Adapt libavogadro/python to Eigen 3.3

---
 libavogadro/src/python/camera.cpp |  2 +-
 libavogadro/src/python/eigen.cpp  | 60 +++++++++++++++++++--------------------
 2 files changed, 31 insertions(+), 31 deletions(-)

diff --git a/libavogadro/src/python/camera.cpp b/libavogadro/src/python/camera.cpp
index 69ca87bf8..30b32af7d 100644
--- a/libavogadro/src/python/camera.cpp
+++ b/libavogadro/src/python/camera.cpp
@@ -10,7 +10,7 @@ using namespace Avogadro;
 void export_Camera()
 {

-  const Eigen::Transform3d& (Camera::*modelview_ptr)() const = &Camera::modelview;
+  const Eigen::Projective3d& (Camera::*modelview_ptr)() const = &Camera::modelview;
   Eigen::Vector3d (Camera::*unProject_ptr1)(const Eigen::Vector3d&) const = &Camera::unProject;
   Eigen::Vector3d (Camera::*unProject_ptr2)(const QPoint&, const Eigen::Vector3d&) const = &Camera::unProject;
   Eigen::Vector3d (Camera::*unProject_ptr3)(const QPoint&) const = &Camera::unProject;
diff --git a/libavogadro/src/python/eigen.cpp b/libavogadro/src/python/eigen.cpp
index c1faedbcc..20b4e719d 100644
--- a/libavogadro/src/python/eigen.cpp
+++ b/libavogadro/src/python/eigen.cpp
@@ -305,9 +305,9 @@ template <> struct ScalarTraits<double>
     struct innerclass
     {
       //
-      //  Eigen::Transform3d --> python array (4x4)
+      //  Eigen::Projective3d --> python array (4x4)
       //
-      static PyObject* convert(Eigen::Transform3d const &trans)
+      static PyObject* convert(Eigen::Projective3d const &trans)
       {
         npy_intp dims[2] = { 4, 4 };
         PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
@@ -321,9 +321,9 @@ template <> struct ScalarTraits<double>
         return incref(result);
       }
       //
-      //  Eigen::Transform3d* --> python array (4x4)
+      //  Eigen::Projective3d* --> python array (4x4)
       //
-      static PyObject* convert(Eigen::Transform3d *trans)
+      static PyObject* convert(Eigen::Projective3d *trans)
       {
         npy_intp dims[2] = { 4, 4 };
         PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
@@ -337,9 +337,9 @@ template <> struct ScalarTraits<double>
         return incref(result);
       }
       //
-      //  const Eigen::Transform3d* --> python array (4x4)
+      //  const Eigen::Projective3d* --> python array (4x4)
       //
-      static PyObject* convert(const Eigen::Transform3d *trans)
+      static PyObject* convert(const Eigen::Projective3d *trans)
       {
         npy_intp dims[2] = { 4, 4 };
         PyObject *result = PyArray_SimpleNew(2, dims, PyArray_DOUBLE);
@@ -358,10 +358,10 @@ template <> struct ScalarTraits<double>
     Transform3d_to_python_array()
     {
       #ifndef WIN32
-      to_python_converter<Eigen::Transform3d, innerclass>();
+      to_python_converter<Eigen::Projective3d, innerclass>();
       #endif
-      to_python_converter<Eigen::Transform3d*, innerclass>();
-      to_python_converter<const Eigen::Transform3d*, innerclass>();
+      to_python_converter<Eigen::Projective3d*, innerclass>();
+      to_python_converter<const Eigen::Projective3d*, innerclass>();
     }

   };
@@ -373,17 +373,17 @@ template <> struct ScalarTraits<double>
       // Insert an rvalue from_python converter at the tail of the
       // chain. Used for implicit conversions
       //
-      //  python array --> Eigen::Transform3d
+      //  python array --> Eigen::Projective3d
       //
       // used for:
       //
-      //  void function(Eigen::Transform3d vec)
-      //  void function(Eigen::Transform3d & vec)
-      //  void function(const Eigen::Transform3d & vec)
+      //  void function(Eigen::Projective3d vec)
+      //  void function(Eigen::Projective3d & vec)
+      //  void function(const Eigen::Projective3d & vec)
       //
-      converter::registry::push_back( &convertible, &construct, type_id<Eigen::Transform3d>() );
+      converter::registry::push_back( &convertible, &construct, type_id<Eigen::Projective3d>() );

-      converter::registry::insert( &convert, type_id<Eigen::Transform3d>() );
+      converter::registry::insert( &convert, type_id<Eigen::Projective3d>() );
     }

     static void* convert(PyObject *obj_ptr)
@@ -401,7 +401,7 @@ template <> struct ScalarTraits<double>
         throw_error_already_set(); // the 1D array does not have exactly 3 elements

       double *values = reinterpret_cast<double*>(array->data);
-      Eigen::Transform3d *c_obj = new Eigen::Transform3d();
+      Eigen::Projective3d *c_obj = new Eigen::Projective3d();
       double *dataPtr = c_obj->data();

       for (int i = 0; i < 16; ++i)
@@ -432,7 +432,7 @@ template <> struct ScalarTraits<double>
       // I think this is a better way to get at the double array, where is this
       // deleted though? Does Boost::Python do it?
       double *values = reinterpret_cast<double*>(array->data);
-      Eigen::Transform3d *storage = new Eigen::Transform3d();
+      Eigen::Projective3d *storage = new Eigen::Projective3d();
       double *dataPtr = storage->data();

       for (int i = 0; i < 16; ++i)
@@ -467,21 +467,21 @@ class EigenUnitTestHelper
     void set_vector3d_ptr(Eigen::Vector3d* vec)                 { m_vector3d = *vec; }
     void set_const_vector3d_ptr(const Eigen::Vector3d* const vec) { m_vector3d = *vec; }

-    //Eigen::Transform3d             transform3d()              { return m_transform3d; }
-    //Eigen::Transform3d&            transform3d_ref()          { return m_transform3d; }
-    const Eigen::Transform3d&      const_transform3d_ref()    { return m_transform3d; }
-    Eigen::Transform3d*            transform3d_ptr()          { return &m_transform3d; }
-    const Eigen::Transform3d*      const_transform3d_ptr()    { return &m_transform3d; }
-
-    //void set_transform3d(Eigen::Transform3d vec)                      { m_transform3d = vec; }
-    //void set_transform3d_ref(Eigen::Transform3d& vec)                 { m_transform3d = vec; }
-    void set_const_transform3d_ref(const Eigen::Transform3d& vec)     { m_transform3d = vec; }
-    void set_transform3d_ptr(Eigen::Transform3d* vec)                 { m_transform3d = *vec; }
-    void set_const_transform3d_ptr(const Eigen::Transform3d* const vec) { m_transform3d = *vec; }
+    //Eigen::Projective3d             transform3d()              { return m_transform3d; }
+    //Eigen::Projective3d&            transform3d_ref()          { return m_transform3d; }
+    const Eigen::Projective3d&      const_transform3d_ref()    { return m_transform3d; }
+    Eigen::Projective3d*            transform3d_ptr()          { return &m_transform3d; }
+    const Eigen::Projective3d*      const_transform3d_ptr()    { return &m_transform3d; }
+
+    //void set_transform3d(Eigen::Projective3d vec)                      { m_transform3d = vec; }
+    //void set_transform3d_ref(Eigen::Projective3d& vec)                 { m_transform3d = vec; }
+    void set_const_transform3d_ref(const Eigen::Projective3d& vec)     { m_transform3d = vec; }
+    void set_transform3d_ptr(Eigen::Projective3d* vec)                 { m_transform3d = *vec; }
+    void set_const_transform3d_ptr(const Eigen::Projective3d* const vec) { m_transform3d = *vec; }

   private:
     Eigen::Vector3d m_vector3d;
-    Eigen::Transform3d m_transform3d;
+    Eigen::Projective3d m_transform3d;

 };
 #endif
@@ -529,6 +529,6 @@ void export_Eigen()
   Vector3x_to_python_array<Eigen::Vector3i>();
   Vector3x_from_python_array<Eigen::Vector3i>();

-  // Eigen::Transform3d
+  // Eigen::Projective3d
   Transform3d_to_python_array();
   Transform3d_from_python_array();

license: mit


code:
Do not introduce timestamps in PNG files (for icons).
See <https://wiki.debian.org/ReproducibleBuilds/TimestampsInPNG>.

--- awesome-3.4.15/CMakeLists.txt	2013-02-11 14:50:21.000000000 +0100
+++ awesome-3.4.15/CMakeLists.txt	2016-06-16 13:59:30.528125439 +0200
@@ -295,7 +295,7 @@ macro(a_icon_convert match replacement i
         set(ALL_ICONS ${ALL_ICONS} ${output})

         add_custom_command(
-            COMMAND ${CONVERT_EXECUTABLE} ${input} -strip ${ARGN} ${output}
+            COMMAND ${CONVERT_EXECUTABLE} +set date:create +set date:modify -define png:exclude-chunk=time ${input} -strip ${ARGN} ${output}
             OUTPUT  ${output}
             DEPENDS ${input}
             VERBATIM)


code:
This patch adds the "sigc" and "std" namespace prefixes where needed.  It also
replaces a double single-argument "bind" with a single two-argument "bind",
because the former would confuse the compiler.

The patch has been sent to the developer on 2016-09-26.

--- azr3-jack-1.2.3/azr3/knob.cpp	2016-09-26 10:29:27.653375902 +0200
+++ azr3-jack-1.2.3/azr3/knob.cpp	2016-09-26 10:29:38.693430647 +0200
@@ -44,7 +44,7 @@
   set_size_request(44, 44);
   add_events(EXPOSURE_MASK | BUTTON1_MOTION_MASK |
              BUTTON_PRESS_MASK | SCROLL_MASK);
-  m_adj.signal_value_changed().connect(mem_fun(*this, &Knob::queue_draw));
+  m_adj.signal_value_changed().connect(sigc::mem_fun(*this, &Knob::queue_draw));
 }

--- azr3-jack-1.2.3/azr3/drawbar.cpp	2016-09-26 10:27:40.632845216 +0200
+++ azr3-jack-1.2.3/azr3/drawbar.cpp	2016-09-26 10:27:48.952886473 +0200
@@ -37,7 +37,7 @@
   set_size_request(22, 150);
   add_events(EXPOSURE_MASK | BUTTON1_MOTION_MASK |
              BUTTON_PRESS_MASK | SCROLL_MASK);
-  m_adj.signal_value_changed().connect(mem_fun(*this, &Drawbar::queue_draw));
+  m_adj.signal_value_changed().connect(sigc::mem_fun(*this, &Drawbar::queue_draw));
 }

--- azr3-jack-1.2.3/azr3/switch.cpp	2016-09-26 10:28:48.169180111 +0200
+++ azr3-jack-1.2.3/azr3/switch.cpp	2016-09-26 10:28:55.713217520 +0200
@@ -49,7 +49,7 @@
   }
   set_size_request(m_width, m_height);
   add_events(EXPOSURE_MASK | BUTTON_PRESS_MASK | SCROLL_MASK);
-  m_adj.signal_value_changed().connect(mem_fun(*this, &Switch::queue_draw));
+  m_adj.signal_value_changed().connect(sigc::mem_fun(*this, &Switch::queue_draw));
 }

--- azr3-jack-1.2.3/azr3/azr3gui.cpp	2016-09-26 09:05:10.106963561 +0200
+++ azr3-jack-1.2.3/azr3/azr3gui.cpp	2016-09-26 10:26:47.480581648 +0200
@@ -73,19 +73,19 @@
   m_tbox = add_textbox(m_fbox, pixmap, 391, 19, 3, 140, 39);
   m_tbox->add_events(SCROLL_MASK);
   m_tbox->signal_scroll_display.
-    connect(mem_fun(*this, &AZR3GUI::display_scroll));
+    connect(sigc::mem_fun(*this, &AZR3GUI::display_scroll));
   m_splitpoint_adj = new Adjustment(0, 0, 1);
   m_adj[n_splitpoint] = m_splitpoint_adj;
   m_splitpoint_adj->signal_value_changed().
-    connect(mem_fun(*this, &AZR3GUI::splitpoint_changed));
+    connect(sigc::mem_fun(*this, &AZR3GUI::splitpoint_changed));
   Menu* menu = create_menu();
   m_tbox->signal_button_press_event().
-    connect(bind(mem_fun(*this, &AZR3GUI::popup_menu), menu));
+    connect(sigc::bind(sigc::mem_fun(*this, &AZR3GUI::popup_menu), menu));

   // keyboard split switch
   m_splitswitch = add_switch(m_fbox, -1, 537, 49, Switch::Mini);
   m_splitswitch->get_adjustment().signal_value_changed().
-    connect(mem_fun(*this, &AZR3GUI::splitbox_clicked));
+    connect(sigc::mem_fun(*this, &AZR3GUI::splitbox_clicked));

   // upper knobs
   add_switch(m_fbox, n_mono, 61, 105, Switch::Mini);
@@ -141,8 +141,8 @@
   // mode switcher
   Widget* eb = add_clickbox(m_fbox, 14, 319, 14, 44);
   eb->signal_button_press_event().
-    connect(sigc::hide(bind(bind(mem_fun(*this, &AZR3GUI::change_mode),
-				 ref(m_fbox)), false)));
+    connect(sigc::hide(sigc::bind(sigc::mem_fun(*this, &AZR3GUI::change_mode),
+                                  false, std::ref(m_fbox))));
   m_fx_widgets.push_back(eb);

   // Mr Valve controls
@@ -182,8 +182,8 @@
   // mode switcher 2
   Widget* eb2 = add_clickbox(m_vbox, 14, 53, 14, 44);
   eb2->signal_button_press_event().
-    connect(sigc::hide(bind(bind(mem_fun(*this, &AZR3GUI::change_mode),
-				 ref(m_fbox)), true)));
+    connect(sigc::hide(sigc::bind(sigc::mem_fun(*this, &AZR3GUI::change_mode),
+                                  true, std::ref(m_fbox))));

   // vibrato controls
   add_switch(m_vbox, n_1_vibrato, 39, 17, Switch::Green);
@@ -352,9 +352,9 @@
   knob->set_style(s);
   if (port >= 0 && port < m_adj.size()) {
     knob->get_adjustment().signal_value_changed().
-      connect(compose(bind<0>(mem_fun(*this, &AZR3GUI::control_changed), port),
-		      mem_fun(knob->get_adjustment(),
-			      &Adjustment::get_value)));
+      connect(compose(sigc::bind<0>(sigc::mem_fun(*this, &AZR3GUI::control_changed), port),
+		      sigc::mem_fun(knob->get_adjustment(),
+                                    &Adjustment::get_value)));
     assert(m_adj[port] == 0);
     m_adj[port] = &knob->get_adjustment();
   }
@@ -382,8 +382,8 @@
   db->set_style(s);
   if (port >= 0 && port < m_adj.size()) {
     db->get_adjustment().signal_value_changed().
-      connect(compose(bind<0>(mem_fun(*this, &AZR3GUI::control_changed), port),
-		      mem_fun(db->get_adjustment(), &Adjustment::get_value)));
+      connect(compose(sigc::bind<0>(sigc::mem_fun(*this, &AZR3GUI::control_changed), port),
+		      sigc::mem_fun(db->get_adjustment(), &Adjustment::get_value)));
     assert(m_adj[port] == 0);
     m_adj[port] = &db->get_adjustment();
   }
@@ -397,8 +397,8 @@
   fbox.put(*sw, xoffset, yoffset);
   if (port >= 0 && port < m_adj.size()) {
     sw->get_adjustment().signal_value_changed().
-      connect(compose(bind<0>(mem_fun(*this, &AZR3GUI::control_changed),port),
-		      mem_fun(sw->get_adjustment(), &Adjustment::get_value)));
+      connect(compose(sigc::bind<0>(sigc::mem_fun(*this, &AZR3GUI::control_changed),port),
+		      sigc::mem_fun(sw->get_adjustment(), &Adjustment::get_value)));
     assert(m_adj[port] == 0);
     m_adj[port] = &sw->get_adjustment();
   }
@@ -489,7 +489,7 @@
     oss<<setw(2)<<setfill('0')<<iter->first<<' '<<iter->second.substr(0, 23);
     MenuItem* item = manage(new MenuItem(oss.str()));
     item->signal_activate().
-      connect(bind(mem_fun(*this, &AZR3GUI::program_changed), iter->first));
+      connect(sigc::bind(sigc::mem_fun(*this, &AZR3GUI::program_changed), iter->first));
     m_program_menu->items().push_back(*item);
     item->show();
     item->get_child()->modify_bg(STATE_NORMAL, m_menu_bg);
@@ -503,8 +503,8 @@
   for (int i = 0; i < 128; ++i) {
     MenuItem* item = manage(new MenuItem(note2str(i)));
     item->signal_activate().
-      connect(bind(mem_fun(*m_splitpoint_adj, &Adjustment::set_value),
-		   i / 128.0));
+      connect(sigc::bind(sigc::mem_fun(*m_splitpoint_adj, &Adjustment::set_value),
+                         i / 128.0));
     m_split_menu->items().push_back(*item);
     item->show();
     item->get_child()->modify_bg(STATE_NORMAL, m_menu_bg);
@@ -533,7 +533,7 @@

   MenuItem* save_item = manage(new MenuItem("Save program"));
   save_item->signal_activate().
-    connect(mem_fun(*this, &AZR3GUI::save_program));
+    connect(sigc::mem_fun(*this, &AZR3GUI::save_program));
   save_item->show();
   save_item->get_child()->modify_fg(STATE_NORMAL, m_menu_bg);
   save_item->get_child()->modify_fg(STATE_NORMAL, m_menu_fg);


code:
Bash-completion is written with FHS in mind where completion scripts
all get added to /usr/share/bash-completion/completions and are picked
up by the dynamic completion loader from there---whether they are
part of bash-completion or installed by another package.

On Guix systems, we want not only to search within bash-completion's own
directory, but also in the user's profile and in the system profile.
This is what this patch does.

--- a/bash_completion
+++ b/bash_completion
@@ -2016,7 +2016,13 @@ complete -F _minimal ''

 __load_completion()
 {
-    local -a dirs=( ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
+    local -a dirs=(
+        "$HOME/.guix-profile/share/bash-completion/completions/$base"
+        "$HOME/.guix-profile/etc/bash_completion.d/$base"
+        "/run/current-system/profile/share/bash-completion/completions/$base"
+        "/run/current-system/profile/etc/bash_completion.d/$base"
+        ${BASH_COMPLETION_USER_DIR:-${XDG_DATA_HOME:-$HOME/.local/share}/bash-completion}/completions )
+
     local OIFS=$IFS IFS=: dir cmd="${1##*/}" compfile
     for dir in ${XDG_DATA_DIRS:-/usr/local/share:/usr/share}; do
         dirs+=( $dir/bash-completion/completions )


code:
Unconditionally enable PGRP_PIPE on Linux (the kernel), regardless of
the kernel version in use on the build machine.

--- configure.ac.orig	2019-01-02 09:38:44.000000000 -0500
+++ configure.ac	2019-08-15 16:40:24.271758379 -0400
@@ -1108,10 +1108,7 @@
 solaris2*)	LOCAL_CFLAGS=-DSOLARIS ;;
 lynxos*)	LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
 linux*)		LOCAL_LDFLAGS=-rdynamic		 # allow dynamic loading
-		case "`uname -r`" in
-		1.*|2.[[0123]]*)	: ;;
-		*)	AC_DEFINE(PGRP_PIPE) ;;
-		esac ;;
+		AC_DEFINE(PGRP_PIPE) ;;
 netbsd*|openbsd*)	LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
 *qnx[[67]]*)	LOCAL_LIBS="-lncurses" ;;
 *qnx*)		LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
--- configure.orig	2019-01-02 09:43:04.000000000 -0500
+++ configure	2019-08-15 16:41:44.440155912 -0400
@@ -16312,11 +16312,7 @@
 solaris2*)	LOCAL_CFLAGS=-DSOLARIS ;;
 lynxos*)	LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
 linux*)		LOCAL_LDFLAGS=-rdynamic		 # allow dynamic loading
-		case "`uname -r`" in
-		1.*|2.[0123]*)	: ;;
-		*)	$as_echo "#define PGRP_PIPE 1" >>confdefs.h
- ;;
-		esac ;;
+		$as_echo "#define PGRP_PIPE 1" >>confdefs.h ;;
 netbsd*|openbsd*)	LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
 *qnx[67]*)	LOCAL_LIBS="-lncurses" ;;
 *qnx*)		LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;


code:
Unconditionally enable PGRP_PIPE on Linux (the kernel), regardless of
the kernel version in use on the build machine.

diff -purN bash-5.0-orig/configure bash-5.0/configure
--- configure	1970-01-01 01:00:00.000000000 +0100
+++ configure	2019-09-29 11:51:42.664518665 +0200
@@ -16312,11 +16312,7 @@ solaris2.10*)	LOCAL_CFLAGS=-DSOLARIS  ;;
 solaris2*)	LOCAL_CFLAGS=-DSOLARIS ;;
 lynxos*)	LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
 linux*)		LOCAL_LDFLAGS=-rdynamic		 # allow dynamic loading
-		case "`uname -r`" in
-		1.*|2.[0123]*)	: ;;
-		*)	$as_echo "#define PGRP_PIPE 1" >>confdefs.h
- ;;
-		esac ;;
+		$as_echo "#define PGRP_PIPE 1" >>confdefs.h ;;
 netbsd*|openbsd*)	LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
 *qnx[67]*)	LOCAL_LIBS="-lncurses" ;;
 *qnx*)		LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;
diff -purN bash-5.0-orig/configure.ac bash-5.0/configure.ac
--- configure.ac	1970-01-01 01:00:00.000000000 +0100
+++ configure.ac	2019-09-29 11:51:10.692026225 +0200
@@ -1108,10 +1108,7 @@ solaris2.10*)	LOCAL_CFLAGS=-DSOLARIS  ;;
 solaris2*)	LOCAL_CFLAGS=-DSOLARIS ;;
 lynxos*)	LOCAL_CFLAGS=-DRECYCLES_PIDS ;;
 linux*)		LOCAL_LDFLAGS=-rdynamic		 # allow dynamic loading
-		case "`uname -r`" in
-		1.*|2.[[0123]]*)	: ;;
-		*)	AC_DEFINE(PGRP_PIPE) ;;
-		esac ;;
+		AC_DEFINE(PGRP_PIPE) ;;
 netbsd*|openbsd*)	LOCAL_CFLAGS="-DDEV_FD_STAT_BROKEN" ;;
 *qnx[[67]]*)	LOCAL_LIBS="-lncurses" ;;
 *qnx*)		LOCAL_CFLAGS="-Dqnx -F -3s" LOCAL_LDFLAGS="-3s" LOCAL_LIBS="-lunix -lncurses" ;;


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Wed, 3 Oct 2018 23:30:42 +0200
Subject: [PATCH] bastet: Change source of unordered_set.

This allows building bastet 0.43.2 with boost >=1.66.
It was backported verbatim from the upstream master branch.

From 0e03f8d4d6bc6949cf1c447e632ce0d1b98c4be1 Mon Sep 17 00:00:00 2001
From: Federico Poloni <fpoloni@di.unipi.it>
Date: Wed, 4 Oct 2017 19:35:01 +0200
Subject: [PATCH] Changed source of unordered_set (should hopefully fix #6
 without reopening #1)

---
 BastetBlockChooser.hpp | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/BastetBlockChooser.hpp b/BastetBlockChooser.hpp
index 992e556..7ee3b7c 100644
--- a/BastetBlockChooser.hpp
+++ b/BastetBlockChooser.hpp
@@ -23,8 +23,7 @@

 #include "Well.hpp"

-#include <boost/tr1/tr1/unordered_set>
-#include <set>
+#include <boost/unordered_set.hpp>
 #include <boost/functional/hash.hpp>

 namespace Bastet{
@@ -75,7 +74,7 @@ namespace Bastet{
   public:
     Searcher(BlockType b, const Well *well, Vertex v, WellVisitor *visitor);
   private:
-    std::tr1::unordered_set<Vertex> _visited;
+    boost::unordered_set<Vertex> _visited;
     //std::set<Vertex> _visited; ^^ the above is more efficient, we need to do many inserts
     BlockType _block;
     const Well *_well;


code:
Fix CVE-2017-14176:

https://bugs.launchpad.net/bzr/+bug/1710979
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14176

Patch copied from Debian's Bazaar package version bzr_2.7.0+bzr6619-7+deb9u1:

https://alioth.debian.org/scm/loggerhead/pkg-bazaar/bzr/2.7/revision/4204

Description: Prevent SSH command line options from being specified in bzr+ssh:// URLs
Bug: https://bugs.launchpad.net/brz/+bug/1710979
Bug-Debian: https://bugs.debian.org/874429
Bug-Debian-Security: https://security-tracker.debian.org/tracker/CVE-2017-14176
Forwarded: no
Author: Jelmer Vernooĳ <jelmer@jelmer.uk>
Last-Update: 2017-11-26

=== modified file 'bzrlib/tests/test_ssh_transport.py'
--- old/bzrlib/tests/test_ssh_transport.py	2010-10-07 12:45:51 +0000
+++ new/bzrlib/tests/test_ssh_transport.py	2017-08-20 01:59:20 +0000
@@ -22,6 +22,7 @@
     SSHCorpSubprocessVendor,
     LSHSubprocessVendor,
     SSHVendorManager,
+    StrangeHostname,
     )

@@ -161,6 +162,19 @@

 class SubprocessVendorsTests(TestCase):

+    def test_openssh_command_tricked(self):
+        vendor = OpenSSHSubprocessVendor()
+        self.assertEqual(
+            vendor._get_vendor_specific_argv(
+                "user", "-oProxyCommand=blah", 100, command=["bzr"]),
+            ["ssh", "-oForwardX11=no", "-oForwardAgent=no",
+                "-oClearAllForwardings=yes",
+                "-oNoHostAuthenticationForLocalhost=yes",
+                "-p", "100",
+                "-l", "user",
+                "--",
+                "-oProxyCommand=blah", "bzr"])
+
     def test_openssh_command_arguments(self):
         vendor = OpenSSHSubprocessVendor()
         self.assertEqual(
@@ -171,6 +185,7 @@
                 "-oNoHostAuthenticationForLocalhost=yes",
                 "-p", "100",
                 "-l", "user",
+                "--",
                 "host", "bzr"]
             )

@@ -184,9 +199,16 @@
                 "-oNoHostAuthenticationForLocalhost=yes",
                 "-p", "100",
                 "-l", "user",
-                "-s", "host", "sftp"]
+                "-s", "--", "host", "sftp"]
             )

+    def test_openssh_command_tricked(self):
+        vendor = SSHCorpSubprocessVendor()
+        self.assertRaises(
+            StrangeHostname,
+            vendor._get_vendor_specific_argv,
+                "user", "-oProxyCommand=host", 100, command=["bzr"])
+
     def test_sshcorp_command_arguments(self):
         vendor = SSHCorpSubprocessVendor()
         self.assertEqual(
@@ -209,6 +231,13 @@
                 "-s", "sftp", "host"]
             )

+    def test_lsh_command_tricked(self):
+        vendor = LSHSubprocessVendor()
+        self.assertRaises(
+            StrangeHostname,
+            vendor._get_vendor_specific_argv,
+                "user", "-oProxyCommand=host", 100, command=["bzr"])
+
     def test_lsh_command_arguments(self):
         vendor = LSHSubprocessVendor()
         self.assertEqual(
@@ -231,6 +260,13 @@
                 "--subsystem", "sftp", "host"]
             )

+    def test_plink_command_tricked(self):
+        vendor = PLinkSubprocessVendor()
+        self.assertRaises(
+            StrangeHostname,
+            vendor._get_vendor_specific_argv,
+                "user", "-oProxyCommand=host", 100, command=["bzr"])
+
     def test_plink_command_arguments(self):
         vendor = PLinkSubprocessVendor()
         self.assertEqual(

=== modified file 'bzrlib/transport/ssh.py'
--- old/bzrlib/transport/ssh.py	2015-07-31 01:04:41 +0000
+++ new/bzrlib/transport/ssh.py	2017-08-20 01:59:20 +0000
@@ -46,6 +46,10 @@
     from paramiko.sftp_client import SFTPClient

+class StrangeHostname(errors.BzrError):
+    _fmt = "Refusing to connect to strange SSH hostname %(hostname)s"
+
+
 SYSTEM_HOSTKEYS = {}
 BZR_HOSTKEYS = {}

@@ -360,6 +364,11 @@
     # tests, but beware of using PIPE which may hang due to not being read.
     _stderr_target = None

+    @staticmethod
+    def _check_hostname(arg):
+        if arg.startswith('-'):
+            raise StrangeHostname(hostname=arg)
+
     def _connect(self, argv):
         # Attempt to make a socketpair to use as stdin/stdout for the SSH
         # subprocess.  We prefer sockets to pipes because they support
@@ -424,9 +433,9 @@
         if username is not None:
             args.extend(['-l', username])
         if subsystem is not None:
-            args.extend(['-s', host, subsystem])
+            args.extend(['-s', '--', host, subsystem])
         else:
-            args.extend([host] + command)
+            args.extend(['--', host] + command)
         return args

 register_ssh_vendor('openssh', OpenSSHSubprocessVendor())
@@ -439,6 +448,7 @@

     def _get_vendor_specific_argv(self, username, host, port, subsystem=None,
                                   command=None):
+        self._check_hostname(host)
         args = [self.executable_path, '-x']
         if port is not None:
             args.extend(['-p', str(port)])
@@ -460,6 +470,7 @@

     def _get_vendor_specific_argv(self, username, host, port, subsystem=None,
                                   command=None):
+        self._check_hostname(host)
         args = [self.executable_path]
         if port is not None:
             args.extend(['-p', str(port)])
@@ -481,6 +492,7 @@

     def _get_vendor_specific_argv(self, username, host, port, subsystem=None,
                                   command=None):
+        self._check_hostname(host)
         args = [self.executable_path, '-x', '-a', '-ssh', '-2', '-batch']
         if port is not None:
             args.extend(['-P', str(port)])


code:
Patch taken from nix.

commit fdda59736ddc048cf38a2c7103f4f5d9eeaf995e
Author: Ben Gamari <ben@smart-cactus.org>
Date:   Tue Oct 17 10:51:34 2017 -0400

    Try implementing cross-compilation

diff --git a/bc/Makefile.am b/bc/Makefile.am
index d9d412e..fdef633 100644
--- a/bc/Makefile.am
+++ b/bc/Makefile.am
@@ -17,6 +17,7 @@ MAINTAINERCLEANFILES = Makefile.in bc.c bc.h scan.c \

 AM_CPPFLAGS = -I$(srcdir) -I$(srcdir)/../h
 LIBBC = ../lib/libbc.a
+LIBBC_HOST = ../lib/libbc_host.a
 LIBL = @LEXLIB@
 LDADD = $(LIBBC) $(LIBL) @READLINELIB@

@@ -29,12 +30,20 @@ $(PROGRAMS): libmath.h $(LIBBC)
 scan.o: bc.h
 global.o: libmath.h
+
+main_host.c : main.c
+	cp $< $@

-fbcOBJ = main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o
+fbcOBJ = $(addsuffix _host,main.o bc.o scan.o execute.o load.o storage.o util.o warranty.o)
+
+%.o_host : CC:=$(CC_FOR_BUILD)
+
+%.o_host : %.c
+	$(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<

-libmath.h: libmath.b $(fbcOBJ) $(LIBBC)
+libmath.h: libmath.b $(fbcOBJ) $(LIBBC_HOST)
 	echo '{0}' > libmath.h
-	$(MAKE) global.o
-	$(LINK) -o fbc $(fbcOBJ) global.o $(LIBBC) $(LIBL) $(READLINELIB) $(LIBS)
+	$(MAKE) global.o_host
+	$(CC_FOR_BUILD) -o fbc $(fbcOBJ) global.o_host $(LIBBC_HOST) $(LIBL) ${READLINELIB} $(LIBS)
 	./fbc -c $(srcdir)/libmath.b </dev/null >libmath.h
 	$(srcdir)/fix-libmath_h
 	rm -f ./fbc ./global.o
diff --git a/configure.ac b/configure.ac
index fc74573..5cabb73 100644
--- a/configure.ac
+++ b/configure.ac
@@ -20,6 +20,7 @@ m4_define([dc_version], 1.4.1)

 AC_INIT([bc],[bc_version])
 AC_CONFIG_SRCDIR(doc/bc.1)
+AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([dist-bzip2])
 AC_CONFIG_HEADERS(config.h)

@@ -35,6 +36,7 @@ AC_DEFINE([DC_COPYRIGHT],
 	  [Define the dc copyright line.])

 AC_PROG_CC
+AX_CC_FOR_BUILD
 AC_USE_SYSTEM_EXTENSIONS

 AM_PROG_LEX
diff --git a/lib/Makefile.am b/lib/Makefile.am
index ec4bf59..c670f5b 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,5 +1,5 @@
 ## Process this file with automake to produce Makefile.in
-noinst_LIBRARIES = libbc.a
+noinst_LIBRARIES = libbc.a libbc_host.a

 AM_CPPFLAGS = -I. -I.. -I$(srcdir)/../h

@@ -24,3 +24,11 @@ testmul: testmul.o number.o

 specialnumber: newnumber.o
 	cp newnumber.o number.o
+
+%.o_host : CC:=$(CC_FOR_BUILD)
+%.o_host : %.c
+	$(COMPILE) -c $(CFLAGS) $(INCLUDES) -o $@ $<
+
+libbc_host.a : $(addsuffix _host,$(libbc_a_OBJECTS))
+	ar cru $@ $+
+	ranlib $@
diff --git a/m4/cc_for_build.m4 b/m4/cc_for_build.m4
new file mode 100644
index 0000000..c62ffad
--- /dev/null
+++ b/m4/cc_for_build.m4
@@ -0,0 +1,77 @@
+# ===========================================================================
+#     https://www.gnu.org/software/autoconf-archive/ax_cc_for_build.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_CC_FOR_BUILD
+#
+# DESCRIPTION
+#
+#   Find a build-time compiler. Sets CC_FOR_BUILD and EXEEXT_FOR_BUILD.
+#
+# LICENSE
+#
+#   Copyright (c) 2010 Reuben Thomas <rrt@sc3d.org>
+#   Copyright (c) 1999 Richard Henderson <rth@redhat.com>
+#
+#   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 <https://www.gnu.org/licenses/>.
+#
+#   As a special exception, the respective Autoconf Macro's copyright owner
+#   gives unlimited permission to copy, distribute and modify the configure
+#   scripts that are the output of Autoconf when processing the Macro. You
+#   need not follow the terms of the GNU General Public License when using
+#   or distributing such scripts, even though portions of the text of the
+#   Macro appear in them. The GNU General Public License (GPL) does govern
+#   all other use of the material that constitutes the Autoconf Macro.
+#
+#   This special exception to the GPL applies to versions of the Autoconf
+#   Macro released by the Autoconf Archive. When you make and distribute a
+#   modified version of the Autoconf Macro, you may extend this special
+#   exception to the GPL to apply to your modified version as well.
+
+#serial 3
+
+dnl Get a default for CC_FOR_BUILD to put into Makefile.
+AC_DEFUN([AX_CC_FOR_BUILD],
+[# Put a plausible default for CC_FOR_BUILD in Makefile.
+if test -z "$CC_FOR_BUILD"; then
+  if test "x$cross_compiling" = "xno"; then
+    CC_FOR_BUILD='$(CC)'
+  else
+    CC_FOR_BUILD=gcc
+  fi
+fi
+AC_SUBST(CC_FOR_BUILD)
+# Also set EXEEXT_FOR_BUILD.
+if test "x$cross_compiling" = "xno"; then
+  EXEEXT_FOR_BUILD='$(EXEEXT)'
+else
+  AC_CACHE_CHECK([for build system executable suffix], bfd_cv_build_exeext,
+    [rm -f conftest*
+     echo 'int main () { return 0; }' > conftest.c
+     bfd_cv_build_exeext=
+     ${CC_FOR_BUILD} -o conftest conftest.c 1>&5 2>&5
+     for file in conftest.*; do
+       case $file in
+       *.c | *.o | *.obj | *.ilk | *.pdb) ;;
+       *) bfd_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
+       esac
+     done
+     rm -f conftest*
+     test x"${bfd_cv_build_exeext}" = x && bfd_cv_build_exeext=no])
+  EXEEXT_FOR_BUILD=""
+  test x"${bfd_cv_build_exeext}" != xno && EXEEXT_FOR_BUILD=${bfd_cv_build_exeext}
+fi
+AC_SUBST(EXEEXT_FOR_BUILD)])dnl


code:
https://sources.debian.org/data/main/b/beancount/2.2.0-3/debian/patches/0001-Remove-fonts.googleapis.com-links-for-the-bean-web-t.patch

From: Nicolas Dandrimont <nicolas@dandrimont.eu>
Date: Tue, 1 May 2018 04:49:55 +0200
Subject: Remove fonts.googleapis.com links for the bean-web template

---
 beancount/web/web.html | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/beancount/web/web.html b/beancount/web/web.html
index 3995ce2..ec9e707 100644
--- a/beancount/web/web.html
+++ b/beancount/web/web.html
@@ -3,10 +3,6 @@
   <head>
     <meta content="text/html; charset=utf-8" http-equiv="Content-Type" />

-    <link href="https://fonts.googleapis.com/css?family=Roboto+Condensed:400italic,700italic,700,400" rel="stylesheet" type="text/css" />
-    <link href="https://fonts.googleapis.com/css?family=Roboto:400italic,700italic,700,400" rel="stylesheet" type="text/css" />
-    <link href='https://fonts.googleapis.com/css?family=Droid+Sans+Mono' rel='stylesheet' type='text/css' />
-
     <link href="/resources/web.css" rel="stylesheet" type="text/css" />
     <title>{{title}}: {{pagetitle}}</title>


code:
Be compatible with python-werkzeug 1.0.0.

Taken from upstream:
https://github.com/beetbox/beets/commit/d43d54e21cde97f57f19486925ab56b419254cc8

diff --git a/beetsplug/web/__init__.py b/beetsplug/web/__init__.py
index f53fb3a954..21ff5d94ed 100644
--- a/beetsplug/web/__init__.py
+++ b/beetsplug/web/__init__.py
@@ -169,7 +169,7 @@ def to_python(self, value):
         return ids

     def to_url(self, value):
-        return ','.join(value)
+        return ','.join(str(v) for v in value)

 class QueryConverter(PathConverter):


code:
Fix build with Python 3.8, this is a patch based on upstream commit [1].

1: c000c88eb5239b87f299c85e83b349b0ef387ae7

diff --git a/behave.ini b/behave.ini
index 45c0f0d7..952240d6 100644
--- a/behave.ini
+++ b/behave.ini
@@ -15,8 +15,9 @@ show_skipped = false
 format   = rerun
     progress3
 outfiles = rerun.txt
-    reports/report_progress3.txt
+    build/behave.reports/report_progress3.txt
 junit = true
+junit_directory = build/behave.reports
 logging_level = INFO
 # logging_format = LOG.%(levelname)-8s  %(name)-10s: %(message)s
 # logging_format = LOG.%(levelname)-8s  %(asctime)s  %(name)-10s: %(message)s
diff --git a/features/environment.py b/features/environment.py
index 4744e89a..3769ee40 100644
--- a/features/environment.py
+++ b/features/environment.py
@@ -1,5 +1,7 @@
 # -*- coding: UTF-8 -*-
+# FILE: features/environemnt.py

+from __future__ import absolute_import, print_function
 from behave.tag_matcher import ActiveTagMatcher, setup_active_tag_values
 from behave4cmd0.setup_command_shell import setup_command_shell_processors4behave
 import platform
@@ -20,6 +22,15 @@
 }
 active_tag_matcher = ActiveTagMatcher(active_tag_value_provider)

+
+def print_active_tags_summary():
+    active_tag_data = active_tag_value_provider
+    print("ACTIVE-TAG SUMMARY:")
+    print("use.with_python.version=%s" % active_tag_data.get("python.version"))
+    # print("use.with_os=%s" % active_tag_data.get("os"))
+    print()
+
+
 # -----------------------------------------------------------------------------
 # HOOKS:
 # -----------------------------------------------------------------------------
@@ -30,11 +41,14 @@ def before_all(context):
     setup_python_path()
     setup_context_with_global_params_test(context)
     setup_command_shell_processors4behave()
+    print_active_tags_summary()
+

 def before_feature(context, feature):
     if active_tag_matcher.should_exclude_with(feature.tags):
         feature.skip(reason=active_tag_matcher.exclude_reason)

+
 def before_scenario(context, scenario):
     if active_tag_matcher.should_exclude_with(scenario.effective_tags):
         scenario.skip(reason=active_tag_matcher.exclude_reason)
diff --git a/features/step.duplicated_step.feature b/features/step.duplicated_step.feature
index 59888b0f..396cca27 100644
--- a/features/step.duplicated_step.feature
+++ b/features/step.duplicated_step.feature
@@ -32,11 +32,11 @@ Feature: Duplicated Step Definitions
         AmbiguousStep: @given('I call Alice') has already been defined in
         existing step @given('I call Alice') at features/steps/alice_steps.py:3
         """
-    And the command output should contain:
-        """
-        File "features/steps/alice_steps.py", line 7, in <module>
-        @given(u'I call Alice')
-        """
+    # -- DISABLED: Python 3.8 traceback line numbers differ w/ decorators (+1).
+    # And the command output should contain:
+    #    """
+    #    File "features/steps/alice_steps.py", line 7, in <module>
+    #    """

   Scenario: Duplicated Step Definition in another File
@@ -70,11 +70,11 @@ Feature: Duplicated Step Definitions
         AmbiguousStep: @given('I call Bob') has already been defined in
         existing step @given('I call Bob') at features/steps/bob1_steps.py:3
         """
-    And the command output should contain:
-        """
-        File "features/steps/bob2_steps.py", line 3, in <module>
-        @given('I call Bob')
-        """
+    # -- DISABLED: Python 3.8 traceback line numbers differ w/ decorators (+1).
+    # And the command output should contain:
+    #    """
+    #    File "features/steps/bob2_steps.py", line 3, in <module>
+    #    """

   @xfail
   Scenario: Duplicated Same Step Definition via import from another File
diff --git a/issue.features/environment.py b/issue.features/environment.py
index 2dfec751..7e48ee03 100644
--- a/issue.features/environment.py
+++ b/issue.features/environment.py
@@ -1,5 +1,5 @@
 # -*- coding: UTF-8 -*-
-# FILE: features/environment.py
+# FILE: issue.features/environemnt.py
 # pylint: disable=unused-argument
 """
 Functionality:
@@ -7,17 +7,20 @@
   * active tags
 """

-from __future__ import print_function
+
+from __future__ import absolute_import, print_function
 import sys
 import platform
 import os.path
 import six
 from behave.tag_matcher import ActiveTagMatcher
 from behave4cmd0.setup_command_shell import setup_command_shell_processors4behave
-# PREPARED:
-# from behave.tag_matcher import setup_active_tag_values
+# PREPARED: from behave.tag_matcher import setup_active_tag_values

+# ---------------------------------------------------------------------------
+# TEST SUPPORT: For Active Tags
+# ---------------------------------------------------------------------------
 def require_tool(tool_name):
     """Check if a tool (an executable program) is provided on this platform.

@@ -45,12 +48,14 @@ def require_tool(tool_name):
     # print("TOOL-NOT-FOUND: %s" % tool_name)
     return False

+
 def as_bool_string(value):
     if bool(value):
         return "yes"
     else:
         return "no"

+
 def discover_ci_server():
     # pylint: disable=invalid-name
     ci_server = "none"
@@ -67,11 +72,17 @@ def discover_ci_server():
     return ci_server

+# ---------------------------------------------------------------------------
+# BEHAVE SUPPORT: Active Tags
+# ---------------------------------------------------------------------------
 # -- MATCHES ANY TAGS: @use.with_{category}={value}
 # NOTE: active_tag_value_provider provides category values for active tags.
+python_version = "%s.%s" % sys.version_info[:2]
 active_tag_value_provider = {
+    "platform": sys.platform,
     "python2": str(six.PY2).lower(),
     "python3": str(six.PY3).lower(),
+    "python.version": python_version,
     # -- python.implementation: cpython, pypy, jython, ironpython
     "python.implementation": platform.python_implementation().lower(),
     "pypy":    str("__pypy__" in sys.modules).lower(),
@@ -82,17 +92,33 @@ def discover_ci_server():
 }
 active_tag_matcher = ActiveTagMatcher(active_tag_value_provider)

+
+def print_active_tags_summary():
+    active_tag_data = active_tag_value_provider
+    print("ACTIVE-TAG SUMMARY:")
+    print("use.with_python.version=%s" % active_tag_data.get("python.version"))
+    # print("use.with_platform=%s" % active_tag_data.get("platform"))
+    # print("use.with_os=%s" % active_tag_data.get("os"))
+    print()
+
+
+# ---------------------------------------------------------------------------
+# BEHAVE HOOKS:
+# ---------------------------------------------------------------------------
 def before_all(context):
     # -- SETUP ACTIVE-TAG MATCHER (with userdata):
     # USE: behave -D browser=safari ...
-    # NOT-NEEDED: setup_active_tag_values(active_tag_value_provider,
-    #                                     context.config.userdata)
+    # NOT-NEEDED:
+    # setup_active_tag_values(active_tag_value_provider, context.config.userdata)
     setup_command_shell_processors4behave()
+    print_active_tags_summary()
+

 def before_feature(context, feature):
     if active_tag_matcher.should_exclude_with(feature.tags):
         feature.skip(reason=active_tag_matcher.exclude_reason)

+
 def before_scenario(context, scenario):
     if active_tag_matcher.should_exclude_with(scenario.effective_tags):
         scenario.skip(reason=active_tag_matcher.exclude_reason)
diff --git a/issue.features/issue0330.feature b/issue.features/issue0330.feature
index dc1ebe75..81cb6e29 100644
--- a/issue.features/issue0330.feature
+++ b/issue.features/issue0330.feature
@@ -70,6 +70,7 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
     And note that "bob.feature is skipped"

+  @not.with_python.version=3.8
   Scenario: Junit report for skipped feature is created with --show-skipped
     When I run "behave --junit -t @tag1 --show-skipped @alice_and_bob.featureset"
     Then it should pass with:
@@ -83,6 +84,23 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
       <testsuite errors="0" failures="0" name="bob.Bob" skipped="1" tests="1" time="0.0">
       """

+  @use.with_python.version=3.8
+  Scenario: Junit report for skipped feature is created with --show-skipped
+    When I run "behave --junit -t @tag1 --show-skipped @alice_and_bob.featureset"
+    Then it should pass with:
+      """
+      1 feature passed, 0 failed, 1 skipped
+      """
+    And a file named "test_results/TESTS-alice.xml" exists
+    And a file named "test_results/TESTS-bob.xml" exists
+    And the file "test_results/TESTS-bob.xml" should contain:
+      """
+      <testsuite name="bob.Bob" tests="1" errors="0" failures="0" skipped="1" time="0.0">
+      """
+      # -- HINT FOR: Python < 3.8
+      # <testsuite errors="0" failures="0" name="bob.Bob" skipped="1" tests="1" time="0.0">
+
+  @not.with_python.version=3.8
   Scenario: Junit report for skipped scenario is neither shown nor counted with --no-skipped
     When I run "behave --junit -t @tag1 --no-skipped"
     Then it should pass with:
@@ -102,7 +120,30 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
       """
     And note that "Charly2 is the skipped scenarion in charly.feature"

+  @use.with_python.version=3.8
+  Scenario: Junit report for skipped scenario is neither shown nor counted with --no-skipped
+    When I run "behave --junit -t @tag1 --no-skipped"
+    Then it should pass with:
+      """
+      2 features passed, 0 failed, 1 skipped
+      2 scenarios passed, 0 failed, 2 skipped
+      """
+    And a file named "test_results/TESTS-alice.xml" exists
+    And a file named "test_results/TESTS-charly.xml" exists
+    And the file "test_results/TESTS-charly.xml" should contain:
+      """
+      <testsuite name="charly.Charly" tests="1" errors="0" failures="0" skipped="0"
+      """
+      # -- HINT FOR: Python < 3.8
+      # <testsuite errors="0" failures="0" name="charly.Charly" skipped="0" tests="1"
+    And the file "test_results/TESTS-charly.xml" should not contain:
+      """
+      <testcase classname="charly.Charly" name="Charly2"
+      """
+    And note that "Charly2 is the skipped scenarion in charly.feature"
+

+  @not.with_python.version=3.8
   Scenario: Junit report for skipped scenario is shown and counted with --show-skipped
     When I run "behave --junit -t @tag1 --show-skipped"
     Then it should pass with:
@@ -122,3 +163,26 @@ Feature: Issue #330: Skipped scenarios are included in junit reports when --no-s
       """
     And note that "Charly2 is the skipped scenarion in charly.feature"

+
+  @use.with_python.version=3.8
+  Scenario: Junit report for skipped scenario is shown and counted with --show-skipped
+    When I run "behave --junit -t @tag1 --show-skipped"
+    Then it should pass with:
+      """
+      2 features passed, 0 failed, 1 skipped
+      2 scenarios passed, 0 failed, 2 skipped
+      """
+    And a file named "test_results/TESTS-alice.xml" exists
+    And a file named "test_results/TESTS-charly.xml" exists
+    And the file "test_results/TESTS-charly.xml" should contain:
+      """
+      <testsuite name="charly.Charly" tests="2" errors="0" failures="0" skipped="1"
+      """
+      # HINT: Python < 3.8
+      # <testsuite errors="0" failures="0" name="charly.Charly" skipped="1" tests="2"
+    And the file "test_results/TESTS-charly.xml" should contain:
+      """
+      <testcase classname="charly.Charly" name="Charly2" status="skipped"
+      """
+    And note that "Charly2 is the skipped scenarion in charly.feature"
+
diff --git a/issue.features/issue0446.feature b/issue.features/issue0446.feature
index a2ed892d..901bdec5 100644
--- a/issue.features/issue0446.feature
+++ b/issue.features/issue0446.feature
@@ -58,6 +58,7 @@ Feature: Issue #446 -- Support scenario hook-errors with JUnitReporter
         behave.reporter.junit.show_hostname = False
         """

+    @not.with_python.version=3.8
     Scenario: Hook error in before_scenario()
       When I run "behave -f plain --junit features/before_scenario_failure.feature"
       Then it should fail with:
@@ -86,6 +87,40 @@ Feature: Issue #446 -- Support scenario hook-errors with JUnitReporter
       And note that "the traceback is contained in the XML element <error/>"

+    @use.with_python.version=3.8
+    Scenario: Hook error in before_scenario()
+      When I run "behave -f plain --junit features/before_scenario_failure.feature"
+      Then it should fail with:
+        """
+        0 scenarios passed, 1 failed, 0 skipped
+        """
+      And the command output should contain:
+        """
+        HOOK-ERROR in before_scenario: RuntimeError: OOPS
+        """
+      And the file "reports/TESTS-before_scenario_failure.xml" should contain:
+        """
+        <testsuite name="before_scenario_failure.Alice" tests="1" errors="1" failures="0" skipped="0"
+        """
+        # -- HINT FOR: Python < 3.8
+        # <testsuite errors="1" failures="0" name="before_scenario_failure.Alice" skipped="0" tests="1"
+      And the file "reports/TESTS-before_scenario_failure.xml" should contain:
+        """
+        <error type="RuntimeError" message="HOOK-ERROR in before_scenario: RuntimeError: OOPS">
+        """
+        # -- HINT FOR: Python < 3.8
+        # <error message="HOOK-ERROR in before_scenario: RuntimeError: OOPS" type="RuntimeError">
+      And the file "reports/TESTS-before_scenario_failure.xml" should contain:
+        """
+        File "features/environment.py", line 6, in before_scenario
+          cause_hook_failure()
+        File "features/environment.py", line 2, in cause_hook_failure
+          raise RuntimeError("OOPS")
+        """
+      And note that "the traceback is contained in the XML element <error/>"
+
+
+    @not.with_python.version=3.8
     Scenario: Hook error in after_scenario()
       When I run "behave -f plain --junit features/after_scenario_failure.feature"
       Then it should fail with:
@@ -114,3 +149,38 @@ Feature: Issue #446 -- Support scenario hook-errors with JUnitReporter
           raise RuntimeError("OOPS")
         """
       And note that "the traceback is contained in the XML element <error/>"
+
+
+    @use.with_python.version=3.8
+    Scenario: Hook error in after_scenario()
+      When I run "behave -f plain --junit features/after_scenario_failure.feature"
+      Then it should fail with:
+        """
+        0 scenarios passed, 1 failed, 0 skipped
+        """
+      And the command output should contain:
+        """
+          Scenario: B1
+            Given another step passes ... passed
+        HOOK-ERROR in after_scenario: RuntimeError: OOPS
+        """
+      And the file "reports/TESTS-after_scenario_failure.xml" should contain:
+        """
+        <testsuite name="after_scenario_failure.Bob" tests="1" errors="1" failures="0" skipped="0"
+        """
+        # -- HINT FOR: Python < 3.8
+        # <testsuite errors="1" failures="0" name="after_scenario_failure.Bob" skipped="0" tests="1"
+      And the file "reports/TESTS-after_scenario_failure.xml" should contain:
+        """
+        <error type="RuntimeError" message="HOOK-ERROR in after_scenario: RuntimeError: OOPS">
+        """
+        # -- HINT FOR: Python < 3.8
+        # <error message="HOOK-ERROR in after_scenario: RuntimeError: OOPS" type="RuntimeError">
+      And the file "reports/TESTS-after_scenario_failure.xml" should contain:
+        """
+        File "features/environment.py", line 10, in after_scenario
+          cause_hook_failure()
+        File "features/environment.py", line 2, in cause_hook_failure
+          raise RuntimeError("OOPS")
+        """
+      And note that "the traceback is contained in the XML element <error/>"
diff --git a/issue.features/issue0457.feature b/issue.features/issue0457.feature
index f80640e9..46f96e9c 100644
--- a/issue.features/issue0457.feature
+++ b/issue.features/issue0457.feature
@@ -24,6 +24,7 @@ Feature: Issue #457 -- Double-quotes in error messages of JUnit XML reports
         """

+    @not.with_python.version=3.8
     Scenario: Use failing assertation in a JUnit XML report
       Given a file named "features/fails1.feature" with:
         """
@@ -44,6 +45,31 @@ Feature: Issue #457 -- Double-quotes in error messages of JUnit XML reports
         <failure message="FAILED: My name is "Alice""
         """

+    @use.with_python.version=3.8
+    Scenario: Use failing assertation in a JUnit XML report
+      Given a file named "features/fails1.feature" with:
+        """
+        Feature:
+          Scenario: Alice
+            Given a step fails with message:
+              '''
+              My name is "Alice"
+              '''
+        """
+      When I run "behave --junit features/fails1.feature"
+      Then it should fail with:
+        """
+        0 scenarios passed, 1 failed, 0 skipped
+        """
+      And the file "reports/TESTS-fails1.xml" should contain:
+        """
+        <failure type="AssertionError" message="FAILED: My name is "Alice"">
+        """
+        # -- HINT FOR: Python < 3.8
+        # <failure message="FAILED: My name is "Alice""
+
+
+    @not.with_python.version=3.8
     Scenario: Use exception in a JUnit XML report
       Given a file named "features/fails2.feature" with:
         """
@@ -63,3 +89,26 @@ Feature: Issue #457 -- Double-quotes in error messages of JUnit XML reports
         """
         <error message="My name is "Bob" and <here> I am"
         """
+
+    @use.with_python.version=3.8
+    Scenario: Use exception in a JUnit XML report
+      Given a file named "features/fails2.feature" with:
+        """
+        Feature:
+          Scenario: Bob
+            Given a step fails with error and message:
+              '''
+              My name is "Bob" and <here> I am
+              '''
+        """
+      When I run "behave --junit features/fails2.feature"
+      Then it should fail with:
+        """
+        0 scenarios passed, 1 failed, 0 skipped
+        """
+      And the file "reports/TESTS-fails2.xml" should contain:
+        """
+        <error type="RuntimeError" message="My name is "Bob" and <here> I am">
+        """
+        # -- HINT FOR: Python < 3.8
+        # <error message="My name is "Bob" and <here> I am"


code:
Help CMake find Clang's libraries.
Have it install the ICD file in the right place.

diff --git a/CMake/FindLLVM.cmake b/CMake/FindLLVM.cmake
index 5457f248..e8e8f94a 100644
--- a/CMake/FindLLVM.cmake
+++ b/CMake/FindLLVM.cmake
@@ -107,7 +107,7 @@ endif (LLVM_VERSION_NODOT VERSION_GREATER 34)
 macro(add_one_lib name)
   FIND_LIBRARY(CLANG_LIB
     NAMES ${name}
-    PATHS ${LLVM_LIBRARY_DIR} NO_DEFAULT_PATH)
+    PATHS ${CLANG_LIBRARY_DIR} NO_DEFAULT_PATH)
   set(CLANG_LIBRARIES ${CLANG_LIBRARIES} ${CLANG_LIB})
 	unset(CLANG_LIB CACHE)
 endmacro()
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c11acbb2..fb99e5c8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -217,7 +217,7 @@ IF(OCLIcd_FOUND)
     "intel-beignet.icd.in"
     "${ICD_FILE_NAME}"
   )
-  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${ICD_FILE_NAME} DESTINATION /etc/OpenCL/vendors)
+  install (FILES ${CMAKE_CURRENT_BINARY_DIR}/${ICD_FILE_NAME} DESTINATION etc/OpenCL/vendors COMPONENT config)
 ELSE(OCLIcd_FOUND)
   MESSAGE(STATUS "Looking for OCL ICD header file - not found")
   MESSAGE(FATAL_ERROR "OCL ICD loader miss. If you really want to disable OCL ICD support, please run cmake with option -DOCLICD_COMPAT=0.")
--
2.14.3


code:
From 5eb306618196ea78b8c9390e22ea2edce20760fe Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=A1bor=20Boskovits?= <boskovits@gmail.com>
Date: Fri, 14 Jun 2019 22:15:49 +0200
Subject: [PATCH] Remove googletest lookup from build system.

---
 cmake/GoogleTest.cmake    | 18 +++++++++---------
 cmake/GoogleTest.cmake.in | 12 ++++++------
 2 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/cmake/GoogleTest.cmake b/cmake/GoogleTest.cmake
index fb7c6be..a6c473b 100644
--- a/cmake/GoogleTest.cmake
+++ b/cmake/GoogleTest.cmake
@@ -27,15 +27,15 @@ endif()
 # settings on Windows
 set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

-include(${GOOGLETEST_PREFIX}/googletest-paths.cmake)
+#include(${GOOGLETEST_PREFIX}/googletest-paths.cmake)

 # Add googletest directly to our build. This defines
 # the gtest and gtest_main targets.
-add_subdirectory(${GOOGLETEST_SOURCE_DIR}
-                 ${GOOGLETEST_BINARY_DIR}
-                 EXCLUDE_FROM_ALL)
-
-set_target_properties(gtest PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest,INTERFACE_INCLUDE_DIRECTORIES>)
-set_target_properties(gtest_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest_main,INTERFACE_INCLUDE_DIRECTORIES>)
-set_target_properties(gmock PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock,INTERFACE_INCLUDE_DIRECTORIES>)
-set_target_properties(gmock_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock_main,INTERFACE_INCLUDE_DIRECTORIES>)
+#add_subdirectory(${GOOGLETEST_SOURCE_DIR}
+#                 ${GOOGLETEST_BINARY_DIR}
+#                 EXCLUDE_FROM_ALL)
+
+#set_target_properties(gtest PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest,INTERFACE_INCLUDE_DIRECTORIES>)
+#set_target_properties(gtest_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gtest_main,INTERFACE_INCLUDE_DIRECTORIES>)
+#set_target_properties(gmock PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock,INTERFACE_INCLUDE_DIRECTORIES>)
+#set_target_properties(gmock_main PROPERTIES INTERFACE_SYSTEM_INCLUDE_DIRECTORIES $<TARGET_PROPERTY:gmock_main,INTERFACE_INCLUDE_DIRECTORIES>)
diff --git a/cmake/GoogleTest.cmake.in b/cmake/GoogleTest.cmake.in
index 28818ee..13b0888 100644
--- a/cmake/GoogleTest.cmake.in
+++ b/cmake/GoogleTest.cmake.in
@@ -31,7 +31,7 @@ if(EXISTS "${GOOGLETEST_PATH}"            AND IS_DIRECTORY "${GOOGLETEST_PATH}"
   )
 else()
   if(NOT ALLOW_DOWNLOADING_GOOGLETEST)
-    message(SEND_ERROR "Did not find Google Test sources! Either pass correct path in GOOGLETEST_PATH, or enable ALLOW_DOWNLOADING_GOOGLETEST, or disable BENCHMARK_ENABLE_GTEST_TESTS / BENCHMARK_ENABLE_TESTING.")
+    message(WARNING "Did not find Google Test sources! Either pass correct path in GOOGLETEST_PATH, or enable ALLOW_DOWNLOADING_GOOGLETEST, or disable BENCHMARK_ENABLE_GTEST_TESTS / BENCHMARK_ENABLE_TESTING.")
   else()
     message(WARNING "Did not find Google Test sources! Fetching from web...")
     ExternalProject_Add(
@@ -51,8 +51,8 @@ else()
   endif()
 endif()

-ExternalProject_Get_Property(googletest SOURCE_DIR BINARY_DIR)
-file(WRITE googletest-paths.cmake
-"set(GOOGLETEST_SOURCE_DIR \"${SOURCE_DIR}\")
-set(GOOGLETEST_BINARY_DIR \"${BINARY_DIR}\")
-")
+#ExternalProject_Get_Property(googletest SOURCE_DIR BINARY_DIR)
+#file(WRITE googletest-paths.cmake
+#"set(GOOGLETEST_SOURCE_DIR \"${SOURCE_DIR}\")
+#set(GOOGLETEST_BINARY_DIR \"${BINARY_DIR}\")
+#")
--
2.22.0


code:
From 2a9b15aefb842a734637f3d230936ea1b7c60096 Mon Sep 17 00:00:00 2001
From: Philip Kime <Philip@kime.org.uk>
Date: Thu, 8 Nov 2018 22:02:09 +0100
Subject: [PATCH] Fix to address #239

---
 lib/Biber.pm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/Biber.pm b/lib/Biber.pm
index 8b1f80a5..d97fca29 100644
--- a/lib/Biber.pm
+++ b/lib/Biber.pm
@@ -311,6 +311,8 @@ sub parse_ctrlfile {
     unless (eval {$checkbuf = File::Slurper::read_text($ctrl_file_path, 'latin1')}) {
       biber_error("$ctrl_file_path is not UTF-8 or even latin1, how horrible.");
     }
+    # Write ctrl file as UTF-8
+    File::Slurper::write_text($ctrl_file_path, NFC($checkbuf));# Unicode NFC boundary
   }

   $checkbuf = NFD($checkbuf);# Unicode NFD boundary
@@ -319,8 +321,6 @@ sub parse_ctrlfile {
     unlink($output) unless $output eq '-';# ignore deletion of STDOUT marker
     biber_error("$ctrl_file_path is malformed, last biblatex run probably failed. Deleted $output");
   }
-  # Write ctrl file as UTF-8
-  File::Slurper::write_text($ctrl_file_path, NFC($checkbuf));# Unicode NFC boundary

   # Validate if asked to
   if (Biber::Config->getoption('validate_control')) {