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)
|
||||
|
||||
- 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}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,10 +3,8 @@
|
|||
buildPackages,
|
||||
callPackage,
|
||||
stdenv,
|
||||
nim1,
|
||||
nim2,
|
||||
nim,
|
||||
nim_builder,
|
||||
defaultNimVersion ? 2,
|
||||
nimOverrides,
|
||||
buildNimPackage,
|
||||
}:
|
||||
|
|
@ -17,6 +15,7 @@ let
|
|||
enableParallelBuilding = true;
|
||||
__structuredAttrs = true;
|
||||
doCheck = true;
|
||||
|
||||
configurePhase = ''
|
||||
runHook preConfigure
|
||||
export NIX_NIM_BUILD_INPUTS=''${pkgsHostTarget[@]} $NIX_NIM_BUILD_INPUTS
|
||||
|
|
@ -38,7 +37,7 @@ let
|
|||
nim_builder --phase:install
|
||||
runHook postInstall
|
||||
'';
|
||||
meta = { inherit (nim2.meta) maintainers platforms; };
|
||||
meta = { inherit (nim.meta) maintainers platforms; };
|
||||
};
|
||||
|
||||
fodFromLockEntry =
|
||||
|
|
@ -108,30 +107,34 @@ let
|
|||
|
||||
finalOverride =
|
||||
{
|
||||
depsBuildBuild ? [ ],
|
||||
nativeBuildInputs ? [ ],
|
||||
nimFlags ? [ ],
|
||||
requiredNimVersion ? defaultNimVersion,
|
||||
passthru ? { },
|
||||
nativeBuildInputs ? [ ],
|
||||
depsBuildBuild ? [ ],
|
||||
...
|
||||
}:
|
||||
}@args:
|
||||
(
|
||||
if requiredNimVersion == 1 then
|
||||
{
|
||||
depsBuildBuild = [ nim_builder ] ++ depsBuildBuild;
|
||||
nativeBuildInputs = [ nim1 ] ++ nativeBuildInputs;
|
||||
}
|
||||
else if requiredNimVersion == 2 then
|
||||
{
|
||||
depsBuildBuild = [ nim_builder ] ++ depsBuildBuild;
|
||||
nativeBuildInputs = [ nim2 ] ++ nativeBuildInputs;
|
||||
}
|
||||
#TODO: Remove at 26.11
|
||||
if args ? requiredNimVersion then
|
||||
if args.requiredNimVersion == 2 then
|
||||
lib.warn ''
|
||||
`requiredNimVersion' is deprecated and will be removed in nixpkgs 26.11.
|
||||
Please update your package to remove this.
|
||||
''
|
||||
else
|
||||
throw ''
|
||||
`requiredNimVersion' ${toString args.requiredNimVersion} is not supported.
|
||||
Ensure your package supports nim 2, and remove `requiredNimVersion'.
|
||||
''
|
||||
else
|
||||
throw "requiredNimVersion ${toString requiredNimVersion} is not valid"
|
||||
{ }
|
||||
)
|
||||
// {
|
||||
nativeBuildInputs = [ nim ] ++ nativeBuildInputs;
|
||||
depsBuildBuild = [ nim_builder ] ++ depsBuildBuild;
|
||||
nimFlags = lockFileNimFlags ++ nimFlags;
|
||||
passthru = passthru // {
|
||||
|
||||
# allow overriding the result of buildNimPackageArgs before this composition is applied
|
||||
# this allows overriding the lockFile for packages built using buildNimPackage
|
||||
# this is adapted from mkDerivationExtensible in stdenv.mkDerivation
|
||||
|
|
|
|||
|
|
@ -799,7 +799,7 @@ rec {
|
|||
## `pkgs.writers.writeNim` usage example
|
||||
|
||||
```nix
|
||||
writeNim "hello-nim" { nim = pkgs.nim2; } ''
|
||||
writeNim "hello-nim" { nim = pkgs.nim; } ''
|
||||
echo "hello nim"
|
||||
'';
|
||||
```
|
||||
|
|
@ -809,7 +809,7 @@ rec {
|
|||
name:
|
||||
{
|
||||
makeWrapperArgs ? [ ],
|
||||
nim ? pkgs.nim2,
|
||||
nim ? pkgs.nim,
|
||||
nimCompileOptions ? { },
|
||||
strip ? true,
|
||||
}:
|
||||
|
|
|
|||
|
|
@ -9,8 +9,6 @@ buildNimPackage (finalAttrs: {
|
|||
pname = "mosdepth";
|
||||
version = "0.3.13";
|
||||
|
||||
requiredNimVersion = 1;
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "brentp";
|
||||
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()
|
||||
|
||||
- proc ERR_load_BIO_strings*() {.cdecl, dynlib: DLLUtilName, importc.}
|
||||
+ proc ERR_load_BIO_strings*() {.cdecl, gimportc.}
|
||||
+ proc ERR_load_BIO_strings*() {.cdecl, importc.}
|
||||
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, gimportc, discardable.}
|
||||
+ proc OPENSSL_init_ssl*(opts: uint64, settings: uint8): cint {.cdecl, importc, discardable.}
|
||||
proc SSL_library_init*(): cint {.discardable.} =
|
||||
## Initialize SSL using OPENSSL_init_ssl for OpenSSL >= 1.1.0
|
||||
return OPENSSL_init_ssl(0.uint64, 0.uint8)
|
||||
|
||||
- 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 =
|
||||
TLS_method()
|
||||
|
||||
- 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 =
|
||||
## Return OpenSSL version as unsigned long
|
||||
|
|
@ -71,13 +71,13 @@ index e659746ee..dfb2d3cf2 100644
|
|||
|
||||
when defined(libressl) or defined(openssl10):
|
||||
- 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.} =
|
||||
SSL_state(ssl) and SSL_ST_INIT
|
||||
else:
|
||||
- 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_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.}
|
||||
|
||||
template OpenSSL_add_all_algorithms*() = discard
|
||||
|
|
@ -89,7 +89,7 @@ index e659746ee..dfb2d3cf2 100644
|
|||
+ proc SSLv23_client_method*(): PSSL_METHOD {.cdecl, importc.}
|
||||
+ proc SSLv2_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:
|
||||
# Here we're trying to stay compatible between openssl versions. Some
|
||||
|
|
@ -13,12 +13,12 @@
|
|||
}:
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
pname = "nim-unwrapped";
|
||||
version = "2.2.4";
|
||||
version = "2.2.10";
|
||||
strictDeps = true;
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://nim-lang.org/download/nim-${finalAttrs.version}.tar.xz";
|
||||
hash = "sha256-+CtBl1D8zlYfP4l6BIaxgBhoRddvtdmfJIzhZhCBicc=";
|
||||
hash = "sha256-eVe37QBCBrzxC8xPO0dEFTh45i8kMVUqmo6dP0Do1dU=";
|
||||
};
|
||||
|
||||
buildInputs = [
|
||||
|
|
@ -36,7 +36,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
./nixbuild.patch
|
||||
# Load libraries at runtime by absolute path
|
||||
|
||||
./extra-mangling-2.patch
|
||||
./extra-mangling.patch
|
||||
# Mangle store paths of modules to prevent runtime dependence.
|
||||
|
||||
./openssl.patch
|
||||
|
|
@ -49,6 +49,11 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
pname = "nim-bootstrap";
|
||||
inherit (finalAttrs) version src preBuild;
|
||||
enableParallelBuilding = true;
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
./build.sh
|
||||
runHook postBuild
|
||||
'';
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
install -Dt $out/bin bin/nim
|
||||
|
|
@ -67,9 +72,7 @@ stdenv.mkDerivation (finalAttrs: {
|
|||
"--cpu:${stdenv.hostPlatform.nim.cpu}"
|
||||
"--os:${stdenv.hostPlatform.nim.os}"
|
||||
"-d:release"
|
||||
"-d:useGnuReadline"
|
||||
]
|
||||
++ lib.optional (stdenv.hostPlatform.isDarwin || stdenv.hostPlatform.isLinux) "-d:nativeStacktrace";
|
||||
];
|
||||
|
||||
preBuild = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64) ''
|
||||
substituteInPlace makefile \
|
||||
|
|
@ -8,7 +8,7 @@
|
|||
makeWrapper,
|
||||
openssl,
|
||||
pcre,
|
||||
nim-unwrapped-2_2 ? buildPackages.nim-unwrapped-2_2,
|
||||
nim-unwrapped ? buildPackages.nim-unwrapped,
|
||||
}:
|
||||
|
||||
let
|
||||
|
|
@ -18,7 +18,7 @@ let
|
|||
targetPlatformConfig = stdenv.targetPlatform.config;
|
||||
in
|
||||
stdenv.mkDerivation (finalAttrs: {
|
||||
name = "${targetPlatformConfig}-nim-wrapper-${nimUnwrapped.version}";
|
||||
pname = "${targetPlatformConfig}-nim-wrapper";
|
||||
inherit (nimUnwrapped) version;
|
||||
preferLocalBuild = true;
|
||||
strictDeps = true;
|
||||
|
|
@ -86,7 +86,7 @@ let
|
|||
runHook postBuild
|
||||
'';
|
||||
|
||||
wrapperArgs = lib.optionals (!(stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64)) [
|
||||
wrapperArgs = [
|
||||
"--prefix PATH : ${lib.makeBinPath [ buildPackages.gdb ]}:${placeholder "out"}/bin"
|
||||
# Used by nim-gdb
|
||||
|
||||
|
|
@ -148,6 +148,6 @@ let
|
|||
});
|
||||
in
|
||||
wrapNim {
|
||||
nimUnwrapped = nim-unwrapped-2_2;
|
||||
nimUnwrapped = nim-unwrapped;
|
||||
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 ];
|
||||
nativeBuildInputs = [ makeWrapper ];
|
||||
|
||||
patches = [
|
||||
./nil.patch
|
||||
];
|
||||
|
||||
postFixup = ''
|
||||
wrapProgram $out/bin/nim_lk \
|
||||
--suffix PATH : ${
|
||||
|
|
|
|||
|
|
@ -3,17 +3,9 @@
|
|||
buildNimPackage,
|
||||
fetchFromGitHub,
|
||||
srcOnly,
|
||||
nim-2_0,
|
||||
nim-unwrapped-2_0,
|
||||
nim-unwrapped,
|
||||
}:
|
||||
|
||||
let
|
||||
buildNimPackage' = buildNimPackage.override {
|
||||
# Do not build with Nim-2.2.x.
|
||||
nim2 = nim-2_0;
|
||||
};
|
||||
in
|
||||
buildNimPackage' (finalAttrs: {
|
||||
buildNimPackage (finalAttrs: {
|
||||
pname = "nimlsp";
|
||||
version = "0.4.6";
|
||||
|
||||
|
|
@ -40,7 +32,7 @@ buildNimPackage' (finalAttrs: {
|
|||
|
||||
nimFlags = [
|
||||
"--threads:on"
|
||||
"-d:explicitSourcePath=${srcOnly nim-unwrapped-2_0}"
|
||||
"-d:explicitSourcePath=${srcOnly nim-unwrapped}"
|
||||
"-d:tempDir=/tmp"
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -1622,6 +1622,16 @@ mapAliases {
|
|||
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.";
|
||||
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
|
||||
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
|
||||
|
|
|
|||
|
|
@ -4025,13 +4025,6 @@ with pkgs;
|
|||
|
||||
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 { };
|
||||
buildNimSbom = callPackage ../build-support/build-nim-sbom.nix { };
|
||||
nimOverrides = callPackage ./nim-overrides.nix { };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue