diff --git a/pkgs/by-name/ja/jam/package.nix b/pkgs/by-name/ja/jam/package.nix new file mode 100644 index 000000000000..b721f58f9b6a --- /dev/null +++ b/pkgs/by-name/ja/jam/package.nix @@ -0,0 +1,113 @@ +{ + lib, + bison, + buildPackages, + fetchurl, + installShellFiles, + pkgsBuildTarget, + stdenv, + testers, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "jam"; + version = "2.6.1"; + + src = fetchurl { + url = "https://swarm.workshop.perforce.com/downloads/guest/perforce_software/jam/jam-${finalAttrs.version}.tar"; + hash = "sha256-rOayJ8GpmFk0/RPJwK5Pf/RBccbe2Lg7s9p15u/cs6c="; + }; + + outputs = [ + "out" + "doc" + ]; + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + + nativeBuildInputs = [ + bison + installShellFiles + ]; + + makeFlags = [ + "CC=${buildPackages.stdenv.cc.targetPrefix}cc" + ]; + + env = { + LOCATE_TARGET = "bin.unix"; + # Jam uses c89 conventions + NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-std=c89"; + }; + + enableParallelBuilding = true; + + strictDeps = true; + + # Jambase expects ar to have flags. + preConfigure = '' + export AR="$AR rc" + ''; + + # When cross-compiling, we need to set the preprocessor macros + # OSMAJOR/OSMINOR/OSPLAT to the values from the target platform, not the host + # platform. This looks a little ridiculous because the vast majority of build + # tools don't embed target-specific information into their binary, but in this + # case we behave more like a compiler than a make(1)-alike. + postPatch = lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform) '' + cat >>jam.h <