summary refs log tree commit diff
path: root/pkgs/development/compilers/tinycc/default.nix
diff options
context:
space:
mode:
Diffstat (limited to 'pkgs/development/compilers/tinycc/default.nix')
-rw-r--r--pkgs/development/compilers/tinycc/default.nix22
1 files changed, 18 insertions, 4 deletions
diff --git a/pkgs/development/compilers/tinycc/default.nix b/pkgs/development/compilers/tinycc/default.nix
index 338ba931249..7c81f9ba163 100644
--- a/pkgs/development/compilers/tinycc/default.nix
+++ b/pkgs/development/compilers/tinycc/default.nix
@@ -1,13 +1,14 @@
-{ stdenv, fetchFromRepoOrCz, perl, texinfo }:
-with stdenv.lib;
+{ stdenv, lib, fetchFromRepoOrCz, perl, texinfo }:
+with lib;
 
 stdenv.mkDerivation rec {
   pname = "tcc";
   version = "0.9.27";
+  upstreamVersion = "release_${concatStringsSep "_" (builtins.splitVersion version)}";
 
   src = fetchFromRepoOrCz {
     repo = "tinycc";
-    rev = "release_0_9_27";
+    rev = upstreamVersion;
     sha256 = "12mm1lqywz0akr2yb2axjfbw8lwv57nh395vzsk534riz03ml977";
   };
 
@@ -15,6 +16,8 @@ stdenv.mkDerivation rec {
 
   hardeningDisable = [ "fortify" ];
 
+  enableParallelBuilding = true;
+
   postPatch = ''
     substituteInPlace "texi2pod.pl" \
       --replace "/usr/bin/perl" "${perl}/bin/perl"
@@ -30,6 +33,17 @@ stdenv.mkDerivation rec {
     configureFlagsArray+=("--libpaths=${getLib stdenv.cc.libc}/lib")
   '';
 
+  postFixup = ''
+    cat >libtcc.pc <<EOF
+    Name: libtcc
+    Description: Tiny C compiler backend
+    Version: ${version}
+    Libs: -L$out/lib -Wl,--rpath $out/lib -ltcc -ldl
+    Cflags: -I$out/include
+    EOF
+    install -Dt $out/lib/pkgconfig libtcc.pc
+  '';
+
   doCheck = true;
   checkTarget = "test";
 
@@ -60,7 +74,7 @@ stdenv.mkDerivation rec {
       generation.
     '';
 
-    homepage = http://www.tinycc.org/;
+    homepage = "http://www.tinycc.org/";
     license = licenses.mit;
 
     platforms = [ "x86_64-linux" ];