对于没有指定“安装”目标的软件,使用“make”插件

对于没有指定“安装”目标的软件,使用“make”插件

我想尝试拍摄一些东西,并选择sl这个地方作为起点,因为 a) 它相当简单,并且 b) 它是世界上最好的东西。是我的 snapcraft.yaml:

name: sl
version: "1.0"
summary: SL(1) - Cure your bad habit of mistyping
description: SL (Steam Locomotive) runs across your terminal when you type "sl" as you meant to type "ls". It's just a joke command, and not useful at all.
confinement: strict

apps:
  sl:
    command: sl

parts:
  sl:
    plugin: make
    source: https://github.com/mtoyoda/sl.git
    source-type: git
    source-branch: master
    build-packages:
      - libncurses5-dev

然而,当我运行 snapcraft 时,我得到了以下错误

$ snapcraft 
Preparing to pull sl 
Pulling sl 
Cloning into '/home/darren/Scratch/snapls/parts/sl/src'...
remote: Counting objects: 11, done.
remote: Compressing objects: 100% (10/10), done.
remote: Total 11 (delta 0), reused 3 (delta 0), pack-reused 0
Unpacking objects: 100% (11/11), done.
Checking connectivity... done.
Preparing to build sl 
Building sl 
make -j4
gcc -O -o sl sl.c -lncurses
make install DESTDIR=/home/darren/Scratch/snapls/parts/sl/install
make: *** No rule to make target 'install'. Stop.
Command '['/bin/sh', '/tmp/tmpyus7efkq', 'make', 'install', 'DESTDIR=/home/darren/Scratch/snapls/parts/sl/install']' returned non-zero exit status 2

有人能指出我哪里错了吗?

答案1

你没有做错什么。如果你看看Makefile 文件,您可以看到它根本没有定义如何以及在何处安装生成的二进制文件。

我尝试了make插件的make-parameters选项,但无法让它忽略丢失的install目标。要解决这个问题,有两个选项:

  1. 发布 PRhttps://github.com/mtoyoda/sl您可以在其中添加install目标并同时使用您的 fork 进行构建。

  2. 添加自定义插件它只运行make而不是make install

相关内容