2022-09-09 14:08:57 +00:00
|
|
|
{ lib, stdenv, fetchurl, bison, buildPackages }:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
let
|
|
|
|
mkJam = { meta ? { }, ... } @ args: stdenv.mkDerivation (args // {
|
|
|
|
depsBuildBuild = [ buildPackages.stdenv.cc ];
|
|
|
|
nativeBuildInputs = [ bison ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
# Jambase expects ar to have flags.
|
|
|
|
preConfigure = ''
|
|
|
|
export AR="$AR rc"
|
|
|
|
'';
|
|
|
|
|
|
|
|
LOCATE_TARGET = "bin.unix";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
buildPhase = ''
|
|
|
|
runHook preBuild
|
|
|
|
make $makeFlags jam0
|
|
|
|
./jam0 -j$NIX_BUILD_CORES -sCC=${buildPackages.stdenv.cc.targetPrefix}cc jambase.c
|
|
|
|
./jam0 -j$NIX_BUILD_CORES
|
|
|
|
runHook postBuild
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
installPhase = ''
|
|
|
|
runHook preInstall
|
|
|
|
mkdir -p $out/bin $out/doc/jam
|
|
|
|
cp bin.unix/jam $out/bin/jam
|
|
|
|
cp *.html $out/doc/jam
|
|
|
|
runHook postInstall
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
enableParallelBuilding = true;
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
meta = with lib; meta // {
|
|
|
|
license = licenses.free;
|
|
|
|
mainProgram = "jam";
|
|
|
|
platforms = platforms.unix;
|
|
|
|
};
|
|
|
|
});
|
|
|
|
in
|
|
|
|
{
|
|
|
|
jam = let
|
|
|
|
pname = "jam";
|
|
|
|
version = "2.6.1";
|
|
|
|
in mkJam {
|
|
|
|
inherit pname version;
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://swarm.workshop.perforce.com/projects/perforce_software-jam/download/main/${pname}-${version}.tar";
|
|
|
|
sha256 = "19xkvkpycxfsncxvin6yqrql3x3z9ypc1j8kzls5k659q4kv5rmc";
|
|
|
|
};
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Just Another Make";
|
|
|
|
homepage = "https://www.perforce.com/resources/documentation/jam";
|
|
|
|
maintainers = with maintainers; [ impl orivej ];
|
|
|
|
};
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
ftjam = let
|
|
|
|
pname = "ftjam";
|
|
|
|
version = "2.5.2";
|
|
|
|
in mkJam {
|
|
|
|
inherit pname version;
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
src = fetchurl {
|
|
|
|
url = "https://downloads.sourceforge.net/project/freetype/${pname}/${version}/${pname}-${version}.tar.bz2";
|
|
|
|
hash = "sha256-6JdzUAqSkS3pGOn+v/q+S2vOedaa8ZRDX04DK4ptZqM=";
|
|
|
|
};
|
2022-01-13 20:06:32 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace Jamfile --replace strip ${stdenv.cc.targetPrefix}strip
|
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
# Doesn't understand how to cross compile once bootstrapped, so we'll just
|
|
|
|
# use the Makefile for the bootstrapping portion.
|
|
|
|
configurePlatforms = [ "build" "target" ];
|
|
|
|
configureFlags = [
|
|
|
|
"CC=${buildPackages.stdenv.cc.targetPrefix}cc"
|
|
|
|
"--host=${stdenv.buildPlatform.config}"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-09 14:08:57 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "FreeType's enhanced, backwards-compatible Jam clone";
|
|
|
|
homepage = "https://freetype.org/jam/";
|
|
|
|
maintainers = with maintainers; [ AndersonTorres impl ];
|
|
|
|
};
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|