我尝试过 snapcrafters 论坛,但 AU 格式可以覆盖更广泛的受众。我的问题是关于为 Swift 编程语言创建 snap。我无法找到答案的一个问题是 snap 是否允许访问本质上是库的二进制文件,是否有可能生成像编程语言这样的可用 snap?
我成功创造并发布了正确安装二进制文件,但是安装后系统无法访问这些文件,因此我决定改变我的方法并尝试基于源创建一个快照。
使用 cmake 进行安装通常适用于:
## 1. Install prerequisites
sudo apt-get install git cmake ninja-build clang python uuid-dev libicu-dev icu-devtools libbsd-dev libedit-dev libxml2-dev libsqlite3-dev swig libpython-dev libncurses5-dev pkg-config libblocksruntime-dev libcurl4-openssl-dev autoconf libtool systemtap-sdt-dev tzdata
## 2. Download source
mkdir swift-source
cd swift-source
# if using ssh…
git clone [email protected]:apple/swift.git
./swift/utils/update-checkout --clone-with-ssh
# alternately, if using http…
git clone https://github.com/apple/swift.git
./swift/utils/update-checkout --clone
## 3. Build source
cd swift
utils/build-script --release-debuginfo
但是,我的尝试没有奏效:
name: swift
version: 'master'
summary: The Swift Programming Language
description: |
Swift is a high-performance system programming language. It has a clean and
modern syntax, offers seamless access to existing C and Objective-C code and
frameworks, and is memory safe by default.
grade: stable
confinement: classic
parts:
swift:
plugin: cmake
source: https://github.com/apple/swift.git
# source-tag: 'swift-3.0.2-RELEASE'
build-packages:
- git
- cmake
- ninja-build
- clang
- python
- uuid-dev
- libicu-dev
- icu-devtools
- libbsd-dev
- libedit-dev
- libxml2-dev
- libsqlite3-dev
- swig
- libpython-dev
- libncurses5-dev
- pkg-config
- libblocksruntime-dev
- libcurl4-openssl-dev
- autoconf
- automake
- libtool
- systemtap-sdt-dev
- python-sphinx
build: |
./utils/update-checkout --clone
./utils/build-script -Rt -j 1
install: |
cp -a build/Ninja-ReleaseAssert/* $SNAPCRAFT_PART_INSTALL/
使用 ubuntu-make 安装更加简单,但是 umake 没有 snap 插件:
sudo apt install ubuntu-make
umake swift
- 如何才能让系统快速访问一个图书馆?