summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnderson Torres <torres.anderson.85@protonmail.com>2022-09-05 23:38:57 -0300
committerGitHub <noreply@github.com>2022-09-05 23:38:57 -0300
commit449d92d413def71b648ca3ae8df8950887951981 (patch)
tree24077401e5ffcba315d40b2cfba3ec476561c97a
parentcabd3cb4d3758ef5b3bec5bf3b27a26523c67672 (diff)
parent4d4d4587ec31b1d722c8aa8074026144c5927b36 (diff)
Merge pull request #189487 from impl/fix-jam-cross
{jam,ftjam}: fix cross-compiling and refactor
-rw-r--r--maintainers/maintainer-list.nix10
-rw-r--r--pkgs/development/tools/build-managers/jam/default.nix105
-rw-r--r--pkgs/development/tools/build-managers/jam/ftjam.nix53
-rw-r--r--pkgs/top-level/all-packages.nix6
4 files changed, 87 insertions, 87 deletions
diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix
index a92d096d9fc2..e80001cd8436 100644
--- a/maintainers/maintainer-list.nix
+++ b/maintainers/maintainer-list.nix
@@ -5643,6 +5643,16 @@
githubId = 510202;
name = "Ismaƫl Bouya";
};
+ impl = {
+ email = "noah@noahfontes.com";
+ matrix = "@impl:matrix.org";
+ github = "impl";
+ githubId = 41129;
+ name = "Noah Fontes";
+ keys = [{
+ fingerprint = "F5B2 BE1B 9AAD 98FE 2916 5597 3665 FFF7 9D38 7BAA";
+ }];
+ };
imsofi = {
email = "sofi+git@mailbox.org";
github = "imsofi";
diff --git a/pkgs/development/tools/build-managers/jam/default.nix b/pkgs/development/tools/build-managers/jam/default.nix
index c4d73785db49..192c27682ab5 100644
--- a/pkgs/development/tools/build-managers/jam/default.nix
+++ b/pkgs/development/tools/build-managers/jam/default.nix
@@ -1,45 +1,88 @@
-{ lib, stdenv, fetchurl, bison }:
+{ lib, stdenv, fetchurl, bison, buildPackages }:
-stdenv.mkDerivation rec {
- pname = "jam";
- version = "2.6.1";
+let
+ mkJam = { meta ? { }, ... } @ args: stdenv.mkDerivation (args // {
+ depsBuildBuild = [ buildPackages.stdenv.cc ];
+ 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"
+ '';
+
+ LOCATE_TARGET = "bin.unix";
- nativeBuildInputs = [ bison ];
+ 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
+ '';
- preConfigure = ''
- unset AR
- '';
+ installPhase = ''
+ runHook preInstall
+ mkdir -p $out/bin $out/doc/jam
+ cp bin.unix/jam $out/bin/jam
+ cp *.html $out/doc/jam
+ runHook postInstall
+ '';
- buildPhase = ''
- runHook preBuild
+ enableParallelBuilding = true;
- make jam0
+ 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;
- runHook postBuild
- '';
+ 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 ];
+ };
+ };
- installPhase = ''
- runHook preInstall
+ ftjam = let
+ pname = "ftjam";
+ version = "2.5.2";
+ in mkJam {
+ inherit pname version;
- ./jam0 -j$NIX_BUILD_CORES -sBINDIR=$out/bin install
- mkdir -p $out/doc/jam
- cp *.html $out/doc/jam
+ src = fetchurl {
+ url = "https://downloads.sourceforge.net/project/freetype/${pname}/${version}/${pname}-${version}.tar.bz2";
+ hash = "sha256-6JdzUAqSkS3pGOn+v/q+S2vOedaa8ZRDX04DK4ptZqM=";
+ };
- runHook postInstall
- '';
+ postPatch = ''
+ substituteInPlace Jamfile --replace strip ${stdenv.cc.targetPrefix}strip
+ '';
- enableParallelBuilding = true;
+ # 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}"
+ ];
- meta = with lib; {
- homepage = "https://www.perforce.com/resources/documentation/jam";
- license = licenses.free;
- description = "Just Another Make";
- maintainers = with maintainers; [ 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 ];
+ };
};
}
diff --git a/pkgs/development/tools/build-managers/jam/ftjam.nix b/pkgs/development/tools/build-managers/jam/ftjam.nix
deleted file mode 100644
index 1f106401c0d1..000000000000
--- a/pkgs/development/tools/build-managers/jam/ftjam.nix
+++ /dev/null
@@ -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
diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix
index a6327061cb17..1548051431ff 100644
--- a/pkgs/top-level/all-packages.nix
+++ b/pkgs/top-level/all-packages.nix
@@ -16512,9 +16512,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 {
# Upstream doesn't support anything newer than Java 8.