Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tinycc: 0.9.27-unstable-2022-07-15 -> 0.9.27-unstable-2025-01-06 #374684

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
3 changes: 3 additions & 0 deletions doc/release-notes/rl-2505.section.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
62 changes: 36 additions & 26 deletions pkgs/development/compilers/tinycc/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -57,24 +59,37 @@ 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"
]
++ lib.optionals stdenv.hostPlatform.isMusl [
"--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
Expand All @@ -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/[email protected]/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";
Expand Down Expand Up @@ -133,11 +143,11 @@ stdenv.mkDerivation (finalAttrs: {
maintainers = with lib.maintainers; [
joachifm
AndersonTorres
onemoresuza
];
platforms = lib.platforms.unix;
# https://www.mail-archive.com/[email protected]/msg10199.html
broken = stdenv.hostPlatform.isDarwin && stdenv.hostPlatform.isAarch64;
};
})
# TODO: more multiple outputs
# TODO: self-compilation