From d83bbac9eaece45deca08667004a4f0816073fc4 Mon Sep 17 00:00:00 2001 From: Coutinho de Souza Date: Fri, 17 Jan 2025 19:49:50 -0300 Subject: [PATCH] tinycc: 0.9.27-unstable-2022-07-15 -> 0.9.27-unstable-2025-01-06 Fix checkPhase by making it instalCheckPhase, since tcc depends on libtcc1.a, which is build together with it, for its tests. Create dev, doc and lib outpus. Now the binaries, i. e., tcc and the cross compilers are what the user gets with tinycc.out. Make the recipe compliant with nixpkgs-hammer. Enable parallel building. --- doc/release-notes/rl-2505.section.md | 3 + pkgs/development/compilers/tinycc/default.nix | 61 +++++++++++-------- 2 files changed, 38 insertions(+), 26 deletions(-) diff --git a/doc/release-notes/rl-2505.section.md b/doc/release-notes/rl-2505.section.md index 956d9fb754e9c..ed68560d37fc4 100644 --- a/doc/release-notes/rl-2505.section.md +++ b/doc/release-notes/rl-2505.section.md @@ -18,6 +18,9 @@ - [`lib.types.enum`](https://nixos.org/manual/nixos/unstable/#sec-option-types-basic): Previously the `functor.payload` was the list of enum values directly. Now it is an attribute set containing the values in the `values` attribute. - [`lib.types.separatedString`](https://nixos.org/manual/nixos/unstable/#sec-option-types-string): Previously the `functor.payload` was the seperator directly. Now it is an attribute set containing the seperator in the `sep` attribute. +- The `tinycc` package now has the `dev`, `doc` and `lib` outputs, thus, +`tinycc.out` may now only provide the tcc and cross compilers binaries. + - The `virtualisation.hypervGuest.videoMode` option has been removed. Standard tooling can now be used to configure display modes for Hyper-V VMs. ### Deprecations {#sec-nixpkgs-release-25.05-lib-deprecations} diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix index c02368914a775..0632b01e3ef98 100644 --- a/pkgs/development/compilers/tinycc/default.nix +++ b/pkgs/development/compilers/tinycc/default.nix @@ -8,23 +8,25 @@ texinfo, which, }: - stdenv.mkDerivation (finalAttrs: { pname = "tcc"; - version = "0.9.27-unstable-2022-07-15"; - - src = fetchFromRepoOrCz { - repo = "tinycc"; - rev = "af1abf1f45d45b34f0b02437f559f4dfdba7d23c"; - hash = "sha256-jY0P2GErmo//YBaz6u4/jj/voOE3C2JaIDRmo0orXN8="; - }; + version = "0.9.27-unstable-2025-01-06"; outputs = [ - "out" + "dev" + "doc" "info" + "lib" "man" + "out" ]; + src = fetchFromRepoOrCz { + repo = "tinycc"; + rev = "f6385c05308f715bdd2c06336801193a21d69b50"; + hash = "sha256-tO3N+NplYy8QUOC2N3x0CO5Ui75j9bQzLSZQF1HQyhY="; + }; + nativeBuildInputs = [ copyPkgconfigItems perl @@ -57,17 +59,15 @@ stdenv.mkDerivation (finalAttrs: { (makePkgconfigItem libtcc-pcitem) ]; - postPatch = '' - patchShebangs texi2pod.pl - ''; - configureFlags = [ "--cc=$CC" "--ar=$AR" "--crtprefix=${lib.getLib stdenv.cc.libc}/lib" "--sysincludepaths=${lib.getDev stdenv.cc.libc}/include:{B}/include" - "--libpaths=${lib.getLib stdenv.cc.libc}/lib" + # The first libpath will be the one in which tcc will look for libtcc1.a, + # which is need for its tests. + "--libpaths=$lib/lib/tcc:$lib/lib:${lib.getLib stdenv.cc.libc}/lib" # build cross compilers "--enable-cross" ] @@ -75,6 +75,21 @@ stdenv.mkDerivation (finalAttrs: { "--config-musl" ]; + enableParallelBuilding = true; + + env.NIX_CFLAGS_COMPILE = toString [ + "-Wno-error=implicit-int" + "-Wno-error=int-conversion" + ]; + + # Test segfault for static build + doInstallCheck = + !stdenv.hostPlatform.isStatic && stdenv.buildPlatform.canExecute stdenv.hostPlatform; + + postPatch = '' + patchShebangs texi2pod.pl + ''; + preConfigure = let # To avoid "malformed 32-bit x.y.z" error on mac when using clang @@ -90,19 +105,14 @@ stdenv.mkDerivation (finalAttrs: { configureFlagsArray+=("--elfinterp=$(< $NIX_CC/nix-support/dynamic-linker)") ''; - env.NIX_CFLAGS_COMPILE = toString [ - "-Wno-error=implicit-int" - "-Wno-error=int-conversion" - ]; - - # Test segfault for static build - doCheck = !stdenv.hostPlatform.isStatic; + installCheckTarget = "test"; - checkTarget = "test"; # https://www.mail-archive.com/tinycc-devel@nongnu.org/msg10142.html - preCheck = lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) '' - rm tests/tests2/{108,114}* - ''; + preInstallCheck = + lib.optionalString (stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isx86_64) + '' + rm tests/tests2/{108,114}* + ''; meta = { homepage = "https://repo.or.cz/tinycc.git"; @@ -139,5 +149,4 @@ stdenv.mkDerivation (finalAttrs: { broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64; }; }) -# TODO: more multiple outputs # TODO: self-compilation