···11+# Javascript {#language-javascript}
22+33+## Introduction {#javascript-introduction}
44+55+This contains instructions on how to package javascript applications. For instructions on how to add a cli package from npm please consult the #node.js section
66+77+The various tools available will be listed in the [tools-overview](#javascript-tools-overview). Some general principles for packaging will follow. Finally some tool specific instructions will be given.
88+99+## Tools overview {#javascript-tools-overview}
1010+1111+## General principles {#javascript-general-principles}
1212+1313+The following principles are given in order of importance with potential exceptions.
1414+1515+### Try to use the same node version used upstream {#javascript-upstream-node-version}
1616+1717+It is often not documented which node version is used upstream, but if it is, try to use the same version when packaging.
1818+1919+This can be a problem if upstream is using the latest and greatest and you are trying to use an earlier version of node. Some cryptic errors regarding V8 may appear.
2020+2121+An exception to this:
2222+2323+### Try to respect the package manager originally used by upstream (and use the upstream lock file) {#javascript-upstream-package-manager}
2424+2525+A lock file (package-lock.json, yarn.lock...) is supposed to make reproducible installations of node_modules for each tool.
2626+2727+Guidelines of package managers, recommend to commit those lock files to the repos. If a particular lock file is present, it is a strong indication of which package manager is used upstream.
2828+2929+It's better to try to use a nix tool that understand the lock file. Using a different tool might give you hard to understand error because different packages have been installed. An example of problems that could arise can be found [here](https://github.com/NixOS/nixpkgs/pull/126629). Upstream uses npm, but this is an attempt to package it with yarn2nix (that uses yarn.lock)
3030+3131+Using a different tool forces to commit a lock file to the repository. Those files are fairly large, so when packaging for nixpkgs, this approach does not scale well.
3232+3333+Exceptions to this rule are:
3434+3535+- when you encounter one of the bugs from a nix tool. In each of the tool specific instructions, known problems will be detailed. If you have a problem with a particular tool, then it's best to try another tool, even if this means you will have to recreate a lock file and commit it to nixpkgs. In general yarn2nix has less known problems and so a simple search in nixpkgs will reveal many yarn.lock files commited
3636+- Some lock files contain particular version of a package that has been pulled off npm for some reason. In that case, you can recreate upstream lock (by removing the original and `npm install`, `yarn`, ...) and commit this to nixpkgs.
3737+- The only tool that supports workspaces (a feature of npm that helps manage sub-directories with different package.json from a single top level package.json) is yarn2nix. If upstream has workspaces you should try yarn2nix.
3838+3939+### Try to use upstream package.json {#javascript-upstream-package-json}
4040+4141+Exceptions to this rule are
4242+4343+- Sometimes the upstream repo assumes some dependencies be installed globally. In that case you can add them manually to the upstream package.json (`yarn add xxx` or `npm install xxx`, ...). Dependencies that are installed locally can be executed with `npx` for cli tools. (e.g. `npx postcss ...`, this is how you can call those dependencies in the phases).
4444+- Sometimes there is a version conflict between some dependency requirements. In that case you can fix a version (by removing the `^`).
4545+- Sometimes the script defined in the package.json does not work as is. Some scripts for example use cli tools that might not be available, or cd in directory with a different package.json (for workspaces notably). In that case, it's perfectly fine to look at what the particular script is doing and break this down in the phases. In the build script you can see `build:*` calling in turns several other build scripts like `build:ui` or `build:server`. If one of those fails, you can try to separate those into:
4646+4747+```Shell
4848+yarn build:ui
4949+yarn build:server
5050+# OR
5151+npm run build:ui
5252+npm run build:server
5353+```
5454+5555+when you need to override a package.json. It's nice to use the one from the upstream src and do some explicit override. Here is an example.
5656+5757+```nix
5858+patchedPackageJSON = final.runCommand "package.json" { } ''
5959+ ${jq}/bin/jq '.version = "0.4.0" |
6060+ .devDependencies."@jsdoc/cli" = "^0.2.5"
6161+ ${sonar-src}/package.json > $out
6262+'';
6363+```
6464+6565+you will still need to commit the modified version of the lock files, but at least the overrides are explicit for everyone to see.
6666+6767+### Using node_modules directly {#javascript-using-node_modules}
6868+6969+each tool has an abstraction to just build the node_modules (dependencies) directory. you can always use the stdenv.mkDerivation with the node_modules to build the package (symlink the node_modules directory and then use the package build command). the node_modules abstraction can be also used to build some web framework frontends. For an example of this see how [plausible](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/web-apps/plausible/default.nix) is built. mkYarnModules to make the derivation containing node_modules. Then when building the frontend you can just symlink the node_modules directory
7070+7171+## javascript packages inside nixpkgs {#javascript-packages-nixpkgs}
7272+7373+The `pkgs/development/node-packages` folder contains a generated collection of
7474+[NPM packages](https://npmjs.com/) that can be installed with the Nix package
7575+manager.
7676+7777+As a rule of thumb, the package set should only provide _end user_ software
7878+packages, such as command-line utilities. Libraries should only be added to the
7979+package set if there is a non-NPM package that requires it.
8080+8181+When it is desired to use NPM libraries in a development project, use the
8282+`node2nix` generator directly on the `package.json` configuration file of the
8383+project.
8484+8585+The package set provides support for the official stable Node.js versions.
8686+The latest stable LTS release in `nodePackages`, as well as the latest stable
8787+Current release in `nodePackages_latest`.
8888+8989+If your package uses native addons, you need to examine what kind of native
9090+build system it uses. Here are some examples:
9191+9292+- `node-gyp`
9393+- `node-gyp-builder`
9494+- `node-pre-gyp`
9595+9696+After you have identified the correct system, you need to override your package
9797+expression while adding in build system as a build input. For example, `dat`
9898+requires `node-gyp-build`, so [we override](https://github.com/NixOS/nixpkgs/blob/32f5e5da4a1b3f0595527f5195ac3a91451e9b56/pkgs/development/node-packages/default.nix#L37-L40) its expression in [`default.nix`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/node-packages/default.nix):
9999+100100+```nix
101101+ dat = super.dat.override {
102102+ buildInputs = [ self.node-gyp-build pkgs.libtool pkgs.autoconf pkgs.automake ];
103103+ meta.broken = since "12";
104104+ };
105105+```
106106+107107+To add a package from NPM to nixpkgs:
108108+109109+1. Modify `pkgs/development/node-packages/node-packages.json` to add, update
110110+ or remove package entries to have it included in `nodePackages` and
111111+ `nodePackages_latest`.
112112+2. Run the script: `cd pkgs/development/node-packages && ./generate.sh`.
113113+3. Build your new package to test your changes:
114114+ `cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`.
115115+ To build against the latest stable Current Node.js version (e.g. 14.x):
116116+ `nix-build -A nodePackages_latest.<new-or-updated-package>`
117117+4. Add and commit all modified and generated files.
118118+119119+For more information about the generation process, consult the
120120+[README.md](https://github.com/svanderburg/node2nix) file of the `node2nix`
121121+tool.
122122+123123+## Tool specific instructions {#javascript-tool-specific}
124124+125125+### node2nix {#javascript-node2nix}
126126+127127+#### Preparation {#javascript-node2nix-preparation}
128128+129129+you will need to generate a nix expression for the dependencies
130130+131131+- don't forget the `-l package-lock.json` if there is a lock file
132132+- Most probably you will need the `--development` to include the `devDependencies`
133133+134134+so the command will most likely be
135135+`node2nix --developmennt -l package-lock.json`
136136+137137+[link to the doc in the repo](https://github.com/svanderburg/node2nix)
138138+139139+#### Pitfalls {#javascript-node2nix-pitfalls}
140140+141141+- if upstream package.json does not have a "version" attribute, node2nix will crash. You will need to add it like shown in [the package.json section](#javascript-upstream-package-json)
142142+- node2nix has some [bugs](https://github.com/svanderburg/node2nix/issues/238). related to working with lock files from npm distributed with nodejs-16_x
143143+- node2nix does not like missing packages from npm. If you see something like `Cannot resolve version: vue-loader-v16@undefined` then you might want to try another tool. The package might have been pulled off of npm.
144144+145145+### yarn2nix {#javascript-yarn2nix}
146146+147147+#### Preparation {#javascript-yarn2nix-preparation}
148148+149149+you will need at least a yarn.lock and yarn.nix file
150150+151151+- generate a yarn.lock in upstream if it is not already there
152152+- `yarn2nix > yarn.nix` will generate the dependencies in a nix format
153153+154154+#### mkYarnPackage {#javascript-yarn2nix-mkYarnPackage}
155155+156156+this will by default try to generate a binary. For package only generating static assets (Svelte, Vue, React...), you will need to explicitely override the build step with your instructions. It's important to use the `--offline` flag. For example if you script is `"build": "something"` in package.json use
157157+158158+```nix
159159+buildPhase = ''
160160+ yarn build --offline
161161+'';
162162+```
163163+164164+The dist phase is also trying to build a binary, the only way to override it is with
165165+166166+```nix
167167+distPhase = "true";
168168+```
169169+170170+the configure phase can sometimes fail because it tries to be too clever.
171171+One common override is
172172+173173+```nix
174174+configurePhase = "ln -s $node_modules node_modules";
175175+```
176176+177177+#### mkYarnModules {#javascript-yarn2nix-mkYarnModules}
178178+179179+this will generate a derivation including the node_modules. If you have to build a derivation for an integrated web framework (rails, phoenix..), this is probably the easiest way. [Plausible](https://github.com/NixOS/nixpkgs/blob/master/pkgs/servers/web-apps/plausible/default.nix#L39) offers a good example of how to do this.
180180+181181+#### Pitfalls {#javascript-yarn2nix-pitfalls}
182182+183183+- if version is missing from upstream package.json, yarn will silently install nothing. In that case, you will need to override package.json as shown in the [package.json section](#javascript-upstream-package-json)
184184+185185+## Outside of nixpkgs {#javascript-outside-nixpkgs}
186186+187187+There are some other options available that can't be used inside nixpkgs. Those other options are written in nix. Importing them in nixpkgs will require moving the source code into nixpkgs. Using [Import From Derivation](https://nixos.wiki/wiki/Import_From_Derivation) is not allowed in hydra at present. If you are packaging something outside nixpkgs, those can be considered
188188+189189+### npmlock2nix {#javascript-npmlock2nix}
190190+191191+[npmlock2nix](https://github.com/nix-community/npmlock2nix) aims at building node_modules without code generation. It hasn't reached v1 yet, the api might be suject to change.
192192+193193+#### Pitfalls {#javascript-npmlock2nix-pitfalls}
194194+195195+- there are some [problems with npm v7](https://github.com/tweag/npmlock2nix/issues/45).
196196+197197+### nix-npm-buildpackage {#javascript-nix-npm-buildpackage}
198198+199199+[nix-npm-buildpackage](https://github.com/serokell/nix-npm-buildpackage) aims at building node_modules without code generation. It hasn't reached v1 yet, the api might change. It supports both package-lock.json and yarn.lock.
200200+201201+#### Pitfalls {#javascript-nix-npm-buildpackage-pitfalls}
202202+203203+- there are some [problems with npm v7](https://github.com/serokell/nix-npm-buildpackage/issues/33).
-51
doc/languages-frameworks/node.section.md
···11-# Node.js {#node.js}
22-33-The `pkgs/development/node-packages` folder contains a generated collection of
44-[NPM packages](https://npmjs.com/) that can be installed with the Nix package
55-manager.
66-77-As a rule of thumb, the package set should only provide *end user* software
88-packages, such as command-line utilities. Libraries should only be added to the
99-package set if there is a non-NPM package that requires it.
1010-1111-When it is desired to use NPM libraries in a development project, use the
1212-`node2nix` generator directly on the `package.json` configuration file of the
1313-project.
1414-1515-The package set provides support for the official stable Node.js versions.
1616-The latest stable LTS release in `nodePackages`, as well as the latest stable
1717-Current release in `nodePackages_latest`.
1818-1919-If your package uses native addons, you need to examine what kind of native
2020-build system it uses. Here are some examples:
2121-2222-* `node-gyp`
2323-* `node-gyp-builder`
2424-* `node-pre-gyp`
2525-2626-After you have identified the correct system, you need to override your package
2727-expression while adding in build system as a build input. For example, `dat`
2828-requires `node-gyp-build`, so [we override](https://github.com/NixOS/nixpkgs/blob/32f5e5da4a1b3f0595527f5195ac3a91451e9b56/pkgs/development/node-packages/default.nix#L37-L40) its expression in [`default.nix`](https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/node-packages/default.nix):
2929-3030-```nix
3131- dat = super.dat.override {
3232- buildInputs = [ self.node-gyp-build pkgs.libtool pkgs.autoconf pkgs.automake ];
3333- meta.broken = since "12";
3434- };
3535-```
3636-3737-To add a package from NPM to nixpkgs:
3838-3939- 1. Modify `pkgs/development/node-packages/node-packages.json` to add, update
4040- or remove package entries to have it included in `nodePackages` and
4141- `nodePackages_latest`.
4242- 2. Run the script: `cd pkgs/development/node-packages && ./generate.sh`.
4343- 3. Build your new package to test your changes:
4444- `cd /path/to/nixpkgs && nix-build -A nodePackages.<new-or-updated-package>`.
4545- To build against the latest stable Current Node.js version (e.g. 14.x):
4646- `nix-build -A nodePackages_latest.<new-or-updated-package>`
4747- 4. Add and commit all modified and generated files.
4848-4949-For more information about the generation process, consult the
5050-[README.md](https://github.com/svanderburg/node2nix) file of the `node2nix`
5151-tool.
···114114115115A list of the maintainers of this Nix expression. Maintainers are defined in [`nixpkgs/maintainers/maintainer-list.nix`](https://github.com/NixOS/nixpkgs/blob/master/maintainers/maintainer-list.nix). There is no restriction to becoming a maintainer, just add yourself to that list in a separate commit titled “maintainers: add alice”, and reference maintainers with `maintainers = with lib.maintainers; [ alice bob ]`.
116116117117+### `mainProgram` {#var-meta-mainProgram}
118118+119119+The name of the main binary for the package. This effects the binary `nix run` executes and falls back to the name of the package. Example: `"rg"`
120120+117121### `priority` {#var-meta-priority}
118122119123The *priority* of the package, used by `nix-env` to resolve file name conflicts between packages. See the Nix manual page for `nix-env` for details. Example: `"10"` (a low-priority package).
···182182 </para>
183183 </listitem>
184184 </itemizedlist>
185185+ <itemizedlist spacing="compact">
186186+ <listitem>
187187+ <para>
188188+ <link xlink:href="https://docs.fluidd.xyz/">fluidd</link>, a
189189+ Klipper web interface for managing 3d printers using
190190+ moonraker. Available as
191191+ <link linkend="opt-services.fluidd.enable">fluidd</link>.
192192+ </para>
193193+ </listitem>
194194+ </itemizedlist>
185195 </section>
186196 <section xml:id="sec-release-21.11-incompatibilities">
187197 <title>Backward Incompatibilities</title>
···273283 <listitem>
274284 <para>
275285 The <literal>staticjinja</literal> package has been upgraded
276276- from 1.0.4 to 3.0.1
286286+ from 1.0.4 to 4.1.0
277287 </para>
278288 </listitem>
279289 <listitem>
···878888 3.9 introduces many deprecation warnings, please look at the
879889 <link xlink:href="https://docs.python.org/3/whatsnew/3.9.html">What’s
880890 New In Python 3.9 post</link> for more information.
891891+ </para>
892892+ </listitem>
893893+ <listitem>
894894+ <para>
895895+ <literal>qtile</literal> hase been updated from
896896+ <quote>0.16.0</quote> to <quote>0.18.0</quote>, please check
897897+ <link xlink:href="https://github.com/qtile/qtile/blob/master/CHANGELOG">qtile
898898+ changelog</link> for changes.
881899 </para>
882900 </listitem>
883901 <listitem>
+5-1
nixos/doc/manual/release-notes/rl-2111.section.md
···5656* [navidrome](https://www.navidrome.org/), a personal music streaming server with
5757subsonic-compatible api. Available as [navidrome](#opt-services.navidrome.enable).
58585959+- [fluidd](https://docs.fluidd.xyz/), a Klipper web interface for managing 3d printers using moonraker. Available as [fluidd](#opt-services.fluidd.enable).
6060+5961## Backward Incompatibilities {#sec-release-21.11-incompatibilities}
60626163- The `paperless` module and package have been removed. All users should migrate to the
···105107 Superuser created successfully.
106108 ```
107109108108-- The `staticjinja` package has been upgraded from 1.0.4 to 3.0.1
110110+- The `staticjinja` package has been upgraded from 1.0.4 to 4.1.0
109111110112- The `erigon` ethereum node has moved to a new database format in `2021-05-04`, and requires a full resync
111113···253255- Sway: The terminal emulator `rxvt-unicode` is no longer installed by default via `programs.sway.extraPackages`. The current default configuration uses `alacritty` (and soon `foot`) so this is only an issue when using a customized configuration and not installing `rxvt-unicode` explicitly.
254256255257- `python3` now defaults to Python 3.9. Python 3.9 introduces many deprecation warnings, please look at the [What's New In Python 3.9 post](https://docs.python.org/3/whatsnew/3.9.html) for more information.
258258+259259+- `qtile` hase been updated from '0.16.0' to '0.18.0', please check [qtile changelog](https://github.com/qtile/qtile/blob/master/CHANGELOG) for changes.
256260257261- The `claws-mail` package now references the new GTK+ 3 release branch, major version 4. To use the GTK+ 2 releases, one can install the `claws-mail-gtk2` package.
258262
···4747 ];
4848 description = ''
4949 Listen addresses and ports for this virtual host.
5050- <note><para>
5050+ <note>
5151+ <para>
5152 This option overrides <literal>addSSL</literal>, <literal>forceSSL</literal> and <literal>onlySSL</literal>.
5252- </para></note>
5353+ </para>
5454+ <para>
5555+ If you only want to set the addresses manually and not the ports, take a look at <literal>listenAddresses</literal>.
5656+ </para>
5757+ </note>
5858+ '';
5959+ };
6060+6161+ listenAddresses = mkOption {
6262+ type = with types; nonEmptyListOf str;
6363+6464+ description = ''
6565+ Listen addresses for this virtual host.
6666+ Compared to <literal>listen</literal> this only sets the addreses
6767+ and the ports are chosen automatically.
5368 '';
6969+ default = [ "*" ];
7070+ example = [ "127.0.0.1" ];
5471 };
55725673 enableSSL = mkOption {
···1818in
19192020{
2121- imports = [ ../profiles/headless.nix ./ec2-data.nix ./amazon-init.nix ];
2121+ imports = [
2222+ ../profiles/headless.nix
2323+ # Note: While we do use the headless profile, we also explicitly
2424+ # turn on the serial console on ttyS0 below. This is because
2525+ # AWS does support accessing the serial console:
2626+ # https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/configure-access-to-serial-console.html
2727+ ./ec2-data.nix
2828+ ./amazon-init.nix
2929+ ];
22302331 config = {
2432···4957 ];
5058 boot.initrd.kernelModules = [ "xen-blkfront" "xen-netfront" ];
5159 boot.initrd.availableKernelModules = [ "ixgbevf" "ena" "nvme" ];
5252- boot.kernelParams = mkIf cfg.hvm [ "console=ttyS0" "random.trust_cpu=on" ];
6060+ boot.kernelParams = mkIf cfg.hvm [ "console=ttyS0,115200n8" "random.trust_cpu=on" ];
53615462 # Prevent the nouveau kernel module from being loaded, as it
5563 # interferes with the nvidia/nvidia-uvm modules needed for CUDA.
···6371 boot.loader.grub.extraPerEntryConfig = mkIf (!cfg.hvm) "root (hd0)";
6472 boot.loader.grub.efiSupport = cfg.efi;
6573 boot.loader.grub.efiInstallAsRemovable = cfg.efi;
6666- boot.loader.timeout = 0;
7474+ boot.loader.timeout = 1;
7575+ boot.loader.grub.extraConfig = ''
7676+ serial --unit=0 --speed=115200 --word=8 --parity=no --stop=1
7777+ terminal_output console serial
7878+ terminal_input console serial
7979+ '';
67806881 boot.initrd.network.enable = true;
6982···127140 copy_bin_and_libs ${pkgs.util-linux}/sbin/swapon
128141 '';
129142130130- # Don't put old configurations in the GRUB menu. The user has no
131131- # way to select them anyway.
132132- boot.loader.grub.configurationLimit = 0;
133133-134143 # Allow root logins only using the SSH key that the user specified
135144 # at instance creation time.
136145 services.openssh.enable = true;
137146 services.openssh.permitRootLogin = "prohibit-password";
147147+148148+ # Enable the serial console on ttyS0
149149+ systemd.services."serial-getty@ttyS0".enable = true;
138150139151 # Creates symlinks for block device names.
140152 services.udev.packages = [ pkgs.ec2-utils ];
···3131 "Control various aspects of Microsoft Surface devices on Linux from the Command-Line";
3232 homepage = "https://github.com/linux-surface/surface-control";
3333 license = licenses.mit;
3434- maintainers = with maintainers; [ winterqt ];
3434+ maintainers = with maintainers; [ ];
3535 platforms = platforms.linux;
3636 };
3737}
···11-{ lib, fetchFromGitHub }:
11+{ lib, fetchurl }:
2233let
44- version = "6.9";
55-in fetchFromGitHub rec {
44+ version = "7.040";
55+in fetchurl rec {
66 name = "libertinus-${version}";
77+ url = "https://github.com/alerque/libertinus/releases/download/v${version}/Libertinus-${version}.tar.xz";
88+ sha256 = "0z658r88p52dyrcslv0wlccw0sw7m5jz8nbqizv95nf7bfw96iyk";
7988- owner = "alif-type";
99- repo = "libertinus";
1010- rev = "v${version}";
1010+ downloadToTemp = true;
1111+ recursiveHash = true;
11121213 postFetch = ''
1314 tar xf $downloadedFile --strip=1
1414- install -m444 -Dt $out/share/fonts/opentype *.otf
1515- install -m444 -Dt $out/share/doc/${name} *.txt
1515+ install -m644 -Dt $out/share/fonts/opentype static/OTF/*.otf
1616 '';
1717- sha256 = "0765a7w0askkhrjmjk638gcm9h6fcm1jpaza8iw9afr3sz1s0xlq";
18171918 meta = with lib; {
2020- description = "A fork of the Linux Libertine and Linux Biolinum fonts";
1919+ description = "The Libertinus font family";
2120 longDescription = ''
2222- Libertinus fonts is a fork of the Linux Libertine and Linux Biolinum fonts
2323- that started as an OpenType math companion of the Libertine font family,
2424- but grown as a full fork to address some of the bugs in the fonts.
2121+ The Libertinus font project began as a fork of the Linux Libertine and
2222+ Linux Biolinum fonts. The original impetus was to add an OpenType math
2323+ companion to the Libertine font families. Over time it grew into to a
2424+ full-fledged fork addressing many of the bugs in the Libertine fonts.
2525 '';
2626- homepage = "https://github.com/alif-type/libertinus";
2626+ homepage = "https://github.com/alerque/libertinus";
2727 license = licenses.ofl;
2828 maintainers = with maintainers; [ siddharthist ];
2929 platforms = platforms.all;
···11-Moved to [/doc/languages-frameworks/node.section.md](/doc/languages-frameworks/node.section.md)
11+Moved to [/doc/languages-frameworks/javascript.section.md](/doc/languages-frameworks/javascript.section.md)
···11+diff --git a/buildconfig/config_darwin.py b/buildconfig/config_darwin.py
22+index 8d84683f..70df8f9c 100644
33+--- a/buildconfig/config_darwin.py
44++++ b/buildconfig/config_darwin.py
55+@@ -56,10 +56,10 @@ class Dependency:
66+ class FrameworkDependency(Dependency):
77+ def configure(self, incdirs, libdirs):
88+ BASE_DIRS = '/', os.path.expanduser('~/'), '/System/'
99+- for n in BASE_DIRS:
1010++ for n in incdirs + libdirs:
1111+ n += 'Library/Frameworks/'
1212+ fmwk = n + self.libs + '.framework/Versions/Current/'
1313+- if os.path.isfile(fmwk + self.libs):
1414++ if os.path.isfile(fmwk + self.libs + '.tbd'):
1515+ print ('Framework ' + self.libs + ' found')
1616+ self.found = 1
1717+ self.inc_dir = fmwk + 'Headers'
1818+@@ -158,19 +158,8 @@ def main(sdl2=False):
1919+ ])
2020+2121+ print ('Hunting dependencies...')
2222+- incdirs = ['/usr/local/include']
2323+- if sdl2:
2424+- incdirs.append('/usr/local/include/SDL2')
2525+- else:
2626+- incdirs.append('/usr/local/include/SDL')
2727+-
2828+- incdirs.extend([
2929+- #'/usr/X11/include',
3030+- '/opt/local/include',
3131+- '/opt/local/include/freetype2/freetype']
3232+- )
3333+- #libdirs = ['/usr/local/lib', '/usr/X11/lib', '/opt/local/lib']
3434+- libdirs = ['/usr/local/lib', '/opt/local/lib']
3535++ incdirs = @buildinputs_include@
3636++ libdirs = @buildinputs_lib@
3737+3838+ for d in DEPS:
3939+ if isinstance(d, (list, tuple)):
4040+diff --git a/buildconfig/config_unix.py b/buildconfig/config_unix.py
4141+index f6a4ea4b..f7f5be76 100644
4242+--- a/buildconfig/config_unix.py
4343++++ b/buildconfig/config_unix.py
4444+@@ -224,18 +224,8 @@ def main(sdl2=False):
4545+ if not DEPS[0].found:
4646+ raise RuntimeError('Unable to run "sdl-config". Please make sure a development version of SDL is installed.')
4747+4848+- incdirs = []
4949+- libdirs = []
5050+- for extrabase in extrabases:
5151+- incdirs += [extrabase + d for d in origincdirs]
5252+- libdirs += [extrabase + d for d in origlibdirs]
5353+- incdirs += ["/usr"+d for d in origincdirs]
5454+- libdirs += ["/usr"+d for d in origlibdirs]
5555+- incdirs += ["/usr/local"+d for d in origincdirs]
5656+- libdirs += ["/usr/local"+d for d in origlibdirs]
5757+- if localbase:
5858+- incdirs = [localbase+d for d in origincdirs]
5959+- libdirs = [localbase+d for d in origlibdirs]
6060++ incdirs = @buildinputs_include@
6161++ libdirs = @buildinputs_lib@
6262+6363+ for arg in DEPS[0].cflags.split():
6464+ if arg[:2] == '-I':
···1414 sha256 = "1wdlblj127skgynf9amk7waabc3abbyxys9dvyc6c72zpcpdy5nc";
1515 };
16161717- preBuild = ''
1818- # TODO: is there a way to get the commit ref so we can set main.buildCommit?
1919- buildFlagsArray+=("-ldflags" "-X main.buildDate=1970-01-01T00:00:00+0000 -X main.buildVersion=${version}")
2020-'';
1717+ # TODO: is there a way to get the commit ref so we can set main.buildCommit?
1818+ ldflags = [
1919+ "-X main.buildDate=1970-01-01T00:00:00+0000" "-X main.buildVersion=${version}"
2020+ ];
21212222 meta = {
2323 description = "A go rewrite of envdir";
···561561 olifant = throw "olifant has been removed from nixpkgs, as it was unmaintained."; # added 2021-08-05
562562 opencl-icd = ocl-icd; # added 2017-01-20
563563 openconnect_pa = throw "openconnect_pa fork has been discontinued, support for GlobalProtect is now available in openconnect"; # added 2021-05-21
564564+ openelec-dvb-firmware = libreelec-dvb-firmware; # added 2021-05-10
564565 openexr_ctl = ctl; # added 2018-04-25
565566 openisns = open-isns; # added 2020-01-28
566567 openjpeg_1 = throw "openjpeg_1 has been removed, use openjpeg_2 instead"; # added 2021-01-24