about summary refs log tree commit diff
path: root/pkgs/development/interpreters
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2023-09-06 16:13:15 +0200
committerKarel Kočí <cynerd@email.cz>2023-09-25 11:01:02 +0200
commit48926aa490da5d615d99949a73a272ccdc9ec3fa (patch)
treef87d2bae3da95a3624016a8fe1ab900a07471123 /pkgs/development/interpreters
parent29351a88df4201a8423fb4ab72b9438251e6744e (diff)
downloadnixlib-48926aa490da5d615d99949a73a272ccdc9ec3fa.tar
nixlib-48926aa490da5d615d99949a73a272ccdc9ec3fa.tar.gz
nixlib-48926aa490da5d615d99949a73a272ccdc9ec3fa.tar.bz2
nixlib-48926aa490da5d615d99949a73a272ccdc9ec3fa.tar.lz
nixlib-48926aa490da5d615d99949a73a272ccdc9ec3fa.tar.xz
nixlib-48926aa490da5d615d99949a73a272ccdc9ec3fa.tar.zst
nixlib-48926aa490da5d615d99949a73a272ccdc9ec3fa.zip
jimtcl: Fix cross compilation and allow disable of SDL
Jimtcl is dependency of OpenOCD that does not need SDL. For some
embedded systems it is beneficial to not pull in graphics related
dependencies to reduce the size. The second reason is that right now
SDL_gfx is not cross compiling and thus OpenOCD can't be cross compiled
either.

This also fixes cross compilation of Jimtcl itself. The attempt to cross
compile resulted in:

  No installed jimsh or tclsh, building local bootstrap jimsh0

The solution here is to add jimtcl to native build dependencies in case
of cross compilation.
Diffstat (limited to 'pkgs/development/interpreters')
-rw-r--r--pkgs/development/interpreters/jimtcl/default.nix15
1 files changed, 11 insertions, 4 deletions
diff --git a/pkgs/development/interpreters/jimtcl/default.nix b/pkgs/development/interpreters/jimtcl/default.nix
index ed0ddc7da22f..e478ff945472 100644
--- a/pkgs/development/interpreters/jimtcl/default.nix
+++ b/pkgs/development/interpreters/jimtcl/default.nix
@@ -5,12 +5,15 @@
 , asciidoc
 , pkg-config
 , inetutils
+, tcl
 
 , sqlite
 , readline
 , SDL
 , SDL_gfx
 , openssl
+
+, SDLSupport ? true
 }:
 
 stdenv.mkDerivation rec {
@@ -27,15 +30,17 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [
     pkg-config
     asciidoc
+    tcl
   ];
 
   buildInputs = [
     sqlite
     readline
+    openssl
+  ] ++ (lib.optionals SDLSupport [
     SDL
     SDL_gfx
-    openssl
-  ];
+  ]);
 
   configureFlags = [
     "--shared"
@@ -44,11 +49,10 @@ stdenv.mkDerivation rec {
     "--with-ext=binary"
     "--with-ext=sqlite3"
     "--with-ext=readline"
-    "--with-ext=sdl"
     "--with-ext=json"
     "--enable-utf8"
     "--ipv6"
-  ];
+  ] ++ (lib.optional SDLSupport "--with-ext=sdl");
 
   enableParallelBuilding = true;
 
@@ -58,6 +62,9 @@ stdenv.mkDerivation rec {
     rm tests/exec2.test
     # requires internet access
     rm tests/ssl.test
+    # test fails due to timing in some environments
+    # https://github.com/msteveb/jimtcl/issues/282
+    rm tests/timer.test
   '';
 
   # test posix-1.6 needs the "hostname" command