File size: 17,157 Bytes
703f5e6
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>

  <!-- Meta -->
  <meta name="Description" content="KLayout layout viewer and editor project page" /> 
  <meta name="Keywords" content="KLayout OASIS GDS2 viewer editor layout semiconductor mask chip design" /> 
  <meta name="abstract" content="KLayout is a free layout viewer and editor for several formats commonly used in the semiconductor industry to transfer layout data" />
  <meta name="URL" content="https://www.klayout.de/" />
  <meta name="Author" content="Matthias Koefferlein" />
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">

  <title>KLayout Layout Viewer And Editor</title>

  <!-- General -->
  <link rel="alternate" type="application/rss+xml" title="RSS" href="http://www.klayout.de/news.xml"/>
  <link rel="stylesheet" type="text/css" href="https://www.klayout.de/format.css?v2.0"/>
  <link rel="shortcut icon" href="https://www.klayout.de/favicon.ico"/>

  <!-- Fonts -->
  <link rel="stylesheet" type="text/css" href="https://www.klayout.de/fonts.css"/>

  <!-- jQuery -->
  <script src="https://www.klayout.de/jquery-3.4.1.min.js"></script>

  <!-- bootstrap -->
  <link href="https://www.klayout.de/bootstrap-4.3.1-dist/css/bootstrap.min.css" rel="stylesheet">
  <script src="https://www.klayout.de/bootstrap-4.3.1-dist/js/bootstrap.min.js"></script>

  <link href="/generated-doc.css" rel="stylesheet">
<link href="/search.css" rel="stylesheet">
<script src="/klayout-search.js"></script>

</head>

<body>

<div class="klayout-header">

  <div class="container mb-5">

    <nav class="navbar navbar-dark navbar-expand-lg">

      <a class="navbar-brand" href="https://www.klayout.de"><img src="https://www.klayout.de/klayout.png" srcset="https://www.klayout.de/klayout-x2.png 2x" alt="KLayout"></a>

      <div class="collapse navbar-collapse" id="navbarToggleExternalContent">

          <ul class="navbar-nav ml-auto mr-auto">

            <li class="nav-item dropdown active mr-4">
              <a class="nav-link dropdown-toggle klayout-menu" href="#" id="navbarDropdown" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                About
              </a>
              <div class="dropdown-menu" aria-labelledby="navbarDropdown">
                <a class="dropdown-item" href="https://www.klayout.de/intro.html">KLayout Project</a>
                <a class="dropdown-item" href="https://www.klayout.de/doc.html">Documentation</a>
                <a class="dropdown-item" href="https://www.klayout.de/galleries.html">Galleries</a>
                <a class="dropdown-item" href="https://www.klayout.de/credits.html">Credits</a>
                <div class="dropdown-divider"></div>
                <a class="dropdown-item" href="https://www.klayout.de/contact.html">Contact</a>
                <a class="dropdown-item" href="https://www.klayout.de/impressum.html">Impressum / Imprint</a>
                <a class="dropdown-item" href="https://www.klayout.de/privacy_policy.html">Datenschutz / Privacy Policy</a>
              </div>
            </li>
            <li class="nav-item active mr-4">
              <a class="nav-link klayout-menu" href="https://www.klayout.de/build.html">Get KLayout</a>
            </li>
            <li class="nav-item active mr-4">
              <a class="nav-link klayout-menu" href="https://sami.klayout.org">Package Index</a>
            </li>
            <li class="nav-item active mr-5">
              <a class="nav-link klayout-menu" href="https://www.klayout.de/forum">Forum</a>
            </li>
            <li class="nav-item active">
              <span class="nav-link klayout-menu">
                <a href="https://f-si.org"><img src="https://www.klayout.de/f-si_logo_32h_w.png" border="0" title="Free Silicon Foundation" alt="F-Si"/></a>
                <a class="ml-4" href="https://github.com/KLayout"><img src="https://www.klayout.de/GitHub-Mark-32px-white.png" border="0" title="KLayout on GitHub" alt="GitHub"/></a>
              </span>
            </li>

          </ul>

      </div>

      <!-- collapse button -->
      <button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Toggle navigation">
        <span class="navbar-toggler-icon"></span>
      </button>

    </nav>

  </div>

</div>

<div class="container">





<form class="search">
  <div class="input-group">
    <input id="search-text" class="form-control" type="text" onkeydown="klayoutSearchTextChanged()">
    <div class="input-group-append">
      <button class="btn btn-secondary" type="submit" id="search-button" onclick="klayoutSearchClicked(5); event.returnValue = false; return false">Search</button>
    </div>
  </div>
</form>

<div id="search-result">
  <div class="search-results-close-box" onclick="klayoutSearchCloseClicked()"></div>
  <div id="search-results-container">
  </div>
</div>

<div class='klayout-generated-doc'><p class="navigator"><b>KLayout Documentation (Qt 5): </b><a href="../index.html">Main Index</a> » <a href="index.html">Various Topics</a> » About Packages</p><h1>About Packages</h1><a name="k_1"></a><a name="k_2"></a><a name="k_3"></a><p>
  &quot;Salt&quot; is KLayout's package manager which allows selecting and installing packages from a global repository. 
  Packages make KLayout more tasty. Packages (the &quot;grains&quot;) may cover a variety of features:
  </p><ul><li>Ruby or Python macros</li><li>DRC runsets</li><li>Technologies</li><li>Fonts for the Basic.TEXT PCell</li><li>Static layout libraries</li><li>PCell libraries</li><li>Code libraries for Ruby and Python</li><li>Binary extensions</li></ul><p>
  Packages can depend on other packages - these are installed automatically if a package requires them and they are not installed yet.
  </p><p>
  Packages are identified by name. A package name needs to be unique in the package universe. 
  You can use a prefixed name like <tt>www.mydomain.org/nameofpackage</tt> to create a non-ambiguous name.
  Use a slash to separate the prefix from the actual package name.
  The choice of the prefix is entirely up to you as long as it contains letters, digits, underscores, hypthens or dots. 
  You can use a domain name that is owned by 
  yourself for example. You can use multiple prefixes to further differentiate the packages
  inside your namespace.
  </p><p>
  Packages also come with version information, so KLayout can check for updates and install 
  them if required. KLayout will assume strict upward compatibility. This specifically 
  applies to packages that other packages are depending on (such as code libraries). 
  If you need to change them in a non-backward compatible way, you'd need to provide 
  a new package with a different name.
  </p><p>
  Packages come with some meta data such as authoring information, an optional icon and 
  screen shot image, license information and more. The more information you provide, the 
  more useful a package will become.
  </p><p>
  The key component for public package deployment is the &quot;Salt.Mine&quot; package repository 
  service. This is a web service that maintains a package index. It 
  does not host the packages, but stores links to the actual hosting site. In order 
  to author a package, you need to upload the package to one of the supported host 
  sites and register your package on the Salt.Mine page. Registration is a simple 
  process and the only information required is the link to your host site and a mail 
  account for confirmation.
  </p><a name="h2-65"></a><h2>Installing Packages</h2><p>
  To install external packages, open the package manager with &quot;Tools/Manage Packages&quot;.
  On the &quot;Install New Packages&quot; page, a list of available packages is shown. Select 
  the desired packages and mark them using the check mark button. Marked packages will
  be downloaded and installed with the &quot;Apply&quot; button.
  </p><p>
  A filter above the package list allows selecting packages by name.
  The right panel shows details about the package currently selected.
  </p><a name="h2-79"></a><h2>Updating Packages</h2><p>
  To check for updates, use the &quot;Update Packages&quot; tab of the package manager.
  In the list, those packages for which updates are available are shown.
  Mark packages for update using the check mark button. Click &quot;Apply&quot; to 
  apply the selected updates.
  </p><a name="h2-88"></a><h2>Uninstalling Packages</h2><p>
  To uninstall packages, open the package manager using &quot;Tools/Manage Packages&quot;.
  Go to the &quot;Current Packages&quot; tab. Select a package and use the &quot;Remove Package&quot;
  button to uninstall the package.
  </p><a name="h2-96"></a><h2>Creating Packages</h2><p>
  For package development you can utilize KLayout to initialize and edit the files inside 
  the package folder or populate the folder manually.
  </p><p>
  KLayout offers initialization of new packages from templates. You can modify that package
  according to your requirements afterwards.
  To create a package from a template, open the package manager using &quot;Tools/Manage Packages&quot;,
  go to the &quot;Current Packages&quot; tab and push the &quot;Create (Edit) Package&quot; button.
  Chose a template from the list that opens and enter a package name (with prefix, if 
  desired). Select &quot;Ok&quot; to let KLayout create a new package based on the template you
  selected.
  </p><p>
  The package details can be edited with the &quot;pen&quot; button at the top right of the 
  right details panel. Please specify at least some author information, a license
  model and a version. If the package needs other packages, the dependencies can be 
  listed in the &quot;Depends on&quot; table. Those packages will be automatically installed
  together with the new package. The showcase image can be a screen shot that gives
  some idea what the package will do.
  The package details are kept in a file called &quot;grain.xml&quot; inside the package 
  folder. You can also edit this file manually. The &quot;grain.xml&quot; is the basic description
  file for the package.
  </p><p>
  If the package is a macro or static library package, the macro editor can be used
  to edit the package files. If the package is a tech package, the technology manager
  can be used to edit the technology inside the package. To populate the package
  folder with other files use your favorite editor of KLayout itself for layout files.
  </p><a name="h2-132"></a><h2>Deployment inside your organisation</h2><p>
  Once a package is finished, it needs to be deployed to make it available to other
  users. Deployment basically means to put it on some public place where others
  can download the package. For local deployment inside an organisation, 
  this can be a web server or a folder on 
  a file server. KLayout talks WebDAV, so the web server needs to offer WebDAV 
  access. A subversion (SVN) server provides WebDAV by default, so this is a good
  choice. For the packages themselves, Git or WebDAV/Subversion can be used. You
  need to specify the protocol in the package URL (see below).
  </p><p>
  After a package has been made available for download, it needs to be entered 
  in the package index. For local deployment, the index can be a file hosted
  on a web server or on the file system. The package index location needs to be 
  specified by the <tt>KLAYOUT_SALT_MINE</tt> environment variable which contains the 
  download URL of the package index file.
  </p><p>
  For public deployment, the Salt.Mine service (<tt>http://sami.klayout.org</tt>) is used to register 
  new packages in the package index. By default, KLayout loads the package index from that service, so
  once your package is registered there, everyone using KLayout will see it.
  </p><a name="h2-159"></a><h2>The Package Index</h2><p>
  Public Packages are published on the Salt.Mine server. This is a web service that delivers a 
  packages index with some meta data such as current version, the icon 
  and a brief description. KLayout uses this list to inform users of packages available
  for installation and available updates. For local deployment, the package index can be served by other
  ways too. The only requirement is to be accessible by a http, https or file URL.
  </p><p>
  The basic format of the index is XML with this structure:
  </p><pre>&lt;salt-mine&gt;
  &lt;salt-grain&gt;
    &lt;name&gt;name&lt;/name&gt;
    &lt;version&gt;Version&lt;/version&gt;
    &lt;title&gt;Title of the package&lt;/title&gt;
    &lt;doc&gt;A brief description&lt;/doc&gt;
    &lt;doc-url&gt;Documentation URL&lt;/doc-url&gt;
    &lt;url&gt;Download URL&lt;/url&gt;
    &lt;license&gt;License model&lt;/license&gt;
    &lt;icon&gt;Icon image: base64-encoded, 64x64 max, PNG preferred&lt;/icon&gt;
  &lt;/salt-grain&gt;
  ...
  &lt;include&gt;URL to include other index files into this one&lt;/include&gt;
  ...
&lt;/salt-mine&gt;</pre><p>
  You can include other repositories - specifically the default one - into a 
  custom XML file. This allows extending the public index with local packages.
  </p><p>
  When the package manager is opened, KLayout will download the index from 
  <tt>http://sami.klayout.org/repository.xml</tt>. You can set the <tt>KLAYOUT_SALT_MINE</tt>
  environment variable to a different URL which makes KLayout use another dictionary
  service, i.e. one inside your own organisation. This service can be any HTTP server 
  that delivers a package list in the same format than the Salt.Mine package service.
  The URL can also be a &quot;file:&quot; scheme URL. In this case, KLayout will download the 
  list from the given file location.
  </p><p>
  When installing a package, KLayout will simply download the files from the URL given 
  in the package list. KLayout employs the WebDAV protocol to download the files. 
  This protocol is spoken by Subversion and GitHub with the subversion bridge. The 
  latter requires a simple translation of the original Git URL's to obtain the 
  subversion equivalent.
  </p><a name="h2-212"></a><h2>Generic package URLs</h2><p>
  Package URLs are the locations from where KLayout will download the package
  files. The package data is a hierarchy of files. The package description file
  (&quot;grain.xml&quot;) needs to be located at the root of this hierarchy.
  </p><p>
  A plain package URL will instruct KLayout to download the package file from
  the given hierarchy using the WebDAV protocol. You can add &quot;svn+&quot; at the front
  of the URL to make this specification a little more explicit. These are
  WebDAV/Subversion URLs:
  </p><pre>https://www.klayout.org/example-package
svn+https://www.klayout.org/example-package</pre><p>
  Git is another option to host packages. In order to use the Git protocol,
  add &quot;git+&quot; at the front of the URL:
  </p><pre>git+https://github.com/klayout/example-package.git</pre><p>
  This will make KLayout clone the &quot;example-package&quot; repository and use the default
  branch for checking out the files. It will expect a file named &quot;grain.xml&quot; at the
  root of the package file hierarchy.
  </p><p>
  To use a different branch or tag, specify the tag or branch name in square
  brackes. For example:
  </p><pre>git+https://github.com/klayout/example-package.git[v1.0]</pre><p>
  This will use the &quot;v1.0&quot; tag or branch for checking out the files.
  </p><p>
  It is also possible to have packages in the a subfolder of the repository.
  To specify the subfolder, separate the subfolder path from the repository
  URL using &quot;+&quot;, like this:
  </p><pre>git+https://github.com/klayout/repository.git+klayout/package-data[v1.0]</pre><p>
  This will clone the &quot;repository&quot; project and in this project, KLayout will checkout
  files from &quot;klayout/package-data&quot; and below. This is also the place, where KLayout expects
  the &quot;grain.xml&quot; file.
  </p><a name="h2-268"></a><h2>Installation Hooks</h2><p>
  Scripts can register an event through <a href="../code/class_Application.html#m_on_salt_changed">Application#on_salt_changed</a> which 
  indicates that packages have been installed or uninstalled.
  </p><p>
  Packages itself can supply special scripts which are executed after a package was installed
  or before a package is uninstalled:
  </p><ul><li><tt>_install.lym</tt>: if present, this script is executed after the package is installed.</li><li><tt>_uninstall.lym</tt>: if present, this script is executed before the package is uninstalled.</li></ul><p>
  Both scripts need to be stored in the same location as &quot;grain.xml&quot; and have to use 
  &quot;lym&quot; format. This is the generic XML script format KLayout employs as an interpreter-agnostic
  script representation.
  </p></div>
</div>
</body>
</html>