<font size=2 face="sans-serif">Hello,</font><br><br><font size=2 face="sans-serif">We are currently developing a Swift
Package that has a dependency on a C open source library. This C open source
library, on Linux, can be installed by executing: ‘apt-get install -y
<library-name>’.</font><br><br><font size=2 face="sans-serif">Though a developer who wanted to use
our Swift Package in their application could specify in their Package.swift
file the dependency on our Swift Package, that would not be enough. The
developer would also need to execute manually the ‘apt-get install -y
<library-name>’. We are thinking this extra step will probably dissuade
developers from using our Swift Package.</font><br><br><font size=2 face="sans-serif">We took a quick look around to see what
other package management tools are doing such as NPM (for NodeJS). While
doing this, we ran into the following NodeJS module: node-sass (</font><a href="https://www.npmjs.com/package/node-sass"><font size=2 color=blue face="sans-serif">https://www.npmjs.com/package/node-sass</font></a><font size=2 face="sans-serif">).
According to their documentation, it is a library that provides binding
to libsass, which is a library written in C. A NodeJS developer who wants
to leverage node-sass in their application only has to execute: 'npm install
node-sass'. Behind the scenes, NPM seems to be executing all the required
commands (such as apt-get installs) on behalf of the developer for installing
any dependencies (see</font><a href="https://gist.github.com/edouard-lopez/503d40a5c1a49cf8ae87"><font size=2 color=blue face="sans-serif">https://gist.github.com/edouard-lopez/503d40a5c1a49cf8ae87</font></a><font size=2 face="sans-serif">).
Hence, a NodeJS developer is completely abstracted from any low level dependencies
(e.g. code written in C/C++) that are required and he/she only has to execute
one command to leverage the NodeJS module (i.e. npm install <library-name>).</font><br><br><font size=2 face="sans-serif">We are wondering if there are any plans
to provide similar functionality in the Swift Package Manager. Maybe something
along the lines of these two points below?</font><br><br><font size=2 face="sans-serif">1) Swift Packages can specify dependencies
on other libraries that are not Swift Packages (such as C libraries). The
Swift Package Manager could then "parse" this metadata, download
and install the corresponding dependencies on the system (e.g. by executing
apt-get or similar commands). This could be part of the Packages.swift
file or a new file for specifying dependencies that are not Swift Packages.</font><br><br><font size=2 face="sans-serif">2) Define a naming convention for a
script that, if found inside a Swift Package, is executed by the Swift
Package Manager. This script could contain any set of instructions that
should be executed as part of the installation of the Swift Package, such
as downloading and installing any dependencies that the Swift Package needs.
For instance, such a file could include instructions similar to those found
here: </font><a href="https://gist.github.com/edouard-lopez/503d40a5c1a49cf8ae87"><font size=2 color=blue face="sans-serif">https://gist.github.com/edouard-lopez/503d40a5c1a49cf8ae87</font></a><br><br><font size=2 face="sans-serif">Any thoughts on this? Thanks.</font><br><font size=2 face="sans-serif"><br><br>Regards,<br> Ricardo Olivieri<br> Software Engineer</font><BR>