From 32b313f704c70c8fb2b85d16817b302e22b87f86 Mon Sep 17 00:00:00 2001 From: Vincenzo Mantova <1962985+xworld21@users.noreply.github.com> Date: Sat, 22 Apr 2023 21:28:51 +0100 Subject: snobol4: init at 2.3.1 (#225028) --- pkgs/development/interpreters/snobol4/default.nix | 64 ++++++++++++++++++++++ .../interpreters/snobol4/fix-paths.patch | 23 ++++++++ pkgs/top-level/all-packages.nix | 2 + 3 files changed, 89 insertions(+) create mode 100644 pkgs/development/interpreters/snobol4/default.nix create mode 100644 pkgs/development/interpreters/snobol4/fix-paths.patch (limited to 'pkgs') diff --git a/pkgs/development/interpreters/snobol4/default.nix b/pkgs/development/interpreters/snobol4/default.nix new file mode 100644 index 0000000000000..c7e703f64eef5 --- /dev/null +++ b/pkgs/development/interpreters/snobol4/default.nix @@ -0,0 +1,64 @@ +{ lib +, fetchurl +, stdenv +, bzip2 +, gdbm +, gnum4 +, gzip +, libffi +, openssl +, readline +, sqlite +, tcl +, xz +, zlib +}: + +stdenv.mkDerivation rec { + pname = "snobol4"; + version = "2.3.1"; + + src = fetchurl { + urls = [ + "https://ftp.regressive.org/snobol4/snobol4-${version}.tar.gz" + # fallback for when the current version is moved to the old folder + "https://ftp.regressive.org/snobol4/old/snobol4-${version}.tar.gz" + ]; + hash = "sha256-kSRNZ9TinSqtzlZVvUOC/6tExiSn6krWQRQn86vxdTU="; + }; + + outputs = [ "out" "man" "doc" ]; + + # gzip used by Makefile to compress man pages + nativeBuildInputs = [ gnum4 gzip ]; + # enable all features (undocumented, based on manual review of configure script) + buildInputs = [ bzip2 libffi openssl readline sqlite tcl xz zlib ] + # ndbm compat library + ++ lib.optional stdenv.isLinux gdbm; + configureFlags = lib.optional (tcl != null) "--with-tcl=${tcl}/lib/tclConfig.sh"; + + # INSTALL says "parallel make will fail" + enableParallelBuilding = false; + + patches = [ ./fix-paths.patch ]; + + # configure does not support --sbindir and the likes (as introduced by multiple-outputs.sh) + # so man, doc outputs must be handled manually + preConfigurePhases = [ "prePreConfigurePhase" ]; + prePreConfigurePhase = '' + preConfigureHooks="''${preConfigureHooks//_multioutConfig/}" + prependToVar configureFlags --mandir="$man"/share/man + ''; + + meta = with lib; { + description = "The Macro Implementation of SNOBOL4 in C"; + longDescription = '' + An open source port of Macro SNOBOL4 (The original Bell Telephone Labs implementation, written in SIL macros) by Phil Budne. + Supports full SNOBOL4 language plus SPITBOL, [Blocks](https://www.regressive.org/snobol4/blocks/) and other extensions. + ''; + homepage = "https://www.regressive.org/snobol4/csnobol4/"; + license = licenses.bsd2; + platforms = platforms.all; + maintainers = with maintainers; [ xworld21 ]; + }; +} diff --git a/pkgs/development/interpreters/snobol4/fix-paths.patch b/pkgs/development/interpreters/snobol4/fix-paths.patch new file mode 100644 index 0000000000000..d8b424ed3af6e --- /dev/null +++ b/pkgs/development/interpreters/snobol4/fix-paths.patch @@ -0,0 +1,23 @@ +--- a/configure ++++ b/configure +@@ -327,9 +327,9 @@ + SNOLIB_LOCAL="$SNOLIB/local" + SNOLIB_DOC="$SNOLIB" + # XXX use $PREFIX/include/snobol4 ??? +-INCLUDE_DIR="$SNOLIB/include" ++INCLUDE_DIR="$PREFIX"/include/snolib4 + +-DOC_DIR="$PREFIX/share/doc/snobol4-$VERSION" ++DOC_DIR="$doc/share/doc/snobol4-$VERSION" + + echo 'BINDIR=$(DESTDIR)'"$BINDIR" >> $CONFIG_M4 + echo 'MANDIR=$(DESTDIR)'"$MANDIR" >> $CONFIG_M4 +@@ -2110,7 +2110,7 @@ + # IRIX /sbin/install + + # should always find ./install-sh +-for DIR in /usr/bin /usr/ucb /usr/local/bin /bin .; do ++for DIR in `echo $PATH | tr ':' ' '`; do + for INSTALL in install ginstall scoinst install-sh; do + IPATH=$DIR/$INSTALL + if [ -d $IPATH ]; then diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index a6018360ba7a4..0850c4ad65f4e 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -12288,6 +12288,8 @@ with pkgs; sniffglue = callPackage ../tools/networking/sniffglue { }; + snobol4 = callPackage ../development/interpreters/snobol4 { }; + snort = callPackage ../applications/networking/ids/snort { }; so = callPackage ../development/tools/so { -- cgit 1.4.1