12 stdenv.mkDerivation (finalAttrs: {
17 url = "mirror://sourceforge/project/freetype/ftjam/${finalAttrs.version}/ftjam-${finalAttrs.version}.tar.bz2";
18 hash = "sha256-6JdzUAqSkS3pGOn+v/q+S2vOedaa8ZRDX04DK4ptZqM=";
21 depsBuildBuild = [ buildPackages.stdenv.cc ];
28 # Doesn't understand how to cross compile once bootstrapped, so we'll just use
29 # the Makefile for the bootstrapping portion
30 configurePlatforms = [
36 "CC=${buildPackages.stdenv.cc.targetPrefix}cc"
37 "--host=${stdenv.buildPlatform.config}"
41 "CC=${buildPackages.stdenv.cc.targetPrefix}cc"
45 LOCATE_TARGET = "bin.unix";
46 # Jam uses c89 conventions
47 NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-std=c89";
50 enableParallelBuilding = true;
54 # Jambase expects ar to have flags.
59 # When cross-compiling, we need to set the preprocessor macros
60 # OSMAJOR/OSMINOR/OSPLAT to the values from the target platform, not the host
61 # platform. This looks a little ridiculous because the vast majority of build
62 # tools don't embed target-specific information into their binary, but in this
63 # case we behave more like a compiler than a make(1)-alike.
66 substituteInPlace Jamfile \
67 --replace "strip" "${stdenv.cc.targetPrefix}strip"
69 + lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform) ''
75 ${pkgsBuildTarget.targetPackages.stdenv.cc}/bin/${pkgsBuildTarget.targetPackages.stdenv.cc.targetPrefix}cc -E -dM jam.h | grep -E '^#define (OSMAJOR|OSMINOR|OSPLAT) '
83 ./jam0 -j$NIX_BUILD_CORES -sCC=${buildPackages.stdenv.cc.targetPrefix}cc jambase.c
84 ./jam0 -j$NIX_BUILD_CORES
88 # The configure script does not recognize --docdir; because of it, the outputs
93 installBin bin.unix/jam
94 install -Dm644 -t ''${!outputDoc}/share/doc/jam-${finalAttrs.version}/ *.html
100 tests.version = testers.testVersion {
101 package = finalAttrs.finalPackage;
107 homepage = "https://freetype.org/jam/";
108 description = "FreeType's enhanced, backwards-compatible Jam clone";
109 license = lib.licenses.free;
111 maintainers = with lib.maintainers; [
115 platforms = lib.platforms.unix;