2021-12-15 02:30:49 +01:00
|
|
|
{ static ? false }:
|
|
|
|
|
|
|
|
let
|
|
|
|
# Pinned Nixpkgs for reproducibility
|
2022-05-04 10:17:17 +02:00
|
|
|
nixpkgs = builtins.fetchTarball
|
2023-03-06 10:11:39 +01:00
|
|
|
{ name = "nixpkgs-22.11.b26d52c9feb";
|
|
|
|
url = "https://github.com/nixos/nixpkgs/archive/b26d52c9feb.tar.gz";
|
|
|
|
sha256 = "1h2fnn64fx40v42ky8g89jpisjpsz7d2psb1v7jwb2n6rd5yl1ig";
|
2022-05-04 10:17:17 +02:00
|
|
|
};
|
2021-12-15 02:30:49 +01:00
|
|
|
|
2021-12-15 02:30:58 +01:00
|
|
|
# Needed for HTML manual
|
|
|
|
katex = builtins.fetchTarball {
|
|
|
|
url = "https://github.com/KaTeX/KaTeX/releases/download/v0.15.1/katex.tar.gz";
|
|
|
|
sha256 = "007nv11r0z9fz593iwzn55nc0p0wj5lpgf0k2brhs1ynmikq9gjr";
|
|
|
|
};
|
|
|
|
|
2021-12-15 02:30:49 +01:00
|
|
|
# Exclude this file and build artifacts
|
|
|
|
source = builtins.filterSource
|
|
|
|
(path: type:
|
2021-12-15 02:31:20 +01:00
|
|
|
!builtins.elem path [ "configure.mk" "default.nix" "result" ]
|
2021-12-15 02:30:49 +01:00
|
|
|
&& baseNameOf path != "build") ./.;
|
|
|
|
|
2022-05-04 10:17:17 +02:00
|
|
|
inherit (import nixpkgs {}) lib pkgs;
|
2021-12-15 02:30:49 +01:00
|
|
|
|
|
|
|
in
|
|
|
|
pkgs.stdenv.mkDerivation rec {
|
|
|
|
pname = "gray";
|
|
|
|
version = "0.1";
|
|
|
|
src = source;
|
|
|
|
|
2021-12-15 02:30:58 +01:00
|
|
|
nativeBuildInputs = with pkgs; [
|
|
|
|
# fortran
|
|
|
|
gfortran
|
|
|
|
|
|
|
|
# debugging
|
|
|
|
makefile2graph graphviz
|
|
|
|
|
|
|
|
# documentation
|
2021-12-15 02:31:17 +01:00
|
|
|
help2man pandoc
|
|
|
|
haskellPackages.pandoc-crossref
|
2021-12-15 02:30:58 +01:00
|
|
|
(texlive.combine {
|
|
|
|
inherit (texlive) scheme-small xetex fontspec;
|
|
|
|
})
|
2022-05-04 10:17:17 +02:00
|
|
|
|
|
|
|
# save nixpkgs tarball from gc
|
|
|
|
nixpkgs
|
2021-12-15 02:30:58 +01:00
|
|
|
];
|
|
|
|
|
2021-12-15 02:31:19 +01:00
|
|
|
buildInputs = lib.optional static pkgs.glibc.static;
|
|
|
|
|
2021-12-15 02:30:58 +01:00
|
|
|
# fonts needed for the PDF manual
|
|
|
|
FONTCONFIG_FILE = pkgs.makeFontsConf {
|
|
|
|
fontDirectories = with pkgs; [ fira-mono libertinus ];
|
|
|
|
};
|
|
|
|
|
2021-12-15 02:31:19 +01:00
|
|
|
enableParallelBuilding = true;
|
2021-12-15 02:30:49 +01:00
|
|
|
|
|
|
|
hardeningDisable = [ "format" ];
|
|
|
|
configureFlags = [
|
|
|
|
(lib.enableFeature static "static")
|
2021-12-15 02:30:58 +01:00
|
|
|
"--with-katex=${katex}"
|
2023-10-13 13:58:47 +02:00
|
|
|
"--enable-deterministic"
|
2021-12-15 02:30:49 +01:00
|
|
|
"GIT_REV=${version}"
|
|
|
|
"GIT_DIRTY="
|
|
|
|
];
|
|
|
|
|
|
|
|
meta = {
|
|
|
|
homepage = "https://doi.org/10.13182/FST07-A1494";
|
|
|
|
description = "A quasi-optical beam-tracing code for EC waves in tokamaks";
|
|
|
|
platforms = lib.platforms.unix;
|
|
|
|
# license?
|
|
|
|
};
|
|
|
|
}
|