From 91238caafb3ecf0c91fbb19dbc36da932bfbd443 Mon Sep 17 00:00:00 2001 From: Naxdy Date: Sat, 23 Mar 2024 19:03:46 +0100 Subject: [PATCH 01/14] python3Packages.pysimplegui: change license to unfree --- pkgs/development/python-modules/pysimplegui/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/pysimplegui/default.nix b/pkgs/development/python-modules/pysimplegui/default.nix index 30e5de7abd8d..a3ec40cc80cf 100644 --- a/pkgs/development/python-modules/pysimplegui/default.nix +++ b/pkgs/development/python-modules/pysimplegui/default.nix @@ -29,7 +29,7 @@ buildPythonPackage rec { meta = with lib; { description = "Python GUIs for Humans"; homepage = "https://github.com/PySimpleGUI/PySimpleGUI"; - license = licenses.lgpl3Plus; + license = licenses.unfree; maintainers = with maintainers; [ lucasew ]; }; } From 642b9fc72b7c08d47ab0f8b01c5982d956e109bc Mon Sep 17 00:00:00 2001 From: Naxdy Date: Sat, 23 Mar 2024 19:08:33 +0100 Subject: [PATCH 02/14] python3Packages.pysimplegui: mark as broken --- pkgs/development/python-modules/pysimplegui/default.nix | 1 + 1 file changed, 1 insertion(+) diff --git a/pkgs/development/python-modules/pysimplegui/default.nix b/pkgs/development/python-modules/pysimplegui/default.nix index a3ec40cc80cf..58deefb4f3d3 100644 --- a/pkgs/development/python-modules/pysimplegui/default.nix +++ b/pkgs/development/python-modules/pysimplegui/default.nix @@ -31,5 +31,6 @@ buildPythonPackage rec { homepage = "https://github.com/PySimpleGUI/PySimpleGUI"; license = licenses.unfree; maintainers = with maintainers; [ lucasew ]; + broken = true; # update to v5 broke the package, it now needs rsa and is trying to access an X11 socket? }; } From 699cfb5e5d26d69c66a8590337bec0576ac26989 Mon Sep 17 00:00:00 2001 From: John Titor <50095635+JohnRTitor@users.noreply.github.com> Date: Sun, 7 Apr 2024 07:16:30 +0530 Subject: [PATCH 03/14] calibre: 7.7.0 -> 7.8.0 Changelog: https://github.com/kovidgoyal/calibre/releases/tag/v7.8.0 --- pkgs/applications/misc/calibre/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/applications/misc/calibre/default.nix b/pkgs/applications/misc/calibre/default.nix index da1e263107b3..3f57531e099d 100644 --- a/pkgs/applications/misc/calibre/default.nix +++ b/pkgs/applications/misc/calibre/default.nix @@ -32,11 +32,11 @@ stdenv.mkDerivation (finalAttrs: { pname = "calibre"; - version = "7.7.0"; + version = "7.8.0"; src = fetchurl { url = "https://download.calibre-ebook.com/${finalAttrs.version}/calibre-${finalAttrs.version}.tar.xz"; - hash = "sha256-+kz3Fz1RDQ+ROgv7y0WNAWvIESKvHKID8UnSeCh8yA4="; + hash = "sha256-FxYuQzzuaWZihSsmeJc6ssG3VBr2YNEi3TkXyyymLUQ="; }; patches = [ From a0b3ee3a3e84f892aa4b978eec50e42fb6b0467c Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Mon, 8 Apr 2024 04:41:13 +0000 Subject: [PATCH 04/14] python312Packages.pytest-cases: 3.8.4 -> 3.8.5 --- pkgs/development/python-modules/pytest-cases/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/python-modules/pytest-cases/default.nix b/pkgs/development/python-modules/pytest-cases/default.nix index 410f0da478ce..9c89a38c1059 100644 --- a/pkgs/development/python-modules/pytest-cases/default.nix +++ b/pkgs/development/python-modules/pytest-cases/default.nix @@ -10,14 +10,14 @@ buildPythonPackage rec { pname = "pytest-cases"; - version = "3.8.4"; + version = "3.8.5"; pyproject = true; disabled = pythonOlder "3.6"; src = fetchPypi { inherit pname version; - hash = "sha256-tM7DNRVvRPO8+oXnnys0tfpS5jMqhULd8+hPoT+qzXY="; + hash = "sha256-ySBUGHhHp9MNirZwn7FnCoMOThkjS+cAyFyWttcQLBY="; }; nativeBuildInputs = [ From 5380bb424c629f92cc60f103a255cb788476681f Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Wed, 10 Apr 2024 06:39:38 +0200 Subject: [PATCH 05/14] ocamlPackages.result: use Dune 3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ocamlPackages.base_quickcheck: 0.12.0 → 0.12.1 ocamlPackages.janeStreet_0_12: use Dune 3 --- .../ocaml-modules/janestreet/0.12.nix | 65 ++----------------- .../janestreet/janePackage_0_12.nix | 2 +- .../ocaml-migrate-parsetree/1.8.x.nix | 2 - .../ocaml-modules/ocaml-result/default.nix | 8 +-- .../ocaml-modules/ppxlib/default.nix | 4 -- 5 files changed, 8 insertions(+), 73 deletions(-) diff --git a/pkgs/development/ocaml-modules/janestreet/0.12.nix b/pkgs/development/ocaml-modules/janestreet/0.12.nix index 2ea593e10b44..a3b2ac581555 100644 --- a/pkgs/development/ocaml-modules/janestreet/0.12.nix +++ b/pkgs/development/ocaml-modules/janestreet/0.12.nix @@ -24,7 +24,7 @@ with self; hash = "0gl89zpgsf3n30nb6v5cns27g2bfg4rf3s2427gqvwbkr5gcf7ri"; meta.description = "Full standard library replacement for OCaml"; propagatedBuildInputs = [ sexplib0 ]; - buildInputs = [ dune_1 ]; + buildInputs = [ dune-configurator ]; }; stdio = janePackage { @@ -106,7 +106,6 @@ with self; }; ppx_expect = janePackage { - duneVersion = "3"; pname = "ppx_expect"; hash = "1wawsbjfkri4sw52n8xqrzihxc3xfpdicv3ahz83a1rsn4lb8j5q"; meta.description = "Cram like framework for OCaml"; @@ -170,8 +169,9 @@ with self; }; base_quickcheck = janePackage { + version = "0.12.1"; pname = "base_quickcheck"; - hash = "1la6qgq1zwmfyq1hqy6i337w435ym5yqgx2ygk86qip6nws0s6r3"; + hash = "sha256-ABfUtOzdtGrYR6EgtVYkmxRvsH48jJwSVVOwf4Od12Y="; meta.description = "Randomized testing framework, designed for compatibility with Base"; propagatedBuildInputs = [ ppx_base ppx_fields_conv ppx_let splittable_random ]; }; @@ -209,7 +209,7 @@ with self; pname = "jst-config"; hash = "0yxcz13vda1mdh9ah7qqxwfxpcqang5sgdssd8721rszbwqqaw93"; meta.description = "Compile-time configuration for Jane Street libraries"; - buildInputs = [ dune_1 ppx_assert ]; + buildInputs = [ dune-configurator ppx_assert ]; }; ppx_optcomp = janePackage { @@ -276,7 +276,6 @@ with self; }; ppx_jane = janePackage { - duneVersion = "3"; pname = "ppx_jane"; hash = "1a2602isqzsh640q20qbmarx0sc316mlsqc3i25ysv2kdyhh0kyw"; meta.description = "Standard Jane Street ppx rewriters"; @@ -284,7 +283,6 @@ with self; }; base_bigstring = janePackage { - duneVersion = "3"; pname = "base_bigstring"; hash = "0rbgyg511847fbnxad40prz2dyp4da6sffzyzl88j18cxqxbh1by"; meta.description = "String type based on [Bigarray], for use in I/O and C-bindings"; @@ -306,7 +304,6 @@ with self; }; core_kernel = janePackage { - duneVersion = "3"; pname = "core_kernel"; version = "0.12.3"; hash = "sha256-bDgxuOILAs4FYB8o92ysPHDdEzflZMsU/jk5hB9xfuc="; @@ -316,7 +313,6 @@ with self; }; spawn = janePackage { - duneVersion = "3"; pname = "spawn"; version = "0.13.0"; hash = "1w003k1kw1lmyiqlk58gkxx8rac7dchiqlz6ah7aj7bh49b36ppf"; @@ -325,7 +321,6 @@ with self; }; core = janePackage { - duneVersion = "3"; pname = "core"; version = "0.12.3"; hash = "1vmjqiafkg45hqfvahx6jnlaww1q4a4215k8znbgprf0qn3zymnj"; @@ -335,7 +330,6 @@ with self; }; async_kernel = janePackage { - duneVersion = "3"; pname = "async_kernel"; hash = "1d9illx7vvpblj1i2r9y0f2yff2fbhy3rp4hhvamq1n9n3lvxmh2"; meta.description = "Monadic concurrency library"; @@ -343,7 +337,6 @@ with self; }; protocol_version_header = janePackage { - duneVersion = "3"; pname = "protocol_version_header"; hash = "14vqhx3r84rlfhcjq52gxdqksckiaswlck9s47g7y2z1lsc17v7r"; meta.description = "Protocol versioning"; @@ -351,7 +344,6 @@ with self; }; async_rpc_kernel = janePackage { - duneVersion = "3"; pname = "async_rpc_kernel"; hash = "1znhqbzx4fp58i7dbcgyv5rx7difbhb5d8cbqzv96yqvbn67lsjk"; meta.description = "Platform-independent core of Async RPC library"; @@ -359,7 +351,6 @@ with self; }; async_unix = janePackage { - duneVersion = "3"; pname = "async_unix"; hash = "09h10rdyykbm88n6r9nb5a22mlb6vcxa04q6hvrcr0kys6qhhqmb"; meta.description = "Monadic concurrency library"; @@ -367,7 +358,6 @@ with self; }; async_extra = janePackage { - duneVersion = "3"; pname = "async_extra"; hash = "10j4mwlyqvf67yrp5dwd857llqjinpnnykmlzw2gpmks9azxk6mh"; meta.description = "Monadic concurrency library"; @@ -375,7 +365,6 @@ with self; }; textutils = janePackage { - duneVersion = "3"; pname = "textutils"; hash = "0302awqihf3abib9mvzvn4g8m364hm6jxry1r3kc01hzybhy9acq"; meta.description = "Text output utilities"; @@ -383,7 +372,6 @@ with self; }; async = janePackage { - duneVersion = "3"; pname = "async"; hash = "0pk7z3h2gi21nfchvmjz2wx516bynf9vgwf84zf5qhvlvqqsmyrx"; meta.description = "Monadic concurrency library"; @@ -391,7 +379,6 @@ with self; }; async_find = janePackage { - duneVersion = "3"; pname = "async_find"; hash = "0qsz9f15s5rlk6za10s810v6nlkdxg2g9p1827lcpa7nhjcpi673"; meta.description = "Directory traversal with Async"; @@ -399,7 +386,6 @@ with self; }; re2 = janePackage { - duneVersion = "3"; pname = "re2"; version = "0.12.1"; hash = "sha256-NPQKKUSwckZx4GN4wX2sc0Mn7bes6p79oZrN6xouc6o="; @@ -412,7 +398,6 @@ with self; }; shell = janePackage { - duneVersion = "3"; pname = "shell"; hash = "158857rdr6qgglc5iksg0l54jgf51b5lmsw7nlazpxwdwc9fcn5n"; meta.description = "Yet another implementation of fork&exec and related functionality"; @@ -421,7 +406,6 @@ with self; }; async_shell = janePackage { - duneVersion = "3"; pname = "async_shell"; hash = "0cxln9hkc3cy522la9yi9p23qjwl69kqmadsq4lnjh5bxdad06sv"; meta.description = "Shell helpers for Async"; @@ -429,7 +413,6 @@ with self; }; core_bench = janePackage { - duneVersion = "3"; pname = "core_bench"; hash = "00hyzbbj19dkcw0vhfnc8w0ca3zkjriwwvl00ssa0a2g9mygijdm"; meta.description = "Benchmarking library"; @@ -437,7 +420,6 @@ with self; }; core_extended = janePackage { - duneVersion = "3"; pname = "core_extended"; hash = "1gwx66235irpf5krb1r25a3c7w52qhmass8hp7rdv89il9jn49w4"; meta.description = "Extra components that are not as closely vetted or as stable as Core"; @@ -445,7 +427,6 @@ with self; }; sexp_pretty = janePackage { - duneVersion = "3"; pname = "sexp_pretty"; hash = "06hdsaszc5cd7fphiblbn4r1sh36xgjwf2igzr2rvlzqs7jiv2v4"; meta.description = "S-expression pretty-printer"; @@ -453,7 +434,6 @@ with self; }; expect_test_helpers_kernel = janePackage { - duneVersion = "3"; pname = "expect_test_helpers_kernel"; hash = "18ya187y2i2hfxr771sd9vy5jdsa30vhs56yjdhwk06v01b2fzbq"; meta.description = "Helpers for writing expectation tests"; @@ -462,7 +442,6 @@ with self; }; expect_test_helpers = janePackage { - duneVersion = "3"; pname = "expect_test_helpers"; hash = "0ixqck2lnsmz107yw0q2sr8va80skjpldx7lz4ymjiq2vsghk0rb"; meta.description = "Async helpers for writing expectation tests"; @@ -470,7 +449,6 @@ with self; }; patience_diff = janePackage { - duneVersion = "3"; pname = "patience_diff"; hash = "055kd3piadjnplip8c8q99ssh79d4irmhg2wng7aida5pbqp2p9f"; meta.description = "Diff library using Bram Cohen's patience diff algorithm"; @@ -478,45 +456,10 @@ with self; }; ecaml = janePackage { - duneVersion = "3"; pname = "ecaml"; hash = "0n9xi6agc3lgyj2nsi10cbif0xwn57xyaranad9r285rmbxrgjh7"; meta.description = "Library for writing Emacs plugin in OCaml"; propagatedBuildInputs = [ async expect_test_helpers_kernel ]; }; - ### Packages at version 0.11, with dependencies at version 0.12 - - configurator = janePackage { - pname = "configurator"; - version = "0.11.0"; - hash = "0h686630cscav7pil8c3w0gbh6rj4b41dvbnwmicmlkc746q5bfk"; - propagatedBuildInputs = [ stdio ]; - meta.description = "Helper library for gathering system configuration"; - }; - - ppx_core = janePackage { - pname = "ppx_core"; - version = "0.11.0"; - hash = "11hgm9mxig4cm3c827f6dns9mjv3pf8g6skf10x0gw9xnp1dmzmx"; - propagatedBuildInputs = [ ppxlib ]; - meta.description = "Deprecated (see ppxlib)"; - }; - - ppx_driver = janePackage { - pname = "ppx_driver"; - version = "0.11.0"; - hash = "00kfx6js2kxk57k4v7hiqvwk7h35whgjihnxf75m82rnaf4yzvfi"; - propagatedBuildInputs = [ ppxlib ]; - meta.description = "Deprecated (see ppxlib)"; - }; - - ppx_type_conv = janePackage { - pname = "ppx_type_conv"; - version = "0.11.0"; - hash = "04dbrglqqhkas25cpjz8xhjcbpk141c35qggzw66bn69izczfmaf"; - propagatedBuildInputs = [ ppxlib ]; - meta.description = "Deprecated (see ppxlib)"; - }; - } diff --git a/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix b/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix index e5a79ba598f4..bbfd492cb64f 100644 --- a/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix +++ b/pkgs/development/ocaml-modules/janestreet/janePackage_0_12.nix @@ -1,6 +1,6 @@ { lib, fetchFromGitHub, buildDunePackage, defaultVersion ? "0.12.0" }: -{ pname, version ? defaultVersion, duneVersion ? "1", hash, ...}@args: +{ pname, version ? defaultVersion, duneVersion ? "3", hash, ...}@args: buildDunePackage (args // { inherit version duneVersion; diff --git a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix index daed1a7fbffb..9802d07d4a4f 100644 --- a/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix +++ b/pkgs/development/ocaml-modules/ocaml-migrate-parsetree/1.8.x.nix @@ -8,8 +8,6 @@ buildDunePackage rec { pname = "ocaml-migrate-parsetree"; version = "1.8.0"; - duneVersion = if lib.versionAtLeast ocaml.version "4.08" then "3" else "1"; - src = fetchFromGitHub { owner = "ocaml-ppx"; repo = pname; diff --git a/pkgs/development/ocaml-modules/ocaml-result/default.nix b/pkgs/development/ocaml-modules/ocaml-result/default.nix index 15e8f96a4846..2814c6c52806 100644 --- a/pkgs/development/ocaml-modules/ocaml-result/default.nix +++ b/pkgs/development/ocaml-modules/ocaml-result/default.nix @@ -1,6 +1,6 @@ -{ lib, buildDunePackage, fetchurl, ocaml }: +{ lib, buildDunePackage, fetchurl }: -buildDunePackage (rec { +buildDunePackage rec { pname = "result"; version = "1.5"; @@ -19,6 +19,4 @@ buildDunePackage (rec { ''; license = lib.licenses.bsd3; }; -} // lib.optionalAttrs (!lib.versionAtLeast ocaml.version "4.08") { - duneVersion = "1"; -}) +} diff --git a/pkgs/development/ocaml-modules/ppxlib/default.nix b/pkgs/development/ocaml-modules/ppxlib/default.nix index 0998b5d6a134..ab0e6bd30c38 100644 --- a/pkgs/development/ocaml-modules/ppxlib/default.nix +++ b/pkgs/development/ocaml-modules/ppxlib/default.nix @@ -12,14 +12,12 @@ let param = { "0.8.1" = { sha256 = "sha256-pct57oO7qAMEtlvEfymFOCvviWaLG0b5/7NzTC8vdSE="; max_version = "4.10"; - useDune2 = false; OMP = [ ocaml-migrate-parsetree ]; }; "0.13.0" = { sha256 = "sha256-geHz0whQDg5/YQjVsN2iuHlkClwh7z3Eqb2QOBzuOdk="; min_version = "4.07"; max_version = "4.11"; - useDune2 = false; OMP = [ ocaml-migrate-parsetree ]; }; "0.15.0" = { @@ -80,8 +78,6 @@ buildDunePackage rec { pname = "ppxlib"; inherit version; - duneVersion = if param.useDune2 or true then "3" else "1"; - src = fetchurl { url = "https://github.com/ocaml-ppx/ppxlib/releases/download/${version}/ppxlib-${version}.tbz"; inherit (param) sha256; From 41493b10d795e600c7679f3e42139f220ce32026 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 11 Apr 2024 09:47:36 +0200 Subject: [PATCH 06/14] ocamlPackages.octavius: use Dune 3 --- pkgs/development/ocaml-modules/octavius/default.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/development/ocaml-modules/octavius/default.nix b/pkgs/development/ocaml-modules/octavius/default.nix index 5c108ac6b80e..1a973da5e84d 100644 --- a/pkgs/development/ocaml-modules/octavius/default.nix +++ b/pkgs/development/ocaml-modules/octavius/default.nix @@ -1,6 +1,6 @@ -{ lib, fetchFromGitHub, buildDunePackage, ocaml }: +{ lib, fetchFromGitHub, buildDunePackage }: -buildDunePackage (rec { +buildDunePackage rec { pname = "octavius"; version = "1.2.2"; @@ -21,6 +21,4 @@ buildDunePackage (rec { license = licenses.isc; maintainers = with maintainers; [ vbgl ]; }; -} // lib.optionalAttrs (!lib.versionAtLeast ocaml.version "4.08") { - duneVersion = "1"; -}) +} From 8d5f73b5433682bc6259ba7b57fb6e4bb2e06b08 Mon Sep 17 00:00:00 2001 From: Vincent Laporte Date: Thu, 11 Apr 2024 09:56:05 +0200 Subject: [PATCH 07/14] ocamlPackages.ppx_derivers: use Dune 3 --- pkgs/development/ocaml-modules/ppx_derivers/default.nix | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/pkgs/development/ocaml-modules/ppx_derivers/default.nix b/pkgs/development/ocaml-modules/ppx_derivers/default.nix index 49217781b8ac..ebf19c70ff30 100644 --- a/pkgs/development/ocaml-modules/ppx_derivers/default.nix +++ b/pkgs/development/ocaml-modules/ppx_derivers/default.nix @@ -1,6 +1,6 @@ -{ lib, fetchFromGitHub, buildDunePackage, ocaml }: +{ lib, fetchFromGitHub, buildDunePackage }: -buildDunePackage (rec { +buildDunePackage rec { pname = "ppx_derivers"; version = "1.2.1"; @@ -19,6 +19,4 @@ buildDunePackage (rec { maintainers = [ lib.maintainers.vbgl ]; inherit (src.meta) homepage; }; -} // lib.optionalAttrs (!lib.versionAtLeast ocaml.version "4.08") { - duneVersion = "1"; -}) +} From 34cae29e839adbcf2129eb7b67e15838dbd414a5 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Fri, 12 Apr 2024 23:34:16 +0000 Subject: [PATCH 08/14] beeper: 3.102.14 -> 3.103.36 --- .../networking/instant-messengers/beeper/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/beeper/default.nix b/pkgs/applications/networking/instant-messengers/beeper/default.nix index c14f2e8a4385..63d6720aaf0d 100644 --- a/pkgs/applications/networking/instant-messengers/beeper/default.nix +++ b/pkgs/applications/networking/instant-messengers/beeper/default.nix @@ -11,11 +11,11 @@ }: let pname = "beeper"; - version = "3.102.14"; + version = "3.103.36"; name = "${pname}-${version}"; src = fetchurl { - url = "https://download.todesktop.com/2003241lzgn20jd/beeper-3.102.14-build-24040616ytycz8q-x86_64.AppImage"; - hash = "sha256-A+0dXAddZq7GWMyi9v1g0B9f7b6COMkFlm8bX4XXvzU="; + url = "https://download.todesktop.com/2003241lzgn20jd/beeper-3.103.36-build-240411hw9xbpc7s-x86_64.AppImage"; + hash = "sha256-qxu/a8eeWeOKCsno51J2IHUXTXH82KXBNajfoEkkid8="; }; appimage = appimageTools.wrapType2 { inherit version pname src; From cd82e3be21d43ce7b56f15bb41a7dce075108108 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 13 Apr 2024 07:21:44 +0000 Subject: [PATCH 09/14] slack: 4.37.94 -> 4.37.101 --- .../networking/instant-messengers/slack/default.nix | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/pkgs/applications/networking/instant-messengers/slack/default.nix b/pkgs/applications/networking/instant-messengers/slack/default.nix index f406181b4511..e0ce9027551c 100644 --- a/pkgs/applications/networking/instant-messengers/slack/default.nix +++ b/pkgs/applications/networking/instant-messengers/slack/default.nix @@ -45,14 +45,14 @@ let pname = "slack"; - x86_64-darwin-version = "4.37.94"; - x86_64-darwin-sha256 = "01v7v977fq8mfsl0lipdc7ig55p2sknxzr1jmh8qxiq4f4y0rj5g"; + x86_64-darwin-version = "4.37.101"; + x86_64-darwin-sha256 = "03k4iv6y7y1z9ac7if35r3lk7kp7ic4aa4rdyzbrzihvpfb3nvdh"; - x86_64-linux-version = "4.37.94"; - x86_64-linux-sha256 = "1f1spl767ldrarvpxrayry2d0nyr22b8xacxl4g1r8raryvnyz0x"; + x86_64-linux-version = "4.37.101"; + x86_64-linux-sha256 = "0vmaam0aiqcqmm8n3zrjmf012d6pdi0g1d08v1zhgx2rhl614ff9"; - aarch64-darwin-version = "4.37.94"; - aarch64-darwin-sha256 = "0gh45gvlbjzxh0fn24z15glxqih5lggam8w6kpawsxgivkw6rjcc"; + aarch64-darwin-version = "4.37.101"; + aarch64-darwin-sha256 = "07qfqrq32sh5cw7vmq2x0s5zvkvcl7j1kkvdncg36fay9276f2pp"; version = { x86_64-darwin = x86_64-darwin-version; From fe77b88406ac0b7950fc55c25c113821eab72a95 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 13 Apr 2024 18:35:05 +0000 Subject: [PATCH 10/14] unciv: 4.11.2 -> 4.11.4 --- pkgs/by-name/un/unciv/package.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/by-name/un/unciv/package.nix b/pkgs/by-name/un/unciv/package.nix index 5a256c31bf6a..b73b58113728 100644 --- a/pkgs/by-name/un/unciv/package.nix +++ b/pkgs/by-name/un/unciv/package.nix @@ -27,11 +27,11 @@ let in stdenv.mkDerivation rec { pname = "unciv"; - version = "4.11.2"; + version = "4.11.4"; src = fetchurl { url = "https://github.com/yairm210/Unciv/releases/download/${version}/Unciv.jar"; - hash = "sha256-ZUDfJf+FgIX8gRoZYlYAJhpLwNWp3MCKEQOSQGQ88T8="; + hash = "sha256-QqnM1kTXHHpf8l99J8ydIjTkl/LetijzIJgLYt6OaRA="; }; dontUnpack = true; From 7a80e67cb302fc4c7d39c38e18f7b992eb674006 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 13 Apr 2024 22:23:50 +0000 Subject: [PATCH 11/14] turso-cli: 0.90.3 -> 0.90.7 --- pkgs/development/tools/turso-cli/default.nix | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkgs/development/tools/turso-cli/default.nix b/pkgs/development/tools/turso-cli/default.nix index c68b1a3010a8..84113832cb34 100644 --- a/pkgs/development/tools/turso-cli/default.nix +++ b/pkgs/development/tools/turso-cli/default.nix @@ -8,16 +8,16 @@ }: buildGoModule rec { pname = "turso-cli"; - version = "0.90.3"; + version = "0.90.7"; src = fetchFromGitHub { owner = "tursodatabase"; repo = "turso-cli"; rev = "v${version}"; - hash = "sha256-NkCkInQLwGwb8bFeRTSk2rpuPBOkMvWBgVx2IFFyRFQ="; + hash = "sha256-+pd2bRyu1BFhzJ1iGDmBv/DR8oZHC0hGZBgZZIxpaYo="; }; - vendorHash = "sha256-oxlIaSSLZ6JirvUPOIHirp43G5qrDFJhNd6HjA9UYKo="; + vendorHash = "sha256-2NjdjB09WYzHjQEl2hMUWN1/xsj/Hlr8lVYU/pkxTqQ="; nativeBuildInputs = [ installShellFiles ]; From 73492d7fa13f3ade085d258a6b8d834189ad2445 Mon Sep 17 00:00:00 2001 From: "R. Ryantm" Date: Sat, 13 Apr 2024 23:38:29 +0000 Subject: [PATCH 12/14] awscli2: 2.15.34 -> 2.15.38 --- pkgs/tools/admin/awscli2/default.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/tools/admin/awscli2/default.nix b/pkgs/tools/admin/awscli2/default.nix index a556d7cb90f0..9e10746b5363 100644 --- a/pkgs/tools/admin/awscli2/default.nix +++ b/pkgs/tools/admin/awscli2/default.nix @@ -59,14 +59,14 @@ let in with py.pkgs; buildPythonApplication rec { pname = "awscli2"; - version = "2.15.34"; # N.B: if you change this, check if overrides are still up-to-date + version = "2.15.38"; # N.B: if you change this, check if overrides are still up-to-date pyproject = true; src = fetchFromGitHub { owner = "aws"; repo = "aws-cli"; rev = "refs/tags/${version}"; - hash = "sha256-lFovWxPlo3WlKE4yOlTtILbsRsILgioqVmPptOQO0bM="; + hash = "sha256-ddZqexGrO2m8iUE9RDkks0ohm27dpitbsj+20aWUrJw="; }; postPatch = '' From 907ee9b75ac2162bb7b6f9ab6a6a15b7643dd52f Mon Sep 17 00:00:00 2001 From: Sarah Clark Date: Sat, 13 Apr 2024 18:25:42 -0700 Subject: [PATCH 13/14] maintainers: corrected email address (#303922) Co-authored-by: sarahec --- maintainers/maintainer-list.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/maintainers/maintainer-list.nix b/maintainers/maintainer-list.nix index 1b90aa6f4456..768a380fd019 100644 --- a/maintainers/maintainer-list.nix +++ b/maintainers/maintainer-list.nix @@ -17671,7 +17671,7 @@ name = "Sanskar Gurdasani"; }; sarahec = { - email = "sarahec@nextquestion.net"; + email = "seclark@nextquestion.net"; github = "sarahec"; githubId = 11277967; name = "Sarah Clark"; From dc4d5c21937ec81d41e0211d74d6e562955bf5be Mon Sep 17 00:00:00 2001 From: Tristan Ross Date: Thu, 28 Mar 2024 11:11:16 -0700 Subject: [PATCH 14/14] llvmPackages_{12,13,14,15,16,17,18,git}: use common clang --- .../compilers/llvm/12/clang/default.nix | 132 ---------------- .../development/compilers/llvm/12/default.nix | 16 +- .../compilers/llvm/13/clang/default.nix | 126 ---------------- .../development/compilers/llvm/13/default.nix | 21 ++- .../compilers/llvm/14/clang/default.nix | 129 ---------------- .../development/compilers/llvm/14/default.nix | 16 +- .../development/compilers/llvm/15/default.nix | 16 +- .../compilers/llvm/16/clang/default.nix | 137 ----------------- .../development/compilers/llvm/16/default.nix | 16 +- .../compilers/llvm/17/clang/default.nix | 141 ------------------ .../development/compilers/llvm/17/default.nix | 16 +- .../development/compilers/llvm/18/default.nix | 16 +- .../llvm/{15 => common}/clang/default.nix | 134 ++++++++++++----- .../compilers/llvm/git/clang/default.nix | 139 ----------------- .../compilers/llvm/git/default.nix | 16 +- 15 files changed, 205 insertions(+), 866 deletions(-) delete mode 100644 pkgs/development/compilers/llvm/12/clang/default.nix delete mode 100644 pkgs/development/compilers/llvm/13/clang/default.nix delete mode 100644 pkgs/development/compilers/llvm/14/clang/default.nix delete mode 100644 pkgs/development/compilers/llvm/16/clang/default.nix delete mode 100644 pkgs/development/compilers/llvm/17/clang/default.nix rename pkgs/development/compilers/llvm/{15 => common}/clang/default.nix (56%) delete mode 100644 pkgs/development/compilers/llvm/git/clang/default.nix diff --git a/pkgs/development/compilers/llvm/12/clang/default.nix b/pkgs/development/compilers/llvm/12/clang/default.nix deleted file mode 100644 index c482a8ee6875..000000000000 --- a/pkgs/development/compilers/llvm/12/clang/default.nix +++ /dev/null @@ -1,132 +0,0 @@ -{ lib, stdenv, llvm_meta, fetch, substituteAll, cmake, libxml2, libllvm, version, clang-tools-extra_src, python3 -, buildLlvmTools -, fixDarwinDylibNames -, enableManpages ? false -}: - -let - self = stdenv.mkDerivation ({ - pname = "clang"; - inherit version; - - src = fetch "clang" "0px4gl27az6cdz6adds89qzdwb1cqpjsfvrldbz9qvpmphrj34bf"; - inherit clang-tools-extra_src; - - unpackPhase = '' - unpackFile $src - mv clang-* clang - sourceRoot=$PWD/clang - unpackFile ${clang-tools-extra_src} - mv clang-tools-extra-* $sourceRoot/tools/extra - substituteInPlace $sourceRoot/tools/extra/clangd/quality/CompletionModel.cmake \ - --replace ' ''${CMAKE_SOURCE_DIR}/../clang-tools-extra' ' ''${CMAKE_SOURCE_DIR}/tools/extra' - ''; - - nativeBuildInputs = [ cmake python3 ] - ++ lib.optional enableManpages python3.pkgs.sphinx - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - - buildInputs = [ libxml2 libllvm ]; - - cmakeFlags = [ - "-DCLANGD_BUILD_XPC=OFF" - "-DLLVM_ENABLE_RTTI=ON" - ] ++ lib.optionals enableManpages [ - "-DCLANG_INCLUDE_DOCS=ON" - "-DLLVM_ENABLE_SPHINX=ON" - "-DSPHINX_OUTPUT_MAN=ON" - "-DSPHINX_OUTPUT_HTML=OFF" - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" - "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" - ]; - - patches = [ - ./purity.patch - # https://reviews.llvm.org/D51899 - ./gnu-install-dirs.patch - (substituteAll { - src = ../../common/clang/clang-11-15-LLVMgold-path.patch; - libllvmLibdir = "${libllvm.lib}/lib"; - }) - ]; - - postPatch = '' - sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \ - -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \ - lib/Driver/ToolChains/*.cpp - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp - ''; - - outputs = [ "out" "lib" "dev" "python" ]; - - postInstall = '' - ln -sv $out/bin/clang $out/bin/cpp - - # Move libclang to 'lib' output - moveToOutput "lib/libclang.*" "$lib" - moveToOutput "lib/libclang-cpp.*" "$lib" - substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp." - - mkdir -p $python/bin $python/share/{clang,scan-view} - mv $out/bin/{git-clang-format,scan-view} $python/bin - if [ -e $out/bin/set-xcode-analyzer ]; then - mv $out/bin/set-xcode-analyzer $python/bin - fi - mv $out/share/clang/*.py $python/share/clang - mv $out/share/scan-view/*.py $python/share/scan-view - rm $out/bin/c-index-test - patchShebangs $python/bin - - mkdir -p $dev/bin - cp bin/clang-tblgen $dev/bin - ''; - - passthru = { - inherit libllvm; - isClang = true; - hardeningUnsupportedFlags = [ "fortify3" "zerocallusedregs" ]; - }; - - meta = llvm_meta // { - homepage = "https://clang.llvm.org/"; - description = "A C language family frontend for LLVM"; - longDescription = '' - The Clang project provides a language front-end and tooling - infrastructure for languages in the C language family (C, C++, Objective - C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. - It aims to deliver amazingly fast compiles, extremely useful error and - warning messages and to provide a platform for building great source - level tools. The Clang Static Analyzer and clang-tidy are tools that - automatically find bugs in your code, and are great examples of the sort - of tools that can be built using the Clang frontend as a library to - parse C/C++ code. - ''; - mainProgram = "clang"; - }; - } // lib.optionalAttrs enableManpages { - pname = "clang-manpages"; - - buildPhase = '' - make docs-clang-man - ''; - - installPhase = '' - mkdir -p $out/share/man/man1 - # Manually install clang manpage - cp docs/man/*.1 $out/share/man/man1/ - ''; - - outputs = [ "out" ]; - - doCheck = false; - - meta = llvm_meta // { - description = "man page for Clang ${version}"; - }; - }); -in self diff --git a/pkgs/development/compilers/llvm/12/default.nix b/pkgs/development/compilers/llvm/12/default.nix index 7bd82c071538..0d9202df8aee 100644 --- a/pkgs/development/compilers/llvm/12/default.nix +++ b/pkgs/development/compilers/llvm/12/default.nix @@ -1,6 +1,6 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake , preLibcCrossHeaders -, substitute, fetchFromGitHub, fetchpatch +, substitute, substituteAll, fetchFromGitHub, fetchpatch , libxml2, python3, isl, fetchurl, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross @@ -56,7 +56,7 @@ let then tools.bintools else bootBintools; - in { + in rec { libllvm = callPackage ./llvm { inherit llvm_meta; @@ -66,7 +66,17 @@ let # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm; - libclang = callPackage ./clang { + libclang = callPackage ../common/clang { + src = fetch "clang" "0px4gl27az6cdz6adds89qzdwb1cqpjsfvrldbz9qvpmphrj34bf"; + patches = [ + ./clang/purity.patch + # https://reviews.llvm.org/D51899 + ./clang/gnu-install-dirs.patch + (substituteAll { + src = ../common/clang/clang-11-15-LLVMgold-path.patch; + libllvmLibdir = "${libllvm.lib}/lib"; + }) + ]; inherit clang-tools-extra_src llvm_meta; }; diff --git a/pkgs/development/compilers/llvm/13/clang/default.nix b/pkgs/development/compilers/llvm/13/clang/default.nix deleted file mode 100644 index 2d02ffb60b36..000000000000 --- a/pkgs/development/compilers/llvm/13/clang/default.nix +++ /dev/null @@ -1,126 +0,0 @@ -{ lib, stdenv, llvm_meta, src, substituteAll, cmake, libxml2, libllvm, version, python3 -, buildLlvmTools -, fixDarwinDylibNames -, enableManpages ? false -}: - -let - self = stdenv.mkDerivation ({ - pname = "clang"; - inherit version; - - inherit src; - sourceRoot = "${src.name}/clang"; - - nativeBuildInputs = [ cmake python3 ] - ++ lib.optional enableManpages python3.pkgs.sphinx - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - - buildInputs = [ libxml2 libllvm ]; - - cmakeFlags = [ - "-DCLANGD_BUILD_XPC=OFF" - "-DLLVM_ENABLE_RTTI=ON" - ] ++ lib.optionals enableManpages [ - "-DCLANG_INCLUDE_DOCS=ON" - "-DLLVM_ENABLE_SPHINX=ON" - "-DSPHINX_OUTPUT_MAN=ON" - "-DSPHINX_OUTPUT_HTML=OFF" - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" - "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" - ]; - - patches = [ - ./purity.patch - # https://reviews.llvm.org/D51899 - ./gnu-install-dirs.patch - # Revert of https://reviews.llvm.org/D100879 - # The malloc alignment assumption is incorrect for jemalloc and causes - # mis-compilation in firefox. - # See: https://bugzilla.mozilla.org/show_bug.cgi?id=1741454 - ./revert-malloc-alignment-assumption.patch - ../../common/clang/add-nostdlibinc-flag.patch - (substituteAll { - src = ../../common/clang/clang-11-15-LLVMgold-path.patch; - libllvmLibdir = "${libllvm.lib}/lib"; - }) - ]; - - postPatch = '' - (cd tools && ln -s ../../clang-tools-extra extra) - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp - ''; - - outputs = [ "out" "lib" "dev" "python" ]; - - postInstall = '' - ln -sv $out/bin/clang $out/bin/cpp - - # Move libclang to 'lib' output - moveToOutput "lib/libclang.*" "$lib" - moveToOutput "lib/libclang-cpp.*" "$lib" - substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp." - - mkdir -p $python/bin $python/share/{clang,scan-view} - mv $out/bin/{git-clang-format,scan-view} $python/bin - if [ -e $out/bin/set-xcode-analyzer ]; then - mv $out/bin/set-xcode-analyzer $python/bin - fi - mv $out/share/clang/*.py $python/share/clang - mv $out/share/scan-view/*.py $python/share/scan-view - rm $out/bin/c-index-test - patchShebangs $python/bin - - mkdir -p $dev/bin - cp bin/clang-tblgen $dev/bin - ''; - - passthru = { - inherit libllvm; - isClang = true; - hardeningUnsupportedFlags = [ "fortify3" "zerocallusedregs" ]; - }; - - meta = llvm_meta // { - homepage = "https://clang.llvm.org/"; - description = "A C language family frontend for LLVM"; - longDescription = '' - The Clang project provides a language front-end and tooling - infrastructure for languages in the C language family (C, C++, Objective - C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. - It aims to deliver amazingly fast compiles, extremely useful error and - warning messages and to provide a platform for building great source - level tools. The Clang Static Analyzer and clang-tidy are tools that - automatically find bugs in your code, and are great examples of the sort - of tools that can be built using the Clang frontend as a library to - parse C/C++ code. - ''; - mainProgram = "clang"; - }; - } // lib.optionalAttrs enableManpages { - pname = "clang-manpages"; - - buildPhase = '' - make docs-clang-man - ''; - - installPhase = '' - mkdir -p $out/share/man/man1 - # Manually install clang manpage - cp docs/man/*.1 $out/share/man/man1/ - ''; - - outputs = [ "out" ]; - - doCheck = false; - - meta = llvm_meta // { - description = "man page for Clang ${version}"; - }; - }); -in self diff --git a/pkgs/development/compilers/llvm/13/default.nix b/pkgs/development/compilers/llvm/13/default.nix index 712c6e160d1e..ecdbd14e98e7 100644 --- a/pkgs/development/compilers/llvm/13/default.nix +++ b/pkgs/development/compilers/llvm/13/default.nix @@ -1,7 +1,7 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake , preLibcCrossHeaders , fetchpatch -, libxml2, python3, isl, fetchFromGitHub, substitute, overrideCC, wrapCCWith, wrapBintoolsWith +, libxml2, python3, isl, fetchFromGitHub, substitute, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross , targetLlvm @@ -82,7 +82,7 @@ in let then tools.bintools else bootBintools; - in { + in rec { libllvm = callPackage ./llvm { inherit llvm_meta; @@ -92,7 +92,22 @@ in let # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm; - libclang = callPackage ./clang { + libclang = callPackage ../common/clang { + patches = [ + ./clang/purity.patch + # https://reviews.llvm.org/D51899 + ./clang/gnu-install-dirs.patch + # Revert of https://reviews.llvm.org/D100879 + # The malloc alignment assumption is incorrect for jemalloc and causes + # mis-compilation in firefox. + # See: https://bugzilla.mozilla.org/show_bug.cgi?id=1741454 + ./clang/revert-malloc-alignment-assumption.patch + ../common/clang/add-nostdlibinc-flag.patch + (substituteAll { + src = ../common/clang/clang-11-15-LLVMgold-path.patch; + libllvmLibdir = "${libllvm.lib}/lib"; + }) + ]; inherit llvm_meta; }; diff --git a/pkgs/development/compilers/llvm/14/clang/default.nix b/pkgs/development/compilers/llvm/14/clang/default.nix deleted file mode 100644 index 829edb15d600..000000000000 --- a/pkgs/development/compilers/llvm/14/clang/default.nix +++ /dev/null @@ -1,129 +0,0 @@ -{ lib, stdenv, llvm_meta -, monorepoSrc, runCommand -, substituteAll, cmake, libxml2, libllvm, version, python3 -, buildLlvmTools -, fixDarwinDylibNames -, enableManpages ? false -}: - -let - self = stdenv.mkDerivation (rec { - pname = "clang"; - inherit version; - - src = runCommand "${pname}-src-${version}" {} '' - mkdir -p "$out" - cp -r ${monorepoSrc}/cmake "$out" - cp -r ${monorepoSrc}/${pname} "$out" - cp -r ${monorepoSrc}/clang-tools-extra "$out" - ''; - - sourceRoot = "${src.name}/${pname}"; - - nativeBuildInputs = [ cmake python3 ] - ++ lib.optional enableManpages python3.pkgs.sphinx - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - - buildInputs = [ libxml2 libllvm ]; - - cmakeFlags = [ - "-DCLANGD_BUILD_XPC=OFF" - "-DLLVM_ENABLE_RTTI=ON" - ] ++ lib.optionals enableManpages [ - "-DCLANG_INCLUDE_DOCS=ON" - "-DLLVM_ENABLE_SPHINX=ON" - "-DSPHINX_OUTPUT_MAN=ON" - "-DSPHINX_OUTPUT_HTML=OFF" - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) [ - "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" - "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" - ]; - - patches = [ - ./purity.patch - # https://reviews.llvm.org/D51899 - ./gnu-install-dirs.patch - ../../common/clang/add-nostdlibinc-flag.patch - (substituteAll { - src = ../../common/clang/clang-11-15-LLVMgold-path.patch; - libllvmLibdir = "${libllvm.lib}/lib"; - }) - ]; - - postPatch = '' - (cd tools && ln -s ../../clang-tools-extra extra) - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp - ''; - - outputs = [ "out" "lib" "dev" "python" ]; - - postInstall = '' - ln -sv $out/bin/clang $out/bin/cpp - - # Move libclang to 'lib' output - moveToOutput "lib/libclang.*" "$lib" - moveToOutput "lib/libclang-cpp.*" "$lib" - substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp." - - mkdir -p $python/bin $python/share/{clang,scan-view} - mv $out/bin/{git-clang-format,scan-view} $python/bin - if [ -e $out/bin/set-xcode-analyzer ]; then - mv $out/bin/set-xcode-analyzer $python/bin - fi - mv $out/share/clang/*.py $python/share/clang - mv $out/share/scan-view/*.py $python/share/scan-view - rm $out/bin/c-index-test - patchShebangs $python/bin - - mkdir -p $dev/bin - cp bin/clang-tblgen $dev/bin - ''; - - passthru = { - inherit libllvm; - isClang = true; - hardeningUnsupportedFlags = [ "fortify3" "zerocallusedregs" ]; - }; - - meta = llvm_meta // { - homepage = "https://clang.llvm.org/"; - description = "A C language family frontend for LLVM"; - longDescription = '' - The Clang project provides a language front-end and tooling - infrastructure for languages in the C language family (C, C++, Objective - C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. - It aims to deliver amazingly fast compiles, extremely useful error and - warning messages and to provide a platform for building great source - level tools. The Clang Static Analyzer and clang-tidy are tools that - automatically find bugs in your code, and are great examples of the sort - of tools that can be built using the Clang frontend as a library to - parse C/C++ code. - ''; - mainProgram = "clang"; - }; - } // lib.optionalAttrs enableManpages { - pname = "clang-manpages"; - - buildPhase = '' - make docs-clang-man - ''; - - installPhase = '' - mkdir -p $out/share/man/man1 - # Manually install clang manpage - cp docs/man/*.1 $out/share/man/man1/ - ''; - - outputs = [ "out" ]; - - doCheck = false; - - meta = llvm_meta // { - description = "man page for Clang ${version}"; - }; - }); -in self diff --git a/pkgs/development/compilers/llvm/14/default.nix b/pkgs/development/compilers/llvm/14/default.nix index efab4ca73572..fb1b8743b6eb 100644 --- a/pkgs/development/compilers/llvm/14/default.nix +++ b/pkgs/development/compilers/llvm/14/default.nix @@ -1,6 +1,6 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake , preLibcCrossHeaders -, libxml2, python3, fetchFromGitHub, substitute, overrideCC, wrapCCWith, wrapBintoolsWith +, libxml2, python3, fetchFromGitHub, substitute, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross , targetLlvm @@ -78,7 +78,7 @@ in let then tools.bintools else bootBintools; - in { + in rec { libllvm = callPackage ./llvm { inherit llvm_meta; @@ -88,7 +88,17 @@ in let # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm; - libclang = callPackage ./clang { + libclang = callPackage ../common/clang { + patches = [ + ./clang/purity.patch + # https://reviews.llvm.org/D51899 + ./clang/gnu-install-dirs.patch + ../common/clang/add-nostdlibinc-flag.patch + (substituteAll { + src = ../common/clang/clang-11-15-LLVMgold-path.patch; + libllvmLibdir = "${libllvm.lib}/lib"; + }) + ]; inherit llvm_meta; }; diff --git a/pkgs/development/compilers/llvm/15/default.nix b/pkgs/development/compilers/llvm/15/default.nix index 01112e0165e4..ce8426857ebe 100644 --- a/pkgs/development/compilers/llvm/15/default.nix +++ b/pkgs/development/compilers/llvm/15/default.nix @@ -1,6 +1,6 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja , preLibcCrossHeaders -, libxml2, python3, fetchFromGitHub, fetchpatch, substitute, overrideCC, wrapCCWith, wrapBintoolsWith +, libxml2, python3, fetchFromGitHub, fetchpatch, substitute, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross , targetLlvm @@ -84,7 +84,7 @@ in let then tools.bintools else bootBintools; - in { + in rec { libllvm = callPackage ./llvm { inherit llvm_meta; @@ -94,7 +94,17 @@ in let # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm; - libclang = callPackage ./clang { + libclang = callPackage ../common/clang { + patches = [ + ./clang/purity.patch + # https://reviews.llvm.org/D51899 + ./clang/gnu-install-dirs.patch + ../common/clang/add-nostdlibinc-flag.patch + (substituteAll { + src = ../common/clang/clang-11-15-LLVMgold-path.patch; + libllvmLibdir = "${libllvm.lib}/lib"; + }) + ]; inherit llvm_meta; }; diff --git a/pkgs/development/compilers/llvm/16/clang/default.nix b/pkgs/development/compilers/llvm/16/clang/default.nix deleted file mode 100644 index c5d9af356d9e..000000000000 --- a/pkgs/development/compilers/llvm/16/clang/default.nix +++ /dev/null @@ -1,137 +0,0 @@ -{ lib, stdenv, llvm_meta -, monorepoSrc, runCommand -, substituteAll, cmake, ninja, libxml2, libllvm, version, python3 -, buildLlvmTools -, fixDarwinDylibNames -, enableManpages ? false -}: - -let - self = stdenv.mkDerivation (finalAttrs: rec { - pname = "clang"; - inherit version; - - src = runCommand "${pname}-src-${version}" {} '' - mkdir -p "$out" - cp -r ${monorepoSrc}/cmake "$out" - cp -r ${monorepoSrc}/${pname} "$out" - cp -r ${monorepoSrc}/clang-tools-extra "$out" - ''; - - sourceRoot = "${src.name}/${pname}"; - - nativeBuildInputs = [ cmake ninja python3 ] - ++ lib.optional enableManpages python3.pkgs.sphinx - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - - buildInputs = [ libxml2 libllvm ]; - - cmakeFlags = [ - "-DCLANG_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/clang" - "-DCLANGD_BUILD_XPC=OFF" - "-DLLVM_ENABLE_RTTI=ON" - ] ++ lib.optionals enableManpages [ - "-DCLANG_INCLUDE_DOCS=ON" - "-DLLVM_ENABLE_SPHINX=ON" - "-DSPHINX_OUTPUT_MAN=ON" - "-DSPHINX_OUTPUT_HTML=OFF" - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" - "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" - # Added in LLVM15: - # `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb - # `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7 - "-DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${buildLlvmTools.libclang.dev}/bin/clang-tidy-confusable-chars-gen" - "-DCLANG_PSEUDO_GEN=${buildLlvmTools.libclang.dev}/bin/clang-pseudo-gen" - ]; - - patches = [ - ./purity.patch - # https://reviews.llvm.org/D51899 - ./gnu-install-dirs.patch - ../../common/clang/add-nostdlibinc-flag.patch - (substituteAll { - src = ../../common/clang/clang-at-least-16-LLVMgold-path.patch; - libllvmLibdir = "${libllvm.lib}/lib"; - }) - ]; - - postPatch = '' - (cd tools && ln -s ../../clang-tools-extra extra) - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp - ''; - - outputs = [ "out" "lib" "dev" "python" ]; - - postInstall = '' - ln -sv $out/bin/clang $out/bin/cpp - - # Move libclang to 'lib' output - moveToOutput "lib/libclang.*" "$lib" - moveToOutput "lib/libclang-cpp.*" "$lib" - substituteInPlace $dev/lib/cmake/clang/ClangTargets-release.cmake \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp." - - mkdir -p $python/bin $python/share/clang/ - mv $out/bin/{git-clang-format,scan-view} $python/bin - if [ -e $out/bin/set-xcode-analyzer ]; then - mv $out/bin/set-xcode-analyzer $python/bin - fi - mv $out/share/clang/*.py $python/share/clang - rm $out/bin/c-index-test - patchShebangs $python/bin - - mkdir -p $dev/bin - cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin - ''; - - passthru = { - inherit libllvm; - isClang = true; - hardeningUnsupportedFlags = [ - "fortify3" - ]; - hardeningUnsupportedFlagsByTargetPlatform = targetPlatform: - lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs" - ++ (finalAttrs.passthru.hardeningUnsupportedFlags or []); - }; - - meta = llvm_meta // { - homepage = "https://clang.llvm.org/"; - description = "A C language family frontend for LLVM"; - longDescription = '' - The Clang project provides a language front-end and tooling - infrastructure for languages in the C language family (C, C++, Objective - C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. - It aims to deliver amazingly fast compiles, extremely useful error and - warning messages and to provide a platform for building great source - level tools. The Clang Static Analyzer and clang-tidy are tools that - automatically find bugs in your code, and are great examples of the sort - of tools that can be built using the Clang frontend as a library to - parse C/C++ code. - ''; - mainProgram = "clang"; - }; - } // lib.optionalAttrs enableManpages { - pname = "clang-manpages"; - - ninjaFlags = [ "docs-clang-man" ]; - - installPhase = '' - mkdir -p $out/share/man/man1 - # Manually install clang manpage - cp docs/man/*.1 $out/share/man/man1/ - ''; - - outputs = [ "out" ]; - - doCheck = false; - - meta = llvm_meta // { - description = "man page for Clang ${version}"; - }; - }); -in self diff --git a/pkgs/development/compilers/llvm/16/default.nix b/pkgs/development/compilers/llvm/16/default.nix index 99ab725273b8..5716267426b2 100644 --- a/pkgs/development/compilers/llvm/16/default.nix +++ b/pkgs/development/compilers/llvm/16/default.nix @@ -1,6 +1,6 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja , preLibcCrossHeaders -, libxml2, python3, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith +, libxml2, python3, fetchFromGitHub, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross , targetLlvm @@ -85,7 +85,7 @@ in let then tools.bintools else bootBintools; - in { + in rec { libllvm = callPackage ./llvm { inherit llvm_meta; @@ -95,7 +95,17 @@ in let # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm; - libclang = callPackage ./clang { + libclang = callPackage ../common/clang { + patches = [ + ./clang/purity.patch + # https://reviews.llvm.org/D51899 + ./clang/gnu-install-dirs.patch + ../common/clang/add-nostdlibinc-flag.patch + (substituteAll { + src = ../common/clang/clang-at-least-16-LLVMgold-path.patch; + libllvmLibdir = "${libllvm.lib}/lib"; + }) + ]; inherit llvm_meta; }; diff --git a/pkgs/development/compilers/llvm/17/clang/default.nix b/pkgs/development/compilers/llvm/17/clang/default.nix deleted file mode 100644 index f7922f3d9951..000000000000 --- a/pkgs/development/compilers/llvm/17/clang/default.nix +++ /dev/null @@ -1,141 +0,0 @@ -{ lib, stdenv, llvm_meta -, monorepoSrc, runCommand -, substituteAll, cmake, ninja, libxml2, libllvm, version, python3 -, buildLlvmTools -, fixDarwinDylibNames -, enableManpages ? false -}: - -let - self = stdenv.mkDerivation (finalAttrs: rec { - pname = "clang"; - inherit version; - - src = runCommand "${pname}-src-${version}" {} '' - mkdir -p "$out" - cp -r ${monorepoSrc}/cmake "$out" - cp -r ${monorepoSrc}/${pname} "$out" - cp -r ${monorepoSrc}/clang-tools-extra "$out" - ''; - - sourceRoot = "${src.name}/${pname}"; - - nativeBuildInputs = [ cmake ninja python3 ] - ++ lib.optional enableManpages python3.pkgs.sphinx - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - - buildInputs = [ libxml2 libllvm ]; - - cmakeFlags = [ - "-DCLANG_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/clang" - "-DCLANGD_BUILD_XPC=OFF" - "-DLLVM_ENABLE_RTTI=ON" - "-DLLVM_INCLUDE_TESTS=OFF" - ] ++ lib.optionals enableManpages [ - "-DCLANG_INCLUDE_DOCS=ON" - "-DLLVM_ENABLE_SPHINX=ON" - "-DSPHINX_OUTPUT_MAN=ON" - "-DSPHINX_OUTPUT_HTML=OFF" - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" - "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" - # Added in LLVM15: - # `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb - # `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7 - "-DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${buildLlvmTools.libclang.dev}/bin/clang-tidy-confusable-chars-gen" - "-DCLANG_PSEUDO_GEN=${buildLlvmTools.libclang.dev}/bin/clang-pseudo-gen" - ]; - - patches = [ - ./purity.patch - # https://reviews.llvm.org/D51899 - ./gnu-install-dirs.patch - ../../common/clang/add-nostdlibinc-flag.patch - (substituteAll { - src = ../../common/clang/clang-at-least-16-LLVMgold-path.patch; - libllvmLibdir = "${libllvm.lib}/lib"; - }) - ]; - - postPatch = '' - (cd tools && ln -s ../../clang-tools-extra extra) - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp - ''; - - outputs = [ "out" "lib" "dev" "python" ]; - - postInstall = '' - ln -sv $out/bin/clang $out/bin/cpp - - mkdir -p $lib/lib/clang - mv $lib/lib/17 $lib/lib/clang/17 - - # Move libclang to 'lib' output - moveToOutput "lib/libclang.*" "$lib" - moveToOutput "lib/libclang-cpp.*" "$lib" - substituteInPlace $dev/lib/cmake/clang/ClangTargets-release.cmake \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp." - - mkdir -p $python/bin $python/share/clang/ - mv $out/bin/{git-clang-format,scan-view} $python/bin - if [ -e $out/bin/set-xcode-analyzer ]; then - mv $out/bin/set-xcode-analyzer $python/bin - fi - mv $out/share/clang/*.py $python/share/clang - rm $out/bin/c-index-test - patchShebangs $python/bin - - mkdir -p $dev/bin - cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin - ''; - - passthru = { - inherit libllvm; - isClang = true; - hardeningUnsupportedFlags = [ - "fortify3" - ]; - hardeningUnsupportedFlagsByTargetPlatform = targetPlatform: - lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs" - ++ (finalAttrs.passthru.hardeningUnsupportedFlags or []); - }; - - meta = llvm_meta // { - homepage = "https://clang.llvm.org/"; - description = "A C language family frontend for LLVM"; - longDescription = '' - The Clang project provides a language front-end and tooling - infrastructure for languages in the C language family (C, C++, Objective - C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. - It aims to deliver amazingly fast compiles, extremely useful error and - warning messages and to provide a platform for building great source - level tools. The Clang Static Analyzer and clang-tidy are tools that - automatically find bugs in your code, and are great examples of the sort - of tools that can be built using the Clang frontend as a library to - parse C/C++ code. - ''; - mainProgram = "clang"; - }; - } // lib.optionalAttrs enableManpages { - pname = "clang-manpages"; - - ninjaFlags = [ "docs-clang-man" ]; - - installPhase = '' - mkdir -p $out/share/man/man1 - # Manually install clang manpage - cp docs/man/*.1 $out/share/man/man1/ - ''; - - outputs = [ "out" ]; - - doCheck = false; - - meta = llvm_meta // { - description = "man page for Clang ${version}"; - }; - }); -in self diff --git a/pkgs/development/compilers/llvm/17/default.nix b/pkgs/development/compilers/llvm/17/default.nix index 2f2663217653..2f60666536f3 100644 --- a/pkgs/development/compilers/llvm/17/default.nix +++ b/pkgs/development/compilers/llvm/17/default.nix @@ -1,6 +1,6 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja , preLibcCrossHeaders -, libxml2, python3, fetchFromGitHub, fetchpatch, overrideCC, wrapCCWith, wrapBintoolsWith +, libxml2, python3, fetchFromGitHub, fetchpatch, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross , targetLlvm @@ -80,7 +80,7 @@ in let then tools.bintools else bootBintools; - in { + in rec { libllvm = callPackage ./llvm { inherit llvm_meta; @@ -90,7 +90,17 @@ in let # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm; - libclang = callPackage ./clang { + libclang = callPackage ../common/clang { + patches = [ + ./clang/purity.patch + # https://reviews.llvm.org/D51899 + ./clang/gnu-install-dirs.patch + ../common/clang/add-nostdlibinc-flag.patch + (substituteAll { + src = ../common/clang/clang-at-least-16-LLVMgold-path.patch; + libllvmLibdir = "${libllvm.lib}/lib"; + }) + ]; inherit llvm_meta; }; diff --git a/pkgs/development/compilers/llvm/18/default.nix b/pkgs/development/compilers/llvm/18/default.nix index 4bc56be45b3e..0a30288755e6 100644 --- a/pkgs/development/compilers/llvm/18/default.nix +++ b/pkgs/development/compilers/llvm/18/default.nix @@ -1,6 +1,6 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja , preLibcCrossHeaders -, libxml2, python3, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith +, libxml2, python3, fetchFromGitHub, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross , targetLlvm @@ -80,7 +80,7 @@ in let then tools.bintools else bootBintools; - in { + in rec { libllvm = callPackage ./llvm { inherit llvm_meta; @@ -90,7 +90,17 @@ in let # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm; - libclang = callPackage ./clang { + libclang = callPackage ../common/clang { + patches = [ + ./clang/purity.patch + # https://reviews.llvm.org/D51899 + ./clang/gnu-install-dirs.patch + ../common/clang/add-nostdlibinc-flag.patch + (substituteAll { + src = ../common/clang/clang-at-least-16-LLVMgold-path.patch; + libllvmLibdir = "${libllvm.lib}/lib"; + }) + ]; inherit llvm_meta; }; diff --git a/pkgs/development/compilers/llvm/15/clang/default.nix b/pkgs/development/compilers/llvm/common/clang/default.nix similarity index 56% rename from pkgs/development/compilers/llvm/15/clang/default.nix rename to pkgs/development/compilers/llvm/common/clang/default.nix index de789edaa9ff..2373795b49fd 100644 --- a/pkgs/development/compilers/llvm/15/clang/default.nix +++ b/pkgs/development/compilers/llvm/common/clang/default.nix @@ -1,109 +1,145 @@ -{ lib, stdenv, llvm_meta -, monorepoSrc, runCommand -, substituteAll, cmake, ninja, libxml2, libllvm, version, python3 +{ lib +, stdenv +, llvm_meta +, patches ? [] +, src ? null +, monorepoSrc ? null +, runCommand +, substituteAll +, cmake +, ninja +, libxml2 +, libllvm +, release_version +, version +, python3 , buildLlvmTools , fixDarwinDylibNames , enableManpages ? false +, clang-tools-extra_src ? null }: let - self = stdenv.mkDerivation (finalAttrs: rec { - pname = "clang"; - inherit version; + pname = "clang"; - src = runCommand "${pname}-src-${version}" {} '' + src' = if monorepoSrc != null then + runCommand "${pname}-src-${version}" {} '' mkdir -p "$out" cp -r ${monorepoSrc}/cmake "$out" cp -r ${monorepoSrc}/${pname} "$out" cp -r ${monorepoSrc}/clang-tools-extra "$out" - ''; + '' else src; - sourceRoot = "${src.name}/${pname}"; + self = stdenv.mkDerivation (finalAttrs: rec { + inherit pname version patches; - nativeBuildInputs = [ cmake ninja python3 ] + src = src'; + + sourceRoot = if lib.versionOlder release_version "13" then null + else "${src.name}/${pname}"; + + nativeBuildInputs = [ cmake ] + ++ (lib.optional (lib.versionAtLeast release_version "15") ninja) + ++ [ python3 ] + ++ lib.optional (lib.versionAtLeast version "18" && enableManpages) python3.pkgs.myst-parser ++ lib.optional enableManpages python3.pkgs.sphinx ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; buildInputs = [ libxml2 libllvm ]; - cmakeFlags = [ + cmakeFlags = (lib.optionals (lib.versionAtLeast release_version "15") [ "-DCLANG_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/clang" + ]) ++ [ "-DCLANGD_BUILD_XPC=OFF" "-DLLVM_ENABLE_RTTI=ON" + ] ++ lib.optionals (lib.versionAtLeast release_version "17") [ + "-DLLVM_INCLUDE_TESTS=OFF" ] ++ lib.optionals enableManpages [ "-DCLANG_INCLUDE_DOCS=ON" "-DLLVM_ENABLE_SPHINX=ON" "-DSPHINX_OUTPUT_MAN=ON" "-DSPHINX_OUTPUT_HTML=OFF" "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ + ] ++ lib.optionals (stdenv.hostPlatform != stdenv.buildPlatform) ([ "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" + ] ++ lib.optionals (lib.versionAtLeast release_version "15") [ # Added in LLVM15: # `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb # `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7 "-DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${buildLlvmTools.libclang.dev}/bin/clang-tidy-confusable-chars-gen" "-DCLANG_PSEUDO_GEN=${buildLlvmTools.libclang.dev}/bin/clang-pseudo-gen" - ]; + ]); - patches = [ - ./purity.patch - # https://reviews.llvm.org/D51899 - ./gnu-install-dirs.patch - ../../common/clang/add-nostdlibinc-flag.patch - (substituteAll { - src = ../../common/clang/clang-11-15-LLVMgold-path.patch; - libllvmLibdir = "${libllvm.lib}/lib"; - }) - ]; - - postPatch = '' + postPatch = (if lib.versionOlder release_version "13" then '' + sed -i -e 's/DriverArgs.hasArg(options::OPT_nostdlibinc)/true/' \ + -e 's/Args.hasArg(options::OPT_nostdlibinc)/true/' \ + lib/Driver/ToolChains/*.cpp + '' else '' (cd tools && ln -s ../../clang-tools-extra extra) - '' + lib.optionalString stdenv.hostPlatform.isMusl '' + '') + lib.optionalString stdenv.hostPlatform.isMusl '' sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp ''; outputs = [ "out" "lib" "dev" "python" ]; - env = lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { - # The following warning is triggered with (at least) gcc >= - # 12, but appears to occur only for cross compiles. - NIX_CFLAGS_COMPILE = "-Wno-maybe-uninitialized"; - }; - postInstall = '' ln -sv $out/bin/clang $out/bin/cpp + '' + (lib.optionalString (lib.versions.major release_version == "17") '' + + mkdir -p $lib/lib/clang + mv $lib/lib/17 $lib/lib/clang/17 + '') + '' # Move libclang to 'lib' output moveToOutput "lib/libclang.*" "$lib" moveToOutput "lib/libclang-cpp.*" "$lib" + '' + (if lib.versionOlder release_version "15" then '' + substituteInPlace $out/lib/cmake/clang/ClangTargets-release.cmake \ + --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \ + --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp." + '' else '' substituteInPlace $dev/lib/cmake/clang/ClangTargets-release.cmake \ --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \ --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp." + '') + '' + '' + (if lib.versionOlder release_version "15" then '' + mkdir -p $python/bin $python/share/{clang,scan-view} + '' else '' mkdir -p $python/bin $python/share/clang/ + '') + '' mv $out/bin/{git-clang-format,scan-view} $python/bin if [ -e $out/bin/set-xcode-analyzer ]; then mv $out/bin/set-xcode-analyzer $python/bin fi mv $out/share/clang/*.py $python/share/clang + '' + (lib.optionalString (lib.versionOlder release_version "15") '' + mv $out/share/scan-view/*.py $python/share/scan-view + '') + '' rm $out/bin/c-index-test patchShebangs $python/bin mkdir -p $dev/bin + '' + (if lib.versionOlder release_version "15" then '' + cp bin/clang-tblgen $dev/bin + '' else '' cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin - ''; + ''); passthru = { inherit libllvm; isClang = true; + } // (lib.optionalAttrs (lib.versionAtLeast release_version "15") { hardeningUnsupportedFlags = [ "fortify3" ]; hardeningUnsupportedFlagsByTargetPlatform = targetPlatform: lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs" ++ (finalAttrs.passthru.hardeningUnsupportedFlags or []); - }; + }) // (lib.optionalAttrs (lib.versionOlder release_version "15") { + hardeningUnsupportedFlags = [ "fortify3" "zerocallusedregs" ]; + }); meta = llvm_meta // { homepage = "https://clang.llvm.org/"; @@ -121,11 +157,9 @@ let ''; mainProgram = "clang"; }; - } // lib.optionalAttrs enableManpages { + } // lib.optionalAttrs enableManpages ({ pname = "clang-manpages"; - ninjaFlags = [ "docs-clang-man" ]; - installPhase = '' mkdir -p $out/share/man/man1 # Manually install clang manpage @@ -139,5 +173,29 @@ let meta = llvm_meta // { description = "man page for Clang ${version}"; }; - }); + } // (if lib.versionOlder release_version "15" then { + buildPhase = '' + make docs-clang-man + ''; + } else { + ninjaFlags = [ "docs-clang-man" ]; + })) // (lib.optionalAttrs (clang-tools-extra_src != null) { inherit clang-tools-extra_src; }) + // (lib.optionalAttrs (lib.versionOlder release_version "13") { + unpackPhase = '' + unpackFile $src + mv clang-* clang + sourceRoot=$PWD/clang + unpackFile ${clang-tools-extra_src} + mv clang-tools-extra-* $sourceRoot/tools/extra + substituteInPlace $sourceRoot/tools/extra/clangd/quality/CompletionModel.cmake \ + --replace ' ''${CMAKE_SOURCE_DIR}/../clang-tools-extra' ' ''${CMAKE_SOURCE_DIR}/tools/extra' + ''; + }) + // (lib.optionalAttrs (lib.versionAtLeast release_version "15") { + env = lib.optionalAttrs (stdenv.buildPlatform != stdenv.hostPlatform) { + # The following warning is triggered with (at least) gcc >= + # 12, but appears to occur only for cross compiles. + NIX_CFLAGS_COMPILE = "-Wno-maybe-uninitialized"; + }; + })); in self diff --git a/pkgs/development/compilers/llvm/git/clang/default.nix b/pkgs/development/compilers/llvm/git/clang/default.nix deleted file mode 100644 index 1e777c6132e4..000000000000 --- a/pkgs/development/compilers/llvm/git/clang/default.nix +++ /dev/null @@ -1,139 +0,0 @@ -{ lib, stdenv, llvm_meta -, monorepoSrc, runCommand -, substituteAll, cmake, ninja, libxml2, libllvm, version, python3 -, buildLlvmTools -, fixDarwinDylibNames -, enableManpages ? false -}: - -let - self = stdenv.mkDerivation (finalAttrs: rec { - pname = "clang"; - inherit version; - - src = runCommand "${pname}-src-${version}" {} '' - mkdir -p "$out" - cp -r ${monorepoSrc}/cmake "$out" - cp -r ${monorepoSrc}/${pname} "$out" - cp -r ${monorepoSrc}/clang-tools-extra "$out" - ''; - - sourceRoot = "${src.name}/${pname}"; - - nativeBuildInputs = [ cmake ninja python3 ] - ++ lib.optional (lib.versionAtLeast version "18" && enableManpages) python3.pkgs.myst-parser - ++ lib.optional enableManpages python3.pkgs.sphinx - ++ lib.optional stdenv.hostPlatform.isDarwin fixDarwinDylibNames; - - buildInputs = [ libxml2 libllvm ]; - - cmakeFlags = [ - "-DCLANG_INSTALL_PACKAGE_DIR=${placeholder "dev"}/lib/cmake/clang" - "-DCLANGD_BUILD_XPC=OFF" - "-DLLVM_ENABLE_RTTI=ON" - "-DLLVM_INCLUDE_TESTS=OFF" - ] ++ lib.optionals enableManpages [ - "-DCLANG_INCLUDE_DOCS=ON" - "-DLLVM_ENABLE_SPHINX=ON" - "-DSPHINX_OUTPUT_MAN=ON" - "-DSPHINX_OUTPUT_HTML=OFF" - "-DSPHINX_WARNINGS_AS_ERRORS=OFF" - ] ++ lib.optionals (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) [ - "-DLLVM_TABLEGEN_EXE=${buildLlvmTools.llvm}/bin/llvm-tblgen" - "-DCLANG_TABLEGEN=${buildLlvmTools.libclang.dev}/bin/clang-tblgen" - # Added in LLVM15: - # `clang-tidy-confusable-chars-gen`: https://github.com/llvm/llvm-project/commit/c3574ef739fbfcc59d405985a3a4fa6f4619ecdb - # `clang-pseudo-gen`: https://github.com/llvm/llvm-project/commit/cd2292ef824591cc34cc299910a3098545c840c7 - "-DCLANG_TIDY_CONFUSABLE_CHARS_GEN=${buildLlvmTools.libclang.dev}/bin/clang-tidy-confusable-chars-gen" - "-DCLANG_PSEUDO_GEN=${buildLlvmTools.libclang.dev}/bin/clang-pseudo-gen" - ]; - - patches = [ - ./purity.patch - # https://reviews.llvm.org/D51899 - ./gnu-install-dirs.patch - ../../common/clang/add-nostdlibinc-flag.patch - (substituteAll { - src = ../../common/clang/clang-at-least-16-LLVMgold-path.patch; - libllvmLibdir = "${libllvm.lib}/lib"; - }) - ]; - - postPatch = '' - (cd tools && ln -s ../../clang-tools-extra extra) - '' + lib.optionalString stdenv.hostPlatform.isMusl '' - sed -i -e 's/lgcc_s/lgcc_eh/' lib/Driver/ToolChains/*.cpp - ''; - - outputs = [ "out" "lib" "dev" "python" ]; - - postInstall = '' - ln -sv $out/bin/clang $out/bin/cpp - - # Move libclang to 'lib' output - moveToOutput "lib/libclang.*" "$lib" - moveToOutput "lib/libclang-cpp.*" "$lib" - substituteInPlace $dev/lib/cmake/clang/ClangTargets-release.cmake \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang." "$lib/lib/libclang." \ - --replace "\''${_IMPORT_PREFIX}/lib/libclang-cpp." "$lib/lib/libclang-cpp." - - mkdir -p $python/bin $python/share/clang/ - mv $out/bin/{git-clang-format,scan-view} $python/bin - if [ -e $out/bin/set-xcode-analyzer ]; then - mv $out/bin/set-xcode-analyzer $python/bin - fi - mv $out/share/clang/*.py $python/share/clang - rm $out/bin/c-index-test - patchShebangs $python/bin - - mkdir -p $dev/bin - cp bin/{clang-tblgen,clang-tidy-confusable-chars-gen,clang-pseudo-gen} $dev/bin - ''; - - passthru = { - inherit libllvm; - isClang = true; - hardeningUnsupportedFlags = [ - "fortify3" - ]; - hardeningUnsupportedFlagsByTargetPlatform = targetPlatform: - lib.optional (!(targetPlatform.isx86_64 || targetPlatform.isAarch64)) "zerocallusedregs" - ++ (finalAttrs.passthru.hardeningUnsupportedFlags or []); - }; - - meta = llvm_meta // { - homepage = "https://clang.llvm.org/"; - description = "A C language family frontend for LLVM"; - longDescription = '' - The Clang project provides a language front-end and tooling - infrastructure for languages in the C language family (C, C++, Objective - C/C++, OpenCL, CUDA, and RenderScript) for the LLVM project. - It aims to deliver amazingly fast compiles, extremely useful error and - warning messages and to provide a platform for building great source - level tools. The Clang Static Analyzer and clang-tidy are tools that - automatically find bugs in your code, and are great examples of the sort - of tools that can be built using the Clang frontend as a library to - parse C/C++ code. - ''; - mainProgram = "clang"; - }; - } // lib.optionalAttrs enableManpages { - pname = "clang-manpages"; - - ninjaFlags = [ "docs-clang-man" ]; - - installPhase = '' - mkdir -p $out/share/man/man1 - # Manually install clang manpage - cp docs/man/*.1 $out/share/man/man1/ - ''; - - outputs = [ "out" ]; - - doCheck = false; - - meta = llvm_meta // { - description = "man page for Clang ${version}"; - }; - }); -in self diff --git a/pkgs/development/compilers/llvm/git/default.nix b/pkgs/development/compilers/llvm/git/default.nix index 1b65ce81055b..56fae64d59d8 100644 --- a/pkgs/development/compilers/llvm/git/default.nix +++ b/pkgs/development/compilers/llvm/git/default.nix @@ -1,6 +1,6 @@ { lowPrio, newScope, pkgs, lib, stdenv, cmake, ninja , preLibcCrossHeaders -, libxml2, python3, fetchFromGitHub, overrideCC, wrapCCWith, wrapBintoolsWith +, libxml2, python3, fetchFromGitHub, substituteAll, overrideCC, wrapCCWith, wrapBintoolsWith , buildLlvmTools # tools, but from the previous stage, for cross , targetLlvmLibraries # libraries, but from the next stage, for cross , targetLlvm @@ -85,7 +85,7 @@ in let then tools.bintools else bootBintools; - in { + in rec { libllvm = callPackage ./llvm { inherit llvm_meta; @@ -95,7 +95,17 @@ in let # we need to reintroduce `outputSpecified` to get the expected behavior e.g. of lib.get* llvm = tools.libllvm; - libclang = callPackage ./clang { + libclang = callPackage ../common/clang { + patches = [ + ./clang/purity.patch + # https://reviews.llvm.org/D51899 + ./clang/gnu-install-dirs.patch + ../common/clang/add-nostdlibinc-flag.patch + (substituteAll { + src = ../common/clang/clang-at-least-16-LLVMgold-path.patch; + libllvmLibdir = "${libllvm.lib}/lib"; + }) + ]; inherit llvm_meta; };