mirror of
https://github.com/NixOS/nixpkgs.git
synced 2026-07-06 17:13:24 -05:00
nim: huge refactor of packages (#496960)
This commit is contained in:
commit
abe4c0979b
24 changed files with 93 additions and 284 deletions
|
|
@ -70,6 +70,8 @@
|
||||||
- `rebuilderd` has been updated to 0.27.0 introducing breaking changes. See upstream changelog for details: [0.26.0](https://github.com/kpcyrd/rebuilderd/releases/tag/v0.26.0), [0.27.0](https://github.com/kpcyrd/rebuilderd/releases/tag/v0.27.0)
|
- `rebuilderd` has been updated to 0.27.0 introducing breaking changes. See upstream changelog for details: [0.26.0](https://github.com/kpcyrd/rebuilderd/releases/tag/v0.26.0), [0.27.0](https://github.com/kpcyrd/rebuilderd/releases/tag/v0.27.0)
|
||||||
|
|
||||||
- Starting with v14, `flameshot` will primarily utilise xdg-desktop-portal calls for screenshotting. This will directly affect users on X11 window managers due to the lack of a compatible portal with Screenshot feature. See [upstream changelog](https://github.com/flameshot-org/flameshot/releases/tag/v14.0.0) or [NixOS Flameshot](https://wiki.nixos.org/wiki/Flameshot) wiki page for workarounds.
|
- Starting with v14, `flameshot` will primarily utilise xdg-desktop-portal calls for screenshotting. This will directly affect users on X11 window managers due to the lack of a compatible portal with Screenshot feature. See [upstream changelog](https://github.com/flameshot-org/flameshot/releases/tag/v14.0.0) or [NixOS Flameshot](https://wiki.nixos.org/wiki/Flameshot) wiki page for workarounds.
|
||||||
|
- `nim1` and respective aliases have been removed due to entering EOL; please migrate to `nim` or `nim-unwrapped` (nim 2).
|
||||||
|
- `nim-2_0` & `nim-2_2` and respective aliases have been removed; please migrate to `nim` or `nim-unwrapped` (nim 2.2.10).
|
||||||
|
|
||||||
## Other Notable Changes {#sec-nixpkgs-release-26.11-notable-changes}
|
## Other Notable Changes {#sec-nixpkgs-release-26.11-notable-changes}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,8 @@
|
||||||
buildPackages,
|
buildPackages,
|
||||||
callPackage,
|
callPackage,
|
||||||
stdenv,
|
stdenv,
|
||||||
nim1,
|
nim,
|
||||||
nim2,
|
|
||||||
nim_builder,
|
nim_builder,
|
||||||
defaultNimVersion ? 2,
|
|
||||||
nimOverrides,
|
nimOverrides,
|
||||||
buildNimPackage,
|
buildNimPackage,
|
||||||
}:
|
}:
|
||||||
|
|
@ -17,6 +15,7 @@ let
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
__structuredAttrs = true;
|
__structuredAttrs = true;
|
||||||
doCheck = true;
|
doCheck = true;
|
||||||
|
|
||||||
configurePhase = ''
|
configurePhase = ''
|
||||||
runHook preConfigure
|
runHook preConfigure
|
||||||
export NIX_NIM_BUILD_INPUTS=''${pkgsHostTarget[@]} $NIX_NIM_BUILD_INPUTS
|
export NIX_NIM_BUILD_INPUTS=''${pkgsHostTarget[@]} $NIX_NIM_BUILD_INPUTS
|
||||||
|
|
@ -38,7 +37,7 @@ let
|
||||||
nim_builder --phase:install
|
nim_builder --phase:install
|
||||||
runHook postInstall
|
runHook postInstall
|
||||||
'';
|
'';
|
||||||
meta = { inherit (nim2.meta) maintainers platforms; };
|
meta = { inherit (nim.meta) maintainers platforms; };
|
||||||
};
|
};
|
||||||
|
|
||||||
fodFromLockEntry =
|
fodFromLockEntry =
|
||||||
|
|
@ -108,30 +107,34 @@ let
|
||||||
|
|
||||||
finalOverride =
|
finalOverride =
|
||||||
{
|
{
|
||||||
depsBuildBuild ? [ ],
|
|
||||||
nativeBuildInputs ? [ ],
|
|
||||||
nimFlags ? [ ],
|
nimFlags ? [ ],
|
||||||
requiredNimVersion ? defaultNimVersion,
|
|
||||||
passthru ? { },
|
passthru ? { },
|
||||||
|
nativeBuildInputs ? [ ],
|
||||||
|
depsBuildBuild ? [ ],
|
||||||
...
|
...
|
||||||
}:
|
}@args:
|
||||||
(
|
(
|
||||||
if requiredNimVersion == 1 then
|
#TODO: Remove at 26.11
|
||||||
{
|
if args ? requiredNimVersion then
|
||||||
depsBuildBuild = [ nim_builder ] ++ depsBuildBuild;
|
if args.requiredNimVersion == 2 then
|
||||||
nativeBuildInputs = [ nim1 ] ++ nativeBuildInputs;
|
lib.warn ''
|
||||||
}
|
`requiredNimVersion' is deprecated and will be removed in nixpkgs 26.11.
|
||||||
else if requiredNimVersion == 2 then
|
Please update your package to remove this.
|
||||||
{
|
''
|
||||||
depsBuildBuild = [ nim_builder ] ++ depsBuildBuild;
|
else
|
||||||
nativeBuildInputs = [ nim2 ] ++ nativeBuildInputs;
|
throw ''
|
||||||
}
|
`requiredNimVersion' ${toString args.requiredNimVersion} is not supported.
|
||||||
|
Ensure your package supports nim 2, and remove `requiredNimVersion'.
|
||||||
|
''
|
||||||
else
|
else
|
||||||
throw "requiredNimVersion ${toString requiredNimVersion} is not valid"
|
{ }
|
||||||
)
|
)
|
||||||
// {
|
// {
|
||||||
|
nativeBuildInputs = [ nim ] ++ nativeBuildInputs;
|
||||||
|
depsBuildBuild = [ nim_builder ] ++ depsBuildBuild;
|
||||||
nimFlags = lockFileNimFlags ++ nimFlags;
|
nimFlags = lockFileNimFlags ++ nimFlags;
|
||||||
passthru = passthru // {
|
passthru = passthru // {
|
||||||
|
|
||||||
# allow overriding the result of buildNimPackageArgs before this composition is applied
|
# allow overriding the result of buildNimPackageArgs before this composition is applied
|
||||||
# this allows overriding the lockFile for packages built using buildNimPackage
|
# this allows overriding the lockFile for packages built using buildNimPackage
|
||||||
# this is adapted from mkDerivationExtensible in stdenv.mkDerivation
|
# this is adapted from mkDerivationExtensible in stdenv.mkDerivation
|
||||||
|
|
|
||||||
|
|
@ -799,7 +799,7 @@ rec {
|
||||||
## `pkgs.writers.writeNim` usage example
|
## `pkgs.writers.writeNim` usage example
|
||||||
|
|
||||||
```nix
|
```nix
|
||||||
writeNim "hello-nim" { nim = pkgs.nim2; } ''
|
writeNim "hello-nim" { nim = pkgs.nim; } ''
|
||||||
echo "hello nim"
|
echo "hello nim"
|
||||||
'';
|
'';
|
||||||
```
|
```
|
||||||
|
|
@ -809,7 +809,7 @@ rec {
|
||||||
name:
|
name:
|
||||||
{
|
{
|
||||||
makeWrapperArgs ? [ ],
|
makeWrapperArgs ? [ ],
|
||||||
nim ? pkgs.nim2,
|
nim ? pkgs.nim,
|
||||||
nimCompileOptions ? { },
|
nimCompileOptions ? { },
|
||||||
strip ? true,
|
strip ? true,
|
||||||
}:
|
}:
|
||||||
|
|
|
||||||
|
|
@ -9,8 +9,6 @@ buildNimPackage (finalAttrs: {
|
||||||
pname = "mosdepth";
|
pname = "mosdepth";
|
||||||
version = "0.3.13";
|
version = "0.3.13";
|
||||||
|
|
||||||
requiredNimVersion = 1;
|
|
||||||
|
|
||||||
src = fetchFromGitHub {
|
src = fetchFromGitHub {
|
||||||
owner = "brentp";
|
owner = "brentp";
|
||||||
repo = "mosdepth";
|
repo = "mosdepth";
|
||||||
|
|
|
||||||
|
|
@ -1,31 +0,0 @@
|
||||||
diff --git a/config/nim.cfg b/config/nim.cfg
|
|
||||||
index 3b964d124..850ed0ed9 100644
|
|
||||||
--- a/config/nim.cfg
|
|
||||||
+++ b/config/nim.cfg
|
|
||||||
@@ -8,26 +8,12 @@
|
|
||||||
# Environment variables can be accessed like so:
|
|
||||||
# gcc.path %= "$CC_PATH"
|
|
||||||
|
|
||||||
-cc = gcc
|
|
||||||
-
|
|
||||||
# additional options always passed to the compiler:
|
|
||||||
--parallel_build: "0" # 0 to auto-detect number of processors
|
|
||||||
|
|
||||||
hint[LineTooLong]=off
|
|
||||||
#hint[XDeclaredButNotUsed]=off
|
|
||||||
|
|
||||||
-# Examples of how to setup a cross-compiler:
|
|
||||||
-
|
|
||||||
-# Cross-compiling for Raspberry Pi.
|
|
||||||
-# (This compiler is available in gcc-arm-linux-gnueabihf package on Ubuntu)
|
|
||||||
-arm.linux.gcc.exe = "arm-linux-gnueabihf-gcc"
|
|
||||||
-arm.linux.gcc.linkerexe = "arm-linux-gnueabihf-gcc"
|
|
||||||
-
|
|
||||||
-# For OpenWRT, you will also need to adjust PATH to point to your toolchain.
|
|
||||||
-mips.linux.gcc.exe = "mips-openwrt-linux-gcc"
|
|
||||||
-mips.linux.gcc.linkerexe = "mips-openwrt-linux-gcc"
|
|
||||||
-
|
|
||||||
-
|
|
||||||
path="$lib/deprecated/core"
|
|
||||||
path="$lib/deprecated/pure"
|
|
||||||
path="$lib/pure/collections"
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
nim-unwrapped-1,
|
|
||||||
nim,
|
|
||||||
}:
|
|
||||||
|
|
||||||
nim.passthru.wrapNim {
|
|
||||||
nimUnwrapped = nim-unwrapped-1;
|
|
||||||
patches = [ ./nim.cfg.patch ];
|
|
||||||
}
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
||||||
{
|
|
||||||
nim-unwrapped-2_0,
|
|
||||||
nim-2_2,
|
|
||||||
}:
|
|
||||||
|
|
||||||
nim-2_2.passthru.wrapNim {
|
|
||||||
nimUnwrapped = nim-unwrapped-2_0;
|
|
||||||
inherit (nim-2_2) patches;
|
|
||||||
}
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
diff --git a/compiler/modulepaths.nim b/compiler/modulepaths.nim
|
|
||||||
index fa8fab08a..63b0cb44d 100644
|
|
||||||
--- a/compiler/modulepaths.nim
|
|
||||||
+++ b/compiler/modulepaths.nim
|
|
||||||
@@ -73,6 +73,17 @@ proc checkModuleName*(conf: ConfigRef; n: PNode; doLocalError=true): FileIndex =
|
|
||||||
else:
|
|
||||||
result = fileInfoIdx(conf, fullPath)
|
|
||||||
|
|
||||||
+proc rot13(result: var string) =
|
|
||||||
+ # don't mangle .nim
|
|
||||||
+ let finalIdx =
|
|
||||||
+ if result.endsWith(".nim"): result.len - 4
|
|
||||||
+ else: result.len
|
|
||||||
+ for i, c in result[0..<finalIdx]:
|
|
||||||
+ case c
|
|
||||||
+ of 'a'..'m', 'A'..'M': result[i] = char(c.uint8 + 13)
|
|
||||||
+ of 'n'..'z', 'N'..'Z': result[i] = char(c.uint8 - 13)
|
|
||||||
+ else: discard
|
|
||||||
+
|
|
||||||
proc mangleModuleName*(conf: ConfigRef; path: AbsoluteFile): string =
|
|
||||||
## Mangle a relative module path to avoid path and symbol collisions.
|
|
||||||
##
|
|
||||||
@@ -81,9 +92,11 @@ proc mangleModuleName*(conf: ConfigRef; path: AbsoluteFile): string =
|
|
||||||
##
|
|
||||||
## Example:
|
|
||||||
## `foo-#head/../bar` becomes `@foo-@hhead@s..@sbar`
|
|
||||||
- "@m" & relativeTo(path, conf.projectPath).string.multiReplace(
|
|
||||||
+ result = "@m" & relativeTo(path, conf.projectPath).string.multiReplace(
|
|
||||||
{$os.DirSep: "@s", $os.AltSep: "@s", "#": "@h", "@": "@@", ":": "@c"})
|
|
||||||
+ rot13(result)
|
|
||||||
|
|
||||||
proc demangleModuleName*(path: string): string =
|
|
||||||
## Demangle a relative module path.
|
|
||||||
result = path.multiReplace({"@@": "@", "@h": "#", "@s": "/", "@m": "", "@c": ":"})
|
|
||||||
+ rot13(result)
|
|
||||||
diff --git a/compiler/msgs.nim b/compiler/msgs.nim
|
|
||||||
index ae4bcfcb8..1ad7e5c08 100644
|
|
||||||
--- a/compiler/msgs.nim
|
|
||||||
+++ b/compiler/msgs.nim
|
|
||||||
@@ -661,8 +661,10 @@ proc uniqueModuleName*(conf: ConfigRef; fid: FileIndex): string =
|
|
||||||
for i in 0..<trunc:
|
|
||||||
let c = rel[i]
|
|
||||||
case c
|
|
||||||
- of 'a'..'z':
|
|
||||||
- result.add c
|
|
||||||
+ of 'a'..'m':
|
|
||||||
+ result.add char(c.uint8 + 13)
|
|
||||||
+ of 'n'..'z':
|
|
||||||
+ result.add char(c.uint8 - 13)
|
|
||||||
of {os.DirSep, os.AltSep}:
|
|
||||||
result.add 'Z' # because it looks a bit like '/'
|
|
||||||
of '.':
|
|
||||||
|
|
@ -1,30 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
stdenv,
|
|
||||||
fetchurl,
|
|
||||||
nim-unwrapped-2,
|
|
||||||
}:
|
|
||||||
|
|
||||||
nim-unwrapped-2.overrideAttrs (
|
|
||||||
finalAttrs: prevAttrs: {
|
|
||||||
version = "1.6.20";
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://nim-lang.org/download/nim-${finalAttrs.version}.tar.xz";
|
|
||||||
hash = "sha256-/+0EdQTR/K9hDw3Xzz4Ce+kaKSsMnFEWFQTC87mE/7k=";
|
|
||||||
};
|
|
||||||
|
|
||||||
patches =
|
|
||||||
builtins.filter (
|
|
||||||
p:
|
|
||||||
builtins.elem (baseNameOf p) [
|
|
||||||
"NIM_CONFIG_DIR.patch"
|
|
||||||
"nixbuild.patch"
|
|
||||||
]
|
|
||||||
) nim-unwrapped-2.patches
|
|
||||||
++ [
|
|
||||||
./extra-mangling.patch
|
|
||||||
# Mangle store paths of modules to prevent runtime dependence.
|
|
||||||
]
|
|
||||||
++ lib.optional (!stdenv.hostPlatform.isWindows) ./toLocation.patch;
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
@ -1,16 +0,0 @@
|
||||||
diff --git a/lib/std/private/miscdollars.nim b/lib/std/private/miscdollars.nim
|
|
||||||
index 840fedf54..6c3436308 100644
|
|
||||||
--- a/lib/std/private/miscdollars.nim
|
|
||||||
+++ b/lib/std/private/miscdollars.nim
|
|
||||||
@@ -6,9 +6,8 @@ template toLocation*(result: var string, file: string | cstring, line: int, col:
|
|
||||||
# it can be done in a single place.
|
|
||||||
result.add file
|
|
||||||
if line > 0:
|
|
||||||
- result.add "("
|
|
||||||
+ result.add ":"
|
|
||||||
addInt(result, line)
|
|
||||||
if col > 0:
|
|
||||||
- result.add ", "
|
|
||||||
+ result.add ":"
|
|
||||||
addInt(result, col)
|
|
||||||
- result.add ")"
|
|
||||||
|
|
@ -1,27 +0,0 @@
|
||||||
{
|
|
||||||
lib,
|
|
||||||
fetchurl,
|
|
||||||
nim-unwrapped-1,
|
|
||||||
nim-unwrapped-2_2,
|
|
||||||
}:
|
|
||||||
|
|
||||||
nim-unwrapped-2_2.overrideAttrs (
|
|
||||||
finalAttrs: previousAttrs: {
|
|
||||||
version = "2.0.16";
|
|
||||||
src = fetchurl {
|
|
||||||
url = "https://nim-lang.org/download/nim-${finalAttrs.version}.tar.xz";
|
|
||||||
hash = "sha256-sucMbAEbVQcJMJCoiH+iUncyCP0EfuOPhWLiVp5cN4o=";
|
|
||||||
};
|
|
||||||
patches = lib.lists.unique (
|
|
||||||
builtins.filter (
|
|
||||||
p:
|
|
||||||
builtins.elem (baseNameOf p) [
|
|
||||||
"NIM_CONFIG_DIR.patch"
|
|
||||||
"nixbuild.patch"
|
|
||||||
"extra-mangling.patch"
|
|
||||||
"openssl.patch"
|
|
||||||
]
|
|
||||||
) (nim-unwrapped-1.patches ++ nim-unwrapped-2_2.patches)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
@ -1,52 +0,0 @@
|
||||||
diff --git a/compiler/modulegraphs.nim b/compiler/modulegraphs.nim
|
|
||||||
index 77762d23a..59dd8903a 100644
|
|
||||||
--- a/compiler/modulegraphs.nim
|
|
||||||
+++ b/compiler/modulegraphs.nim
|
|
||||||
@@ -503,7 +503,11 @@ proc uniqueModuleName*(conf: ConfigRef; m: PSym): string =
|
|
||||||
for i in 0..<trunc:
|
|
||||||
let c = rel[i]
|
|
||||||
case c
|
|
||||||
- of 'a'..'z', '0'..'9':
|
|
||||||
+ of 'a'..'m':
|
|
||||||
+ result.add char(c.uint8 + 13)
|
|
||||||
+ of 'n'..'z':
|
|
||||||
+ result.add char(c.uint8 - 13)
|
|
||||||
+ of '0'..'9':
|
|
||||||
result.add c
|
|
||||||
of {os.DirSep, os.AltSep}:
|
|
||||||
result.add 'Z' # because it looks a bit like '/'
|
|
||||||
diff --git a/compiler/modulepaths.nim b/compiler/modulepaths.nim
|
|
||||||
index c9e6060e5..2b349f27c 100644
|
|
||||||
--- a/compiler/modulepaths.nim
|
|
||||||
+++ b/compiler/modulepaths.nim
|
|
||||||
@@ -79,6 +79,17 @@ proc checkModuleName*(conf: ConfigRef; n: PNode; doLocalError=true): FileIndex =
|
|
||||||
else:
|
|
||||||
result = fileInfoIdx(conf, fullPath)
|
|
||||||
|
|
||||||
+proc rot13(result: var string) =
|
|
||||||
+ # don't mangle .nim
|
|
||||||
+ let finalIdx =
|
|
||||||
+ if result.endsWith(".nim"): result.len - 4
|
|
||||||
+ else: result.len
|
|
||||||
+ for i, c in result[0..<finalIdx]:
|
|
||||||
+ case c
|
|
||||||
+ of 'a'..'m', 'A'..'M': result[i] = char(c.uint8 + 13)
|
|
||||||
+ of 'n'..'z', 'N'..'Z': result[i] = char(c.uint8 - 13)
|
|
||||||
+ else: discard
|
|
||||||
+
|
|
||||||
proc mangleModuleName*(conf: ConfigRef; path: AbsoluteFile): string =
|
|
||||||
## Mangle a relative module path to avoid path and symbol collisions.
|
|
||||||
##
|
|
||||||
@@ -87,9 +98,11 @@ proc mangleModuleName*(conf: ConfigRef; path: AbsoluteFile): string =
|
|
||||||
##
|
|
||||||
## Example:
|
|
||||||
## `foo-#head/../bar` becomes `@foo-@hhead@s..@sbar`
|
|
||||||
- "@m" & relativeTo(path, conf.projectPath).string.multiReplace(
|
|
||||||
+ result = "@m" & relativeTo(path, conf.projectPath).string.multiReplace(
|
|
||||||
{$os.DirSep: "@s", $os.AltSep: "@s", "#": "@h", "@": "@@", ":": "@c"})
|
|
||||||
+ rot13(result)
|
|
||||||
|
|
||||||
proc demangleModuleName*(path: string): string =
|
|
||||||
## Demangle a relative module path.
|
|
||||||
result = path.multiReplace({"@@": "@", "@h": "#", "@s": "/", "@m": "", "@c": ":"})
|
|
||||||
+ rot13(result)
|
|
||||||
17
pkgs/by-name/ni/nim-unwrapped/extra-mangling.patch
Normal file
17
pkgs/by-name/ni/nim-unwrapped/extra-mangling.patch
Normal file
|
|
@ -0,0 +1,17 @@
|
||||||
|
diff --git a/compiler/modulegraphs.nim b/compiler/modulegraphs.nim
|
||||||
|
index 55f751cda..b0b3e3f40 100644
|
||||||
|
--- a/compiler/modulegraphs.nim
|
||||||
|
+++ b/compiler/modulegraphs.nim
|
||||||
|
@@ -466,7 +466,11 @@ proc uniqueModuleName*(conf: ConfigRef; m: PSym): string =
|
||||||
|
for i in 0..<trunc:
|
||||||
|
let c = rel[i]
|
||||||
|
case c
|
||||||
|
- of 'a'..'z', '0'..'9':
|
||||||
|
+ of 'a'..'m':
|
||||||
|
+ result.add char(c.uint8 + 13)
|
||||||
|
+ of 'n'..'z':
|
||||||
|
+ result.add char(c.uint8 - 13)
|
||||||
|
+ of '0'..'9':
|
||||||
|
result.add c
|
||||||
|
of {os.DirSep, os.AltSep}:
|
||||||
|
result.add 'Z' # because it looks a bit like '/'
|
||||||
|
|
@ -48,21 +48,21 @@ index e659746ee..dfb2d3cf2 100644
|
||||||
SSLeay()
|
SSLeay()
|
||||||
|
|
||||||
- proc ERR_load_BIO_strings*() {.cdecl, dynlib: DLLUtilName, importc.}
|
- proc ERR_load_BIO_strings*() {.cdecl, dynlib: DLLUtilName, importc.}
|
||||||
+ proc ERR_load_BIO_strings*() {.cdecl, gimportc.}
|
+ proc ERR_load_BIO_strings*() {.cdecl, importc.}
|
||||||
else:
|
else:
|
||||||
- proc OPENSSL_init_ssl*(opts: uint64, settings: uint8): cint {.cdecl, dynlib: DLLSSLName, importc, discardable.}
|
- proc OPENSSL_init_ssl*(opts: uint64, settings: uint8): cint {.cdecl, dynlib: DLLSSLName, importc, discardable.}
|
||||||
+ proc OPENSSL_init_ssl*(opts: uint64, settings: uint8): cint {.cdecl, gimportc, discardable.}
|
+ proc OPENSSL_init_ssl*(opts: uint64, settings: uint8): cint {.cdecl, importc, discardable.}
|
||||||
proc SSL_library_init*(): cint {.discardable.} =
|
proc SSL_library_init*(): cint {.discardable.} =
|
||||||
## Initialize SSL using OPENSSL_init_ssl for OpenSSL >= 1.1.0
|
## Initialize SSL using OPENSSL_init_ssl for OpenSSL >= 1.1.0
|
||||||
return OPENSSL_init_ssl(0.uint64, 0.uint8)
|
return OPENSSL_init_ssl(0.uint64, 0.uint8)
|
||||||
|
|
||||||
- proc TLS_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
|
- proc TLS_method*(): PSSL_METHOD {.cdecl, dynlib: DLLSSLName, importc.}
|
||||||
+ proc TLS_method*(): PSSL_METHOD {.cdecl, gimportc.}
|
+ proc TLS_method*(): PSSL_METHOD {.cdecl, importc.}
|
||||||
proc SSLv23_method*(): PSSL_METHOD =
|
proc SSLv23_method*(): PSSL_METHOD =
|
||||||
TLS_method()
|
TLS_method()
|
||||||
|
|
||||||
- proc OpenSSL_version_num(): culong {.cdecl, dynlib: DLLUtilName, importc.}
|
- proc OpenSSL_version_num(): culong {.cdecl, dynlib: DLLUtilName, importc.}
|
||||||
+ proc OpenSSL_version_num(): culong {.cdecl, gimportc.}
|
+ proc OpenSSL_version_num(): culong {.cdecl, importc.}
|
||||||
|
|
||||||
proc getOpenSSLVersion*(): culong =
|
proc getOpenSSLVersion*(): culong =
|
||||||
## Return OpenSSL version as unsigned long
|
## Return OpenSSL version as unsigned long
|
||||||
|
|
@ -71,13 +71,13 @@ index e659746ee..dfb2d3cf2 100644
|
||||||
|
|
||||||
when defined(libressl) or defined(openssl10):
|
when defined(libressl) or defined(openssl10):
|
||||||
- proc SSL_state(ssl: SslPtr): cint {.cdecl, dynlib: DLLSSLName, importc.}
|
- proc SSL_state(ssl: SslPtr): cint {.cdecl, dynlib: DLLSSLName, importc.}
|
||||||
+ proc SSL_state(ssl: SslPtr): cint {.cdecl, gimportc.}
|
+ proc SSL_state(ssl: SslPtr): cint {.cdecl, importc.}
|
||||||
proc SSL_in_init*(ssl: SslPtr): cint {.inline.} =
|
proc SSL_in_init*(ssl: SslPtr): cint {.inline.} =
|
||||||
SSL_state(ssl) and SSL_ST_INIT
|
SSL_state(ssl) and SSL_ST_INIT
|
||||||
else:
|
else:
|
||||||
- proc SSL_in_init*(ssl: SslPtr): cint {.cdecl, dynlib: DLLSSLName, importc.}
|
- proc SSL_in_init*(ssl: SslPtr): cint {.cdecl, dynlib: DLLSSLName, importc.}
|
||||||
- proc SSL_CTX_set_ciphersuites*(ctx: SslCtx, str: cstring): cint {.cdecl, dynlib: DLLSSLName, importc.}
|
- proc SSL_CTX_set_ciphersuites*(ctx: SslCtx, str: cstring): cint {.cdecl, dynlib: DLLSSLName, importc.}
|
||||||
+ proc SSL_in_init*(ssl: SslPtr): cint {.cdecl, gimportc.}
|
+ proc SSL_in_init*(ssl: SslPtr): cint {.cdecl, importc.}
|
||||||
+ proc SSL_CTX_set_ciphersuites*(ctx: SslCtx, str: cstring): cint {.cdecl, importc.}
|
+ proc SSL_CTX_set_ciphersuites*(ctx: SslCtx, str: cstring): cint {.cdecl, importc.}
|
||||||
|
|
||||||
template OpenSSL_add_all_algorithms*() = discard
|
template OpenSSL_add_all_algorithms*() = discard
|
||||||
|
|
@ -89,7 +89,7 @@ index e659746ee..dfb2d3cf2 100644
|
||||||
+ proc SSLv23_client_method*(): PSSL_METHOD {.cdecl, importc.}
|
+ proc SSLv23_client_method*(): PSSL_METHOD {.cdecl, importc.}
|
||||||
+ proc SSLv2_method*(): PSSL_METHOD {.cdecl, importc.}
|
+ proc SSLv2_method*(): PSSL_METHOD {.cdecl, importc.}
|
||||||
+ proc SSLv3_method*(): PSSL_METHOD {.cdecl, importc.}
|
+ proc SSLv3_method*(): PSSL_METHOD {.cdecl, importc.}
|
||||||
+ proc CRYPTO_set_mem_functions(a,b,c: pointer){.cdecl, gimportc.}
|
+ proc CRYPTO_set_mem_functions(a,b,c: pointer){.cdecl, importc.}
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# Here we're trying to stay compatible between openssl versions. Some
|
# Here we're trying to stay compatible between openssl versions. Some
|
||||||
|
|
@ -13,12 +13,12 @@
|
||||||
}:
|
}:
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "nim-unwrapped";
|
pname = "nim-unwrapped";
|
||||||
version = "2.2.4";
|
version = "2.2.10";
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
|
|
||||||
src = fetchurl {
|
src = fetchurl {
|
||||||
url = "https://nim-lang.org/download/nim-${finalAttrs.version}.tar.xz";
|
url = "https://nim-lang.org/download/nim-${finalAttrs.version}.tar.xz";
|
||||||
hash = "sha256-+CtBl1D8zlYfP4l6BIaxgBhoRddvtdmfJIzhZhCBicc=";
|
hash = "sha256-eVe37QBCBrzxC8xPO0dEFTh45i8kMVUqmo6dP0Do1dU=";
|
||||||
};
|
};
|
||||||
|
|
||||||
buildInputs = [
|
buildInputs = [
|
||||||
|
|
@ -36,7 +36,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
./nixbuild.patch
|
./nixbuild.patch
|
||||||
# Load libraries at runtime by absolute path
|
# Load libraries at runtime by absolute path
|
||||||
|
|
||||||
./extra-mangling-2.patch
|
./extra-mangling.patch
|
||||||
# Mangle store paths of modules to prevent runtime dependence.
|
# Mangle store paths of modules to prevent runtime dependence.
|
||||||
|
|
||||||
./openssl.patch
|
./openssl.patch
|
||||||
|
|
@ -49,6 +49,11 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
pname = "nim-bootstrap";
|
pname = "nim-bootstrap";
|
||||||
inherit (finalAttrs) version src preBuild;
|
inherit (finalAttrs) version src preBuild;
|
||||||
enableParallelBuilding = true;
|
enableParallelBuilding = true;
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
./build.sh
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
installPhase = ''
|
installPhase = ''
|
||||||
runHook preInstall
|
runHook preInstall
|
||||||
install -Dt $out/bin bin/nim
|
install -Dt $out/bin bin/nim
|
||||||
|
|
@ -67,9 +72,7 @@ stdenv.mkDerivation (finalAttrs: {
|
||||||
"--cpu:${stdenv.hostPlatform.nim.cpu}"
|
"--cpu:${stdenv.hostPlatform.nim.cpu}"
|
||||||
"--os:${stdenv.hostPlatform.nim.os}"
|
"--os:${stdenv.hostPlatform.nim.os}"
|
||||||
"-d:release"
|
"-d:release"
|
||||||
"-d:useGnuReadline"
|
];
|
||||||
]
|
|
||||||
++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) "-d:nativeStacktrace";
|
|
||||||
|
|
||||||
preBuild = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
|
preBuild = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
|
||||||
substituteInPlace makefile \
|
substituteInPlace makefile \
|
||||||
|
|
@ -8,7 +8,7 @@
|
||||||
makeWrapper,
|
makeWrapper,
|
||||||
openssl,
|
openssl,
|
||||||
pcre,
|
pcre,
|
||||||
nim-unwrapped-2_2 ? buildPackages.nim-unwrapped-2_2,
|
nim-unwrapped ? buildPackages.nim-unwrapped,
|
||||||
}:
|
}:
|
||||||
|
|
||||||
let
|
let
|
||||||
|
|
@ -18,7 +18,7 @@ let
|
||||||
targetPlatformConfig = stdenv.targetPlatform.config;
|
targetPlatformConfig = stdenv.targetPlatform.config;
|
||||||
in
|
in
|
||||||
stdenv.mkDerivation (finalAttrs: {
|
stdenv.mkDerivation (finalAttrs: {
|
||||||
name = "${targetPlatformConfig}-nim-wrapper-${nimUnwrapped.version}";
|
pname = "${targetPlatformConfig}-nim-wrapper";
|
||||||
inherit (nimUnwrapped) version;
|
inherit (nimUnwrapped) version;
|
||||||
preferLocalBuild = true;
|
preferLocalBuild = true;
|
||||||
strictDeps = true;
|
strictDeps = true;
|
||||||
|
|
@ -86,7 +86,7 @@ let
|
||||||
runHook postBuild
|
runHook postBuild
|
||||||
'';
|
'';
|
||||||
|
|
||||||
wrapperArgs = lib.optionals (!(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) [
|
wrapperArgs = [
|
||||||
"--prefix PATH : ${lib.makeBinPath [ buildPackages.gdb ]}:${placeholder "out"}/bin"
|
"--prefix PATH : ${lib.makeBinPath [ buildPackages.gdb ]}:${placeholder "out"}/bin"
|
||||||
# Used by nim-gdb
|
# Used by nim-gdb
|
||||||
|
|
||||||
|
|
@ -148,6 +148,6 @@ let
|
||||||
});
|
});
|
||||||
in
|
in
|
||||||
wrapNim {
|
wrapNim {
|
||||||
nimUnwrapped = nim-unwrapped-2_2;
|
nimUnwrapped = nim-unwrapped;
|
||||||
patches = [ ./nim2.cfg.patch ];
|
patches = [ ./nim2.cfg.patch ];
|
||||||
}
|
}
|
||||||
13
pkgs/by-name/ni/nim_lk/nil.patch
Normal file
13
pkgs/by-name/ni/nim_lk/nil.patch
Normal file
|
|
@ -0,0 +1,13 @@
|
||||||
|
diff --git a/src/nim_lk.nim b/src/nim_lk.nim
|
||||||
|
index 09ced9d..45c5ddc 100644
|
||||||
|
--- a/src/nim_lk.nim
|
||||||
|
+++ b/src/nim_lk.nim
|
||||||
|
@@ -573,7 +573,7 @@ proc update(bom: JsonNode; bomRef: string; byName: bool): bool =
|
||||||
|
let comp = bom.getComponent(bomRef, byName)
|
||||||
|
assert not comp.isNil
|
||||||
|
var bomRef = comp{"bom-ref"}.getStr
|
||||||
|
- assert not bomRef.isNil
|
||||||
|
+ assert bomRef != ""
|
||||||
|
var suitableRefFound = false
|
||||||
|
let extRefs = comp{"externalReferences"}
|
||||||
|
for extRef in extRefs.elems:
|
||||||
|
|
@ -23,6 +23,10 @@ buildNimSbom (finalAttrs: {
|
||||||
buildInputs = [ openssl ];
|
buildInputs = [ openssl ];
|
||||||
nativeBuildInputs = [ makeWrapper ];
|
nativeBuildInputs = [ makeWrapper ];
|
||||||
|
|
||||||
|
patches = [
|
||||||
|
./nil.patch
|
||||||
|
];
|
||||||
|
|
||||||
postFixup = ''
|
postFixup = ''
|
||||||
wrapProgram $out/bin/nim_lk \
|
wrapProgram $out/bin/nim_lk \
|
||||||
--suffix PATH : ${
|
--suffix PATH : ${
|
||||||
|
|
|
||||||
|
|
@ -3,17 +3,9 @@
|
||||||
buildNimPackage,
|
buildNimPackage,
|
||||||
fetchFromGitHub,
|
fetchFromGitHub,
|
||||||
srcOnly,
|
srcOnly,
|
||||||
nim-2_0,
|
nim-unwrapped,
|
||||||
nim-unwrapped-2_0,
|
|
||||||
}:
|
}:
|
||||||
|
buildNimPackage (finalAttrs: {
|
||||||
let
|
|
||||||
buildNimPackage' = buildNimPackage.override {
|
|
||||||
# Do not build with Nim-2.2.x.
|
|
||||||
nim2 = nim-2_0;
|
|
||||||
};
|
|
||||||
in
|
|
||||||
buildNimPackage' (finalAttrs: {
|
|
||||||
pname = "nimlsp";
|
pname = "nimlsp";
|
||||||
version = "0.4.6";
|
version = "0.4.6";
|
||||||
|
|
||||||
|
|
@ -40,7 +32,7 @@ buildNimPackage' (finalAttrs: {
|
||||||
|
|
||||||
nimFlags = [
|
nimFlags = [
|
||||||
"--threads:on"
|
"--threads:on"
|
||||||
"-d:explicitSourcePath=${srcOnly nim-unwrapped-2_0}"
|
"-d:explicitSourcePath=${srcOnly nim-unwrapped}"
|
||||||
"-d:tempDir=/tmp"
|
"-d:tempDir=/tmp"
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1622,6 +1622,16 @@ mapAliases {
|
||||||
nfstrace = throw "nfstrace has been removed, as it was broken"; # Added 2025-08-25
|
nfstrace = throw "nfstrace has been removed, as it was broken"; # Added 2025-08-25
|
||||||
nginxQuic = throw "'nginxQuic' has been removed. QUIC support is now available in the default nginx builds.";
|
nginxQuic = throw "'nginxQuic' has been removed. QUIC support is now available in the default nginx builds.";
|
||||||
ngrid = throw "'ngrid' has been removed as it has been unmaintained upstream and broken"; # Added 2025-11-15
|
ngrid = throw "'ngrid' has been removed as it has been unmaintained upstream and broken"; # Added 2025-11-15
|
||||||
|
nim1 = throw "'nim1' has reached EOL, please use 'nim'"; # Added 2026-03-06
|
||||||
|
nim-unwrapped-1 = throw "'nim-unwrapped-1' has reached EOL, please use 'nim-unwrapped'"; # Added 2026-03-06
|
||||||
|
nim-unwrapped-2 = throw "'nim-unwrapped-2' has been upgraded and removed, please use 'nim-unwrapped'"; # Added 2026-03-06
|
||||||
|
nim-unwrapped-2_0 = throw "'nim-unwrapped-2_0' has been upgraded and removed, please use 'nim-unwrapped'"; # Added 2026-03-06
|
||||||
|
nim-unwrapped-2_2 = throw "'nim-unwrapped-2_2' has been upgraded and removed, please use 'nim-unwrapped'"; # Added 2026-03-06
|
||||||
|
nim-unwrapped_1_0 = throw "'nim-unwrapped_1_0' has reached EOL, please use 'nim-unwrapped'"; # Added 2026-03-06
|
||||||
|
nim_1_0 = throw "'nim_1_0' has reached EOL, please use 'nim'"; # Added 2026-03-06
|
||||||
|
nim_2 = throw "'nim_2' has been upgraded and removed, please use 'nim'"; # Added 2026-03-06
|
||||||
|
nim_2_0 = throw "'nim_2_0' has been upgraded and removed, please use 'nim'"; # Added 2026-03-06
|
||||||
|
nim_2_2 = throw "'nim_2_2' has been upgraded and removed, please use 'nim'"; # Added 2026-03-06
|
||||||
nimbo = throw "'nimbo' has been removed due to being archived upstream."; # Added 2026-01-18
|
nimbo = throw "'nimbo' has been removed due to being archived upstream."; # Added 2026-01-18
|
||||||
nitrokey-fido2-firmware = throw "'nitrokey-fido2-firmware' has been removed as it was broken and unmaintained upstream since 2022"; # Added 2026-03-23
|
nitrokey-fido2-firmware = throw "'nitrokey-fido2-firmware' has been removed as it was broken and unmaintained upstream since 2022"; # Added 2026-03-23
|
||||||
nix-direnv-flakes = throw "'nix-direnv-flakes' has been renamed to/replaced by 'nix-direnv'"; # Converted to throw 2025-10-27
|
nix-direnv-flakes = throw "'nix-direnv-flakes' has been renamed to/replaced by 'nix-direnv'"; # Converted to throw 2025-10-27
|
||||||
|
|
|
||||||
|
|
@ -4025,13 +4025,6 @@ with pkgs;
|
||||||
|
|
||||||
mozart2-binary = callPackage ../development/compilers/mozart/binary.nix { };
|
mozart2-binary = callPackage ../development/compilers/mozart/binary.nix { };
|
||||||
|
|
||||||
nim = nim2;
|
|
||||||
nim1 = nim-1_0;
|
|
||||||
nim2 = nim-2_2;
|
|
||||||
nim-unwrapped = nim-unwrapped-2_2;
|
|
||||||
nim-unwrapped-1 = nim-unwrapped-1_0;
|
|
||||||
nim-unwrapped-2 = nim-unwrapped-2_2;
|
|
||||||
|
|
||||||
buildNimPackage = callPackage ../build-support/build-nim-package.nix { };
|
buildNimPackage = callPackage ../build-support/build-nim-package.nix { };
|
||||||
buildNimSbom = callPackage ../build-support/build-nim-sbom.nix { };
|
buildNimSbom = callPackage ../build-support/build-nim-sbom.nix { };
|
||||||
nimOverrides = callPackage ./nim-overrides.nix { };
|
nimOverrides = callPackage ./nim-overrides.nix { };
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue