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: fix build on darwin #100748
tinycc: fix build on darwin #100748
Conversation
Current build log. Build log
|
I got tcc to build on my mac with the following changes: diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix
index 03e8be7053a..d74a3ebe790 100644
--- a/pkgs/development/compilers/tinycc/default.nix
+++ b/pkgs/development/compilers/tinycc/default.nix
@@ -1,4 +1,11 @@
-{ stdenv, lib, fetchFromRepoOrCz, perl, texinfo }:
+{ stdenv, lib
+, fetchFromRepoOrCz
+, darwin
+, perl
+, texinfo
+, which
+, xcbuild
+}:
with lib;
stdenv.mkDerivation rec {
@@ -8,11 +15,12 @@ stdenv.mkDerivation rec {
src = fetchFromRepoOrCz {
repo = "tinycc";
- rev = upstreamVersion;
- sha256 = "12mm1lqywz0akr2yb2axjfbw8lwv57nh395vzsk534riz03ml977";
+ rev = "78da4586a002275e7f4c29d0f545430f1fc055e7";
+ sha256 = "00piy8gvnf3g8agibrlplc4jr7sifaafvwgd2dgyxb6lrj2psw1n";
};
- nativeBuildInputs = [ perl texinfo ];
+ nativeBuildInputs = [ perl texinfo which ]
+ ++ optional stdenv.isDarwin xcbuild;
hardeningDisable = [ "fortify" ];
@@ -21,6 +29,9 @@ stdenv.mkDerivation rec {
postPatch = ''
substituteInPlace "texi2pod.pl" \
--replace "/usr/bin/perl" "${perl}/bin/perl"
+ '' + optionalString stdenv.isDarwin ''
+ substituteInPlace tests/tests2/Makefile \
+ --replace 'SKIP = ' 'SKIP = 106_pthread.test '
'';
preConfigure = ''
@@ -77,7 +88,7 @@ stdenv.mkDerivation rec {
homepage = "http://www.tinycc.org/";
license = licenses.mit;
- platforms = [ "x86_64-linux" ];
+ platforms = platforms.unix;
maintainers = [ maintainers.joachifm ];
};
} Since this isn't a tagged release, should it be marked as unstable and added to toplevel as e.g. tccUnstable? It's been a while since the last release, maybe someone can pester the maintainers to tag a new one :P |
7ad2440
to
cfa8ff2
Compare
@@ -1,4 +1,11 @@ | |||
{ stdenv, lib, fetchFromRepoOrCz, perl, texinfo }: | |||
{ stdenv, lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ stdenv, lib | |
{ stdenv |
@@ -8,11 +15,12 @@ stdenv.mkDerivation rec { | |||
|
|||
src = fetchFromRepoOrCz { | |||
repo = "tinycc"; | |||
rev = upstreamVersion; | |||
sha256 = "12mm1lqywz0akr2yb2axjfbw8lwv57nh395vzsk534riz03ml977"; | |||
rev = "78da4586a002275e7f4c29d0f545430f1fc055e7"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please update the version.
, texinfo | ||
, which | ||
, xcbuild | ||
}: | ||
with lib; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
with lib; | |
with stdenv.lib; |
I am not a fan of using with on the entire expression. This should be refactored if possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I wasn't sure to refactor that since it was the original expression. I agree.
Result of 2 packages built:
|
Fails to build on Darwin:
|
I marked this as stale due to inactivity. → More info |
@siraben still interested? We''ll need to update tinycc to get it working with the upcoming glibc 2.34 bump. Upstream is going strong with no tags in sight so I think a bump to unstable is overdue. Happy to open a new PR for this if you'd prefer to hand it off. |
Hey, @r-burns, thanks for the interest. I'm currently too busy to debug the failure but I'd be happy to review your PR. |
Motivation for this change
Fix build of
tinycc
on darwin (macOS for me)Things done
sandbox
innix.conf
on non-NixOS linux)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"
./result/bin/
)nix path-info -S
before and after)