Conda: Difference between revisions
No edit summary |
|||
(5 intermediate revisions by the same user not shown) | |||
Line 4: | Line 4: | ||
[http://conda.pydata.org Conda] is a cross-language package and environment manager. It can be used to install NSIS itself and various plugins and header files. | [http://conda.pydata.org Conda] is a cross-language package and environment manager. It can be used to install NSIS itself and various plugins and header files. | ||
== Why use Conda for building NSIS installers? == | == Why use Conda for building NSIS installers? == | ||
Line 11: | Line 10: | ||
Conda typically runs scripts in isolated environments. Configuring continuous integration or build servers is straightforward. | Conda typically runs scripts in isolated environments. Configuring continuous integration or build servers is straightforward. | ||
== How to use Conda == | == How to use Conda == | ||
Line 19: | Line 17: | ||
# Using 'conda execute' | # Using 'conda execute' | ||
# Creating conda environments manually | # Creating conda environments manually | ||
=== Option 1: Using conda execute === | === Option 1: Using conda execute === | ||
Line 28: | Line 25: | ||
# conda execute | # conda execute | ||
# env: | # env: | ||
# - nsis | # - nsis 3.* | ||
# - plugin1 | # - plugin1 | ||
# - plugin2 | # - plugin2 | ||
Line 46: | Line 43: | ||
Install [http://conda.pydata.org/miniconda.html miniconda] and [https://anaconda.org/conda-forge/conda-execute conda execute] first. | Install [http://conda.pydata.org/miniconda.html miniconda] and [https://anaconda.org/conda-forge/conda-execute conda execute] first. | ||
=== Option 2: Creating conda environments manually === | === Option 2: Creating conda environments manually === | ||
Line 52: | Line 48: | ||
Create a permanent NSIS environment like this: | Create a permanent NSIS environment like this: | ||
<pre>conda create --name nsisenv --channel nsis nsis plugin1 plugin2 ...</pre> | <pre>conda create --name nsisenv --channel nsis nsis=3.* plugin1 plugin2 ...</pre> | ||
Then run <code>makensis</code> within that environment to compile an NSIS source file. | Then run <code>makensis</code> within that environment to compile an NSIS source file. | ||
This only requires [http://conda.pydata.org/miniconda.html miniconda]. | This only requires [http://conda.pydata.org/miniconda.html miniconda]. | ||
== Creating Conda packages for NSIS plugins == | == Creating Conda packages for NSIS plugins == | ||
It’s quite simple to create a "conda recipe" to build packages for NSIS plugins or header files. Just have a look at the examples | It’s quite simple to create a "conda recipe" to build packages for NSIS plugins or header files. Just have a look at the examples in [https://github.com/faph/NSIS-Conda-Recipes this GitHub repo] and create a pull request with a new recipe. Once merged into the repo, the recipe will be built and the package published in the [https://anaconda.org/nsis anaconda.org NSIS channel]. | ||
Alternatively, raise a GitHub issue and someone may be willing to create a recipe. | Alternatively, raise a GitHub issue and someone may be willing to create a recipe. | ||
[[Category:Development Environments]] | [[Category:Development Environments]] |
Latest revision as of 10:05, 23 October 2015
Author: Faph (talk, contrib) |
What is Conda?
Conda is a cross-language package and environment manager. It can be used to install NSIS itself and various plugins and header files.
Why use Conda for building NSIS installers?
Conda is particularly good at managing packages and installing required packages and its dependencies. NSIS plugins and macro header files can be distributed as conda packages. A repository of NSIS conda packages is available at the anaconda.org NSIS channel.
Conda typically runs scripts in isolated environments. Configuring continuous integration or build servers is straightforward.
How to use Conda
There are two possible approaches for building NSIS installers with conda:
- Using 'conda execute'
- Creating conda environments manually
Option 1: Using conda execute
Add this to the top of an NSIS source file:
# conda execute # env: # - nsis 3.* # - plugin1 # - plugin2 # - ... # channels: # - nsis # run_with: makensis ; NSIS source as usual ...
Then compile the file like this:
conda execute yourinstaller.nsi
This will create a temporary isolated conda environment with NSIS and the listed plugins installed. You don't need to have NSIS installed first! Then it simply runs makensis
as usual.
Install miniconda and conda execute first.
Option 2: Creating conda environments manually
Create a permanent NSIS environment like this:
conda create --name nsisenv --channel nsis nsis=3.* plugin1 plugin2 ...
Then run makensis
within that environment to compile an NSIS source file.
This only requires miniconda.
Creating Conda packages for NSIS plugins
It’s quite simple to create a "conda recipe" to build packages for NSIS plugins or header files. Just have a look at the examples in this GitHub repo and create a pull request with a new recipe. Once merged into the repo, the recipe will be built and the package published in the anaconda.org NSIS channel.
Alternatively, raise a GitHub issue and someone may be willing to create a recipe.