From f46b2c2ca77368bacbc961d9b5ad82b820b2cff1 Mon Sep 17 00:00:00 2001 From: Anderson Torres Date: Sun, 22 Sep 2024 22:34:57 -0300 Subject: [PATCH 1/3] {ftjam,jam}: "remove" They will be split in their own by-name directories. --- .../tools/build-managers/jam/default.nix | 118 ------------------ pkgs/top-level/all-packages.nix | 4 - 2 files changed, 122 deletions(-) delete mode 100644 pkgs/development/tools/build-managers/jam/default.nix diff --git a/pkgs/development/tools/build-managers/jam/default.nix b/pkgs/development/tools/build-managers/jam/default.nix deleted file mode 100644 index bf06954df4de..000000000000 --- a/pkgs/development/tools/build-managers/jam/default.nix +++ /dev/null @@ -1,118 +0,0 @@ -{ lib, stdenv, fetchurl, bison, buildPackages, pkgsBuildTarget }: - -let - mkJam = { pname, version, src, meta ? { } }: stdenv.mkDerivation { - inherit pname version src; - - depsBuildBuild = [ buildPackages.stdenv.cc ]; - nativeBuildInputs = [ bison ]; - - # Jam uses c89 conventions - env.NIX_CFLAGS_COMPILE = lib.optionalString stdenv.cc.isClang "-std=c89"; - - # 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 < Date: Sun, 22 Sep 2024 22:26:57 -0300 Subject: [PATCH 2/3] ftjam: refactor - migrate to by-name - strictDeps - test version --- pkgs/by-name/ft/ftjam/package.nix | 117 ++++++++++++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 pkgs/by-name/ft/ftjam/package.nix diff --git a/pkgs/by-name/ft/ftjam/package.nix b/pkgs/by-name/ft/ftjam/package.nix new file mode 100644 index 000000000000..7bfdc5f804a4 --- /dev/null +++ b/pkgs/by-name/ft/ftjam/package.nix @@ -0,0 +1,117 @@ +{ + lib, + bison, + buildPackages, + fetchurl, + installShellFiles, + pkgsBuildTarget, + stdenv, + testers, +}: + +stdenv.mkDerivation (finalAttrs: { + pname = "ftjam"; + version = "2.5.2"; + + src = fetchurl { + url = "https://downloads.sourceforge.net/project/freetype/ftjam/${finalAttrs.version}/ftjam-${finalAttrs.version}.tar.bz2"; + hash = "sha256-6JdzUAqSkS3pGOn+v/q+S2vOedaa8ZRDX04DK4ptZqM="; + }; + + depsBuildBuild = [ buildPackages.stdenv.cc ]; + + nativeBuildInputs = [ + bison + installShellFiles + ]; + + # 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}" + ]; + + 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 = + '' + substituteInPlace Jamfile \ + --replace "strip" "${stdenv.cc.targetPrefix}strip" + '' + + lib.optionalString (stdenv.hostPlatform != stdenv.targetPlatform) '' + cat >>jam.h < Date: Sun, 22 Sep 2024 21:50:10 -0300 Subject: [PATCH 3/3] jam: refactor - migrate to by-name - strictDeps - split outputs - test version --- pkgs/by-name/ja/jam/package.nix | 113 ++++++++++++++++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 pkgs/by-name/ja/jam/package.nix 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 <