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.main
parent
6f8378e6fa
commit
3c0eaeb84c
@ -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 |
||||
|
||||
nativeBuildInputs = [ bison ]; |
||||
runHook postInstall |
||||
''; |
||||
|
||||
# Jambase expects ar to have flags. |
||||
preConfigure = '' |
||||
export AR="$AR rc" |
||||
''; |
||||
enableParallelBuilding = true; |
||||
|
||||
makeFlags = [ "CC=${stdenv.cc.targetPrefix}cc" ]; |
||||
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; |
||||
|
||||
installPhase = '' |
||||
runHook preInstall |
||||
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 ]; |
||||
}; |
||||
}; |
||||
|
||||
./jam0 -j$NIX_BUILD_CORES -sBINDIR=$out/bin install |
||||
mkdir -p $out/doc/jam |
||||
cp *.html $out/doc/jam |
||||
ftjam = let |
||||
pname = "ftjam"; |
||||
version = "2.5.2"; |
||||
in mkJam { |
||||
inherit pname version; |
||||
|
||||
runHook postInstall |
||||
''; |
||||
postPatch = '' |
||||
substituteInPlace Jamfile --replace strip ${stdenv.cc.targetPrefix}strip |
||||
''; |
||||
|
||||
enableParallelBuilding = true; |
||||
src = fetchurl { |
||||
url = "https://downloads.sourceforge.net/project/freetype/${pname}/${version}/${pname}-${version}.tar.bz2"; |
||||
hash = "sha256-6JdzUAqSkS3pGOn+v/q+S2vOedaa8ZRDX04DK4ptZqM="; |
||||
}; |
||||
|
||||
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 |
Loading…
Reference in new issue