ftjam: unify build steps with jam
There are only a few minor differences between the way ftjam and jam work from a build perspective, so we can use a common base for them.
This commit is contained in:
@@ -1,40 +1,73 @@
|
||||
{ lib, stdenv, fetchurl, bison }:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "jam";
|
||||
version = "2.6.1";
|
||||
let
|
||||
mkJam = { meta ? { }, ... } @ args: stdenv.mkDerivation (args // {
|
||||
nativeBuildInputs = [ bison ];
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://swarm.workshop.perforce.com/projects/perforce_software-jam/download/main/${pname}-${version}.tar";
|
||||
sha256 = "19xkvkpycxfsncxvin6yqrql3x3z9ypc1j8kzls5k659q4kv5rmc";
|
||||
# Jambase expects ar to have flags.
|
||||
preConfigure = ''
|
||||
export AR="$AR rc"
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
./jam0 -j$NIX_BUILD_CORES -sBINDIR=$out/bin install
|
||||
mkdir -p $out/doc/jam
|
||||
cp *.html $out/doc/jam
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
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;
|
||||
|
||||
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
|
||||
|
||||
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 ];
|
||||
};
|
||||
};
|
||||
|
||||
nativeBuildInputs = [ bison ];
|
||||
ftjam = let
|
||||
pname = "ftjam";
|
||||
version = "2.5.2";
|
||||
in mkJam {
|
||||
inherit pname version;
|
||||
|
||||
# Jambase expects ar to have flags.
|
||||
preConfigure = ''
|
||||
export AR="$AR rc"
|
||||
'';
|
||||
postPatch = ''
|
||||
substituteInPlace Jamfile --replace strip ${stdenv.cc.targetPrefix}strip
|
||||
'';
|
||||
|
||||
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ];
|
||||
src = fetchurl {
|
||||
url = "https://downloads.sourceforge.net/project/freetype/${pname}/${version}/${pname}-${version}.tar.bz2";
|
||||
hash = "sha256-6JdzUAqSkS3pGOn+v/q+S2vOedaa8ZRDX04DK4ptZqM=";
|
||||
};
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
./jam0 -j$NIX_BUILD_CORES -sBINDIR=$out/bin install
|
||||
mkdir -p $out/doc/jam
|
||||
cp *.html $out/doc/jam
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with lib; {
|
||||
homepage = "https://www.perforce.com/resources/documentation/jam";
|
||||
license = licenses.free;
|
||||
description = "Just Another Make";
|
||||
maintainers = with maintainers; [ impl orivej ];
|
||||
platforms = platforms.unix;
|
||||
meta = with lib; {
|
||||
description = "FreeType's enhanced, backwards-compatible Jam clone";
|
||||
homepage = "https://freetype.org/jam/";
|
||||
maintainers = with maintainers; [ AndersonTorres impl ];
|
||||
};
|
||||
};
|
||||
}
|
||||
|
||||
@@ -1,53 +0,0 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchurl
|
||||
, bison
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "ftjam";
|
||||
version = "2.5.2";
|
||||
|
||||
src = fetchurl {
|
||||
url = "https://downloads.sourceforge.net/project/freetype/${pname}/${version}/${pname}-${version}.tar.bz2";
|
||||
hash = "sha256-6JdzUAqSkS3pGOn+v/q+S2vOedaa8ZRDX04DK4ptZqM=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
bison
|
||||
];
|
||||
|
||||
preConfigure = ''
|
||||
unset AR
|
||||
'';
|
||||
|
||||
buildPhase = ''
|
||||
runHook preBuild
|
||||
|
||||
make jam0
|
||||
|
||||
runHook postBuild
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
runHook preInstall
|
||||
|
||||
./jam0 -j$NIX_BUILD_CORES -sBINDIR=$out/bin install
|
||||
mkdir -p $out/doc/jam
|
||||
cp *.html $out/doc/jam
|
||||
|
||||
runHook postInstall
|
||||
'';
|
||||
|
||||
enableParallelBuilding = true;
|
||||
|
||||
meta = with lib; {
|
||||
description = "Freetype's enhanced, backwards-compatible Jam clone";
|
||||
homepage = "https://freetype.org/jam/";
|
||||
license = licenses.free;
|
||||
maintainers = with maintainers; [ AndersonTorres ];
|
||||
mainProgram = "jam";
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
||||
# TODO: setup hook for Jam
|
||||
@@ -16461,9 +16461,9 @@ with pkgs;
|
||||
|
||||
itstool = callPackage ../development/tools/misc/itstool { };
|
||||
|
||||
jam = callPackage ../development/tools/build-managers/jam { };
|
||||
|
||||
ftjam = callPackage ../development/tools/build-managers/jam/ftjam.nix { };
|
||||
inherit (callPackage ../development/tools/build-managers/jam { })
|
||||
jam
|
||||
ftjam;
|
||||
|
||||
javacc = callPackage ../development/tools/parsing/javacc {
|
||||
jdk = jdk8;
|
||||
|
||||
Reference in New Issue
Block a user