rupurt / gnu-cobol-nix

Nix flake to build GnuCOBOL and GnuCOBOL Contrib
MIT License
0 stars 0 forks source link

gnu-cobol-nix

Nix flake to build GnuCOBOL and GnuCOBOL Contrib on Linux & MacOS. This flake fetches source from Github mirrors 1, 2 of the upstream SourceForge SVN repositories.

Usage

{
  description = "Your nix flake with GnuCOBOL. Hack the planet!";

  inputs = {
    nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable";
    flake-utils.url = "github:numtide/flake-utils";
    gnu-cobol= {
      url = "github:rupurt/gnu-cobol-nix";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };

  outputs = {
    flake-utils,
    gnu-cobol,
    nixpkgs,
    ...
  }: let
    systems = ["x86_64-linux" "aarch64-linux" "x86_64-darwin" "aarch64-darwin"];
    outputs = flake-utils.lib.eachSystem systems (system: let
      pkgs = import nixpkgs {
        overlays = [
          gnu-cobol.overlay
        ];
      };
    in {
      # nix fmt
      formatter = pkgs.alejandra;

      # nix develop -c $SHELL
      devShells.default = pkgs.mkShell {
        name = "default dev shell";

        packages = with pkgs; [
          gnu-cobol-pkgs.gnu-cobol.bin
        ];
      };
    });
  in
    outputs;
}

Utilities

cobc

An open-source COBOL compiler

> cobc --help
GnuCOBOL compiler for most COBOL dialects with lots of extensions

Usage: cobc [options]... file...

Options:
  -h, --help            display this help and exit
  -V, --version         display compiler version information and exit
  -dumpversion          display compiler version and exit
  -i, --info            display compiler information (build/environment)
                        and exit
...

cobcrun

COBOL driver program for GnuCOBOL modules

> cobcrun --help
GnuCOBOL module loader

Usage: cobcrun [options] PROGRAM [parameter ...]
  or:  cobcrun options

Options:
  -h, --help                      display this help and exit
  -V, --version                   display version information for cobcrun + runtime and exit
  -dumpversion                    display runtime version and exit
  -i, --info                      display runtime information (build/environment)
  -v, --verbose                   display extended output with --info
  -c <file>, --config=<file>      set runtime configuration from <file>
  -r, --runtime-config            display current runtime configuration
                                  (value and origin for all settings)
  -M <module>, --module=<module>  set entry point module name and/or load path
                                  where -M module prepends any directory to the
                                  dynamic link loader library search path
                                  and any basename to the module preload list
                                  (COB_LIBRARY_PATH and/or COB_PRELOAD)

Report bugs to: bug-gnucobol@gnu.org
or (preferably) use the issue tracker via the home page.
GnuCOBOL home page: <https://www.gnu.org/software/gnucobol/>
General help using GNU software: <https://www.gnu.org/gethelp/>

cob-config

Shell script which simplifies configuring applications against a particular version of the GnuCOBOL library.

> cob-config
This is a shell script which simplifies configuring applications
against a particular version of the GnuCOBOL library.

Usage: cob-config [options]

echos configuration variables of libcob (GnuCOBOL).

Options:
  --prefix           echos the package-prefix of libcob (GnuCOBOL)
  --exec-prefix      echos the executable-prefix of libcob (GnuCOBOL)

  --cflags           echos the C compiler flags needed to compile with libcob (GnuCOBOL)
  --libs             echos the libraries needed to link with libcob (GnuCOBOL)

  --version          echos the release+patchdate version of libcob (GnuCOBOL)

  --bindir           echos the directory containing libcob (GnuCOBOL) programs
  --datarootdir      echos the data root for libcob (GnuCOBOL)
  --datadir          echos the directory containing libcob (GnuCOBOL) data
  --includedir       echos the directory containing libcob (GnuCOBOL) header files
  --libdir           echos the directory containing libcob (GnuCOBOL) libraries
  --mandir           echos the directory containing libcob (GnuCOBOL) manpages

  --help             prints this message

gcsort

A sort tool that implements a subset of the Micro Focus MFSORT utility

> gcsort --help
...

Development

> nix develop -c $SHELL