Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ The MDSplus developers want to know who you are. If you or your site is using MD
[MDSplus User Survey](https://docs.google.com/forms/d/e/1FAIpQLScSsA-fY2yTsW076bBreJmNbBqY9jsd-m4vmAdPvfCxXidiOQ/viewform?usp=sf_link).

## Building MDSplus

### Building from source manually
To build and install MDSplus on unix systems, you will need to obtain the
MDSplus distribution from github either as a git repository or as a
compressed tar file.
Expand Down Expand Up @@ -35,6 +37,7 @@ When MDSplus is built to generate releases for public distribution a deploy
script is used which uses Docker to pull specially configured Docker images
from https://hub.docker.com/r/mdsplus/docker/

### Building using Dockerized build environment
You can build MDSplus for any of the linux and windows operatings systems
without needing to install any special compilers or libraries. If you have
the mdsplus source code and Docker installed on your linux system and your
Expand All @@ -60,6 +63,20 @@ You can find the available operating systems that you could specify for the
# ls <mdsplus-src-dir>/deploy/os/*.opts


### Building with nix package manager
The mdsplus repo is a nix flake, meaning that it specifies a build recipe
for mdsplus and all of its dependencies. You can automatically download,
build, and install mdsplus using the following nix command (after enabling the
currently experimental flakes feature):

nix shell github:mdsplus/mdsplus/<branch or tag name>

Upon first invocation, the above command will build and install mdsplus into
the nix store, and then put the user into a subshell in which the mdsplus
programs are available on the PATH. The commands will be accessible until
the subshell is exited. In subsequent invocations, the user will go directly
into the subshell without rebuilding or reinstalling.

---------------------------------------------------------------------------
Who Uses MDSplus
This map shows world fusion sites using MDSplus.
Expand Down
27 changes: 27 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

59 changes: 59 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
{
description = "mdsplus scientific database";
inputs.nixpkgs.url = "github:nixos/nixpkgs/21.05";

outputs = { self, nixpkgs }:
with import nixpkgs {
system = "x86_64-linux";
};

let
mdsplus = stdenv.mkDerivation rec {
name = "mdsplus";
src = self;
# https://github.com/MDSplus/mdsplus/blob/alpha/README.INSTALL
buildInputs = [
gperf
jdk8
jre8
libxml2
readline
motif
perl
xorg.libXt
];
patchPhase = ''
patchShebangs --build .
'';
preConfigure = ''
./bootstrap
'';
nativeBuildInputs = [
which
automake
autoconf
autoconf-archive
python
git
flex
bison
gfortran
rsync
];
};

mdsplus_wrapped = runCommand "mdsplus" {
buildInputs = [ mdsplus ];
nativeBuildInputs = [ makeWrapper ];
} ''
for b in $(ls ${mdsplus}/bin); do
makeWrapper ${mdsplus}/bin/$b $out/bin/$b --set MDSPLUS_DIR "${mdsplus}"
done
ln -s ${mdsplus} $out/mdsplus-install-location
'';

in {
packages.x86_64-linux = { mdsplus = mdsplus_wrapped; };
defaultPackage.x86_64-linux = self.packages.x86_64-linux.mdsplus;
};
}