aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2024-01-29 09:34:05 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2024-01-29 09:34:05 -0500
commit489a4265994481a59975110d1aa79e9b4a179aa3 (patch)
treeab7bc9111f494bf4d8480c60497362d3c5b018eb
parent5c95d01cfa9364f7aa5c2796bce1c6a98b8ee134 (diff)
downloadhomebrew-nedit-489a4265994481a59975110d1aa79e9b4a179aa3.tar.gz
Initial commit
-rw-r--r--Formula/nedit.rb47
1 files changed, 47 insertions, 0 deletions
diff --git a/Formula/nedit.rb b/Formula/nedit.rb
new file mode 100644
index 0000000..24c9329
--- /dev/null
+++ b/Formula/nedit.rb
@@ -0,0 +1,47 @@
+class Nedit < Formula
+ desc "Fast, compact Motif/X11 plain text editor w/ Debian patches"
+ homepage "https://sourceforge.net/projects/nedit/"
+ url "http://deb.debian.org/debian/pool/main/n/nedit/nedit_5.7.orig.tar.gz"
+ sha256 "32bf3fc15dbb6154838a34d560ca5b0f3e7744301f4c15f8a2af8ad2ea3d0764"
+ license "GPL-2.0-or-later"
+ revision 1
+
+ resource "patches" do
+ url "http://deb.debian.org/debian/pool/main/n/nedit/nedit_5.7-5.debian.tar.xz"
+ sha256 "32bf3fc15dbb6154838a34d560ca5b0f3e7744301f4c15f8a2af8ad2ea3d0764"
+ end
+
+ depends_on "libice"
+ depends_on "libsm"
+ depends_on "libx11"
+ depends_on "libxext"
+ depends_on "libxp"
+ depends_on "libxpm"
+ depends_on "libxt"
+ depends_on "openmotif"
+
+ uses_from_macos "bison" => :build
+
+ def install
+ resources("patches").stage { "." }
+ File.foreach("debian/patches/series", "\n") do |fp|
+ system "patch", "-p1", fp.chomp
+ end
+ os = OS.mac? ? "macosx" : OS.kernel_name.downcase
+ system "make", os, "MOTIFLINK='-lXm'"
+ system "make", "-C", "doc", "man", "doc"
+
+ bin.install "source/nedit"
+ bin.install "source/nc" => "ncl"
+
+ man1.install "doc/nedit.man" => "nedit.1x"
+ man1.install "doc/nc.man" => "ncl.1x"
+ (etc/"X11/app-defaults").install "doc/NEdit.ad" => "NEdit"
+ doc.install Dir["doc/*"]
+ end
+
+ test do
+ assert_match "Can't open display", shell_output("DISPLAY= #{bin}/nedit 2>&1", 1)
+ assert_match "Can't open display", shell_output("DISPLAY= #{bin}/ncl 2>&1", 1)
+ end
+end