Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Octave modules #108562

Merged
merged 68 commits into from
Feb 24, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
481e1d3
octave.pkgs: init
KarlJoad Feb 14, 2021
572ecd5
octave.pkgs.signal: init at 1.4.1
KarlJoad Dec 13, 2020
c45d56a
octave.pkgs.symbolic: init at 2.9.0
KarlJoad Dec 13, 2020
77fdefa
octave.pkgs.linear-algebra: init at 2.2.3
KarlJoad Dec 13, 2020
6bb3161
octave.pkgs.io: init at 2.6.3
KarlJoad Dec 16, 2020
76bcbfc
octave.pkgs.general: init at version 2.1.1
KarlJoad Dec 18, 2020
88f20f3
octave.pkgs.arduino: init at 0.6.0
KarlJoad Jan 6, 2021
035879d
octave.pkgs.audio: init at 2.0.2
KarlJoad Jan 6, 2021
3cf6bd0
octave.pkgs.bim: init at 1.1.5
KarlJoad Jan 6, 2021
c4765ca
octave.pkgs.bsltl: init at 1.3.1
KarlJoad Jan 6, 2021
cd3928a
octave.pkgs.cgi: init at 0.1.2
KarlJoad Jan 6, 2021
27f86a1
octave.pkgs.communications: init at 1.2.2
KarlJoad Jan 6, 2021
0abd242
octave.pkgs.control: init at 3.2.0
KarlJoad Dec 13, 2020
f429821
octave.pkgs.data-smoothing: init at 1.3.0
KarlJoad Jan 6, 2021
abd0c22
octave.pkgs.database: init at 2.4.4
KarlJoad Jan 6, 2021
a236575
octave.pkgs.dataframe: init at 1.2.0
KarlJoad Jan 6, 2021
0de6cfa
octave.pkgs.dicom: init at 0.4.0
KarlJoad Jan 6, 2021
7494446
octave.pkgs.divand: init at 1.1.2
KarlJoad Jan 6, 2021
4e3c428
octave.pkgs.doctest: init at 0.7.0
KarlJoad Jan 6, 2021
726a17c
octave.pkgs.econometrics: init at 1.1.2
KarlJoad Jan 6, 2021
4296286
octave.pkgs.fem-fenics: init at 0.0.5
KarlJoad Jan 6, 2021
6ad87c3
octave.pkgs.financial: init at 0.5.3
KarlJoad Jan 6, 2021
df13f16
octave.pkgs.fits: init at 1.0.7
KarlJoad Jan 6, 2021
ddabcd3
octave.pkgs.fpl: init at 1.3.5
KarlJoad Jan 6, 2021
187ae71
octave.pkgs.fuzzy-logic-toolkit: init at 0.4.5
KarlJoad Jan 6, 2021
0b1f57b
octave.pkgs.ga: init at 0.10.2
KarlJoad Jan 6, 2021
099a55d
octave.pkgs.generate_html: init at 0.3.2
KarlJoad Jan 6, 2021
33cc927
octave.pkgs.geometry: init at 4.0.0
KarlJoad Jan 6, 2021
4777d91
octave.pkgs.gsl: init at 2.1.1
KarlJoad Jan 6, 2021
6cce7e8
octave.pkgs.image: init at 2.12.0
KarlJoad Jan 6, 2021
bb3295b
octave.pkgs.image-acquisition: init at 0.2.2
KarlJoad Jan 6, 2021
b9bdc30
octave.pkgs.instrument-control: init at 0.6.0
KarlJoad Jan 6, 2021
8ec29ea
octave.pkgs.interval: init at 3.2.0
KarlJoad Jan 6, 2021
31c13c0
octave.pkgs.level-set: init at 2019-04-13
KarlJoad Jan 6, 2021
0b7b03d
octave.pkgs.lssa: init at 0.1.4
KarlJoad Jan 6, 2021
bc8d72e
octave.pkgs.ltfat: init at 2.3.1
KarlJoad Jan 6, 2021
c45836b
octave.pkgs.mapping: init at 1.4.1
KarlJoad Jan 6, 2021
a6314f4
octave.pkgs.matgeom: init at 1.2.2
KarlJoad Jan 6, 2021
29b9735
octave.pkgs.miscellaneous: init at 1.3.0
KarlJoad Jan 6, 2021
7a4dc7a
octave.pkgs.msh: init at 1.0.10
KarlJoad Jan 6, 2021
3c945d5
octave.pkgs.mvn: init at 1.1.0
KarlJoad Jan 6, 2021
e59d49e
octave.pkgs.nan: init at 3.5.2
KarlJoad Jan 6, 2021
7321def
octave.pkgs.ncarray: init at 1.0.4
KarlJoad Jan 6, 2021
3af6867
octave.pkgs.netcdf: init at 1.0.14
KarlJoad Jan 6, 2021
bfd5399
octave.pkgs.nurbs: init at 1.3.13
KarlJoad Jan 6, 2021
656fbc8
octave.pkgs.ocl: init at 1.1.1
KarlJoad Jan 6, 2021
8919d98
octave.pkgs.octclip: init at 2.0.1
KarlJoad Jan 6, 2021
7913c41
octave.pkgs.octproj: init at 2.0.1
KarlJoad Jan 6, 2021
25b1e33
octave.pkgs.optics: init at 0.1.4
KarlJoad Jan 6, 2021
686dc5c
octave.pkgs.optim: init at 1.6.0
KarlJoad Jan 6, 2021
3669503
octave.pkgs.optiminterp: init at 0.3.6
KarlJoad Jan 6, 2021
68f2862
octave.pkgs.parallel: init at 4.0.0
KarlJoad Jan 6, 2021
00a723b
octave.pkgs.struct: init at 1.0.16
KarlJoad Jan 6, 2021
d8612d6
octave.pkgs.quaternion: init at 2.4.0
KarlJoad Jan 6, 2021
5c3b1a0
octave.pkgs.queueing: init at 1.2.7
KarlJoad Jan 6, 2021
b1fb1a3
octave.pkgs.sockets: init at 1.2.1
KarlJoad Jan 6, 2021
c968c7a
octave.pkgs.stk: init at 2.6.1
KarlJoad Jan 6, 2021
75918e1
octave.pkgs.sparsersb: init at 1.0.8
KarlJoad Jan 6, 2021
545804e
octave.pkgs.splines: init at 1.3.3
KarlJoad Jan 6, 2021
57c8919
octave.pkgs.statistics: init at 1.4.2
KarlJoad Jan 6, 2021
49d3aac
octave.pkgs.strings: init at 1.2.0
KarlJoad Jan 6, 2021
609223e
octave.pkgs.tisean: init at 0.2.3
KarlJoad Jan 6, 2021
455befa
octave.pkgs.tsa: init at 4.6.2
KarlJoad Jan 6, 2021
2c9224c
octave.pkgs.vibes: init at 0.2.0
KarlJoad Jan 6, 2021
97ac699
octave.pkgs.video: init at 2.0.0
KarlJoad Jan 6, 2021
487f5ba
octave.pkgs.vrml: init at 1.0.13
KarlJoad Jan 6, 2021
04129d3
octave.pkgs.windows: init at 1.5.0
KarlJoad Jan 6, 2021
64bacd1
octave.pkgs.zeromq: init at 1.5.2
KarlJoad Jan 6, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
83 changes: 83 additions & 0 deletions pkgs/development/interpreters/octave/build-env.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
{ stdenv, octave, buildEnv
, makeWrapper, texinfo
, octavePackages
, wrapOctave
, computeRequiredOctavePackages
, extraLibs ? []
, extraOutputsToInstall ? []
, postBuild ? ""
, ignoreCollisions ? false
}:

# Create an octave executable that knows about additional packages
let
packages = computeRequiredOctavePackages extraLibs;

in buildEnv {
name = "${octave.name}-env";
paths = extraLibs ++ [ octave ];

inherit ignoreCollisions;
extraOutputsToInstall = [ "out" ] ++ extraOutputsToInstall;

buildInputs = [ makeWrapper texinfo wrapOctave ];

# During "build" we must first unlink the /share symlink to octave's /share
# Then, we can re-symlink the all of octave/share, except for /share/octave
# in env/share/octave, re-symlink everything from octave/share/octave and then
# perform the pkg install.
postBuild = ''
. "${makeWrapper}/nix-support/setup-hook"
# The `makeWrapper` used here is the one defined in
# ${makeWrapper}/nix-support/setup-hook

if [ -L "$out/bin" ]; then
unlink $out/bin
mkdir -p "$out/bin"
cd "${octave}/bin"
for prg in *; do
if [ -x $prg ]; then
makeWrapper "${octave}/bin/$prg" "$out/bin/$prg" --set OCTAVE_SITE_INITFILE "$out/share/octave/site/m/startup/octaverc"
fi
done
cd $out
fi

# Remove symlinks to the input tarballs, they aren't needed.
rm $out/*.tar.gz
SuperSandro2000 marked this conversation as resolved.
Show resolved Hide resolved

createOctavePackagesPath $out ${octave}

for path in ${stdenv.lib.concatStringsSep " " packages}; do
if [ -e $path/*.tar.gz ]; then
$out/bin/octave-cli --eval "pkg local_list $out/.octave_packages; \
pkg prefix $out/${octave.octPkgsPath} $out/${octave.octPkgsPath}; \
pfx = pkg (\"prefix\"); \
pkg install -nodeps -local $path/*.tar.gz"
fi
done

# Re-write the octave-wide startup file (share/octave/site/m/startup/octaverc)
# To point to the new local_list in $out
addPkgLocalList $out ${octave}

wrapOctavePrograms "${stdenv.lib.concatStringsSep " " packages}"
'' + postBuild;
SuperSandro2000 marked this conversation as resolved.
Show resolved Hide resolved

inherit (octave) meta;

passthru = octave.passthru // {
interpreter = "$out/bin/octave";
inherit octave;
env = stdenv.mkDerivation {
name = "interactive-${octave.name}-environment";

buildCommand = ''
echo >&2 ""
echo >&2 "*** octave 'env' attributes are intended for interactive nix-shell sessions, not for building! ***"
echo >&2 ""
exit 1
'';
KarlJoad marked this conversation as resolved.
Show resolved Hide resolved
};
};
}
113 changes: 113 additions & 0 deletions pkgs/development/interpreters/octave/build-octave-package.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
# Generic builder for GNU Octave libraries.
# This is a file that contains nested functions. The first, outer, function
# is the library- and package-wide details, such as the nixpkgs library, any
# additional configuration provided, and the namePrefix to use (based on the
# pname and version of Octave), the octave package, etc.

{ lib
, stdenv
, config
, octave
, texinfo
, computeRequiredOctavePackages
, writeRequiredOctavePackagesHook
}:

# The inner function contains information required to build the individual
# libraries.
{ fullLibName ? "${attrs.pname}-${attrs.version}"

, src

, dontPatch ? false
, patches ? []
, patchPhase ? ""

, enableParallelBuilding ? true
# Build-time dependencies for the package, which were compiled for the system compiling this.
, nativeBuildInputs ? []

# Build-time dependencies for the package, which may not have been compiled for the system compiling this.
, buildInputs ? []

# Propagate build dependencies so in case we have A -> B -> C,
# C can import package A propagated by B
# Run-time dependencies for the package.
, propagatedBuildInputs ? []

# Octave packages that are required at runtime for this one.
# These behave similarly to propagatedBuildInputs, where if
# package A is needed by B, and C needs B, then C also requires A.
# The main difference between these and propagatedBuildInputs is
# during the package's installation into octave, where all
# requiredOctavePackages are ALSO installed into octave.
, requiredOctavePackages ? []

, preBuild ? ""

, meta ? {}

, passthru ? {}

, ... } @ attrs:

let
requiredOctavePackages' = computeRequiredOctavePackages requiredOctavePackages;

in stdenv.mkDerivation {
packageName = "${fullLibName}";
# The name of the octave package ends up being
# "octave-version-package-version"
name = "${octave.pname}-${octave.version}-${fullLibName}";

# This states that any package built with the function that this returns
# will be an octave package. This is used for ensuring other octave
# packages are installed into octave during the environment building phase.
isOctavePackage = true;

OCTAVE_HISTFILE = "/dev/null";

inherit src;

inherit dontPatch patches patchPhase;

dontConfigure = true;

enableParallelBuilding = enableParallelBuilding;

requiredOctavePackages = requiredOctavePackages';

nativeBuildInputs = [
octave
writeRequiredOctavePackagesHook
]
++ nativeBuildInputs;

buildInputs = buildInputs ++ requiredOctavePackages';

propagatedBuildInputs = propagatedBuildInputs ++ [ texinfo ];

preBuild = if preBuild == "" then
''
# This trickery is needed because Octave expects a single directory inside
# at the top-most level of the tarball.
tar --transform 's,^,${fullLibName}/,' -cz * -f ${fullLibName}.tar.gz
''
else
preBuild;

buildPhase = ''
runHook preBuild

mkdir -p $out
octave-cli --eval "pkg build $out ${fullLibName}.tar.gz"

runHook postBuild
'';

# We don't install here, because that's handled when we build the environment
# together with Octave.
dontInstall = true;

inherit meta;
}
Loading