about summary refs log tree commit diff
path: root/pkgs/by-name/cd
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/by-name/cd')
-rw-r--r--pkgs/by-name/cd/cdecl-blocks/cdecl-2.5-lex.patch13
-rw-r--r--pkgs/by-name/cd/cdecl-blocks/package.nix82
-rw-r--r--pkgs/by-name/cd/cdecl-blocks/test_remove_interactive_line.patch10
-rw-r--r--pkgs/by-name/cd/cdecl/package.nix68
-rw-r--r--pkgs/by-name/cd/cdk/package.nix4
-rw-r--r--pkgs/by-name/cd/cdncheck/package.nix43
-rw-r--r--pkgs/by-name/cd/cdwe/package.nix2
7 files changed, 219 insertions, 3 deletions
diff --git a/pkgs/by-name/cd/cdecl-blocks/cdecl-2.5-lex.patch b/pkgs/by-name/cd/cdecl-blocks/cdecl-2.5-lex.patch
new file mode 100644
index 0000000000000..ecdee5d544f66
--- /dev/null
+++ b/pkgs/by-name/cd/cdecl-blocks/cdecl-2.5-lex.patch
@@ -0,0 +1,13 @@
+diff --git a/Makefile b/Makefile
+index 1643b74..8f1ae11 100644
+--- a/Makefile
++++ b/Makefile
+@@ -33,7 +33,7 @@ c++decl: cdgram.c cdlex.c cdecl.c
+ 	rm -f cdecl
+ 
+ cdlex.c: cdlex.l
+-	lex cdlex.l && mv lex.yy.c cdlex.c
++	flex cdlex.l && mv lex.yy.c cdlex.c
+ 
+ cdgram.c: cdgram.y
+ 	yacc cdgram.y && mv y.tab.c cdgram.c
diff --git a/pkgs/by-name/cd/cdecl-blocks/package.nix b/pkgs/by-name/cd/cdecl-blocks/package.nix
new file mode 100644
index 0000000000000..307a80681a24d
--- /dev/null
+++ b/pkgs/by-name/cd/cdecl-blocks/package.nix
@@ -0,0 +1,82 @@
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  bison,
+  flex,
+  readline,
+  ncurses,
+}:
+
+stdenv.mkDerivation {
+  pname = "cdecl-blocks";
+  version = "2.5-unstable-2024-05-07";
+
+  src = fetchFromGitHub {
+    owner = "ridiculousfish";
+    repo = "cdecl-blocks";
+    rev = "1e6e1596771183d9bb90bcf152d6bc2055219a7e";
+    hash = "sha256-5XuiYkFe+QvVBRIXRieKoE0zbISMvU1iLgEfkw6GnlE=";
+  };
+
+  patches = [
+    ./cdecl-2.5-lex.patch
+    # when `USE_READLINE` is enabled, this option will not be present
+    ./test_remove_interactive_line.patch
+  ];
+
+  prePatch = ''
+    substituteInPlace cdecl.c \
+      --replace 'getline' 'cdecl_getline'
+  '';
+
+  strictDeps = true;
+
+  nativeBuildInputs = [
+    bison
+    flex
+  ];
+
+  buildInputs = [
+    readline
+    ncurses
+  ];
+
+  env = {
+    NIX_CFLAGS_COMPILE = toString (
+      [
+        "-DBSD"
+        "-DUSE_READLINE"
+      ]
+      ++ lib.optionals stdenv.cc.isClang [
+        "-Wno-error=int-conversion"
+        "-Wno-error=incompatible-function-pointer-types"
+      ]
+    );
+    NIX_LDFLAGS = "-lreadline";
+  };
+
+  makeFlags = [
+    "CC=${lib.getExe stdenv.cc}"
+    "PREFIX=${placeholder "out"}"
+    "BINDIR=${placeholder "out"}/bin"
+    "MANDIR=${placeholder "out"}/man1"
+    "CATDIR=${placeholder "out"}/cat1"
+  ];
+
+  doCheck = true;
+  checkTarget = "test";
+
+  preInstall = ''
+    mkdir -p $out/bin;
+  '';
+
+  meta = {
+    description = "Translator English -- C/C++ declarations";
+    homepage = "https://cdecl.org";
+    license = lib.licenses.publicDomain;
+    maintainers = with lib.maintainers; [ sigmanificient ];
+    platforms = lib.platforms.unix;
+    mainProgram = "cdecl";
+  };
+}
diff --git a/pkgs/by-name/cd/cdecl-blocks/test_remove_interactive_line.patch b/pkgs/by-name/cd/cdecl-blocks/test_remove_interactive_line.patch
new file mode 100644
index 0000000000000..5a769f2dfec9d
--- /dev/null
+++ b/pkgs/by-name/cd/cdecl-blocks/test_remove_interactive_line.patch
@@ -0,0 +1,10 @@
+--- a/test_expected_output.txt	2024-05-07 05:47:13.184419240 +0200
++++ b/test_expected_output.txt	2024-05-07 05:48:38.980122345 +0200
+@@ -26,7 +26,6 @@
+ 	options
+ 	create (-c), nocreate
+ 	prompt, noprompt (-q)
+-	interactive (-i), nointeractive
+ 	ritchie (-r), preansi (-p), ansi (-a) or cplusplus (-+)
+ 
+ Current set values are:
diff --git a/pkgs/by-name/cd/cdecl/package.nix b/pkgs/by-name/cd/cdecl/package.nix
new file mode 100644
index 0000000000000..d75f6d994b024
--- /dev/null
+++ b/pkgs/by-name/cd/cdecl/package.nix
@@ -0,0 +1,68 @@
+{
+  lib,
+  stdenv,
+  fetchFromGitHub,
+  autoconf,
+  automake,
+  bison,
+  flex,
+  readline,
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "cdecl";
+  version = "17.0";
+
+  src = fetchFromGitHub {
+    owner = "paul-j-lucas";
+    repo = "cdecl";
+    rev = "refs/tags/cdecl-${finalAttrs.version}";
+    hash = "sha256-ElMmsFD4VXF6BFjFuuWmgFJaqCPCxpQB7S9tLkeGmMY=";
+  };
+
+  strictDeps = true;
+  preConfigure = "./bootstrap";
+
+  nativeBuildInputs = [ autoconf automake bison flex ];
+  buildInputs = [ readline ];
+
+  env = {
+    NIX_CFLAGS_COMPILE = toString (
+      [
+        "-DBSD"
+        "-DUSE_READLINE"
+      ]
+      ++ lib.optionals stdenv.cc.isClang [
+        "-Wno-error=int-conversion"
+        "-Wno-error=incompatible-function-pointer-types"
+      ]
+    );
+    NIX_LDFLAGS = "-lreadline";
+  };
+
+  makeFlags = [
+    "CC=${stdenv.cc.targetPrefix}cc"
+    "PREFIX=${placeholder "out"}"
+    "BINDIR=${placeholder "out"}/bin"
+    "MANDIR=${placeholder "out"}/man1"
+    "CATDIR=${placeholder "out"}/cat1"
+  ];
+
+  doCheck = true;
+  checkTarget = "test";
+
+  preInstall = ''
+    mkdir -p $out/bin;
+  '';
+
+  outputs = [ "out" "man" ];
+
+  meta = {
+    description = "Composing and deciphering C (or C++) declarations or casts, aka ''gibberish.''";
+    homepage = "https://github.com/paul-j-lucas/cdecl";
+    license = lib.licenses.gpl3Only;
+    maintainers = with lib.maintainers; [ sigmanificient ];
+    platforms = lib.platforms.unix;
+    mainProgram = "cdecl";
+  };
+})
diff --git a/pkgs/by-name/cd/cdk/package.nix b/pkgs/by-name/cd/cdk/package.nix
index 9848f293a011b..2d4968e5ce587 100644
--- a/pkgs/by-name/cd/cdk/package.nix
+++ b/pkgs/by-name/cd/cdk/package.nix
@@ -6,11 +6,11 @@
 
 stdenv.mkDerivation (finalAttrs: {
   pname = "cdk";
-  version = "5.0-20230201";
+  version = "5.0-20240619";
 
   src = fetchurl {
     url = "https://invisible-mirror.net/archives/cdk/cdk-${finalAttrs.version}.tgz";
-    hash = "sha256-oxJ7Wf5QX16Jjao90VsM9yShJ0zmgWW3eb4vKdTE8vY=";
+    hash = "sha256-Q28U6KdW5j3f9ZJ+73DJ3PceTFnVZYfiYwKk9yahnv8=";
   };
 
   buildInputs = [
diff --git a/pkgs/by-name/cd/cdncheck/package.nix b/pkgs/by-name/cd/cdncheck/package.nix
new file mode 100644
index 0000000000000..52f28bf9a851c
--- /dev/null
+++ b/pkgs/by-name/cd/cdncheck/package.nix
@@ -0,0 +1,43 @@
+{
+  lib,
+  buildGoModule,
+  fetchFromGitHub,
+}:
+
+buildGoModule rec {
+  pname = "cdncheck";
+  version = "1.1.0";
+
+  src = fetchFromGitHub {
+    owner = "projectdiscovery";
+    repo = "cdncheck";
+    rev = "refs/tags/v${version}";
+    hash = "sha256-1TYUSWbcWnRsOM8ctY1g9CmFSAXiK9NmN5ZDaKeJIgw=";
+  };
+
+  vendorHash = "sha256-0fiZJeBvxUib8a9CeTmYottOp+15YEdTVYhdzKSSCrk=";
+
+  subPackages = [ "cmd/cdncheck/" ];
+
+
+  ldflags = [
+    "-s"
+    "-w"
+  ];
+
+  preCheck = ''
+    # Tests require network access
+    substituteInPlace other_test.go \
+      --replace-fail "TestCheckDomainWithFallback" "SkipTestCheckDomainWithFallback" \
+      --replace-fail "TestCheckDNSResponse" "SkipTestCheckDNSResponse"
+  '';
+
+  meta = with lib; {
+    description = "Tool to detect various technology for a given IP address";
+    homepage = "https://github.com/projectdiscovery/cdncheck";
+    changelog = "https://github.com/projectdiscovery/cdncheck/releases/tag/v${version}";
+    license = licenses.mit;
+    maintainers = with maintainers; [ fab ];
+    mainProgram = "cdncheck";
+  };
+}
diff --git a/pkgs/by-name/cd/cdwe/package.nix b/pkgs/by-name/cd/cdwe/package.nix
index 9f20c80199020..b891daee2980c 100644
--- a/pkgs/by-name/cd/cdwe/package.nix
+++ b/pkgs/by-name/cd/cdwe/package.nix
@@ -17,7 +17,7 @@ rustPlatform.buildRustPackage rec {
   cargoHash = "sha256-V2eWVoRtfjHLe2AypYekUFzMnuV8RYU9Pb7Q1U3fwp4=";
 
   meta = with lib; {
-    description = "A configurable cd wrapper that lets you define your environment per directory";
+    description = "Configurable cd wrapper that lets you define your environment per directory";
     homepage = "https://github.com/synoet/cdwe";
     license = licenses.mit;
     maintainers = with maintainers; [ figsoda ];