+231
doc/languages-frameworks/factor.section.md
+231
doc/languages-frameworks/factor.section.md
···
···+All Nix expressions for the Factor compiler and development environment can be found in `pkgs/top-level/factor-packages.nix`.+The default package `factor-lang` provides support for the built-in graphical user interface and a selected set of C library bindings, e.g., for sound and TLS connections.+It also comes with the Fuel library for Emacs that provides an integrated development environment for developing Factor programs including access to the Factor runtime and online documentation.+For using less frequently used libraries that need additional bindings, you can override the `factor-lang` package and add more library bindings and/or binaries to its PATH.+The package is defined in `pkgs/development/compilers/factor-lang/wrapper.nix` and provides several attributes for adding those:+- `extraLibs` adds the packages' `/lib` paths to the wrapper and adds all shared libraries to an ld.so cache such that they can be found dynamically by the Factor runtime.+- `binPackages` does the same as `extraLibs` and additionally adds the packages to Factor's PATH environment variable.+- `extraVocabs` adds Factor vocabularies to the tree that are not part of the standard library.+This should be set to `true` when considering building and running graphical applications with this Factor runtime (even if the Factor GUI is not used for programming).+- `enableDefaults` can be deactivated to only wrap libraries that are named in `extraLibs` or `binPackages`.+The package also passes through several attributes listing the wrapped libraries and binaries, namely, `extraLibs` and `binPackages` as well as `defaultLibs` and `defaultBins`.+Additionally, all `runtimeLibs` is the concatenation of all the above for the purpose of providing all necessary dynamic libraries as "`propagatedBuildInputs`".+- `factorPackages.factor-lang` is the default package with GUI support and several default library bindings (e.g. openssl, openal etc.).+- `factorPackages.factor-no-gui` turns off GUI support while maintaining default library bindings.+- `factorPackages.factor-minimal` comes with practically no additional library bindings and binaries and no GUI support.+- `factorPackages.factor-minimal-gui` comes with no additional library bindings but includes GUI support.+Factor uses the concept of "scaffolding" to spin off a new vocabulary in a personal workspace rooted at the `work` vocabulary root.+This concept does not scale very well, because it makes many assumptions which all turn out to be wrong at some point.+In the current implementation, the `work` vocabulary root points to `/var/lib/factor` on the target machine.+If you don't like this approach, you can work around it by creating a `~/.factor-roots` file in your home directory which contains the locations you desire to represent additional Factor vocabulary roots, one directory per line.+All Factor vocabularies that shall be added to a Factor environment via the `extraVocabs` attribute must adhere to the following directory scheme.+`work` is routed to `/var/lib/factor` and is not shipped nor referenced in the nix store, see the section on [scaffolding](#ssec-factor-scaffolding).+You should usually use `extra`, but you can use the other roots to overwrite built-in vocabularies.+Be aware that vocabularies in `core` are part of the Factor image which the development environment is run from.+This means the code in those vocabularies is not loaded from the sources, such that you need to call `refresh-all` to re-compile and load the changed definitions.+In these instances, it is advised to override the `factor-unwrapped` package directly, which compiles and packages the core Factor libraries into the default Factor+As per Factor convention, your vocabulary `foo.factor` must be in a directory of the same name in addition to one of the previously mentioned vocabulary roots, e.g. `extra/foo/foo.factor`.+All extra Factor vocabularies are registered in `pkgs/top-level/factor-packages.nix` and their package definitions usually live in `development/compilers/factor-lang/vocabs/`.+Other readily understood vocabulary roots are `core` and `base`, which allow you to modify the default Factor runtime environment with an external package.+- `extraLibs`, `extraVocabs`, `extraPaths` have the same meaning as for [applications](#ssec-factor-applications).+When building factor-lang packages and Factor applications that use this respective vocabulary, these variables are evaluated and their paths added to the runtime environment.+1. Simple single-vocab projects with their Factor and supplementary files directly in the project root.+2. More complex projects with several vocabularies next to each other, e.g. `./<vocabName>` and `./<otherVocab>`.+Vocabularies must reside under `lib/factor/<root>/<vocab>` with the name-giving vocabulary being in `lib/factor/<vocabRoot>/<vocabName>`.+For instance, packaging the Bresenham algorithm for line interpolation looks like this, see `pkgs/development/compilers/factor-lang/vocabs/bresenham` for the complete file:+The vocabulary goes to `lib/factor/extra`, extra files, like licenses etc. would go to `share/` as usual and could be added to the output via a `postInstall` phase.+In case the vocabulary binds to a shared library or calls a binary that needs to be present in the runtime environment of its users, add `extraPaths` and `extraLibs` attributes respectively.+They are then picked up by the `buildFactorApplication` function and added as runtime dependencies.+Factor applications are built using Factor's `deploy` facility with the help of the `buildFactorApplication` function.+When packaging a Factor application with [`buildFactorApplication`](#ssec-factor-buildFactorApplication-func), its [`override`](#sec-pkg-override) interface should contain the `factorPackages` argument.+The `buildFactorApplication` function expects the following source structure for a package `foo-1.0` and produces a `/bin/foo` application:+It provides the additional attributes `vocabName` and `binName` to cope with naming deviations.+The `deploy.factor` file controls how the application is deployed and is documented in the Factor online documentation on the `deploy` facility.+Use the `preInstall` or `postInstall` hooks to copy additional files and directories to `out/`.+A more complex example shows how to specify runtime dependencies and additional Factor vocabularies at the example of the `painter` Factor application:+The use of the `src.name` and`sourceRoot` attributes conveniently establish the necessary `painter` vocabulary directory that is needed for the deployment to work.+This enables the standard pattern for application packages to specify all runtime dependencies explicitly without the Factor runtime interfering.+`buildFactorApplication` is a wrapper around `stdenv.mkDerivation` and takes all of its attributes.+This allows you to maintain Factor's vocabulary hierarchy and distribute the same source tree as a stand-alone application and as a library in the Factor development environment via the `extraVocabs` attribute.+: adds additional binaries to the runtime PATH environment variable (without adding their libraries, as well).+Defaults to `[]` and is concatenated with `defaultBins` and `binPackages` from the used factor-lang package.+: overrides the Factor package to use to deploy this application, which also affects the default library bindings and programs in the runtime PATH.+It defaults to `factor-lang` when `enableUI` is turned on and `factor-no-gui` when it is turned off.+Applications that use only Factor libraries without external bindings or programs may set this to `factor-minimal` or `factor-minimal-gui`.
+1
doc/languages-frameworks/index.md
+1
doc/languages-frameworks/index.md
+18
doc/redirects.json
+18
doc/redirects.json
···
+2
doc/release-notes/rl-2505.section.md
+2
doc/release-notes/rl-2505.section.md
···This introduces some backwards‐incompatible changes; see the [upstream release notes](https://releases.llvm.org/) for details.NEWS can been viewed from Emacs by typing `C-h n`, or by clicking `Help->Emacs News` from the menu bar.
···This introduces some backwards‐incompatible changes; see the [upstream release notes](https://releases.llvm.org/) for details.+- The Factor programming language packages were reworked. `factor-lang-scope` is now named `factorPackages` and provides a `buildFactorApplication` function to deploy Factor programs as binaries. It has also received proper documentation in the Nixpkgs manual.NEWS can been viewed from Emacs by typing `C-h n`, or by clicking `Help->Emacs News` from the menu bar.
+17
-16
pkgs/development/compilers/factor-lang/adjust-paths-in-unit-tests.patch
+17
-16
pkgs/development/compilers/factor-lang/adjust-paths-in-unit-tests.patch
···-diff --git a/basis/io/standard-paths/unix/unix-tests.factor b/basis/io/standard-paths/unix/unix-tests.factor···
···+diff -ur factor.orig/basis/io/standard-paths/unix/unix-tests.factor factor/basis/io/standard-paths/unix/unix-tests.factor+--- factor.orig/basis/io/standard-paths/unix/unix-tests.factor 2024-02-09 14:38:33.932439180 +0100···
+27
pkgs/development/compilers/factor-lang/ld.so.cache-from-env.patch
+27
pkgs/development/compilers/factor-lang/ld.so.cache-from-env.patch
···
···+diff -ur factor.orig/basis/alien/libraries/finder/linux/linux.factor factor/basis/alien/libraries/finder/linux/linux.factor+--- factor.orig/basis/alien/libraries/finder/linux/linux.factor 2024-02-09 14:38:33.966439078 +0100
+141
pkgs/development/compilers/factor-lang/mk-factor-application.nix
+141
pkgs/development/compilers/factor-lang/mk-factor-application.nix
···
···+runtimePaths = with finalAttrs.wrapped-factor; defaultBins ++ binPackages ++ finalAttrs.extraPaths;+appendToVar makeWrapperArgs --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath wrapped-factor.runtimeLibs}"
+59
pkgs/development/compilers/factor-lang/mk-vocab.nix
+59
pkgs/development/compilers/factor-lang/mk-vocab.nix
···
···
-24
pkgs/development/compilers/factor-lang/scope.nix
-24
pkgs/development/compilers/factor-lang/scope.nix
···
···
+110
pkgs/development/compilers/factor-lang/unwrapped.nix
+110
pkgs/development/compilers/factor-lang/unwrapped.nix
···
···+url = "https://downloads.factorcode.org/releases/${finalAttrs.version}/factor-src-${finalAttrs.version}.zip";+--replace-fail '(defcustom fuel-factor-root-dir nil' "(defcustom fuel-factor-root-dir \"$out/lib/factor\""+./factor -script -e='"unix-x86.64" USING: system bootstrap.image memory ; make-image save 0 exit'
+183
pkgs/development/compilers/factor-lang/wrapper.nix
+183
pkgs/development/compilers/factor-lang/wrapper.nix
···
···
+26
pkgs/development/factor-vocabs/bresenham/default.nix
+26
pkgs/development/factor-vocabs/bresenham/default.nix
···
···
+1
pkgs/top-level/aliases.nix
+1
pkgs/top-level/aliases.nix
···fahcontrol = throw "fahcontrol has been removed because the download is no longer available"; # added 2024-09-24fahviewer = throw "fahviewer has been removed because the download is no longer available"; # added 2024-09-24fam = throw "'fam' (aliased to 'gamin') has been removed as it is unmaintained upstream"; # Added 2024-04-19
···+factor-lang-scope = throw "'factor-lang-scope' has been renamed to 'factorPackages'"; # added 2024-11-28fahcontrol = throw "fahcontrol has been removed because the download is no longer available"; # added 2024-09-24fahviewer = throw "fahviewer has been removed because the download is no longer available"; # added 2024-09-24fam = throw "'fam' (aliased to 'gamin') has been removed as it is unmaintained upstream"; # Added 2024-04-19
+2
-2
pkgs/top-level/all-packages.nix
+2
-2
pkgs/top-level/all-packages.nix
···
+43
pkgs/top-level/factor-packages.nix
+43
pkgs/top-level/factor-packages.nix
···
···+interpreter = builtins.throw "factorPackages now offers various wrapped factor runtimes (see documentation) and the buildFactorApplication helper.";