diff options
Diffstat (limited to 'gnu/packages/patches')
-rw-r--r-- | gnu/packages/patches/avogadro-boost148.patch | 69 | ||||
-rw-r--r-- | gnu/packages/patches/avogadro-eigen3-update.patch | 603 | ||||
-rw-r--r-- | gnu/packages/patches/avogadro-python-eigen-lib.patch | 161 | ||||
-rw-r--r-- | gnu/packages/patches/c++-gsl-find-system-gtest.patch | 96 | ||||
-rw-r--r-- | gnu/packages/patches/freebayes-devendor-deps.patch | 2 | ||||
-rw-r--r-- | gnu/packages/patches/icecat-makeicecat.patch | 4 | ||||
-rw-r--r-- | gnu/packages/patches/mutt-CVE-2021-3181.patch | 45 | ||||
-rw-r--r-- | gnu/packages/patches/pinentry-efl.patch | 798 |
8 files changed, 99 insertions, 1679 deletions
diff --git a/gnu/packages/patches/avogadro-boost148.patch b/gnu/packages/patches/avogadro-boost148.patch deleted file mode 100644 index f244f14674..0000000000 --- a/gnu/packages/patches/avogadro-boost148.patch +++ /dev/null @@ -1,69 +0,0 @@ -Index: avogadro-1.2.0/libavogadro/src/pythonengine_p.h -=================================================================== ---- avogadro-1.2.0.orig/libavogadro/src/pythonengine_p.h -+++ avogadro-1.2.0/libavogadro/src/pythonengine_p.h -@@ -31,7 +31,9 @@ - - #include <avogadro/global.h> - #include <avogadro/engine.h> -+#ifndef Q_MOC_RUN - #include <boost/python.hpp> -+#endif - - namespace Avogadro { - -Index: avogadro-1.2.0/libavogadro/src/pythonextension_p.h -=================================================================== ---- avogadro-1.2.0.orig/libavogadro/src/pythonextension_p.h -+++ avogadro-1.2.0/libavogadro/src/pythonextension_p.h -@@ -33,7 +33,9 @@ - #include <avogadro/extension.h> - #include <avogadro/primitive.h> - #include <avogadro/glwidget.h> -+#ifndef Q_MOC_RUN - #include <boost/python.hpp> -+#endif - - #include <QWidget> - #include <QList> -Index: avogadro-1.2.0/libavogadro/src/pythontool_p.h -=================================================================== ---- avogadro-1.2.0.orig/libavogadro/src/pythontool_p.h -+++ avogadro-1.2.0/libavogadro/src/pythontool_p.h -@@ -31,7 +31,9 @@ - - #include <avogadro/global.h> - #include <avogadro/tool.h> -+#ifndef Q_MOC_RUN - #include <boost/python.hpp> -+#endif - - #include <QObject> - #include <QAction> -Index: avogadro-1.2.0/libavogadro/src/pythoninterpreter.h -=================================================================== ---- avogadro-1.2.0.orig/libavogadro/src/pythoninterpreter.h -+++ avogadro-1.2.0/libavogadro/src/pythoninterpreter.h -@@ -26,7 +26,9 @@ - #define PYTHONINTERPRETER_H - - #include <avogadro/global.h> -+#ifndef Q_MOC_RUN - #include <boost/python.hpp> -+#endif - #include <avogadro/primitive.h> - #include <QString> - -Index: avogadro-1.2.0/libavogadro/src/pythonscript.h -=================================================================== ---- avogadro-1.2.0.orig/libavogadro/src/pythonscript.h -+++ avogadro-1.2.0/libavogadro/src/pythonscript.h -@@ -27,6 +27,8 @@ - #define PYTHONSCRIPT_H - - #include <avogadro/global.h> -+#ifndef Q_MOC_RUN - #include <boost/python.hpp> -+#endif - - #include "pythonerror.h" diff --git a/gnu/packages/patches/avogadro-eigen3-update.patch b/gnu/packages/patches/avogadro-eigen3-update.patch deleted file mode 100644 index a5f669292f..0000000000 --- a/gnu/packages/patches/avogadro-eigen3-update.patch +++ /dev/null @@ -1,603 +0,0 @@ -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
\ No newline at end of file diff --git a/gnu/packages/patches/avogadro-python-eigen-lib.patch b/gnu/packages/patches/avogadro-python-eigen-lib.patch deleted file mode 100644 index ac9f2e30af..0000000000 --- a/gnu/packages/patches/avogadro-python-eigen-lib.patch +++ /dev/null @@ -1,161 +0,0 @@ -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(); diff --git a/gnu/packages/patches/c++-gsl-find-system-gtest.patch b/gnu/packages/patches/c++-gsl-find-system-gtest.patch new file mode 100644 index 0000000000..2def650292 --- /dev/null +++ b/gnu/packages/patches/c++-gsl-find-system-gtest.patch @@ -0,0 +1,96 @@ +From f5cf01083baf7e8dc8318db3648bc6098dc32d67 Mon Sep 17 00:00:00 2001 +From: Nicholas Guriev <guriev-ns@ya.ru> +Date: Sat, 18 Apr 2020 13:30:17 +0300 +Subject: [PATCH] Search for GoogleTest via pkg-config first + +--- + tests/CMakeLists.txt | 55 ++++++++++++++++++++++++-------------------- + 1 file changed, 30 insertions(+), 25 deletions(-) + +diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt +index 02193197..53d475c2 100644 +--- a/tests/CMakeLists.txt ++++ b/tests/CMakeLists.txt +@@ -1,36 +1,41 @@ + cmake_minimum_required(VERSION 3.0.2) + + project(GSLTests CXX) ++include(FindPkgConfig) + + # will make visual studio generated project group files + set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +-configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) +-execute_process( +- COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . +- RESULT_VARIABLE result +- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download +-) +-if(result) +- message(FATAL_ERROR "CMake step for googletest failed: ${result}") +-endif() ++pkg_search_module(GTestMain gtest_main) ++if (NOT GTestMain_FOUND) ++ configure_file(CMakeLists.txt.in googletest-download/CMakeLists.txt) ++ execute_process( ++ COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}" . ++ RESULT_VARIABLE result ++ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download ++ ) ++ if(result) ++ message(FATAL_ERROR "CMake step for googletest failed: ${result}") ++ endif() + +-execute_process( +- COMMAND ${CMAKE_COMMAND} --build . +- RESULT_VARIABLE result +- WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download +-) +-if(result) +- message(FATAL_ERROR "CMake step for googletest failed: ${result}") +-endif() ++ execute_process( ++ COMMAND ${CMAKE_COMMAND} --build . ++ RESULT_VARIABLE result ++ WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/googletest-download ++ ) ++ if(result) ++ message(FATAL_ERROR "CMake step for googletest failed: ${result}") ++ endif() + +-set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) ++ set(gtest_force_shared_crt ON CACHE BOOL "" FORCE) ++ set(GTestMain_LIBRARIES gtest_main) + +-add_subdirectory( +- ${CMAKE_CURRENT_BINARY_DIR}/googletest-src +- ${CMAKE_CURRENT_BINARY_DIR}/googletest-build +- EXCLUDE_FROM_ALL +-) ++ add_subdirectory( ++ ${CMAKE_CURRENT_BINARY_DIR}/googletest-src ++ ${CMAKE_CURRENT_BINARY_DIR}/googletest-build ++ EXCLUDE_FROM_ALL ++ ) ++endif() + + if (MSVC AND (GSL_CXX_STANDARD EQUAL 17)) + set(GSL_CPLUSPLUS_OPT -Zc:__cplusplus -permissive-) +@@ -149,7 +154,7 @@ function(add_gsl_test name) + target_link_libraries(${name} + GSL + gsl_tests_config +- gtest_main ++ ${GTestMain_LIBRARIES} + ) + add_test( + ${name} +@@ -254,7 +259,7 @@ function(add_gsl_test_noexcept name) + target_link_libraries(${name} + GSL + gsl_tests_config_noexcept +- gtest_main ++ ${GTestMain_LIBRARIES} + ) + add_test( + ${name} diff --git a/gnu/packages/patches/freebayes-devendor-deps.patch b/gnu/packages/patches/freebayes-devendor-deps.patch index 7e84666b85..9886de11fb 100644 --- a/gnu/packages/patches/freebayes-devendor-deps.patch +++ b/gnu/packages/patches/freebayes-devendor-deps.patch @@ -23,7 +23,7 @@ index f6bf242..bded4af 100644 +tabixpp_dep = dependency('tabixpp', required : false) +fastahack_dep = dependency('fastahack', required : false) +smithwaterman_dep = dependency('smithwaterman', required : false) -+vcflib_dep = dependency('libvcflib', required: false) ++vcflib_dep = dependency('vcflib', required: false) thread_dep = dependency('threads') if htslib_dep.found() diff --git a/gnu/packages/patches/icecat-makeicecat.patch b/gnu/packages/patches/icecat-makeicecat.patch index 3f16880260..edd1ced257 100644 --- a/gnu/packages/patches/icecat-makeicecat.patch +++ b/gnu/packages/patches/icecat-makeicecat.patch @@ -25,7 +25,7 @@ index 8be2362..48716f2 100755 -wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc -gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353 -gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc --echo -n 0d07b74cb66b94018e3d7f11531f95c76a955e0016a3c401241d0d85062ae7ce firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - +-echo -n 1aa041db28cd742e93d663a9da8defd33040b38d8b9470350538473251621643 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - - -echo Extracting Firefox tarball -tar -xf firefox-${FFVERSION}esr.source.tar.xz @@ -37,7 +37,7 @@ index 8be2362..48716f2 100755 +# wget -N https://ftp.mozilla.org/pub/mozilla.org/firefox/releases/${FFVERSION}esr/source/firefox-${FFVERSION}esr.source.tar.xz.asc +# gpg --recv-keys --keyserver keyserver.ubuntu.com 14F26682D0916CDD81E37B6D61B7B526D98F0353 +# gpg --verify firefox-${FFVERSION}esr.source.tar.xz.asc -+# echo -n 0d07b74cb66b94018e3d7f11531f95c76a955e0016a3c401241d0d85062ae7ce firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - ++# echo -n 1aa041db28cd742e93d663a9da8defd33040b38d8b9470350538473251621643 firefox-${FFVERSION}esr.source.tar.xz |sha256sum -c - +# +# echo Extracting Firefox tarball +# tar -xf firefox-${FFVERSION}esr.source.tar.xz diff --git a/gnu/packages/patches/mutt-CVE-2021-3181.patch b/gnu/packages/patches/mutt-CVE-2021-3181.patch deleted file mode 100644 index df5214b052..0000000000 --- a/gnu/packages/patches/mutt-CVE-2021-3181.patch +++ /dev/null @@ -1,45 +0,0 @@ -Fix CVE-2021-3181: - -https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2021-3181 - -Patch copied from upstream source repository: - -https://gitlab.com/muttmua/mutt/-/commit/c059e20ea4c7cb3ee9ffd3500ffe313ae84b2545 - -From c059e20ea4c7cb3ee9ffd3500ffe313ae84b2545 Mon Sep 17 00:00:00 2001 -From: Kevin McCarthy <kevin@8t8.us> -Date: Sun, 17 Jan 2021 10:40:37 -0800 -Subject: [PATCH] Fix memory leak parsing group address. - -When there was a group address terminator with no previous addresses, -an address would be allocated but not attached to the address list. - -Change this to only allocate when last exists. - -It would be more correct to not allocate at all unless we are inside a -group list, but I will address that in a separate commit to master. ---- - rfc822.c | 5 ++--- - 1 file changed, 2 insertions(+), 3 deletions(-) - -diff --git a/rfc822.c b/rfc822.c -index 7ff4eaa3..ced619f2 100644 ---- a/rfc822.c -+++ b/rfc822.c -@@ -587,11 +587,10 @@ ADDRESS *rfc822_parse_adrlist (ADDRESS *top, const char *s) - #endif - - /* add group terminator */ -- cur = rfc822_new_address (); - if (last) - { -- last->next = cur; -- last = cur; -+ last->next = rfc822_new_address (); -+ last = last->next; - } - - phraselen = 0; --- -GitLab - diff --git a/gnu/packages/patches/pinentry-efl.patch b/gnu/packages/patches/pinentry-efl.patch deleted file mode 100644 index 5ba79e28df..0000000000 --- a/gnu/packages/patches/pinentry-efl.patch +++ /dev/null @@ -1,798 +0,0 @@ -https://git.gnupg.org/cgi-bin/gitweb.cgi?p=pinentry.git;a=commit;h=948105b7a34ec9a9e5479d376b7c86bafee50a01 -This patch can be removed with the next release of pinentry. - -From 948105b7a34ec9a9e5479d376b7c86bafee50a01 Mon Sep 17 00:00:00 2001 -From: "William L. Thomson Jr" <wlt@o-sinc.com> -Date: Tue, 29 May 2018 22:50:47 +0100 -Subject: [PATCH] efl: Add an EFL-based pinentry. - -* NEWS: Update. -* Makefile.am: Add new efl subdirectory. -* configure.ac: Add --enable-pinentry-efl option. -* efl/Makefile.am: New file. -* efl/pinentry-efl.c: New file. - -Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org> ---- - Makefile.am | 8 +- - configure.ac | 44 +++- - efl/Makefile.am | 38 ++++ - efl/pinentry-efl.c | 623 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - 6 files changed, 716 insertions(+), 2 deletions(-) - create mode 100644 efl/Makefile.am - create mode 100644 efl/pinentry-efl.c - -diff --git a/Makefile.am b/Makefile.am -index 8c8b8e5..b8fd0e1 100644 ---- a/Makefile.am -+++ b/Makefile.am -@@ -82,10 +82,16 @@ else - pinentry_fltk = - endif - -+if BUILD_PINENTRY_EFL -+pinentry_efl = efl -+else -+pinentry_efl = -+endif -+ - SUBDIRS = m4 secmem pinentry ${pinentry_curses} ${pinentry_tty} \ - ${pinentry_emacs} ${pinentry_gtk_2} ${pinentry_gnome_3} \ - ${pinentry_qt} ${pinentry_tqt} ${pinentry_w32} \ -- ${pinentry_fltk} doc -+ ${pinentry_fltk} ${pinentry_efl} doc - - - install-exec-local: -diff --git a/configure.ac b/configure.ac -index ff6c2e0..e305e44 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -419,6 +419,42 @@ fi - - - dnl -+dnl Check for EFL pinentry programs. -+dnl -+AC_ARG_ENABLE(pinentry-efl, -+ AC_HELP_STRING([--enable-pinentry-efl], [build EFL pinentry]), -+ pinentry_efl=$enableval, pinentry_efl=maybe) -+ -+dnl check for pkg-config -+if test "$pinentry_efl" != "no"; then -+ AC_PATH_PROG(PKG_CONFIG, pkg-config, no) -+ if test x"${PKG_CONFIG}" = xno ; then -+ pinentry_efl=no -+ fi -+fi -+ -+if test "$pinentry_efl" != "no"; then -+ AC_MSG_CHECKING([for efl]) -+ "${PKG_CONFIG}" --exists 'elementary >= 1.18' -+ if test $? -ne 0 ; then -+ AC_MSG_RESULT([no]) -+ AC_MSG_WARN([efl >= 1.18 is required for efl pinentry]) -+ pinentry_efl=no -+ else -+ AC_MSG_RESULT([yes]) -+ EFL_CFLAGS=`"${PKG_CONFIG}" --cflags ecore-x elementary` -+ EFL_LIBS=`"${PKG_CONFIG}" --libs ecore-x elementary` -+ AC_SUBST(EFL_CFLAGS) -+ AC_SUBST(EFL_LIBS) -+ if test "$pinentry_efl" != "no" -+ then -+ pinentry_efl=yes -+ fi -+ fi -+fi -+AM_CONDITIONAL(BUILD_PINENTRY_EFL, test "$pinentry_efl" = "yes") -+ -+dnl - dnl Check for GTK+-2 / GNOME3 pinentry programs. - dnl - AC_ARG_ENABLE(pinentry-gtk2, -@@ -645,7 +681,11 @@ else - if test "$pinentry_tqt" = "yes"; then - PINENTRY_DEFAULT=pinentry-tqt - else -- AC_MSG_ERROR([[No pinentry enabled.]]) -+ if test "$pinentry_efl" = "yes"; then -+ PINENTRY_DEFAULT=pinentry-efl -+ else -+ AC_MSG_ERROR([[No pinentry enabled.]]) -+ fi - fi - fi - fi -@@ -721,6 +761,7 @@ secmem/Makefile - pinentry/Makefile - curses/Makefile - tty/Makefile -+efl/Makefile - emacs/Makefile - gtk+-2/Makefile - gnome3/Makefile -@@ -744,6 +785,7 @@ AC_MSG_NOTICE([ - Curses Pinentry ..: $pinentry_curses - TTY Pinentry .....: $pinentry_tty - Emacs Pinentry ...: $pinentry_emacs -+ EFL Pinentry .....: $pinentry_efl - GTK+-2 Pinentry ..: $pinentry_gtk_2 - GNOME 3 Pinentry .: $pinentry_gnome_3 - Qt Pinentry ......: $pinentry_qt $pinentry_qt_lib_version -diff --git a/efl/Makefile.am b/efl/Makefile.am -new file mode 100644 -index 0000000..b986a04 ---- /dev/null -+++ b/efl/Makefile.am -@@ -0,0 +1,38 @@ -+# Makefile.am - PIN entry EFL frontend. -+# Copyright (C) 2017 Obsidian-Studios, Inc. -+# Author William L. Thomson Jr. <wlt@o-sinc.com> -+# -+# This file is part of PINENTRY. -+# -+# PINENTRY 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 2 of the License, or -+# (at your option) any later version. -+# -+# PINENTRY is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program; if not, write to the Free Software -+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA -+ -+## Process this file with automake to produce Makefile.in -+ -+bin_PROGRAMS = pinentry-efl -+ -+if FALLBACK_CURSES -+ncurses_include = $(NCURSES_INCLUDE) -+libcurses = ../pinentry/libpinentry-curses.a $(LIBCURSES) $(LIBICONV) -+else -+ncurses_include = -+libcurses = -+endif -+ -+AM_CPPFLAGS = $(COMMON_CFLAGS) $(EFL_CFLAGS) $(ncurses_include) \ -+ -I$(top_srcdir)/secmem -I$(top_srcdir)/pinentry -+LDADD = ../pinentry/libpinentry.a ../secmem/libsecmem.a \ -+ $(COMMON_LIBS) $(LIBCAP) $(EFL_LIBS) $(libcurses) -+ -+pinentry_efl_SOURCES = pinentry-efl.c -diff --git a/efl/pinentry-efl.c b/efl/pinentry-efl.c -new file mode 100644 -index 0000000..ca99693 ---- /dev/null -+++ b/efl/pinentry-efl.c -@@ -0,0 +1,623 @@ -+/* pinentry-efl.c -+ Copyright (C) 2017 Obsidian-Studios, Inc. -+ Author William L. Thomson Jr. <wlt@o-sinc.com> -+ -+ Based on pinentry-gtk2.c -+ Copyright (C) 1999 Robert Bihlmeyer <robbe@orcus.priv.at> -+ Copyright (C) 2001, 2002, 2007, 2015 g10 Code GmbH -+ Copyright (C) 2004 by Albrecht Dreà <albrecht.dress@arcor.de> -+ -+ pinentry-efl is a pinentry application for the EFL widget set. -+ It tries to follow the Gnome Human Interface Guide as close as -+ possible. -+ -+ 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 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License -+ along with this program; if not, write to the Free Software -+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -+ */ -+ -+#ifdef HAVE_CONFIG_H -+#include "config.h" -+#endif -+#include <Elementary.h> -+#include <Ecore_X.h> -+#include <gpg-error.h> -+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) -+#pragma GCC diagnostic push -+#pragma GCC diagnostic ignored "-Wstrict-prototypes" -+#endif -+#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7) -+#pragma GCC diagnostic pop -+#endif -+ -+#ifdef HAVE_GETOPT_H -+#include <getopt.h> -+#else -+#include "getopt.h" -+#endif /* HAVE_GETOPT_H */ -+ -+#include "pinentry.h" -+ -+#ifdef FALLBACK_CURSES -+#include "pinentry-curses.h" -+#endif -+ -+#define PGMNAME "pinentry-efl" -+ -+#ifndef VERSION -+#define VERSION -+#endif -+ -+#define ENTRY_HIDE "Hide entry" -+#define ENTRY_SHOW "Show entry" -+ -+typedef enum { CONFIRM_CANCEL, CONFIRM_OK, CONFIRM_NOTOK } confirm_value_t; -+ -+static const int WIDTH = 480; -+static const int BUTTON_HEIGHT = 27; -+static const int BUTTON_WIDTH = 70; -+static const int BUTTON_ICON_SIZE = 13; -+static const int PADDING = 5; -+ -+static Eina_Bool got_input; -+static Ecore_Timer *timer; -+static Evas_Object *check_label; -+static Evas_Object *error_label; -+static Evas_Object *entry; -+static Evas_Object *repeat_entry; -+static Evas_Object *qualitybar; -+static Evas_Object *win; -+static char **pargv; -+static int grab_failed; -+static int passphrase_ok; -+static int confirm_mode; -+static int pargc; -+static confirm_value_t confirm_value; -+static pinentry_t pinentry; -+ -+pinentry_cmd_handler_t pinentry_cmd_handler; -+ -+static void -+quit (void) -+{ -+ evas_object_del(win); -+ elm_exit(); -+ ecore_main_loop_quit (); -+} -+ -+static void -+delete_event (void *data EINA_UNUSED, -+ Evas_Object *obj EINA_UNUSED, -+ void *event EINA_UNUSED) -+{ -+ pinentry->close_button = 1; -+ quit (); -+} -+ -+static void -+changed_text_handler (void *data EINA_UNUSED, -+ Evas_Object *obj, -+ void *event EINA_UNUSED) -+{ -+ const char *s; -+ int length; -+ int percent; -+ -+ got_input = EINA_TRUE; -+ -+ if (pinentry->repeat_passphrase && repeat_entry) -+ { -+ elm_object_text_set (repeat_entry, ""); -+ elm_object_text_set (error_label, ""); -+ } -+ -+ if (!qualitybar || !pinentry->quality_bar) -+ return; -+ -+ s = elm_object_text_get (obj); -+ if (!s) -+ s = ""; -+ length = strlen (s); -+ percent = length? pinentry_inq_quality (pinentry, s, length) : 0; -+ evas_object_color_set(qualitybar, -+ 255 - ( 2.55 * percent ), -+ 2.55 * percent, 0, 255); -+ elm_progressbar_value_set (qualitybar, (double) percent / 100.0); -+} -+ -+static void -+on_check (void *data EINA_UNUSED, Evas_Object *obj, void *event EINA_UNUSED) -+{ -+ if(elm_check_state_get(obj)) -+ { -+ elm_entry_password_set(entry, EINA_FALSE); -+ elm_object_text_set(check_label,ENTRY_HIDE); -+ } -+ else -+ { -+ elm_entry_password_set(entry, EINA_TRUE); -+ elm_object_text_set(check_label,ENTRY_SHOW); -+ } -+ evas_object_size_hint_min_set(check_label, -+ ELM_SCALE_SIZE(BUTTON_WIDTH), -+ ELM_SCALE_SIZE(BUTTON_HEIGHT)); -+ evas_object_size_hint_align_set(check_label, 0, 1); -+} -+ -+static void -+on_click (void *data, Evas_Object *obj EINA_UNUSED, void *event EINA_UNUSED) -+{ -+ if (confirm_mode) -+ { -+ confirm_value = (confirm_value_t) data; -+ quit (); -+ return; -+ } -+ -+ if (data) -+ { -+ const char *s; -+ const char *s2; -+ -+ s = elm_entry_entry_get (entry); -+ if (!s) -+ s = ""; -+ -+ if (pinentry->repeat_passphrase && repeat_entry) -+ { -+ s2 = elm_entry_entry_get (repeat_entry); -+ if (!s2) -+ s2 = ""; -+ if (strcmp (s, s2)) -+ { -+ elm_object_text_set(error_label, -+ pinentry->repeat_error_string? -+ pinentry->repeat_error_string: -+ "not correctly repeated"); -+ elm_object_focus_set(entry,EINA_TRUE); -+ return; -+ } -+ pinentry->repeat_okay = 1; -+ } -+ -+ passphrase_ok = 1; -+ pinentry_setbufferlen (pinentry, strlen (s) + 1); -+ if (pinentry->pin) -+ strncpy (pinentry->pin, s, strlen(s) + 1); -+ } -+ quit (); -+} -+ -+static void -+enter_callback (void *data, Evas_Object * obj, void *event_info EINA_UNUSED) -+{ -+ if (data) -+ elm_object_focus_set (data, 1); -+ else -+ on_click ((void *) CONFIRM_OK, obj, NULL); -+} -+ -+static Eina_Bool -+timeout_cb (const void * data) -+{ -+ pinentry_t pe = (pinentry_t)data; -+ if (!got_input) -+ { -+ ecore_main_loop_quit(); -+ if (pe) -+ pe->specific_err = gpg_error (GPG_ERR_TIMEOUT); -+ } -+ -+ timer = NULL; -+ return ECORE_CALLBACK_DONE; -+} -+ -+static void -+create_window (void) -+{ -+ char *txt; -+ Evas_Object *icon; -+ Evas_Object *obj; -+ Evas_Object *table; -+ int btn_txt_len = 0; -+ int row = 0; -+ int ok_len = 0; -+ -+ win = elm_win_util_dialog_add(NULL,"pinentry","enter pin"); -+ elm_win_autodel_set(win, EINA_TRUE); -+ elm_win_center(win,EINA_TRUE,EINA_TRUE); -+ evas_object_smart_callback_add(win, "delete,request", delete_event, NULL); -+ -+ table = elm_table_add(win); -+ elm_table_padding_set(table,ELM_SCALE_SIZE(PADDING),0); -+ evas_object_size_hint_padding_set (table, -+ ELM_SCALE_SIZE(PADDING), -+ ELM_SCALE_SIZE(PADDING), -+ ELM_SCALE_SIZE(PADDING), -+ ELM_SCALE_SIZE(PADDING)); -+ evas_object_show(table); -+ -+ if (pinentry->title) -+ { -+ txt = pinentry_utf8_to_local (pinentry->lc_ctype, -+ pinentry->title); -+ elm_win_title_set ( win, txt ); -+ free (txt); -+ } -+ -+ /* Description Label */ -+ if (pinentry->description) -+ { -+ char* aligned; -+ int len; -+ -+ obj = elm_label_add(table); -+ elm_label_line_wrap_set (obj, ELM_WRAP_WORD); -+ txt = pinentry_utf8_to_local (pinentry->lc_ctype, pinentry->description); -+ len = strlen(txt)+20; // 20 chars for align tag -+ aligned = calloc(len+1,sizeof(char)); -+ if(aligned) -+ { -+ snprintf(aligned,len, "<align=left>%s</align>",txt); -+ elm_object_text_set(obj,aligned); -+ free (aligned); -+ } else -+ elm_object_text_set(obj,txt); -+ free (txt); -+ evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, 0); -+ evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, 0); -+ elm_table_pack(table, obj, 1, row, 5, 1); -+ evas_object_show(obj); -+ row++; -+ } -+ if (!confirm_mode && (pinentry->error || pinentry->repeat_passphrase)) -+ { -+ /* Error Label */ -+ if (pinentry->error) -+ txt = pinentry_utf8_to_local (pinentry->lc_ctype, pinentry->error); -+ else -+ txt = ""; -+ obj = elm_label_add(table); -+ evas_object_color_set(obj, 255, 0, 0, 255); -+ elm_object_text_set(obj,txt); -+ elm_object_style_set(obj,"slide_bounce"); -+ elm_label_slide_duration_set(obj, 10); -+ elm_label_slide_mode_set(obj, ELM_LABEL_SLIDE_MODE_ALWAYS); -+ elm_label_slide_go(obj); -+ evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, 0); -+ evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, 0); -+ elm_table_pack(table, obj, 1, row, 5, 1); -+ evas_object_show(obj); -+ if (pinentry->error) -+ free (txt); -+ row++; -+ } -+ -+ qualitybar = NULL; -+ -+ if (!confirm_mode) -+ { -+ -+ if (pinentry->prompt) -+ { -+ /* Entry/Prompt Label */ -+ obj = elm_label_add(table); -+ txt = pinentry_utf8_to_local (pinentry->lc_ctype, pinentry->prompt); -+ elm_object_text_set(obj,txt); -+ free (txt); -+ evas_object_size_hint_weight_set(obj, 0, EVAS_HINT_EXPAND); -+ evas_object_size_hint_align_set(obj, 1, EVAS_HINT_FILL); -+ elm_table_pack(table, obj, 1, row, 1, 1); -+ evas_object_show(obj); -+ } -+ -+ entry = elm_entry_add(table); -+ elm_entry_scrollable_set(entry, EINA_TRUE); -+ elm_scroller_policy_set(entry, -+ ELM_SCROLLER_POLICY_OFF, -+ ELM_SCROLLER_POLICY_OFF); -+ elm_entry_password_set(entry, EINA_TRUE); -+ elm_entry_single_line_set(entry, EINA_TRUE); -+ evas_object_size_hint_weight_set(entry, 0, 0); -+ evas_object_size_hint_align_set(entry, EVAS_HINT_FILL, 0); -+ elm_table_pack(table, entry, 2, row, 4, 1); -+ evas_object_smart_callback_add(entry, -+ "changed", -+ changed_text_handler, -+ NULL); -+ evas_object_show(entry); -+ row++; -+ -+ /* Check box */ -+ obj = elm_check_add(table); -+ evas_object_size_hint_align_set(obj, 1, EVAS_HINT_FILL); -+ elm_table_pack(table, obj, 1, row, 1, 1); -+ evas_object_smart_callback_add(obj, "changed", on_check, NULL); -+ evas_object_show(obj); -+ -+ /* Check Label */ -+ check_label = elm_label_add(table); -+ on_check((void *)NULL, obj, (void *)NULL); -+ elm_table_pack(table, check_label, 2, row, 4, 1); -+ evas_object_show(check_label); -+ row++; -+ -+ if (pinentry->quality_bar) -+ { -+ /* Quality Bar Label */ -+ obj = elm_label_add(table); -+ txt = pinentry_utf8_to_local (pinentry->lc_ctype, -+ pinentry->quality_bar); -+ elm_object_text_set(obj,txt); -+ free (txt); -+ evas_object_size_hint_weight_set(obj, 0, EVAS_HINT_EXPAND); -+ evas_object_size_hint_align_set(obj, 1, EVAS_HINT_FILL); -+ elm_table_pack(table, obj, 1, row, 1, 1); -+ evas_object_show(obj); -+ -+ qualitybar = elm_progressbar_add(table); -+ evas_object_color_set(qualitybar, 255, 0, 0, 255); -+ evas_object_show(qualitybar); -+ if (pinentry->quality_bar_tt) -+ elm_object_tooltip_text_set (qualitybar, -+ pinentry->quality_bar_tt); -+ evas_object_size_hint_weight_set(qualitybar, EVAS_HINT_EXPAND, 0); -+ evas_object_size_hint_align_set(qualitybar, EVAS_HINT_FILL, 0); -+ elm_table_pack(table, qualitybar, 2, row, 4, 1); -+ row++; -+ } -+ -+ if (pinentry->repeat_passphrase) -+ { -+ /* Repeat Label */ -+ obj = elm_label_add(table); -+ txt = pinentry_utf8_to_local (pinentry->lc_ctype, -+ pinentry->repeat_passphrase); -+ elm_object_text_set(obj,txt); -+ free (txt); -+ evas_object_size_hint_weight_set(obj, 0, EVAS_HINT_EXPAND); -+ evas_object_size_hint_align_set(obj, 1, EVAS_HINT_FILL); -+ elm_table_pack(table, obj, 1, row, 1, 1); -+ evas_object_show(obj); -+ -+ repeat_entry = elm_entry_add(table); -+ elm_entry_scrollable_set(repeat_entry, EINA_TRUE); -+ elm_scroller_policy_set(repeat_entry, -+ ELM_SCROLLER_POLICY_OFF, -+ ELM_SCROLLER_POLICY_OFF); -+ elm_entry_password_set(repeat_entry, EINA_TRUE); -+ elm_entry_single_line_set(repeat_entry, EINA_TRUE); -+ evas_object_size_hint_weight_set(repeat_entry, 0, 0); -+ evas_object_size_hint_align_set(repeat_entry, EVAS_HINT_FILL, 0); -+ elm_table_pack(table, repeat_entry, 2, row, 4, 1); -+ evas_object_smart_callback_add (repeat_entry, "activated", -+ enter_callback, NULL); -+ evas_object_show(repeat_entry); -+ evas_object_smart_callback_add (entry, -+ "activated", -+ enter_callback, -+ repeat_entry); -+ evas_object_smart_callback_add(repeat_entry, -+ "activated", -+ on_click, -+ (void *) CONFIRM_OK); -+ row++; -+ } -+ else -+ evas_object_smart_callback_add(entry, -+ "activated", -+ on_click, -+ (void *) CONFIRM_OK); -+ } -+ -+ /* Cancel Button */ -+ if (!pinentry->one_button) -+ { -+ obj = elm_button_add(table); -+ icon = elm_icon_add (table); -+ evas_object_size_hint_aspect_set (icon, EVAS_ASPECT_CONTROL_BOTH, 1, 1); -+ if (elm_icon_standard_set (icon, "dialog-cancel") || -+ elm_icon_standard_set (icon, "window-close")) -+ { -+ evas_object_size_hint_min_set(icon, -+ ELM_SCALE_SIZE(BUTTON_ICON_SIZE), -+ ELM_SCALE_SIZE(BUTTON_ICON_SIZE)); -+ elm_object_part_content_set(obj, "icon", icon); -+ evas_object_show (icon); -+ } -+ else -+ evas_object_del(icon); -+ if (pinentry->cancel || pinentry->default_cancel) -+ { -+ if(pinentry->cancel) -+ txt = pinentry_utf8_to_local (pinentry->lc_ctype, pinentry->cancel); -+ else -+ txt = pinentry_utf8_to_local (pinentry->lc_ctype, -+ pinentry->default_cancel); -+ if(txt[0]=='_') -+ elm_object_text_set(obj,txt+1); -+ else -+ elm_object_text_set(obj,txt); -+ btn_txt_len = ELM_SCALE_SIZE(strlen(txt) * (PADDING * 1.5)); -+ free (txt); -+ } -+ else -+ elm_object_text_set(obj, "Cancel"); //STOCK_CANCEL -+ evas_object_size_hint_align_set(obj, 0, 0); -+ if(btn_txt_len>ELM_SCALE_SIZE(BUTTON_WIDTH)) -+ evas_object_size_hint_min_set(obj, -+ btn_txt_len, -+ ELM_SCALE_SIZE(BUTTON_HEIGHT)); -+ else -+ evas_object_size_hint_min_set(obj, -+ ELM_SCALE_SIZE(BUTTON_WIDTH), -+ ELM_SCALE_SIZE(BUTTON_HEIGHT)); -+ elm_table_pack(table, obj, 4, row, 1, 1); -+ evas_object_smart_callback_add(obj, -+ "clicked", -+ on_click, -+ (void *) CONFIRM_CANCEL); -+ evas_object_show(obj); -+ } -+ -+ /* OK Button */ -+ obj = elm_button_add(table); -+ icon = elm_icon_add (table); -+ evas_object_size_hint_aspect_set (icon, EVAS_ASPECT_CONTROL_BOTH, 1, 1); -+ if (elm_icon_standard_set (icon, "dialog-ok") || -+ elm_icon_standard_set (icon, "list-add")) -+ { -+ evas_object_size_hint_min_set(icon, -+ ELM_SCALE_SIZE(BUTTON_ICON_SIZE), -+ ELM_SCALE_SIZE(BUTTON_ICON_SIZE)); -+ elm_object_part_content_set(obj, "icon", icon); -+ evas_object_show (icon); -+ } -+ else -+ evas_object_del(icon); -+ if (pinentry->ok || pinentry->default_ok) -+ { -+ if(pinentry->ok) -+ txt = pinentry_utf8_to_local (pinentry->lc_ctype, pinentry->ok); -+ else -+ txt = pinentry_utf8_to_local (pinentry->lc_ctype, pinentry->default_ok); -+ if(txt[0]=='_') -+ elm_object_text_set(obj,txt+1); -+ else -+ elm_object_text_set(obj,txt); -+ ok_len = ELM_SCALE_SIZE(strlen(txt) * (PADDING * 1.5)); -+ if(ok_len>btn_txt_len) -+ btn_txt_len = ok_len; -+ free (txt); -+ } -+ else -+ elm_object_text_set(obj,"OK"); //STOCK_OK -+ evas_object_size_hint_align_set(obj, 0, 0); -+ if(btn_txt_len>ELM_SCALE_SIZE(BUTTON_WIDTH)) -+ evas_object_size_hint_min_set(obj, -+ btn_txt_len, -+ ELM_SCALE_SIZE(BUTTON_HEIGHT)); -+ else -+ evas_object_size_hint_min_set(obj, -+ ELM_SCALE_SIZE(BUTTON_WIDTH), -+ ELM_SCALE_SIZE(BUTTON_HEIGHT)); -+ elm_table_pack(table, obj, 5, row, 1, 1); -+ evas_object_smart_callback_add(obj, "clicked", on_click, (void *) CONFIRM_OK); -+ evas_object_show(obj); -+ -+ /* Key/Lock Icon */ -+ obj = elm_icon_add (win); -+ evas_object_size_hint_aspect_set (obj, EVAS_ASPECT_CONTROL_BOTH, 1, 1); -+ if (elm_icon_standard_set (obj, "dialog-password")) -+ { -+ double ic_size = WIDTH/5; -+ if(row==0) -+ ic_size = ic_size/3.5; -+ else if(row<4) -+ ic_size = ic_size - ic_size/row; -+ evas_object_size_hint_min_set(obj, -+ ELM_SCALE_SIZE(ic_size), -+ ELM_SCALE_SIZE(ic_size)); -+ evas_object_size_hint_weight_set(obj, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND); -+ evas_object_size_hint_align_set(obj, EVAS_HINT_FILL, 0.5); -+ elm_table_pack(table, obj, 0, 0, 1, row? row:1); -+ evas_object_show (obj); -+ } -+ else -+ evas_object_del(obj); -+ -+ /* Box for padding */ -+ obj = elm_box_add (win); -+ elm_box_pack_end (obj, table); -+ evas_object_show (obj); -+ -+ elm_win_resize_object_add(win,obj); -+ evas_object_show(win); -+ -+ if(entry) -+ elm_object_focus_set (entry, EINA_TRUE); -+ -+ if (pinentry->timeout > 0) -+ timer = ecore_timer_add (pinentry->timeout, -+ (Ecore_Task_Cb)timeout_cb, -+ pinentry); -+} -+ -+static int -+efl_cmd_handler (pinentry_t pe) -+{ -+ int want_pass = !!pe->pin; -+ -+ got_input = EINA_FALSE; -+ pinentry = pe; -+ confirm_value = CONFIRM_CANCEL; -+ passphrase_ok = 0; -+ confirm_mode = want_pass ? 0 : 1; -+ /* init ecore-x explicitly using DISPLAY since this can launch -+ * from console -+ */ -+ if (pe->display) -+ ecore_x_init (pe->display); -+ elm_init (pargc, pargv); -+ create_window (); -+ ecore_main_loop_begin (); -+ -+ if (timer) -+ { -+ ecore_timer_del (timer); -+ timer = NULL; -+ } -+ -+ if (confirm_value == CONFIRM_CANCEL || grab_failed) -+ pe->canceled = 1; -+ -+ pinentry = NULL; -+ if (want_pass) -+ { -+ if (passphrase_ok && pe->pin) -+ return strlen (pe->pin); -+ else -+ return -1; -+ } -+ else -+ return (confirm_value == CONFIRM_OK) ? 1 : 0; -+} -+ -+int -+main (int argc, char *argv[]) -+{ -+ pinentry_init (PGMNAME); -+ -+#ifdef FALLBACK_CURSES -+ if (pinentry_have_display (argc, argv)) -+ { -+#endif -+ -+ pinentry_cmd_handler = efl_cmd_handler; -+ pargc = argc; -+ pargv = argv; -+ -+#ifdef FALLBACK_CURSES -+ } -+ else -+ { -+ pinentry_cmd_handler = curses_cmd_handler; -+ } -+#endif -+ -+ pinentry_parse_opts (argc, argv); -+ if (pinentry_loop ()) -+ return 1; -+ -+ return 0; -+} --- -2.8.0.rc3 - |