diff --git a/doc/languages-frameworks/factor.section.md b/doc/languages-frameworks/factor.section.md new file mode 100644 index 000000000000..62db50e1ff6a --- /dev/null +++ b/doc/languages-frameworks/factor.section.md @@ -0,0 +1,231 @@ +# Factor {#sec-language-factor} + +## Development Environment {#ssec-factor-dev-env} + +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. + The packages must adhere to the default vocabulary root structure to be found. +- `guiSupport` draws in all necessary graphical libraries to enable the Factor GUI. + 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). + This argument is `true` by default. +- `enableDefaults` can be deactivated to only wrap libraries that are named in `extraLibs` or `binPackages`. + This reduces the runtime dependencies especially when shipping Factor applications. + +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` provides pre-configured Factor packages: +- `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. + +### Scaffolding and the `work` vocabulary root {#ssec-factor-scaffolding} + +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. +This can be suitable for a single-user system. +Create the location and make it writable to your user. +Then, you can use the `scaffold-work` word as instructed by many tutorials. + +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. +Use `scaffold-vocab` to create your vocabularies in one of these additional roots. +The online Factor documentation is extensive on how to use the scaffolding framework. + +## Packaging Factor Vocabularies {#ssec-factor-packaging} + +All Factor vocabularies that shall be added to a Factor environment via the `extraVocabs` attribute must adhere to the following directory scheme. +Its top-level directory must be one (or multiple) of `basis`, `core` or `extra`. +`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 +image. + +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/`. + +Package a vocabulary using the `buildFactorVocab` function. +Its default `installPhase` takes care of installing it under `out/lib/factor`. +It also understands the following special attributes: +- `vocabName` is the path to the vocabulary to be installed. + Defaults to `pname`. +- `vocabRoot` is the vocabulary root to install the vocabulary under. + Defaults to `extra`. + Unless you know what you are doing, do not change it. + 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). + They have no immediate effect and are just passed through. + 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. + +The function understands several forms of source directory trees: +1. Simple single-vocab projects with their Factor and supplementary files directly in the project root. + All `.factor` and `.txt` files are copied to `out/lib/factor//`. +2. More complex projects with several vocabularies next to each other, e.g. `./` and `./`. + All directories except `bin`, `doc` and `lib` are copied to `out/lib/factor/`. +3. Even more complex projects that touch multiple vocabulary roots. + Vocabularies must reside under `lib/factor//` with the name-giving vocabulary being in `lib/factor//`. + All directories in `lib/factor` are copied to `out/`. + +For instance, packaging the Bresenham algorithm for line interpolation looks like this, see `pkgs/development/compilers/factor-lang/vocabs/bresenham` for the complete file: +```nix +{ + factorPackages, + fetchFromGitHub, +}: + +factorPackages.buildFactorVocab { + pname = "bresenham"; + version = "dev"; + + src = fetchFromGitHub { + owner = "Capital-EX"; + repo = "bresenham"; + rev = "58d76b31a17f547e19597a09d02d46a742bf6808"; + hash = "sha256-cfQOlB877sofxo29ahlRHVpN3wYTUc/rFr9CJ89dsME="; + }; +} +``` + +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. + +## Building Applications {#ssec-factor-applications} + +Factor applications are built using Factor's `deploy` facility with the help of the `buildFactorApplication` function. + +### `buildFactorApplication` function {#ssec-factor-buildFactorApplication-func} + +`factorPackages.buildFactorApplication` *`buildDesc`* + +When packaging a Factor application with [`buildFactorApplication`](#ssec-factor-buildFactorApplication-func), its [`override`](#sec-pkg-override) interface should contain the `factorPackages` argument. +For example: +```nix +{ + lib, + fetchurl, + factorPackages, +}: + +factorPackages.buildFactorApplication (finalAttrs: { + pname = "foo"; + version = "1.0"; + + src = fetchurl { + url = "https://some-forge.org/foo-${finalAttrs.version}.tar.gz" + }; +}) +``` + +The `buildFactorApplication` function expects the following source structure for a package `foo-1.0` and produces a `/bin/foo` application: +``` +foo-1.0/ + foo/ + foo.factor + deploy.factor + ... +``` + +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/`. +The function itself only builds the application in `/lib/factor/` and a wrapper in `/bin/`. + +A more complex example shows how to specify runtime dependencies and additional Factor vocabularies at the example of the `painter` Factor application: +```nix +{ + lib, + fetchFromGitHub, + factorPackages, + curl, +}: + +factorPackages.buildFactorApplication (finalAttrs: { + pname = "painter"; + version = "1"; + + factor-lang = factorPackages.factor-minimal-gui; + + src = fetchFromGitHub { + name = finalAttrs.vocabName; + owner = "Capital-EX"; + repo = "painter"; + rev = "365797be8c4f82440bec0ad0a50f5a858a06c1b6"; + hash = "sha256-VdvnvKNGcFAtjWVDoxyYgRSyyyy0BEZ2MZGQ71O8nUI="; + }; + + sourceRoot = "."; + + enableUI = true; + extraVocabs = [ factorPackages.bresenham ]; + + extraPaths = with finalAttrs.factor-lang; binPackages ++ defaultBins ++ [ curl ]; + +}) +``` + +The use of the `src.name` and`sourceRoot` attributes conveniently establish the necessary `painter` vocabulary directory that is needed for the deployment to work. + +It requires the packager to specify the full set of binaries to be made available at runtime. +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. +Additional attributes that are understood by `buildFactorApplication`: + +*`buildDesc`* (Function or attribute set) + +: A build description similar to `stdenv.mkDerivation` with the following attributes: + + `vocabName` (String; _optional_) + + : is the path to the vocabulary to be deployed relative to the source root. + So, directory `foo/` from the example above could be `extra/deep/down/foo`. + 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. + + `binName` (String; _optional_) + + : is the name of the resulting binary in `/bin/`. + It defaults to the last directory component in `vocabName`. + It is also added as the `meta.mainProgram` attribute to facilitate `nix run`. + + `enableUI` (Boolean; _optional_) + + : is `false` by default. + Set this to `true` when you ship a graphical application. + + `extraLibs` (List; _optional_) + + : adds additional libraries as runtime dependencies. + Defaults to `[]` and is concatenated with `runtimeLibs` from the used factor-lang package. + Use `factor-minimal` to minimize the closure of runtime libraries. + + `extraPaths` (List; _optional_) + + : 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. + Use `factor-minimal` to minimize the closure of runtime libraries. + + `deployScriptText` (String; _optional_) + + : is the actual deploy Factor file that is executed to deploy the application. + You can change it if you need to perform additional computation during deployment. + + `factor-lang` (Package; _optional_) + + : 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`. diff --git a/doc/languages-frameworks/index.md b/doc/languages-frameworks/index.md index a08318540aac..12e54e2a76ab 100644 --- a/doc/languages-frameworks/index.md +++ b/doc/languages-frameworks/index.md @@ -67,6 +67,7 @@ dhall.section.md dlang.section.md dotnet.section.md emscripten.section.md +factor.section.md gnome.section.md go.section.md gradle.section.md diff --git a/doc/redirects.json b/doc/redirects.json index df7592d17920..2a8069a490bb 100644 --- a/doc/redirects.json +++ b/doc/redirects.json @@ -2754,6 +2754,24 @@ "declarative-debugging": [ "index.html#declarative-debugging" ], + "sec-language-factor": [ + "index.html#sec-language-factor" + ], + "ssec-factor-scaffolding": [ + "index.html#ssec-factor-scaffolding" + ], + "ssec-factor-packaging": [ + "index.html#ssec-factor-packaging" + ], + "ssec-factor-buildFactorApplication-func": [ + "index.html#ssec-factor-buildFactorApplication-func" + ], + "ssec-factor-dev-env": [ + "index.html#ssec-factor-dev-env" + ], + "ssec-factor-applications": [ + "index.html#ssec-factor-applications" + ], "sec-language-gnome": [ "index.html#sec-language-gnome" ], diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 8a090983d133..6a6a797269c6 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -18,6 +18,8 @@ - LLVM has been updated from LLVM 16 (on Darwin) and LLVM 18 (on other platforms) to LLVM 19. 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. + - Emacs has been updated to 30.1. This introduces some backwards‐incompatible changes; see the NEWS for details. NEWS can been viewed from Emacs by typing `C-h n`, or by clicking `Help->Emacs News` from the menu bar. diff --git a/nixos/modules/services/misc/docling-serve.nix b/nixos/modules/services/misc/docling-serve.nix index e717c1fe5e80..b9b7274047e0 100644 --- a/nixos/modules/services/misc/docling-serve.nix +++ b/nixos/modules/services/misc/docling-serve.nix @@ -15,6 +15,13 @@ in enable = lib.mkEnableOption "Docling Serve server"; package = lib.mkPackageOption pkgs "docling-serve" { }; + stateDir = lib.mkOption { + type = types.path; + default = "/var/lib/docling-serve"; + example = "/home/foo"; + description = "State directory of Docling Serve."; + }; + host = lib.mkOption { type = types.str; default = "127.0.0.1"; @@ -36,11 +43,11 @@ in environment = lib.mkOption { type = types.attrsOf types.str; default = { - DOCLING_SERVE_ENABLE_UI = "True"; + DOCLING_SERVE_ENABLE_UI = "False"; }; example = '' { - DOCLING_SERVE_ENABLE_UI = "False"; + DOCLING_SERVE_ENABLE_UI = "True"; } ''; description = '' @@ -77,11 +84,19 @@ in wantedBy = [ "multi-user.target" ]; after = [ "network.target" ]; - environment = cfg.environment; + environment = { + HF_HOME = "."; + EASYOCR_MODULE_PATH = "."; + MPLCONFIGDIR = "."; + } // cfg.environment; serviceConfig = { ExecStart = "${lib.getExe cfg.package} run --host \"${cfg.host}\" --port ${toString cfg.port}"; EnvironmentFile = lib.optional (cfg.environmentFile != null) cfg.environmentFile; + WorkingDirectory = cfg.stateDir; + StateDirectory = "docling-serve"; + RuntimeDirectory = "docling-serve"; + RuntimeDirectoryMode = "0755"; PrivateTmp = true; DynamicUser = true; DevicePolicy = "closed"; diff --git a/nixos/modules/services/web-apps/agorakit.nix b/nixos/modules/services/web-apps/agorakit.nix index b7c86d7585dd..7ee53222dc4f 100644 --- a/nixos/modules/services/web-apps/agorakit.nix +++ b/nixos/modules/services/web-apps/agorakit.nix @@ -13,7 +13,7 @@ let user = cfg.user; group = cfg.group; - php = lib.getExe pkgs.php82; + php = lib.getExe cfg.phpPackage; # shell script for local administration artisan = pkgs.writeScriptBin "agorakit" '' @@ -35,6 +35,8 @@ in options.services.agorakit = { enable = mkEnableOption "agorakit"; + phpPackage = mkPackageOption pkgs "php82" { }; + user = mkOption { default = "agorakit"; description = "User agorakit runs as."; @@ -340,6 +342,7 @@ in services.phpfpm.pools.agorakit = { inherit user group; + phpPackage = cfg.phpPackage; phpOptions = '' log_errors = on post_max_size = ${cfg.maxUploadSize} diff --git a/nixos/modules/services/web-apps/gancio.nix b/nixos/modules/services/web-apps/gancio.nix index a1ec26e2b247..230e93737fdb 100644 --- a/nixos/modules/services/web-apps/gancio.nix +++ b/nixos/modules/services/web-apps/gancio.nix @@ -171,7 +171,16 @@ in }; config = mkIf cfg.enable { - environment.systemPackages = [ cfg.package ]; + environment.systemPackages = [ + (pkgs.runCommand "gancio" { } '' + mkdir -p $out/bin + echo "#!${pkgs.runtimeShell} + cd /var/lib/gancio/ + exec ${lib.getExe cfg.package} ''${1:---help} + " > $out/bin/gancio + chmod +x $out/bin/gancio + '') + ]; users.users.gancio = lib.mkIf (cfg.user == "gancio") { isSystemUser = true; @@ -210,6 +219,11 @@ in NODE_ENV = "production"; }; + path = [ + # required for sendmail + "/run/wrappers" + ]; + preStart = '' # We need this so the gancio executable run by the user finds the right settings. ln -sf ${configFile} config.json diff --git a/nixos/modules/services/web-apps/monica.nix b/nixos/modules/services/web-apps/monica.nix index 727eb6ea5028..2aec2d9f9109 100644 --- a/nixos/modules/services/web-apps/monica.nix +++ b/nixos/modules/services/web-apps/monica.nix @@ -16,7 +16,7 @@ let user = cfg.user; group = cfg.group; - php = lib.getExe pkgs.php83; + php = lib.getExe cfg.phpPackage; # shell script for local administration artisan = pkgs.writeScriptBin "monica" '' @@ -38,6 +38,8 @@ in options.services.monica = { enable = mkEnableOption "monica"; + phpPackage = mkPackageOption pkgs "php83" { }; + user = mkOption { default = "monica"; description = "User monica runs as."; @@ -342,6 +344,7 @@ in services.phpfpm.pools.monica = { inherit user group; + phpPackage = cfg.phpPackage; phpOptions = '' log_errors = on post_max_size = ${cfg.maxUploadSize} diff --git a/pkgs/applications/editors/vim/plugins/generated.nix b/pkgs/applications/editors/vim/plugins/generated.nix index 7cb069ac6a0a..a6bfce69d460 100644 --- a/pkgs/applications/editors/vim/plugins/generated.nix +++ b/pkgs/applications/editors/vim/plugins/generated.nix @@ -6129,6 +6129,19 @@ final: prev: { meta.hydraPlatforms = [ ]; }; + incline-nvim = buildVimPlugin { + pname = "incline.nvim"; + version = "2025-03-24"; + src = fetchFromGitHub { + owner = "b0o"; + repo = "incline.nvim"; + rev = "27040695b3bbfcd3257669037bd008d1a892831d"; + sha256 = "1frm25a0fa13x6ihimi94p21pipxs93s3bbapjjhzmg4z08npj75"; + }; + meta.homepage = "https://github.com/b0o/incline.nvim/"; + meta.hydraPlatforms = [ ]; + }; + increment-activator = buildVimPlugin { pname = "increment-activator"; version = "2024-03-20"; diff --git a/pkgs/applications/editors/vim/plugins/vim-plugin-names b/pkgs/applications/editors/vim/plugins/vim-plugin-names index 652f800cf5ff..2bbafd674a4f 100644 --- a/pkgs/applications/editors/vim/plugins/vim-plugin-names +++ b/pkgs/applications/editors/vim/plugins/vim-plugin-names @@ -469,6 +469,7 @@ https://github.com/HakonHarnes/img-clip.nvim/,HEAD, https://github.com/lewis6991/impatient.nvim/,, https://github.com/backdround/improved-search.nvim/,HEAD, https://github.com/smjonas/inc-rename.nvim/,HEAD, +https://github.com/b0o/incline.nvim/,HEAD, https://github.com/nishigori/increment-activator/,, https://github.com/haya14busa/incsearch-easymotion.vim/,, https://github.com/haya14busa/incsearch.vim/,, diff --git a/pkgs/by-name/ar/archipelago/package.nix b/pkgs/by-name/ar/archipelago/package.nix index a805c550e4c6..b1384d9d60f8 100644 --- a/pkgs/by-name/ar/archipelago/package.nix +++ b/pkgs/by-name/ar/archipelago/package.nix @@ -7,10 +7,10 @@ }: let pname = "archipelago"; - version = "0.5.1"; + version = "0.6.0"; src = fetchurl { url = "https://github.com/ArchipelagoMW/Archipelago/releases/download/${version}/Archipelago_${version}_linux-x86_64.AppImage"; - hash = "sha256-/TwmTQtV/6bR95ZQNEcOFQ4t/0otNK8xx5N+yoYaiYk="; + hash = "sha256-hpyMi/Zd4yDKd/53xuChRTQDD9QkcyqwqrmwoWSQMkY="; }; appimageContents = appimageTools.extractType2 { inherit pname version src; }; diff --git a/pkgs/by-name/bu/bun/package.nix b/pkgs/by-name/bu/bun/package.nix index 6a90565f00f4..a9f40cf9de02 100644 --- a/pkgs/by-name/bu/bun/package.nix +++ b/pkgs/by-name/bu/bun/package.nix @@ -17,7 +17,7 @@ }: stdenvNoCC.mkDerivation rec { - version = "1.2.7"; + version = "1.2.8"; pname = "bun"; src = @@ -86,19 +86,19 @@ stdenvNoCC.mkDerivation rec { sources = { "aarch64-darwin" = fetchurl { url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-darwin-aarch64.zip"; - hash = "sha256-VxB20tZEoKSWchHphR9YTESmRcCgt7tRma/xIXL9WuQ="; + hash = "sha256-ioBqQKA3Mp5PtVlFcmf2xOvoIEy7rNsD85s0m+1ao1U="; }; "aarch64-linux" = fetchurl { url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-linux-aarch64.zip"; - hash = "sha256-nCS4Oky54tHiH8cdHNj4nz1vd3bqeR1CusjgPku1MZs="; + hash = "sha256-Iwg/JW8qHRVcRW4S45xR4x3EG5fGNCDZkV9Du4ar6rE="; }; "x86_64-darwin" = fetchurl { url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-darwin-x64-baseline.zip"; - hash = "sha256-C8LjwcdW/1H6NfzsJ0+X+xRzfYFNihzne8ePJGk1etE="; + hash = "sha256-vYcbm19aR540MrO4YFQgeSwNOKLot8/H03i0NP8c2og="; }; "x86_64-linux" = fetchurl { url = "https://github.com/oven-sh/bun/releases/download/bun-v${version}/bun-linux-x64.zip"; - hash = "sha256-hHsTjLGOq4Inyx87Fu3Kuvdk5Yp5pef5BeunaOo138s="; + hash = "sha256-QrSLNmdguYb+HWqLE8VwbSZzCDmoV3eQzS6PKHmenzE="; }; }; updateScript = writeShellScript "update-bun" '' diff --git a/pkgs/by-name/cn/cntb/package.nix b/pkgs/by-name/cn/cntb/package.nix index 4c2e6643456a..2058ba3fc98f 100644 --- a/pkgs/by-name/cn/cntb/package.nix +++ b/pkgs/by-name/cn/cntb/package.nix @@ -5,13 +5,13 @@ }: buildGoModule rec { pname = "cntb"; - version = "1.5.3"; + version = "1.5.4"; src = fetchFromGitHub { owner = "contabo"; repo = "cntb"; rev = "v${version}"; - hash = "sha256-mGbGtn7/xB4zbBA8OeyMB2ntW4T+BCMZd/xybXWgoQE="; + hash = "sha256-4QS1fkXVcGxhZDPRLDc0xKl4jr8W4og/Qf591i3gzxk="; # docs contains two files with the same name but different cases, # this leads to a different hash on case insensitive filesystems (e.g. darwin) # https://github.com/contabo/cntb/issues/34 @@ -22,7 +22,7 @@ buildGoModule rec { subPackages = [ "." ]; - vendorHash = "sha256-NugvPGuHKuDJVq8Ii/WY1WigxCzC9TJEZJk70k5ifzM="; + vendorHash = "sha256-LOGSllVQ28bXaqHXEv1Zd1vcTRZTZ5wy+gSQv1JWKMU="; ldflags = [ "-X contabo.com/cli/cntb/cmd.version=${src.rev}" diff --git a/pkgs/by-name/do/docling-serve/package.nix b/pkgs/by-name/do/docling-serve/package.nix index df0fb39a4724..ff8e4514d60e 100644 --- a/pkgs/by-name/do/docling-serve/package.nix +++ b/pkgs/by-name/do/docling-serve/package.nix @@ -1,6 +1,10 @@ -{ python3Packages, nixosTests }: +{ + python3Packages, + nixosTests, + withUI ? false, +}: -(python3Packages.toPythonApplication python3Packages.docling-serve) +(python3Packages.toPythonApplication (python3Packages.docling-serve.override { inherit withUI; })) // { passthru.tests = { docling-serve = nixosTests.docling-serve; diff --git a/pkgs/by-name/fa/fastfetch/package.nix b/pkgs/by-name/fa/fastfetch/package.nix index 675296ca94c4..de9c29a9a12b 100644 --- a/pkgs/by-name/fa/fastfetch/package.nix +++ b/pkgs/by-name/fa/fastfetch/package.nix @@ -45,13 +45,13 @@ }: stdenv.mkDerivation (finalAttrs: { pname = "fastfetch"; - version = "2.40.0"; + version = "2.40.1"; src = fetchFromGitHub { owner = "fastfetch-cli"; repo = "fastfetch"; tag = finalAttrs.version; - hash = "sha256-+eCoxWzTUPLYkz05XwJW1i8v5tyO3VRlm/ZKSlP3cts="; + hash = "sha256-k9t4qW8fPWc83/ys0Tyoief1HwELu9awIkclDBgDFW4="; }; outputs = [ diff --git a/pkgs/by-name/gi/git-cinnabar/package.nix b/pkgs/by-name/gi/git-cinnabar/package.nix index 73619ecf6df6..9c6b76b30dde 100644 --- a/pkgs/by-name/gi/git-cinnabar/package.nix +++ b/pkgs/by-name/gi/git-cinnabar/package.nix @@ -13,13 +13,13 @@ stdenv.mkDerivation (finalAttrs: { pname = "git-cinnabar"; - version = "0.6.3"; + version = "0.7.2"; src = fetchFromGitHub { owner = "glandium"; repo = "git-cinnabar"; - rev = finalAttrs.version; - hash = "sha256-RUrklp2hobHKnBZKVvxMGquNSZBG/rVWaD/m+7AWqHo="; + tag = finalAttrs.version; + hash = "sha256-phQ7wfSgctfbjFtg1HVNtoVlnC0yIEJy65Mu/hLPjnw="; fetchSubmodules = true; }; @@ -38,7 +38,7 @@ stdenv.mkDerivation (finalAttrs: { cargoDeps = rustPlatform.fetchCargoVendor { inherit (finalAttrs) src; - hash = "sha256-B2wLxSedFEgL+DPH4D6qL46ovcBZhPSacsYJKscKDYQ="; + hash = "sha256-Vhe9sMUTs16+lQ8hpt8E4Vmu6n4kkyzir1IM9etYBno="; }; ZSTD_SYS_USE_PKG_CONFIG = true; @@ -47,7 +47,6 @@ stdenv.mkDerivation (finalAttrs: { # Disable automated version-check buildNoDefaultFeatures = true; - checkNoDefaultFeatures = true; installPhase = '' runHook preInstall diff --git a/pkgs/by-name/kr/krep/package.nix b/pkgs/by-name/kr/krep/package.nix new file mode 100644 index 000000000000..b94232de2330 --- /dev/null +++ b/pkgs/by-name/kr/krep/package.nix @@ -0,0 +1,42 @@ +{ + lib, + stdenv, + fetchFromGitHub, + versionCheckHook, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "krep"; + version = "0.3.4"; + + src = fetchFromGitHub { + owner = "davidesantangelo"; + repo = "krep"; + rev = "v${finalAttrs.version}"; + hash = "sha256-kAsOAcEFjfxlJs6fJvB0viCMxGFCG1BUs9qPgGMvBpM="; + }; + + makeFlags = [ + "CC=${stdenv.cc.targetPrefix}cc" + "ENABLE_ARCH_DETECTION=0" + ]; + + installFlags = [ + "PREFIX=${placeholder "out"}" + ]; + + doCheck = true; + doInstallCheck = true; + nativeInstallCheck = [ versionCheckHook ]; + + meta = { + description = "Blazingly fast string search utility designed for performance-critical applications"; + homepage = "https://github.com/davidesantangelo/krep"; + changelog = "https://github.com/davidesantangelo/krep/releases/tag/v${finalAttrs.version}"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ + codebam + ]; + platforms = lib.platforms.unix; + }; +}) diff --git a/pkgs/by-name/lo/lockbook-desktop/package.nix b/pkgs/by-name/lo/lockbook-desktop/package.nix index a119da25c520..e50876658ad2 100644 --- a/pkgs/by-name/lo/lockbook-desktop/package.nix +++ b/pkgs/by-name/lo/lockbook-desktop/package.nix @@ -18,17 +18,17 @@ let in rustPlatform.buildRustPackage rec { pname = "lockbook-desktop"; - version = "0.9.20"; + version = "0.9.21"; src = fetchFromGitHub { owner = "lockbook"; repo = "lockbook"; tag = version; - hash = "sha256-nIh5xgdtaUvc5RbS24GGUHxY41lnL2xdkDs0TD/N2Gw="; + hash = "sha256-SRmfLxF78jR1a/37pU1TLM6nFpmYLRbHJzQIVQtM8/M="; }; useFetchCargoVendor = true; - cargoHash = "sha256-CuUg5QT1s5TJd409O9YD3A3bMNUnfY6MrCIUrzS50j8="; + cargoHash = "sha256-faqbsxXF2AjDE+FMkD1PihacPAvQlD6nkczN4QdsCeM="; nativeBuildInputs = [ pkg-config diff --git a/pkgs/by-name/lo/lockbook/package.nix b/pkgs/by-name/lo/lockbook/package.nix index b7fb28ff49e3..bf9c911ae031 100644 --- a/pkgs/by-name/lo/lockbook/package.nix +++ b/pkgs/by-name/lo/lockbook/package.nix @@ -7,17 +7,17 @@ }: rustPlatform.buildRustPackage rec { pname = "lockbook"; - version = "0.9.20"; + version = "0.9.21"; src = fetchFromGitHub { owner = "lockbook"; repo = "lockbook"; tag = version; - hash = "sha256-nIh5xgdtaUvc5RbS24GGUHxY41lnL2xdkDs0TD/N2Gw="; + hash = "sha256-SRmfLxF78jR1a/37pU1TLM6nFpmYLRbHJzQIVQtM8/M="; }; useFetchCargoVendor = true; - cargoHash = "sha256-CuUg5QT1s5TJd409O9YD3A3bMNUnfY6MrCIUrzS50j8="; + cargoHash = "sha256-faqbsxXF2AjDE+FMkD1PihacPAvQlD6nkczN4QdsCeM="; doCheck = false; # there are no cli tests cargoBuildFlags = [ diff --git a/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix b/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix index 1323ac457f59..6731686e16c8 100644 --- a/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix +++ b/pkgs/by-name/mo/modrinth-app-unwrapped/package.nix @@ -18,20 +18,19 @@ let pnpm = pnpm_9; in - rustPlatform.buildRustPackage rec { pname = "modrinth-app-unwrapped"; - version = "0.9.0"; + version = "0.9.3"; src = fetchFromGitHub { owner = "modrinth"; repo = "code"; tag = "v${version}"; - hash = "sha256-uDG+WHeMY/quzF8mHBn5o8xod4/G5+S4/zD2lbqdN0M="; + hash = "sha256-h+zj4Hm7v8SU6Zy0rIWbOknXVdSDf8b1d4q6M12J5Lc="; }; useFetchCargoVendor = true; - cargoHash = "sha256-D9hkdliyKc8m9i2D9pG3keGmZsx+rzrgVXZws9Ot24I="; + cargoHash = "sha256-RrXSBgVh4UZFHcgUWhUjE7rEm/RZFDSDCpXS22gVjZ0="; pnpmDeps = pnpm.fetchDeps { inherit pname version src; diff --git a/pkgs/by-name/mu/music-assistant/frontend.nix b/pkgs/by-name/mu/music-assistant/frontend.nix index 045298cb69e4..17ebc9b78497 100644 --- a/pkgs/by-name/mu/music-assistant/frontend.nix +++ b/pkgs/by-name/mu/music-assistant/frontend.nix @@ -7,12 +7,12 @@ buildPythonPackage rec { pname = "music-assistant-frontend"; - version = "2.12.2"; + version = "2.14.8"; pyproject = true; src = fetchPypi { inherit pname version; - hash = "sha256-aa400lMs6zxC5QhZS27gFUWpRanyC3sFi815iDEiSPk="; + hash = "sha256-YUir/YBBbggsQUh5b6qSG5fpAa25jJmgcSsf0EZ8rhw="; }; postPatch = '' diff --git a/pkgs/by-name/mu/music-assistant/package.nix b/pkgs/by-name/mu/music-assistant/package.nix index 3fa32d1bc937..d518bb0a0a24 100644 --- a/pkgs/by-name/mu/music-assistant/package.nix +++ b/pkgs/by-name/mu/music-assistant/package.nix @@ -16,13 +16,13 @@ let music-assistant-frontend = self.callPackage ./frontend.nix { }; music-assistant-models = super.music-assistant-models.overridePythonAttrs (oldAttrs: rec { - version = "1.1.34"; + version = "1.1.45"; src = fetchFromGitHub { owner = "music-assistant"; repo = "models"; tag = version; - hash = "sha256-UxokPUnYET1XyRok0FH7e8G3RpCMvOigY4huw6Tfllo="; + hash = "sha256-R1KkMe9dVl5J1DjDsFhSYVebpiqBkXZSqkLrd7T8gFg="; }; postPatch = '' @@ -44,14 +44,14 @@ in python.pkgs.buildPythonApplication rec { pname = "music-assistant"; - version = "2.4.4"; + version = "2.5.0"; pyproject = true; src = fetchFromGitHub { owner = "music-assistant"; repo = "server"; tag = version; - hash = "sha256-rxXEsR4EfJZp3OFGHcSRaJp1egt2OT15P8V35v35KmU="; + hash = "sha256-yugtL3dCuGb2OSTy49V4mil9EnfACcGrYCA1rW/lo+4="; }; patches = [ diff --git a/pkgs/by-name/mu/music-assistant/providers.nix b/pkgs/by-name/mu/music-assistant/providers.nix index 2f791317ed7e..b78e089de4d7 100644 --- a/pkgs/by-name/mu/music-assistant/providers.nix +++ b/pkgs/by-name/mu/music-assistant/providers.nix @@ -1,7 +1,7 @@ # Do not edit manually, run ./update-providers.py { - version = "2.4.4"; + version = "2.5.0"; providers = { airplay = ps: [ ]; @@ -21,6 +21,8 @@ ]; builtin = ps: [ ]; + builtin_player = ps: [ + ]; chromecast = ps: with ps; [ pychromecast @@ -44,6 +46,8 @@ ps: with ps; [ python-fullykiosk ]; + gpodder = ps: [ + ]; hass = ps: with ps; [ hass-client @@ -52,10 +56,18 @@ ]; ibroadcast = ps: [ ]; # missing ibroadcastaio + itunes_podcasts = ps: [ + ]; jellyfin = ps: with ps; [ aiojellyfin ]; + lastfm_scrobble = + ps: with ps; [ + pylast + ]; + listenbrainz_scrobble = ps: [ + ]; # missing liblistenbrainz musicbrainz = ps: [ ]; opensubsonic = @@ -68,10 +80,8 @@ ps: with ps; [ plexapi ]; - podcastfeed = - ps: with ps; [ - podcastparser - ]; + podcastfeed = ps: [ + ]; qobuz = ps: [ ]; radiobrowser = @@ -80,14 +90,11 @@ ]; siriusxm = ps: [ ]; # missing sxm - slimproto = - ps: with ps; [ - aioslimproto - ]; snapcast = ps: with ps; [ bidict snapcast + websocket-client ]; sonos = ps: with ps; [ @@ -106,6 +113,10 @@ ]; spotify_connect = ps: [ ]; + squeezelite = + ps: with ps; [ + aioslimproto + ]; template_player_provider = ps: [ ]; test = ps: [ @@ -114,7 +125,7 @@ ]; tidal = ps: with ps; [ - tidalapi + pkce ]; tunein = ps: [ ]; @@ -123,6 +134,6 @@ duration-parser yt-dlp ytmusicapi - ]; + ]; # missing bgutil-ytdlp-pot-provider }; } diff --git a/pkgs/by-name/sd/sdl3/package.nix b/pkgs/by-name/sd/sdl3/package.nix index 24e2dad7946b..1093605f44c1 100644 --- a/pkgs/by-name/sd/sdl3/package.nix +++ b/pkgs/by-name/sd/sdl3/package.nix @@ -57,7 +57,7 @@ assert lib.assertMsg ( stdenv.mkDerivation (finalAttrs: { pname = "sdl3"; - version = "3.2.8"; + version = "3.2.10"; outputs = [ "lib" @@ -69,7 +69,7 @@ stdenv.mkDerivation (finalAttrs: { owner = "libsdl-org"; repo = "SDL"; tag = "release-${finalAttrs.version}"; - hash = "sha256-BpNo8t0st8v2cTV2iSrjvjCPiDa26NwkWXgMGKFkeAQ="; + hash = "sha256-SylXpHPT4Y/37UapfLScJJ/CGniNyK4UNVAWax+WiBo="; }; postPatch = diff --git a/pkgs/by-name/vi/video-downloader/package.nix b/pkgs/by-name/vi/video-downloader/package.nix index 55f50d8b3630..dfc4d49dfc96 100644 --- a/pkgs/by-name/vi/video-downloader/package.nix +++ b/pkgs/by-name/vi/video-downloader/package.nix @@ -18,14 +18,14 @@ python3Packages.buildPythonApplication rec { pname = "video-downloader"; - version = "0.12.22"; + version = "0.12.24"; pyproject = false; # Built with meson src = fetchFromGitHub { owner = "Unrud"; repo = "video-downloader"; tag = "v${version}"; - hash = "sha256-kCw+4ycJiLXvAKY6ct9zthVABf2yqDQVC2qg0Ie/zHk="; + hash = "sha256-lgHAO4/dqwwp/PiIFHCBRfDNUw0GfomMvfaobakxFdA="; }; propagatedBuildInputs = with python3Packages; [ diff --git a/pkgs/by-name/ya/yandex-disk/package.nix b/pkgs/by-name/ya/yandex-disk/package.nix index 95b2295835e8..c62d25c63aa0 100644 --- a/pkgs/by-name/ya/yandex-disk/package.nix +++ b/pkgs/by-name/ya/yandex-disk/package.nix @@ -14,7 +14,7 @@ let if stdenv.hostPlatform.is64bit then { arch = "x86_64"; - gcclib = "${lib.getLib stdenv.cc.cc}/lib64"; + gcclib = "${lib.getLib stdenv.cc.cc}/lib"; sha256 = "sha256-HH/pLZmDr6m/B3e6MHafDGnNWR83oR2y1ijVMR/LOF0="; webarchive = "20220519080155"; } @@ -39,6 +39,10 @@ stdenv.mkDerivation rec { sha256 = p.sha256; }; + buildInputs = [ + zlib + stdenv.cc.cc + ]; builder = writeText "builder.sh" '' mkdir -pv $out/bin mkdir -pv $out/share diff --git a/pkgs/development/compilers/factor-lang/adjust-paths-in-unit-tests.patch b/pkgs/development/compilers/factor-lang/adjust-paths-in-unit-tests.patch index 10f812e3814a..f0374b80b8c0 100644 --- a/pkgs/development/compilers/factor-lang/adjust-paths-in-unit-tests.patch +++ b/pkgs/development/compilers/factor-lang/adjust-paths-in-unit-tests.patch @@ -1,24 +1,19 @@ -From da8a4b9c1094a568f443c525ca1ce11f686be1bc Mon Sep 17 00:00:00 2001 -From: timor -Date: Thu, 8 Aug 2019 14:13:09 +0200 -Subject: [PATCH] adjust unit test for finding executables in path for NixOS - ---- - basis/io/standard-paths/unix/unix-tests.factor | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/basis/io/standard-paths/unix/unix-tests.factor b/basis/io/standard-paths/unix/unix-tests.factor -index acd5029..870537f 100644 ---- a/basis/io/standard-paths/unix/unix-tests.factor -+++ b/basis/io/standard-paths/unix/unix-tests.factor -@@ -5,13 +5,13 @@ sequences tools.test ; - +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 ++++ factor/basis/io/standard-paths/unix/unix-tests.factor 2024-02-09 15:41:18.529141569 +0100 +@@ -1,21 +1,21 @@ + ! Copyright (C) 2011 Doug Coleman. + ! See https://factorcode.org/license.txt for BSD license. + USING: environment io.standard-paths io.standard-paths.unix +-sequences tools.test ; ++kernel sequences tools.test ; + { f } [ "" find-in-path ] unit-test { t } [ - "ls" find-in-path { "/bin/ls" "/usr/bin/ls" } member? + "ls" find-in-path not not ] unit-test - + { t } [ "/sbin:" "PATH" os-env append "PATH" [ "ps" find-in-path @@ -26,3 +21,9 @@ index acd5029..870537f 100644 + not not ] with-os-env ] unit-test + + { t } [ + "ls" find-in-standard-login-path +- { "/bin/ls" "/usr/bin/ls" } member? ++ not not + ] unit-test diff --git a/pkgs/development/compilers/factor-lang/ld.so.cache-from-env.patch b/pkgs/development/compilers/factor-lang/ld.so.cache-from-env.patch new file mode 100644 index 000000000000..75c49a8cac13 --- /dev/null +++ b/pkgs/development/compilers/factor-lang/ld.so.cache-from-env.patch @@ -0,0 +1,27 @@ +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 ++++ factor/basis/alien/libraries/finder/linux/linux.factor 2024-02-09 14:41:16.775938179 +0100 +@@ -2,7 +2,7 @@ + ! See https://factorcode.org/license.txt for BSD license + USING: accessors alien.libraries.finder arrays assocs + combinators.short-circuit environment io io.encodings.utf8 +-io.launcher kernel make sequences sets splitting system ++io.files io.launcher kernel make sequences sets splitting system + unicode ; + IN: alien.libraries.finder.linux + +@@ -25,8 +25,12 @@ + ] map ; + + : load-ldconfig-cache ( -- seq ) +- "/sbin/ldconfig -p" utf8 [ read-lines ] with-process-reader* +- 2drop [ f ] [ rest parse-ldconfig-lines ] if-empty ; ++ "FACTOR_LD_SO_CACHE" os-env [ ++ utf8 [ read-lines ] with-file-reader ++ ] [ ++ { } clone ++ ] if* ++ [ f ] [ rest parse-ldconfig-lines ] if-empty ; + + : ldconfig-arch ( -- str ) + mach-map cpu of { "libc6" } or ; diff --git a/pkgs/development/compilers/factor-lang/mk-factor-application.nix b/pkgs/development/compilers/factor-lang/mk-factor-application.nix new file mode 100644 index 000000000000..0aaa075d006b --- /dev/null +++ b/pkgs/development/compilers/factor-lang/mk-factor-application.nix @@ -0,0 +1,141 @@ +{ + stdenv, + lib, + writeText, + makeWrapper, + factor-lang, + factor-no-gui, + librsvg, + gdk-pixbuf, +}@initAttrs: + +drvArgs: + +let + flang = factor-lang; # workaround to satisfy nixf-tidy +in +(stdenv.mkDerivation drvArgs).overrideAttrs ( + finalAttrs: + { + name ? "${finalAttrs.pname}-${finalAttrs.version}", + factor-lang ? if enableUI then flang else factor-no-gui, + enableUI ? false, + # Allow overriding the path to the deployed vocabulary name. A + # $vocabName.factor file must exist! + vocabName ? finalAttrs.pname or name, + # Allow overriding the binary name + binName ? lib.last (lib.splitString "/" vocabName), + # Extra libraries needed + extraLibs ? [ ], + # Extra binaries in PATH + extraPaths ? [ ], + # Extra vocabularies needed by this application + extraVocabs ? [ ], + deployScriptText ? '' + USING: command-line io io.backend io.pathnames kernel namespaces sequences + tools.deploy tools.deploy.config tools.deploy.backend vocabs.loader ; + + IN: deploy-me + + : load-and-deploy ( path/vocab -- ) + normalize-path [ + parent-directory add-vocab-root + ] [ + file-name dup reload deploy + ] bi ; + + : deploy-vocab ( path/vocab path/target -- ) + normalize-path deploy-directory set + f open-directory-after-deploy? set + load-and-deploy ; + + : deploy-me ( -- ) + command-line get dup length 2 = [ + first2 deploy-vocab + ] [ + drop + "usage: deploy-me " print + nl + ] if ; + + MAIN: deploy-me + '', + ... + }@attrs: + let + deployScript = writeText "deploy-me.factor" finalAttrs.deployScriptText; + wrapped-factor = finalAttrs.factor-lang.override { + inherit (finalAttrs) extraLibs extraVocabs; + doInstallCheck = false; + }; + runtimePaths = with finalAttrs.wrapped-factor; defaultBins ++ binPackages ++ finalAttrs.extraPaths; + in + { + inherit + enableUI + vocabName + deployScriptText + extraLibs + extraPaths + extraVocabs + binName + factor-lang + wrapped-factor + ; + nativeBuildInputs = [ + makeWrapper + (lib.hiPrio finalAttrs.wrapped-factor) + ] ++ attrs.nativeBuildInputs or [ ]; + + buildInputs = (lib.optional enableUI gdk-pixbuf) ++ attrs.buildInputs or [ ]; + + buildPhase = + attrs.buildPhase or '' + runHook preBuild + vocabBaseName=$(basename "$vocabName") + mkdir -p "$out/lib/factor" "$TMPDIR/.cache" + export XDG_CACHE_HOME="$TMPDIR/.cache" + + factor "${deployScript}" "./$vocabName" "$out/lib/factor" + cp "$TMPDIR/factor-temp"/*.image "$out/lib/factor/$vocabBaseName" + runHook postBuild + ''; + + __structuredAttrs = true; + + installPhase = + attrs.installPhase or ( + '' + runHook preInstall + '' + + (lib.optionalString finalAttrs.enableUI '' + # Set Gdk pixbuf loaders file to the one from the build dependencies here + unset GDK_PIXBUF_MODULE_FILE + # Defined in gdk-pixbuf setup hook + findGdkPixbufLoaders "${librsvg}" + appendToVar makeWrapperArgs --set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" + appendToVar makeWrapperArgs --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib + '') + + (lib.optionalString (wrapped-factor.runtimeLibs != [ ])) '' + appendToVar makeWrapperArgs --prefix LD_LIBRARY_PATH : "${lib.makeLibraryPath wrapped-factor.runtimeLibs}" + '' + + '' + mkdir -p "$out/bin" + makeWrapper "$out/lib/factor/$vocabBaseName/$vocabBaseName" \ + "$out/bin/$binName" \ + --prefix PATH : "${lib.makeBinPath runtimePaths}" \ + "''${makeWrapperArgs[@]}" + runHook postInstall + '' + ); + + passthru = { + vocab = finalAttrs.src; + } // attrs.passthru or { }; + + meta = { + platforms = wrapped-factor.meta.platforms; + mainProgram = finalAttrs.binName; + } // attrs.meta or { }; + } +) diff --git a/pkgs/development/compilers/factor-lang/mk-vocab.nix b/pkgs/development/compilers/factor-lang/mk-vocab.nix new file mode 100644 index 000000000000..9d5925aa6de0 --- /dev/null +++ b/pkgs/development/compilers/factor-lang/mk-vocab.nix @@ -0,0 +1,59 @@ +{ + stdenv, +}@initAttrs: + +drvArgs: + +(stdenv.mkDerivation drvArgs).overrideAttrs ( + finalAttrs: + { + name ? "${finalAttrs.pname}-${finalAttrs.version}", + vocabName ? finalAttrs.pname or name, + vocabRoot ? "extra", + # Runtime libraries needed to run this vocab, handed to runtime wrapper + extraLibs ? [ ], + # Extra vocabularies, handed to runtime wrapper + extraVocabs ? [ ], + # Extra binaries in PATH, handed to runtime wrapper + extraPaths ? [ ], + ... + }@attrs: + { + inherit vocabName vocabRoot; + installPhase = + # Default installer + # 1. If lib/factor// exists, copy all vocab roots + # under lib/factor/* to out/. + # 2. If exists, copy all directories next to to + # out/. + # These two carry over package-defined vocabs that the name-giving vocab + # depends on. + # 3. Otherwise, copy all .factor and .txt files to out/. For simple + # single-vocab packages. + attrs.installPhase or '' + runHook preInstall + mkdir -p "$out/lib/factor/${finalAttrs.vocabRoot}/${finalAttrs.vocabName}" + if [ -d "lib/factor/${finalAttrs.vocabRoot}/${finalAttrs.vocabName}" ]; then + find lib/factor -mindepth 1 -maxdepth 1 -type d -exec \ + cp -r -t "$out/lib/factor" {} \+ + elif [ -d "${finalAttrs.vocabName}" ]; then + fname="${finalAttrs.vocabName}" + base=$(basename "${finalAttrs.vocabName}") + root=''${fname%$base} + root=''${root:-.} + find "$root" -mindepth 1 -maxdepth 1 -type -d \ + -not \( -name bin -or -name doc -or -name lib \) -exec \ + cp -r -t "$out/lib/factor/${finalAttrs.vocabRoot}" {} \+ + else + cp *.factor *.txt "$out/lib/factor/${finalAttrs.vocabRoot}/${finalAttrs.vocabName}" + fi + runHook postInstall + ''; + + passthru = { + inherit extraLibs extraVocabs extraPaths; + }; + + meta = attrs.meta or { }; + } +) diff --git a/pkgs/development/compilers/factor-lang/scope.nix b/pkgs/development/compilers/factor-lang/scope.nix deleted file mode 100644 index f44078fcd809..000000000000 --- a/pkgs/development/compilers/factor-lang/scope.nix +++ /dev/null @@ -1,24 +0,0 @@ -{ - lib, - pkgs, - overrides ? (self: super: { }), -}: - -let - inside = ( - self: - let - callPackage = pkgs.newScope self; - in - { - interpreter = callPackage ./factor99.nix { inherit (pkgs) stdenv; }; - - # Convenience access for using the returned attribute the same way as the - # interpreter derivation. Takes a list of runtime libraries as its only - # argument. - inherit (self.interpreter) withLibs; - } - ); - extensible-self = lib.makeExtensible (lib.extends overrides inside); -in -extensible-self diff --git a/pkgs/development/compilers/factor-lang/unwrapped.nix b/pkgs/development/compilers/factor-lang/unwrapped.nix new file mode 100644 index 000000000000..8d7b6dae6661 --- /dev/null +++ b/pkgs/development/compilers/factor-lang/unwrapped.nix @@ -0,0 +1,110 @@ +{ + lib, + stdenv, + fetchurl, + makeWrapper, + curl, + git, + ncurses, + tzdata, + unzip, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "factor-lang"; + version = "0.99"; + + src = fetchurl { + url = "https://downloads.factorcode.org/releases/${finalAttrs.version}/factor-src-${finalAttrs.version}.zip"; + sha256 = "f5626bb3119bd77de9ac3392fdbe188bffc26557fab3ea34f7ca21e372a8443e"; + }; + + patches = [ + # Use full path to image while bootstrapping + ./staging-command-line-0.99-pre.patch + # Point work vocabulary root to a writable location + ./workdir-0.99-pre.patch + # Patch hard-coded FHS paths + ./adjust-paths-in-unit-tests.patch + # Avoid using /sbin/ldconfig + ./ld.so.cache-from-env.patch + ]; + + nativeBuildInputs = [ + git + makeWrapper + curl + unzip + ]; + + postPatch = '' + sed -ie '4i GIT_LABEL = heads/master-'$(< git-id) GNUmakefile + # Some other hard-coded paths to fix: + substituteInPlace extra/tzinfo/tzinfo.factor \ + --replace-fail '/usr/share/zoneinfo' '${tzdata}/share/zoneinfo' + + substituteInPlace extra/terminfo/terminfo.factor \ + --replace-fail '/usr/share/terminfo' '${ncurses.out}/share/terminfo' + + # update default paths in fuel-listener.el for fuel mode + substituteInPlace misc/fuel/fuel-listener.el \ + --replace-fail '(defcustom fuel-factor-root-dir nil' "(defcustom fuel-factor-root-dir \"$out/lib/factor\"" + ''; + + dontConfigure = true; + + preBuild = '' + patchShebangs ./build.sh + # Factor uses XDG_CACHE_HOME for cache during compilation. + # We can't have that. So, set it to $TMPDIR/.cache + export XDG_CACHE_HOME=$TMPDIR/.cache + mkdir -p $XDG_CACHE_HOME + ''; + + makeTarget = "linux-x86-64"; + + postBuild = '' + printf "First build from upstream boot image\n" >&2 + ./build.sh bootstrap + printf "Rebuild boot image\n" >&2 + ./factor -script -e='"unix-x86.64" USING: system bootstrap.image memory ; make-image save 0 exit' + printf "Second build from local boot image\n" >&2 + ./build.sh bootstrap + ''; + + installPhase = '' + runHook preInstall + mkdir -p $out/lib/factor $out/share/emacs/site-lisp + cp -r factor factor.image libfactor.a libfactor-ffi-test.so \ + boot.*.image LICENSE.txt README.md basis core extra misc \ + $out/lib/factor + + # install fuel mode for emacs + ln -r -s $out/lib/factor/misc/fuel/*.el $out/share/emacs/site-lisp + runHook postInstall + ''; + + meta = with lib; { + homepage = "https://factorcode.org/"; + description = "A concatenative, stack-based programming language"; + longDescription = '' + The Factor programming language is a concatenative, stack-based + programming language with high-level features including dynamic types, + extensible syntax, macros, and garbage collection. On a practical side, + Factor has a full-featured library, supports many different platforms, and + has been extensively documented. + + The implementation is fully compiled for performance, while still + supporting interactive development. Factor applications are portable + between all common platforms. Factor can deploy stand-alone applications + on all platforms. Full source code for the Factor project is available + under a BSD license. + ''; + license = licenses.bsd2; + maintainers = with maintainers; [ + vrthra + spacefrogg + ]; + platforms = [ "x86_64-linux" ]; + }; +}) diff --git a/pkgs/development/compilers/factor-lang/wrapper.nix b/pkgs/development/compilers/factor-lang/wrapper.nix new file mode 100644 index 000000000000..354eac944923 --- /dev/null +++ b/pkgs/development/compilers/factor-lang/wrapper.nix @@ -0,0 +1,183 @@ +{ + lib, + stdenv, + makeWrapper, + buildEnv, + factor-unwrapped, + cairo, + freealut, + gdk-pixbuf, + glib, + gnome2, + gtk2-x11, + libGL, + libGLU, + librsvg, + graphviz, + libogg, + libvorbis, + openal, + openssl, + pango, + pcre, + udis86, + zlib, + # Enable factor GUI support + guiSupport ? true, + # Libraries added to ld.so.cache + extraLibs ? [ ], + # Packages added to path (and ld.so.cache) + binPackages ? [ ], + # Extra vocabularies added to out/lib/factor + extraVocabs ? [ ], + # Enable default libs and bins to run most of the standard library code. + enableDefaults ? true, + doInstallCheck ? true, +}: +let + inherit (lib) optional optionals optionalString; + # missing from lib/strings + escapeNixString = s: lib.escape [ "$" ] (builtins.toJSON s); + toFactorArgs = x: lib.concatStringsSep " " (map escapeNixString x); + defaultLibs = optionals enableDefaults [ + libogg + libvorbis + openal + openssl + pcre + udis86 + zlib + ]; + defaultBins = optionals enableDefaults [ graphviz ]; + runtimeLibs = + defaultLibs + ++ extraLibs + ++ binPackages + ++ (lib.flatten (map (v: v.extraLibs or [ ]) extraVocabs)) + ++ optionals guiSupport [ + cairo + freealut + gdk-pixbuf + glib + gnome2.gtkglext + gtk2-x11 + libGL + libGLU + pango + ]; + bins = binPackages ++ defaultBins ++ (lib.flatten (map (v: v.extraPaths or [ ]) extraVocabs)); + vocabTree = buildEnv { + name = "${factor-unwrapped.pname}-vocabs"; + ignoreCollisions = true; + pathsToLink = map (r: "/lib/factor/${r}") [ + "basis" + "core" + "extra" + ]; + paths = [ factor-unwrapped ] ++ extraVocabs; + }; + +in +stdenv.mkDerivation (finalAttrs: { + pname = "${factor-unwrapped.pname}-env"; + inherit (factor-unwrapped) version; + + nativeBuildInputs = [ makeWrapper ]; + buildInputs = optional guiSupport gdk-pixbuf; + + dontUnpack = true; + + installPhase = + '' + runHook preInstall + '' + + optionalString guiSupport '' + # Set Gdk pixbuf loaders file to the one from the build dependencies here + unset GDK_PIXBUF_MODULE_FILE + # Defined in gdk-pixbuf setup hook + findGdkPixbufLoaders "${librsvg}" + makeWrapperArgs+=(--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE") + '' + + '' + makeWrapperArgs+=( + --prefix LD_LIBRARY_PATH : /run/opengl-driver/lib:${lib.makeLibraryPath runtimeLibs} + --prefix PATH : ${lib.makeBinPath bins}) + mkdir -p "$out/bin" "$out/share" + cp -r "${factor-unwrapped}/lib" "$out/" + cp -r "${factor-unwrapped}/share/emacs" "$out/share/" + chmod -R u+w "$out/lib" "$out/share" + ( + cd ${vocabTree} + for f in "lib/factor/"* ; do + rm -r "$out/$f" + ln -s "${vocabTree}/$f" "$out/$f" + done + ) + + # There is no ld.so.cache in NixOS so we construct one + # out of known libraries. The side effect is that find-lib + # will work only on the known libraries. There does not seem + # to be a generic solution here. + find $(echo ${ + lib.makeLibraryPath ([ stdenv.cc.libc ] ++ runtimeLibs) + } | sed -e 's#:# #g') -name \*.so.\* > $TMPDIR/so.lst + (echo $(cat $TMPDIR/so.lst | wc -l) "libs found in cache \`/etc/ld.so.cache'"; + for l in $(<$TMPDIR/so.lst); do + echo " $(basename $l) (libc6,x86-64) => $l"; + done)> $out/lib/factor/ld.so.cache + + # Create a wrapper in bin/ and lib/factor/ + wrapProgram "$out/lib/factor/factor" \ + --argv0 factor \ + --set FACTOR_LD_SO_CACHE "$out/lib/factor/ld.so.cache" \ + "''${makeWrapperArgs[@]}" + mv $out/lib/factor/factor.image $out/lib/factor/.factor-wrapped.image + cp $out/lib/factor/factor $out/bin/ + + # Emacs fuel expects the image being named `factor.image` in the factor base dir + ln -rs $out/lib/factor/.factor-wrapped.image $out/lib/factor/factor.image + + # Update default paths in fuel-listener.el to new output + sed -E -i -e 's#(\(defcustom fuel-factor-root-dir ").*(")#'"\1$out/lib/factor\2#" \ + "$out/share/emacs/site-lisp/fuel-listener.el" + runHook postInstall + ''; + + inherit doInstallCheck; + disabledTests = toFactorArgs [ + "io.files.info.unix" + "io.launcher.unix" + "io.ports" + "io.sockets" + "io.sockets.unix" + "io.sockets.secure.openssl" + "io.sockets.secure.unix" + ]; + installCheckPhase = '' + runHook preCheck + export HOME=$TMPDIR + $out/bin/factor -e='USING: tools.test tools.test.private + zealot.factor sequences namespaces formatting ; + zealot-core-vocabs + { ${finalAttrs.disabledTests} } without + "compiler" suffix + [ test-vocab ] each :test-failures + test-failures get length "Number of failed tests: %d\n" printf' + runHook postCheck + ''; + + passthru = { + inherit + defaultLibs + defaultBins + extraLibs + runtimeLibs + binPackages + extraVocabs + ; + }; + + meta = factor-unwrapped.meta // { + mainProgram = "factor"; + }; +}) diff --git a/pkgs/development/compilers/llvm/common/default.nix b/pkgs/development/compilers/llvm/common/default.nix index a61ad6b085ba..b8b795bc6c54 100644 --- a/pkgs/development/compilers/llvm/common/default.nix +++ b/pkgs/development/compilers/llvm/common/default.nix @@ -228,7 +228,7 @@ let lib.recurseIntoAttrs { llef = callPackage ./lldb-plugins/llef.nix { }; } ); - lldb = callPackage ./lldb.nix ( + lldb = callPackage ./lldb ( { } // lib.optionalAttrs (lib.versions.major metadata.release_version == "16") { diff --git a/pkgs/development/compilers/llvm/common/lldb.nix b/pkgs/development/compilers/llvm/common/lldb/default.nix similarity index 82% rename from pkgs/development/compilers/llvm/common/lldb.nix rename to pkgs/development/compilers/llvm/common/lldb/default.nix index 7b436d7aa1df..3be8102e5315 100644 --- a/pkgs/development/compilers/llvm/common/lldb.nix +++ b/pkgs/development/compilers/llvm/common/lldb/default.nix @@ -32,25 +32,6 @@ }: let - src' = - if monorepoSrc != null then - runCommand "lldb-src-${version}" { inherit (monorepoSrc) passthru; } ( - '' - mkdir -p "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "14") '' - cp -r ${monorepoSrc}/cmake "$out" - '' - + '' - cp -r ${monorepoSrc}/lldb "$out" - '' - + lib.optionalString (lib.versionAtLeast release_version "19" && enableManpages) '' - mkdir -p "$out/llvm" - cp -r ${monorepoSrc}/llvm/docs "$out/llvm/docs" - '' - ) - else - src; vscodeExt = { name = if lib.versionAtLeast release_version "18" then "lldb-dap" else "lldb-vscode"; version = if lib.versionAtLeast release_version "18" then "0.2.0" else "0.1.0"; @@ -58,12 +39,31 @@ let in stdenv.mkDerivation ( - rec { + finalAttrs: + { passthru.monorepoSrc = monorepoSrc; pname = "lldb"; inherit version; - src = src'; + src = + if monorepoSrc != null then + runCommand "lldb-src-${version}" { inherit (monorepoSrc) passthru; } ( + '' + mkdir -p "$out" + '' + + lib.optionalString (lib.versionAtLeast release_version "14") '' + cp -r ${monorepoSrc}/cmake "$out" + '' + + '' + cp -r ${monorepoSrc}/lldb "$out" + '' + + lib.optionalString (lib.versionAtLeast release_version "19" && enableManpages) '' + mkdir -p "$out/llvm" + cp -r ${monorepoSrc}/llvm/docs "$out/llvm/docs" + '' + ) + else + src; # There is no `lib` output because some of the files in `$out/lib` depend on files in `$out/bin`. # For example, `$out/lib/python3.12/site-packages/lldb/lldb-argdumper` is a symlink to `$out/bin/lldb-argdumper`. @@ -73,7 +73,7 @@ stdenv.mkDerivation ( "dev" ]; - sourceRoot = lib.optional (lib.versionAtLeast release_version "13") "${src.name}/${pname}"; + sourceRoot = lib.optional (lib.versionAtLeast release_version "13") "${finalAttrs.src.name}/${finalAttrs.pname}"; patches = let @@ -130,7 +130,7 @@ stdenv.mkDerivation ( ++ lib.optional (lib.versionOlder release_version "14") ( getVersionFile "lldb/gnu-install-dirs.patch" ) - ++ lib.optional (lib.versionAtLeast release_version "14") ./lldb/gnu-install-dirs.patch; + ++ lib.optional (lib.versionAtLeast release_version "14") ./gnu-install-dirs.patch; nativeBuildInputs = [ @@ -177,25 +177,25 @@ stdenv.mkDerivation ( cmakeFlags = [ - "-DLLDB_INCLUDE_TESTS=${if doCheck then "YES" else "NO"}" - "-DLLVM_ENABLE_RTTI=OFF" - "-DClang_DIR=${lib.getDev libclang}/lib/cmake" - "-DLLVM_EXTERNAL_LIT=${lit}/bin/lit" + (lib.cmakeBool "LLDB_INCLUDE_TESTS" finalAttrs.finalPackage.doCheck) + (lib.cmakeBool "LLVM_ENABLE_RTTI" false) + (lib.cmakeFeature "Clang_DIR" "${lib.getDev libclang}/lib/cmake") + (lib.cmakeFeature "LLVM_EXTERNAL_LIT" "${lit}/bin/lit") ] ++ lib.optionals stdenv.hostPlatform.isDarwin [ - "-DLLDB_USE_SYSTEM_DEBUGSERVER=ON" + (lib.cmakeBool "LLDB_USE_SYSTEM_DEBUGSERVER" true) ] ++ lib.optionals (!stdenv.hostPlatform.isDarwin) [ - "-DLLDB_CODESIGN_IDENTITY=" # codesigning makes nondeterministic + (lib.cmakeFeature "LLDB_CODESIGN_IDENTITY" "") # codesigning makes nondeterministic ] ++ lib.optionals (lib.versionAtLeast release_version "17") [ - "-DCLANG_RESOURCE_DIR=../../../../${lib.getLib libclang}" + (lib.cmakeFeature "CLANG_RESOURCE_DIR" "../../../../${lib.getLib libclang}") ] ++ lib.optionals enableManpages ( [ - "-DLLVM_ENABLE_SPHINX=ON" - "-DSPHINX_OUTPUT_MAN=ON" - "-DSPHINX_OUTPUT_HTML=OFF" + (lib.cmakeBool "LLVM_ENABLE_SPHINX" true) + (lib.cmakeBool "SPHINX_OUTPUT_MAN" true) + (lib.cmakeBool "SPHINX_OUTPUT_HTML" false) ] ++ lib.optionals (lib.versionAtLeast release_version "15") [ # docs reference `automodapi` but it's not added to the extensions list when @@ -203,12 +203,12 @@ stdenv.mkDerivation ( # https://github.com/llvm/llvm-project/blob/af6ec9200b09039573d85e349496c4f5b17c3d7f/lldb/docs/conf.py#L54 # # so, we just ignore the resulting errors - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" + (lib.cmakeBool "SPHINX_WARNINGS_AS_ERRORS" false) ] ) - ++ lib.optionals doCheck [ - "-DLLDB_TEST_C_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc" - "-DLLDB_TEST_CXX_COMPILER=${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++" + ++ lib.optionals finalAttrs.finalPackage.doCheck [ + (lib.cmakeFeature "LLDB_TEST_C_COMPILER" "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}cc") + (lib.cmakeFeature "-DLLDB_TEST_CXX_COMPILER" "${stdenv.cc}/bin/${stdenv.cc.targetPrefix}c++") ] ++ devExtraCmakeFlags; diff --git a/pkgs/development/compilers/llvm/common/mlir/default.nix b/pkgs/development/compilers/llvm/common/mlir/default.nix index b0c94ea462bf..40733ac29bb5 100644 --- a/pkgs/development/compilers/llvm/common/mlir/default.nix +++ b/pkgs/development/compilers/llvm/common/mlir/default.nix @@ -11,20 +11,21 @@ libxml2, libllvm, version, - doCheck ? - ( - !stdenv.hostPlatform.isx86_32 # TODO: why - ) - && (!stdenv.hostPlatform.isMusl), devExtraCmakeFlags ? [ ], }: -stdenv.mkDerivation rec { +stdenv.mkDerivation (finalAttrs: { pname = "mlir"; - inherit version doCheck; + inherit version; + + doCheck = + ( + !stdenv.hostPlatform.isx86_32 # TODO: why + ) + && (!stdenv.hostPlatform.isMusl); # Blank llvm dir just so relative path works - src = runCommand "${pname}-src-${version}" { inherit (monorepoSrc) passthru; } ( + src = runCommand "${finalAttrs.pname}-src-${version}" { inherit (monorepoSrc) passthru; } ( '' mkdir -p "$out" '' @@ -39,7 +40,7 @@ stdenv.mkDerivation rec { '' ); - sourceRoot = "${src.name}/mlir"; + sourceRoot = "${finalAttrs.src.name}/mlir"; patches = [ ./gnu-install-dirs.patch @@ -57,27 +58,27 @@ stdenv.mkDerivation rec { cmakeFlags = [ - "-DLLVM_BUILD_TOOLS=ON" + (lib.cmakeBool "LLVM_BUILD_TOOLS" true) # Install headers as well - "-DLLVM_INSTALL_TOOLCHAIN_ONLY=OFF" - "-DMLIR_TOOLS_INSTALL_DIR=${placeholder "out"}/bin/" - "-DLLVM_ENABLE_IDE=OFF" - "-DMLIR_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/mlir" - "-DMLIR_INSTALL_CMAKE_DIR=${placeholder "dev"}/lib/cmake/mlir" - "-DLLVM_BUILD_TESTS=${if doCheck then "ON" else "OFF"}" - "-DLLVM_ENABLE_FFI=ON" - "-DLLVM_HOST_TRIPLE=${stdenv.hostPlatform.config}" - "-DLLVM_DEFAULT_TARGET_TRIPLE=${stdenv.hostPlatform.config}" - "-DLLVM_ENABLE_DUMP=ON" - "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.tblgen}/bin/llvm-tblgen" - "-DMLIR_TABLEGEN_EXE=${buildLlvmTools.tblgen}/bin/mlir-tblgen" + (lib.cmakeBool "LLVM_INSTALL_TOOLCHAIN_ONLY" false) + (lib.cmakeFeature "MLIR_TOOLS_INSTALL_DIR" "${placeholder "out"}/bin/") + (lib.cmakeBool "LLVM_ENABLE_IDE" false) + (lib.cmakeFeature "MLIR_INSTALL_PACKAGE_DIR" "${placeholder "dev"}/lib/cmake/mlir") + (lib.cmakeFeature "MLIR_INSTALL_CMAKE_DIR" "${placeholder "dev"}/lib/cmake/mlir") + (lib.cmakeBool "LLVM_BUILD_TESTS" finalAttrs.finalPackage.doCheck) + (lib.cmakeBool "LLVM_ENABLE_FFI" true) + (lib.cmakeFeature "LLVM_HOST_TRIPLE" stdenv.hostPlatform.config) + (lib.cmakeFeature "LLVM_DEFAULT_TARGET_TRIPLE" stdenv.hostPlatform.config) + (lib.cmakeBool "LLVM_ENABLE_DUMP" true) + (lib.cmakeFeature "LLVM_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/llvm-tblgen") + (lib.cmakeFeature "MLIR_TABLEGEN_EXE" "${buildLlvmTools.tblgen}/bin/mlir-tblgen") (lib.cmakeBool "LLVM_BUILD_LLVM_DYLIB" (!stdenv.hostPlatform.isStatic)) ] ++ lib.optionals stdenv.hostPlatform.isStatic [ # Disables building of shared libs, -fPIC is still injected by cc-wrapper - "-DLLVM_ENABLE_PIC=OFF" - "-DLLVM_BUILD_STATIC=ON" - "-DLLVM_LINK_LLVM_DYLIB=OFF" + (lib.cmakeBool "LLVM_ENABLE_PIC" false) + (lib.cmakeBool "LLVM_BUILD_STATIC" true) + (lib.cmakeBool "LLVM_LINK_LLVM_DYLIB" false) ] ++ devExtraCmakeFlags; @@ -99,4 +100,4 @@ stdenv.mkDerivation rec { existing compilers together. ''; }; -} +}) diff --git a/pkgs/development/factor-vocabs/bresenham/default.nix b/pkgs/development/factor-vocabs/bresenham/default.nix new file mode 100644 index 000000000000..97df1f326400 --- /dev/null +++ b/pkgs/development/factor-vocabs/bresenham/default.nix @@ -0,0 +1,26 @@ +{ + lib, + factorPackages, + fetchFromGitHub, + curl, + gnutls, +}: + +factorPackages.buildFactorVocab { + pname = "bresenham"; + version = "dev"; + + src = fetchFromGitHub { + owner = "Capital-EX"; + repo = "bresenham"; + rev = "58d76b31a17f547e19597a09d02d46a742bf6808"; + hash = "sha256-cfQOlB877sofxo29ahlRHVpN3wYTUc/rFr9CJ89dsME="; + }; + + meta = { + description = "Bresenham's line interpolation algorithm"; + homepage = "https://github.com/Capital-EX/bresenham"; + license = lib.licenses.bsd2; + maintainers = with lib.maintainers; [ spacefrogg ]; + }; +} diff --git a/pkgs/development/interpreters/python/default.nix b/pkgs/development/interpreters/python/default.nix index 60b7bd64731b..b16381009828 100644 --- a/pkgs/development/interpreters/python/default.nix +++ b/pkgs/development/interpreters/python/default.nix @@ -197,8 +197,6 @@ inherit passthruFun; }; - pypy39_prebuilt = throw "pypy 3.9 has been removed, use pypy 3.10 instead"; # Added 2025-01-03 - pypy310_prebuilt = callPackage ./pypy/prebuilt.nix { # Not included at top-level self = __splicedPackages.pythonInterpreters.pypy310_prebuilt; @@ -219,4 +217,7 @@ inherit passthruFun; }; } + // lib.optionalAttrs config.allowAliases { + pypy39_prebuilt = throw "pypy 3.9 has been removed, use pypy 3.10 instead"; # Added 2025-01-03 + } ) diff --git a/pkgs/development/python-modules/ansible/default.nix b/pkgs/development/python-modules/ansible/default.nix index df8c6e7b8400..0a6a6c4fed1c 100644 --- a/pkgs/development/python-modules/ansible/default.nix +++ b/pkgs/development/python-modules/ansible/default.nix @@ -15,6 +15,7 @@ textfsm, ttp, xmltodict, + passlib, # optionals withJunos ? false, @@ -47,6 +48,7 @@ buildPythonPackage { [ # Support ansible collections by default, make all others optional # ansible.netcommon + passlib jxmlease ncclient netaddr diff --git a/pkgs/development/python-modules/docling-serve/default.nix b/pkgs/development/python-modules/docling-serve/default.nix index 3d8d487cf8ff..4a521fbadbec 100644 --- a/pkgs/development/python-modules/docling-serve/default.nix +++ b/pkgs/development/python-modules/docling-serve/default.nix @@ -12,6 +12,10 @@ python-multipart, uvicorn, websockets, + gradio, + nodejs, + which, + withUI ? false, }: buildPythonPackage rec { @@ -43,7 +47,15 @@ buildPythonPackage rec { python-multipart uvicorn websockets - ]; + ] ++ lib.optionals withUI optional-dependencies.ui; + + optional-dependencies = { + ui = [ + gradio + nodejs + which + ]; + }; pythonImportsCheck = [ "docling_serve" diff --git a/pkgs/development/python-modules/snakemake-interface-executor-plugins/default.nix b/pkgs/development/python-modules/snakemake-interface-executor-plugins/default.nix index 48c8eb4bab56..fd8982e9fdd0 100644 --- a/pkgs/development/python-modules/snakemake-interface-executor-plugins/default.nix +++ b/pkgs/development/python-modules/snakemake-interface-executor-plugins/default.nix @@ -10,14 +10,14 @@ buildPythonPackage rec { pname = "snakemake-interface-executor-plugins"; - version = "9.3.3"; + version = "9.3.5"; pyproject = true; src = fetchFromGitHub { owner = "snakemake"; repo = "snakemake-interface-executor-plugins"; tag = "v${version}"; - hash = "sha256-1QmpL+YhpH7CmMKI9C60GnpVBveq9IPM2mrlMOdjUs4="; + hash = "sha256-mmaMzb+nhnLb06OGbjjdVeEQQc81OjVNdrUXdToHJ7Y="; }; build-system = [ poetry-core ]; diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index ae0a409a1b39..3a5d8e40a3fe 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -584,6 +584,7 @@ mapAliases { ### F ### + factor-lang-scope = throw "'factor-lang-scope' has been renamed to 'factorPackages'"; # added 2024-11-28 fahcontrol = throw "fahcontrol has been removed because the download is no longer available"; # added 2024-09-24 fahviewer = throw "fahviewer has been removed because the download is no longer available"; # added 2024-09-24 fam = throw "'fam' (aliased to 'gamin') has been removed as it is unmaintained upstream"; # Added 2024-04-19 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 9753eda1b4ac..2a732d145d65 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -9272,8 +9272,8 @@ with pkgs; inherit (darwin.apple_sdk.frameworks) Carbon OpenGL; }; - factor-lang-scope = callPackage ../development/compilers/factor-lang/scope.nix { }; - factor-lang = factor-lang-scope.interpreter; + factorPackages = callPackage ./factor-packages.nix { }; + factor-lang = factorPackages.factor-lang; far2l = callPackage ../applications/misc/far2l { inherit (darwin.apple_sdk.frameworks) diff --git a/pkgs/top-level/factor-packages.nix b/pkgs/top-level/factor-packages.nix new file mode 100644 index 000000000000..eae05e694130 --- /dev/null +++ b/pkgs/top-level/factor-packages.nix @@ -0,0 +1,43 @@ +{ + lib, + pkgs, + overrides ? (self: super: { }), +}: + +let + inside = + self: + let + callPackage = pkgs.newScope self; + in + lib.recurseIntoAttrs { + + buildFactorApplication = + callPackage ../development/compilers/factor-lang/mk-factor-application.nix + { }; + buildFactorVocab = callPackage ../development/compilers/factor-lang/mk-vocab.nix { }; + + factor-unwrapped = callPackage ../development/compilers/factor-lang/unwrapped.nix { }; + + factor-lang = callPackage ../development/compilers/factor-lang/wrapper.nix { }; + factor-no-gui = callPackage ../development/compilers/factor-lang/wrapper.nix { + guiSupport = false; + }; + factor-minimal = callPackage ../development/compilers/factor-lang/wrapper.nix { + enableDefaults = false; + guiSupport = false; + }; + factor-minimal-gui = callPackage ../development/compilers/factor-lang/wrapper.nix { + enableDefaults = false; + }; + + # Vocabularies + bresenham = callPackage ../development/factor-vocabs/bresenham { }; + + } + // lib.optionalAttrs pkgs.config.allowAliases { + interpreter = builtins.throw "factorPackages now offers various wrapped factor runtimes (see documentation) and the buildFactorApplication helper."; + }; + extensible-self = lib.makeExtensible (lib.extends overrides inside); +in +extensible-self