2023-07-15 17:15:38 +00:00
|
|
|
{ lib
|
|
|
|
, fetchurl
|
|
|
|
, pkgs
|
|
|
|
, stdenv
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "fortran-fpm";
|
|
|
|
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.10.1";
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
src = fetchurl {
|
|
|
|
url = "https://github.com/fortran-lang/fpm/releases/download/v${version}/fpm-${version}.F90";
|
2024-04-21 15:54:59 +00:00
|
|
|
sha256 = "sha256-dVPQW2DCp+iJojuhCgeEFVFpugG/x+DKhG986QuE4co=";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
dontUnpack = true;
|
|
|
|
|
|
|
|
nativeBuildInputs = with pkgs; [ gfortran ];
|
|
|
|
|
|
|
|
buildPath = "build/bootstrap";
|
|
|
|
|
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
|
|
|
|
mkdir -p ${buildPath}
|
|
|
|
gfortran -J ${buildPath} -o ${buildPath}/${pname} $src
|
|
|
|
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
|
|
|
|
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
|
|
|
|
mkdir -p $out/bin
|
|
|
|
cp ${buildPath}/${pname} $out/bin
|
|
|
|
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Fortran Package Manager (fpm)";
|
|
|
|
homepage = "https://fpm.fortran-lang.org";
|
|
|
|
maintainers = [ maintainers.proofconstruction ];
|
|
|
|
license = licenses.mit;
|
|
|
|
platforms = platforms.all;
|
2024-01-02 11:29:13 +00:00
|
|
|
mainProgram = "fortran-fpm";
|
2023-07-15 17:15:38 +00:00
|
|
|
};
|
|
|
|
}
|