-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
Octave modules #108562
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
Merged
Merged
Octave modules #108562
Changes from all commits
Commits
Show all changes
68 commits
Select commit
Hold shift + click to select a range
481e1d3
octave.pkgs: init
KarlJoad 572ecd5
octave.pkgs.signal: init at 1.4.1
KarlJoad c45d56a
octave.pkgs.symbolic: init at 2.9.0
KarlJoad 77fdefa
octave.pkgs.linear-algebra: init at 2.2.3
KarlJoad 6bb3161
octave.pkgs.io: init at 2.6.3
KarlJoad 76bcbfc
octave.pkgs.general: init at version 2.1.1
KarlJoad 88f20f3
octave.pkgs.arduino: init at 0.6.0
KarlJoad 035879d
octave.pkgs.audio: init at 2.0.2
KarlJoad 3cf6bd0
octave.pkgs.bim: init at 1.1.5
KarlJoad c4765ca
octave.pkgs.bsltl: init at 1.3.1
KarlJoad cd3928a
octave.pkgs.cgi: init at 0.1.2
KarlJoad 27f86a1
octave.pkgs.communications: init at 1.2.2
KarlJoad 0abd242
octave.pkgs.control: init at 3.2.0
KarlJoad f429821
octave.pkgs.data-smoothing: init at 1.3.0
KarlJoad abd0c22
octave.pkgs.database: init at 2.4.4
KarlJoad a236575
octave.pkgs.dataframe: init at 1.2.0
KarlJoad 0de6cfa
octave.pkgs.dicom: init at 0.4.0
KarlJoad 7494446
octave.pkgs.divand: init at 1.1.2
KarlJoad 4e3c428
octave.pkgs.doctest: init at 0.7.0
KarlJoad 726a17c
octave.pkgs.econometrics: init at 1.1.2
KarlJoad 4296286
octave.pkgs.fem-fenics: init at 0.0.5
KarlJoad 6ad87c3
octave.pkgs.financial: init at 0.5.3
KarlJoad df13f16
octave.pkgs.fits: init at 1.0.7
KarlJoad ddabcd3
octave.pkgs.fpl: init at 1.3.5
KarlJoad 187ae71
octave.pkgs.fuzzy-logic-toolkit: init at 0.4.5
KarlJoad 0b1f57b
octave.pkgs.ga: init at 0.10.2
KarlJoad 099a55d
octave.pkgs.generate_html: init at 0.3.2
KarlJoad 33cc927
octave.pkgs.geometry: init at 4.0.0
KarlJoad 4777d91
octave.pkgs.gsl: init at 2.1.1
KarlJoad 6cce7e8
octave.pkgs.image: init at 2.12.0
KarlJoad bb3295b
octave.pkgs.image-acquisition: init at 0.2.2
KarlJoad b9bdc30
octave.pkgs.instrument-control: init at 0.6.0
KarlJoad 8ec29ea
octave.pkgs.interval: init at 3.2.0
KarlJoad 31c13c0
octave.pkgs.level-set: init at 2019-04-13
KarlJoad 0b7b03d
octave.pkgs.lssa: init at 0.1.4
KarlJoad bc8d72e
octave.pkgs.ltfat: init at 2.3.1
KarlJoad c45836b
octave.pkgs.mapping: init at 1.4.1
KarlJoad a6314f4
octave.pkgs.matgeom: init at 1.2.2
KarlJoad 29b9735
octave.pkgs.miscellaneous: init at 1.3.0
KarlJoad 7a4dc7a
octave.pkgs.msh: init at 1.0.10
KarlJoad 3c945d5
octave.pkgs.mvn: init at 1.1.0
KarlJoad e59d49e
octave.pkgs.nan: init at 3.5.2
KarlJoad 7321def
octave.pkgs.ncarray: init at 1.0.4
KarlJoad 3af6867
octave.pkgs.netcdf: init at 1.0.14
KarlJoad bfd5399
octave.pkgs.nurbs: init at 1.3.13
KarlJoad 656fbc8
octave.pkgs.ocl: init at 1.1.1
KarlJoad 8919d98
octave.pkgs.octclip: init at 2.0.1
KarlJoad 7913c41
octave.pkgs.octproj: init at 2.0.1
KarlJoad 25b1e33
octave.pkgs.optics: init at 0.1.4
KarlJoad 686dc5c
octave.pkgs.optim: init at 1.6.0
KarlJoad 3669503
octave.pkgs.optiminterp: init at 0.3.6
KarlJoad 68f2862
octave.pkgs.parallel: init at 4.0.0
KarlJoad 00a723b
octave.pkgs.struct: init at 1.0.16
KarlJoad d8612d6
octave.pkgs.quaternion: init at 2.4.0
KarlJoad 5c3b1a0
octave.pkgs.queueing: init at 1.2.7
KarlJoad b1fb1a3
octave.pkgs.sockets: init at 1.2.1
KarlJoad c968c7a
octave.pkgs.stk: init at 2.6.1
KarlJoad 75918e1
octave.pkgs.sparsersb: init at 1.0.8
KarlJoad 545804e
octave.pkgs.splines: init at 1.3.3
KarlJoad 57c8919
octave.pkgs.statistics: init at 1.4.2
KarlJoad 49d3aac
octave.pkgs.strings: init at 1.2.0
KarlJoad 609223e
octave.pkgs.tisean: init at 0.2.3
KarlJoad 455befa
octave.pkgs.tsa: init at 4.6.2
KarlJoad 2c9224c
octave.pkgs.vibes: init at 0.2.0
KarlJoad 97ac699
octave.pkgs.video: init at 2.0.0
KarlJoad 487f5ba
octave.pkgs.vrml: init at 1.0.13
KarlJoad 04129d3
octave.pkgs.windows: init at 1.5.0
KarlJoad 64bacd1
octave.pkgs.zeromq: init at 1.5.2
KarlJoad File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
|
|
||
| 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.
Outdated
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.
Outdated
Show resolved
Hide resolved
|
||
| }; | ||
| }; | ||
| } | ||
113 changes: 113 additions & 0 deletions
113
pkgs/development/interpreters/octave/build-octave-package.nix
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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; | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.