about summary refs log tree commit diff
path: root/nixpkgs/pkgs/by-name/ed/edbrowse/package.nix
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-03-01 11:40:12 +0100
committerAlyssa Ross <hi@alyssa.is>2024-03-01 11:40:12 +0100
commitbf6d657e5dbcb5e39fda280ef7e86b2a7794ca86 (patch)
tree8eb035cbab19794f6415cc460fac7226f7a58afc /nixpkgs/pkgs/by-name/ed/edbrowse/package.nix
parent66f707d69f1e423db5a35c2fe43b32781125a9af (diff)
parent09c1497ce5d4ed4a0edfdd44450d3048074cb300 (diff)
downloadnixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar
nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar.gz
nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar.bz2
nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar.lz
nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar.xz
nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.tar.zst
nixlib-bf6d657e5dbcb5e39fda280ef7e86b2a7794ca86.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Diffstat (limited to 'nixpkgs/pkgs/by-name/ed/edbrowse/package.nix')
-rw-r--r--nixpkgs/pkgs/by-name/ed/edbrowse/package.nix100
1 files changed, 100 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/by-name/ed/edbrowse/package.nix b/nixpkgs/pkgs/by-name/ed/edbrowse/package.nix
new file mode 100644
index 000000000000..154095e57cc8
--- /dev/null
+++ b/nixpkgs/pkgs/by-name/ed/edbrowse/package.nix
@@ -0,0 +1,100 @@
+{ lib
+, curl
+, duktape
+, fetchFromGitHub
+, html-tidy
+, openssl
+, pcre
+, perl
+, pkg-config
+, quickjs
+, readline
+, stdenv
+, unixODBC
+, which
+, withODBC ? true
+}:
+
+stdenv.mkDerivation (finalAttrs: {
+  pname = "edbrowse";
+  version = "3.8.0";
+
+  src = fetchFromGitHub {
+    owner = "CMB";
+    repo = "edbrowse";
+    rev = "v${finalAttrs.version}";
+    hash = "sha256-ZXxzQBAmu7kM3sjqg/rDLBXNucO8sFRFKXV8UxQVQZU=";
+  };
+
+  sourceRoot = "${finalAttrs.src.name}/src";
+
+  patches = [
+    # Fixes some small annoyances on src/makefile
+     ./0001-small-fixes.patch
+  ];
+
+  patchFlags =  [
+    "-p2"
+  ];
+
+  postPatch = ''
+    for file in $(find ./tools/ -type f ! -name '*.c'); do
+      patchShebangs $file
+    done
+  '';
+
+  nativeBuildInputs = [
+    pkg-config
+    which
+  ];
+
+  buildInputs = [
+    curl
+    duktape
+    html-tidy
+    openssl
+    pcre
+    perl
+    quickjs
+    readline
+  ] ++ lib.optionals withODBC [
+    unixODBC
+  ];
+
+  makeFlags = [
+    "PREFIX=${placeholder "out"}"
+  ];
+
+  preBuild = ''
+    buildFlagsArray+=(
+      BUILD_EDBR_ODBC=${if withODBC then "on" else "off"}
+      EBDEMIN=on
+      QUICKJS_LDFLAGS="-L${quickjs}/lib/quickjs -lquickjs -ldl -latomic"
+    )
+  '';
+
+  meta = {
+    homepage = "https://edbrowse.org/";
+    description = "Command Line Editor Browser";
+    longDescription = ''
+      Edbrowse is a combination editor, browser, and mail client that is 100%
+      text based. The interface is similar to /bin/ed, though there are many
+      more features, such as editing multiple files simultaneously, and
+      rendering html. This program was originally written for blind users, but
+      many sighted users have taken advantage of the unique scripting
+      capabilities of this program, which can be found nowhere else. A batch
+      job, or cron job, can access web pages on the internet, submit forms, and
+      send email, with no human intervention whatsoever. edbrowse can also tap
+      into databases through odbc. It was primarily written by Karl Dahlke.
+    '';
+    license = with lib.licenses; [ gpl1Plus ];
+    mainProgram = "edbrowse";
+    maintainers = with lib.maintainers; [
+      schmitthenner
+      equirosa
+      AndersonTorres
+    ];
+    platforms = lib.platforms.linux;
+  };
+})
+# TODO: send the patch to upstream developers