From e7c5b557f97f6a651ab025cc7c1a8ec221fe32f2 Mon Sep 17 00:00:00 2001 From: Dan Vargas Date: Sun, 6 Feb 2022 21:36:32 -0700 Subject: [PATCH] octave --> nix --- packages/octave/6.2.0/build.sh | 22 --------------------- packages/octave/6.2.0/environment | 4 ---- packages/octave/6.2.0/metadata.json | 5 ----- packages/octave/6.2.0/run | 4 ---- packages/octave/6.2.0/test.octave | 1 - runtimes/default.nix | 1 + runtimes/octave.nix | 30 +++++++++++++++++++++++++++++ 7 files changed, 31 insertions(+), 36 deletions(-) delete mode 100755 packages/octave/6.2.0/build.sh delete mode 100644 packages/octave/6.2.0/environment delete mode 100644 packages/octave/6.2.0/metadata.json delete mode 100644 packages/octave/6.2.0/run delete mode 100644 packages/octave/6.2.0/test.octave create mode 100644 runtimes/octave.nix diff --git a/packages/octave/6.2.0/build.sh b/packages/octave/6.2.0/build.sh deleted file mode 100755 index 48a9853..0000000 --- a/packages/octave/6.2.0/build.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash - -# Build octave from source -PREFIX=$(realpath $(dirname $0)) - -mkdir -p build - -cd build - -curl -L "https://ftpmirror.gnu.org/octave/octave-6.2.0.tar.gz" -o octave.tar.gz - -tar xzf octave.tar.gz --strip-components=1 - -# === autoconf based === -# Disable support for GUI, HDF5 and Java -./configure --prefix "$PREFIX" --without-opengl --without-qt --without-x --without-hdf5 --disable-java - -make -j$(nproc) -make install -j$(nproc) - -cd ../ -rm -rf build diff --git a/packages/octave/6.2.0/environment b/packages/octave/6.2.0/environment deleted file mode 100644 index fcbc1e3..0000000 --- a/packages/octave/6.2.0/environment +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Path to octave binary -export PATH=$PWD/bin:$PATH diff --git a/packages/octave/6.2.0/metadata.json b/packages/octave/6.2.0/metadata.json deleted file mode 100644 index 0b209ce..0000000 --- a/packages/octave/6.2.0/metadata.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "language": "octave", - "version": "6.2.0", - "aliases": ["matlab", "m"] -} diff --git a/packages/octave/6.2.0/run b/packages/octave/6.2.0/run deleted file mode 100644 index b3e4e73..0000000 --- a/packages/octave/6.2.0/run +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env bash - -# Run octave scripts without gui, history, init scripts and initial message -octave --no-gui --no-window-system --no-history --no-init-file --no-site-file --norc --quiet "$@" diff --git a/packages/octave/6.2.0/test.octave b/packages/octave/6.2.0/test.octave deleted file mode 100644 index a94310b..0000000 --- a/packages/octave/6.2.0/test.octave +++ /dev/null @@ -1 +0,0 @@ -disp('OK') \ No newline at end of file diff --git a/runtimes/default.nix b/runtimes/default.nix index c9050d2..3a80376 100644 --- a/runtimes/default.nix +++ b/runtimes/default.nix @@ -28,4 +28,5 @@ args: { "ponylang" = import ./ponylang.nix args; "php" = import ./php.nix args; "perl" = import ./perl.nix args; + "octave" = import ./octave.nix args; } diff --git a/runtimes/octave.nix b/runtimes/octave.nix new file mode 100644 index 0000000..1975a48 --- /dev/null +++ b/runtimes/octave.nix @@ -0,0 +1,30 @@ +{pkgs, piston, ...}: +let + pkg = pkgs.octave; +in piston.mkRuntime { + language = "octave"; + version = pkg.version; + + aliases = [ + "matlab" + "m" + ]; + + run = '' + ${pkg}/bin/octave --no-gui --no-window-system --no-history --no-init-file --no-site-file --norc --quiet "$@" + ''; + + tests = [ + (piston.mkTest { + files = { + "test.m" = '' + disp("OK"); + ''; + }; + args = []; + stdin = ""; + packages = []; + main = "test.m"; + }) + ]; +} \ No newline at end of file