在 Ubuntu 19.04 中构建 meson 时未找到手动安装的 exiv

在 Ubuntu 19.04 中构建 meson 时未找到手动安装的 exiv

有人能解释以下内容吗?

user@system:~/gexiv2-0.11.0/build$ exiv2 --version

exiv2 0.27.1

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., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301 USA


user@system:~/gexiv2-0.11.0/build$ meson --prefix=/usr ..

The Meson build system
Version: 0.49.0
Source dir: /home/user/gexiv2-0.11.0
Build dir: /home/user/gexiv2-0.11.0/build
Build type: native build
Project name: gexiv2
Project version: 0.11.0
Native C compiler: cc (gcc 8.3.0 "cc (Ubuntu 8.3.0-6ubuntu1) 8.3.0")
Native C++ compiler: c++ (gcc 8.3.0 "c++ (Ubuntu 8.3.0-6ubuntu1) 8.3.0")
Build machine cpu family: x86_64
Build machine cpu: x86_64
Found pkg-config: /usr/bin/pkg-config (0.29.1)
Found CMake: /usr/bin/cmake (3.13.4)
Dependency exiv2 found: NO (tried pkgconfig)

meson.build:13:0: ERROR:  Dependency "exiv2" not found, tried pkgconfig

A full log can be found at /home/user/gexiv2-0.11.0/build/meson-logs/meson-log.txt

鉴于 exiv2 版本 0.27 不适用于 Ubuntu(它停止于v0.25)。

我做了以下事情:

  1. 我去了exiv 网站
  2. 我获取了 exiv 0.27 的 Linux 版本的链接
  3. 我运行了以下命令

    wget https://www.exiv2.org/builds/exiv2-0.27.1-Linux64.tar.gz
    sudo tar xzf exiv2-0.27.1-Linux64.tar.gz -C /usr/local/lib/
    sudo nano /etc/environment
    
  4. 添加:/usr/local/lib/exiv2-0.27.1-Linux64/bin

  5. source /etc/environment
  6. 重新启动了终端。

然后 exiv 就可以正确使用了。

但是介子在构建过程中没有检测到它的存在。

需要明确的是:软件包 gexiv2 版本0.10.9Ubuntu 19.04 的版本至少比我需要的 0.11.0 版本要差。

答案1

我发现了错误所在——您下载了 Exiv2 的二进制版本,但实际上您需要带有相应标头和开发文件的源版本。

完整的步骤如下:

exiv2 部分

sudo apt-get install cmake meson
sudo apt-get build-dep exiv2

cd ~/Downloads
wget https://www.exiv2.org/builds/exiv2-0.27.1-Source.tar.gz
tar -xf exiv2-0.27.1-Source.tar.gz
cd exiv2-0.27.1-Source/
cmake .
make
sudo make install

查看:

$ exiv2 --version | head -n1
exiv2 0.27.1

gexiv2 部分

sudo apt-get build-dep libgexiv2-dev
cd ~/Downloads
wget http://ftp.gnome.org/pub/GNOME/sources/gexiv2/0.11/gexiv2-0.11.0.tar.xz
tar -xf gexiv2-0.11.0.tar.xz
cd gexiv2-0.11.0/
meson build
cd build
sudo meson install

等等。

相关内容