From 73779ab8d4bf97c775d84d9511944c43fd053e1a Mon Sep 17 00:00:00 2001 From: freezeboy Date: Thu, 17 Sep 2020 23:34:46 +0200 Subject: [PATCH 01/17] accounts-qt: migrate to libsForQt5 derivations to fix cmake config Co-authored-by: Thomas Tuegel --- pkgs/development/libraries/accounts-qt/default.nix | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/pkgs/development/libraries/accounts-qt/default.nix b/pkgs/development/libraries/accounts-qt/default.nix index b60d8d07385..4e2e33b852e 100644 --- a/pkgs/development/libraries/accounts-qt/default.nix +++ b/pkgs/development/libraries/accounts-qt/default.nix @@ -1,6 +1,6 @@ -{ stdenv, fetchFromGitLab, doxygen, glib, libaccounts-glib, pkgconfig, qtbase, qmake }: +{ mkDerivation, lib, fetchFromGitLab, doxygen, glib, libaccounts-glib, pkgconfig, qmake }: -stdenv.mkDerivation rec { +mkDerivation rec { pname = "accounts-qt"; version = "1.16"; @@ -11,17 +11,13 @@ stdenv.mkDerivation rec { owner = "accounts-sso"; }; - buildInputs = [ glib libaccounts-glib qtbase ]; + propagatedBuildInputs = [ glib libaccounts-glib ]; nativeBuildInputs = [ doxygen pkgconfig qmake ]; - preConfigure = '' - qmakeFlags="$qmakeFlags LIBDIR=$out/lib CMAKE_CONFIG_PATH=$out/lib/cmake" - ''; - # Hack to avoid TMPDIR in RPATHs. preFixup = ''rm -rf "$(pwd)" ''; - meta = with stdenv.lib; { + meta = with lib; { description = "Qt library for accessing the online accounts database"; homepage = "https://gitlab.com/accounts-sso"; license = licenses.lgpl21; From 0bc5689058dde8e219ce81356e7f890245529858 Mon Sep 17 00:00:00 2001 From: freezeboy Date: Thu, 17 Sep 2020 23:39:27 +0200 Subject: [PATCH 02/17] kdeApplications.kaccounts-integration: init 20.08.2 --- pkgs/applications/kde/default.nix | 1 + .../kde/kaccounts-integration.nix | 23 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 6 ++--- 3 files changed, 27 insertions(+), 3 deletions(-) create mode 100644 pkgs/applications/kde/kaccounts-integration.nix diff --git a/pkgs/applications/kde/default.nix b/pkgs/applications/kde/default.nix index 1f0f7b5ace3..c0e58abbac2 100644 --- a/pkgs/applications/kde/default.nix +++ b/pkgs/applications/kde/default.nix @@ -88,6 +88,7 @@ let gwenview = callPackage ./gwenview.nix {}; incidenceeditor = callPackage ./incidenceeditor.nix {}; k3b = callPackage ./k3b.nix {}; + kaccounts-integration = callPackage ./kaccounts-integration.nix {}; kaddressbook = callPackage ./kaddressbook.nix {}; kalarm = callPackage ./kalarm.nix {}; kalarmcal = callPackage ./kalarmcal.nix {}; diff --git a/pkgs/applications/kde/kaccounts-integration.nix b/pkgs/applications/kde/kaccounts-integration.nix new file mode 100644 index 00000000000..9ad1b05dd92 --- /dev/null +++ b/pkgs/applications/kde/kaccounts-integration.nix @@ -0,0 +1,23 @@ +{ mkDerivation, lib, extra-cmake-modules, kdoctools, kcmutils, kcoreaddons, kwallet, accounts-qt, signond }: + +mkDerivation { + name = "kaccounts-integration"; + meta = with lib; { + homepage = "https://community.kde.org/KTp/Setting_up_KAccounts"; + description = "Online accounts integration"; + maintainers = with maintainers; [ freezeboy ]; + license = licenses.gpl2Plus; + platforms = platforms.linux; + }; + nativeBuildInputs = [ + extra-cmake-modules + ]; + buildInputs = [ + kcmutils + kcoreaddons + kdoctools + kwallet + accounts-qt + signond + ]; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ec4c8836c99..ff0b1c42090 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15667,9 +15667,9 @@ in inherit (kdeApplications.override { libsForQt5 = self; }) libkdcraw libkexiv2 libkipi libkomparediff2 libksane libkcddb akonadi-contacts - akonadi-calendar akonadi-notes akonadi-search kidentitymanagement kontactinterface - kldap akonadi akregator ark bomber bovo dolphin dragon elisa ffmpegthumbs filelight - granatier gwenview k3b kaddressbook kalzium kapptemplate kapman kate katomic + akonadi-calendar akonadi-notes akonadi-search kaccounts-integration kidentitymanagement + kontactinterface kldap akonadi akregator ark bomber bovo dolphin dragon elisa ffmpegthumbs + filelight granatier gwenview k3b kaddressbook kalzium kapptemplate kapman kate katomic kblackbox kblocks kbounce kcachegrind kcalc kcharselect kcolorchooser kdenlive kdf kdialog kdiamond keditbookmarks kfind kfloppy kget kgpg khelpcenter kig kigo killbots kitinerary kleopatra klettres klines kmag kmail kmines kmix kmplot From eb6bdaa89b6619bc9d18dba2d696f542f2b1fbda Mon Sep 17 00:00:00 2001 From: freezeboy Date: Thu, 17 Sep 2020 23:36:09 +0200 Subject: [PATCH 03/17] signond: init 8.60 --- .../development/libraries/signond/default.nix | 30 +++++++++++++++++++ pkgs/top-level/all-packages.nix | 2 ++ 2 files changed, 32 insertions(+) create mode 100644 pkgs/development/libraries/signond/default.nix diff --git a/pkgs/development/libraries/signond/default.nix b/pkgs/development/libraries/signond/default.nix new file mode 100644 index 00000000000..7e986ed2635 --- /dev/null +++ b/pkgs/development/libraries/signond/default.nix @@ -0,0 +1,30 @@ +{ mkDerivation, lib, fetchFromGitLab, qmake, doxygen }: + +mkDerivation rec { + pname = "signond"; + version = "8.60"; + + src = fetchFromGitLab { + owner = "accounts-sso"; + repo = pname; + rev = "VERSION_${version}"; + sha256 = "pFpeJ13ut5EoP37W33WrYL2LzkX/k7ZKJcRpPO5l8i4="; + }; + + nativeBuildInputs = [ + qmake + doxygen + ]; + + preConfigure = '' + substituteInPlace src/signond/signond.pro \ + --replace "/etc" "@out@/etc" + ''; + + meta = with lib; { + homepage = "https://gitlab.com/accounts-sso/signond"; + description = "Signon Daemon for Qt"; + maintainers = with maintainers; [ freezeboy ]; + platforms = platforms.linux; + }; +} diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index ff0b1c42090..6a25e229e8c 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -15817,6 +15817,8 @@ in # Not a library, but we do want it to be built for every qt version there # is, to allow users to choose the right build if needed. sddm = callPackage ../applications/display-managers/sddm { }; + + signond = callPackage ../development/libraries/signond {}; }; qtEnv = qt5.env; From 4a700a5cf1b338ac13d840d5ecdd7b46fcc67be7 Mon Sep 17 00:00:00 2001 From: Elias Probst Date: Wed, 30 Dec 2020 00:43:33 +0100 Subject: [PATCH 04/17] akonadi: add missing kaccounts deps To enable the KAccounts Integration for Akonadi, the following deps had to be added: - signond - accounts-qt - kaccounts-integration --- pkgs/applications/kde/akonadi/default.nix | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/pkgs/applications/kde/akonadi/default.nix b/pkgs/applications/kde/akonadi/default.nix index 6ffe1e2de8a..55e9e233bf6 100644 --- a/pkgs/applications/kde/akonadi/default.nix +++ b/pkgs/applications/kde/akonadi/default.nix @@ -1,8 +1,9 @@ { mkDerivation, lib, kdepimTeam, - extra-cmake-modules, shared-mime-info, qtbase, - boost, kcompletion, kconfigwidgets, kcrash, kdbusaddons, kdesignerplugin, - ki18n, kiconthemes, kio, kitemmodels, kwindowsystem, mysql, qttools, + extra-cmake-modules, shared-mime-info, qtbase, accounts-qt, + boost, kaccounts-integration, kcompletion, kconfigwidgets, kcrash, kdbusaddons, + kdesignerplugin, ki18n, kiconthemes, kio, kitemmodels, kwindowsystem, mysql, qttools, + signond, }: mkDerivation { @@ -19,8 +20,8 @@ mkDerivation { ]; nativeBuildInputs = [ extra-cmake-modules shared-mime-info ]; buildInputs = [ - kcompletion kconfigwidgets kcrash kdbusaddons kdesignerplugin ki18n - kiconthemes kio kwindowsystem qttools + kaccounts-integration kcompletion kconfigwidgets kcrash kdbusaddons kdesignerplugin + ki18n kiconthemes kio kwindowsystem accounts-qt qttools signond ]; propagatedBuildInputs = [ boost kitemmodels ]; outputs = [ "out" "dev" ]; From 9d0164d53d42417e19f9cea858801fef2cf01768 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Sun, 3 Jan 2021 10:01:03 +0100 Subject: [PATCH 05/17] pdfpc: 4.4.1 -> 4.5.0 --- pkgs/applications/misc/pdfpc/default.nix | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/misc/pdfpc/default.nix b/pkgs/applications/misc/pdfpc/default.nix index fc0bf62f1e9..216f8c4b8b8 100644 --- a/pkgs/applications/misc/pdfpc/default.nix +++ b/pkgs/applications/misc/pdfpc/default.nix @@ -1,16 +1,17 @@ { stdenv, fetchFromGitHub, cmake, pkgconfig, vala, gtk3, libgee, fetchpatch -, poppler, libpthreadstubs, gstreamer, gst-plugins-base, gst-plugins-good, gst-libav, librsvg, pcre, gobject-introspection, wrapGAppsHook }: +, poppler, libpthreadstubs, gstreamer, gst-plugins-base, gst-plugins-good, gst-libav, librsvg, pcre, gobject-introspection, wrapGAppsHook +, webkitgtk, discount, json-glib }: stdenv.mkDerivation rec { name = "${product}-${version}"; product = "pdfpc"; - version = "4.4.1"; + version = "4.5.0"; src = fetchFromGitHub { repo = product; owner = product; rev = "v${version}"; - sha256 = "11n925c5jj3yfwnqkgxzqrmsrpqh8ls1g4idmqqzpsanpam1xvna"; + sha256 = "0bmy51w6ypz927hxwp5g7wapqvzqmsi3w32rch6i3f94kg1152ck"; }; nativeBuildInputs = [ @@ -27,6 +28,9 @@ stdenv.mkDerivation rec { gst-plugins-base (gst-plugins-good.override { gtkSupport = true; }) gst-libav + webkitgtk + discount + json-glib ]; cmakeFlags = stdenv.lib.optional stdenv.isDarwin "-DMOVIES=OFF"; From 0faf72a5578335ac71988cd7b44d4c9a6b9843ca Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Sat, 2 Jan 2021 15:47:09 -0800 Subject: [PATCH 06/17] beets: 1.4.9 -> unstable-2020-12-22 The maintainer has stopped cutting releases[1]. Since the last release, 1.4.9, includes a dependency that is filled with hate speech[2] it's all the more reason to package the unstable version and eliminate that requirement. Moreover a number of fixes, improvements, and features have landed since. [1]: https://github.com/beetbox/beets/issues/3625 [2]: https://github.com/NixOS/nixpkgs/pull/90504 Co-authored-by: Doron Behar --- .../beets/badfiles-plugin-nix-paths.patch | 21 +++ .../beets/bash-completion-always-print.patch | 43 +++++ ...h-breaking-changes-to-the-ast-module.patch | 55 ------ .../beets/convert-plugin-ffmpeg-path.patch | 43 +++++ pkgs/tools/audio/beets/default.nix | 175 ++++++++++-------- .../audio/beets/keyfinder-default-bin.patch | 20 +- pkgs/tools/audio/beets/mutagen-1.43.patch | 40 ---- .../alternatives.nix} | 0 .../check-tests.patch} | 0 .../{check-plugin.nix => plugins/check.nix} | 0 .../copyartifacts.nix} | 0 .../extrafiles.nix} | 0 .../beets/replaygain-default-bs1770gain.patch | 17 -- .../beets/replaygain-default-ffmpeg.patch | 26 +++ 14 files changed, 233 insertions(+), 207 deletions(-) create mode 100644 pkgs/tools/audio/beets/badfiles-plugin-nix-paths.patch create mode 100644 pkgs/tools/audio/beets/bash-completion-always-print.patch delete mode 100644 pkgs/tools/audio/beets/compatibility-with-breaking-changes-to-the-ast-module.patch create mode 100644 pkgs/tools/audio/beets/convert-plugin-ffmpeg-path.patch delete mode 100644 pkgs/tools/audio/beets/mutagen-1.43.patch rename pkgs/tools/audio/beets/{alternatives-plugin.nix => plugins/alternatives.nix} (100%) rename pkgs/tools/audio/beets/{beet-check-tests.patch => plugins/check-tests.patch} (100%) rename pkgs/tools/audio/beets/{check-plugin.nix => plugins/check.nix} (100%) rename pkgs/tools/audio/beets/{copyartifacts-plugin.nix => plugins/copyartifacts.nix} (100%) rename pkgs/tools/audio/beets/{extrafiles-plugin.nix => plugins/extrafiles.nix} (100%) delete mode 100644 pkgs/tools/audio/beets/replaygain-default-bs1770gain.patch create mode 100644 pkgs/tools/audio/beets/replaygain-default-ffmpeg.patch diff --git a/pkgs/tools/audio/beets/badfiles-plugin-nix-paths.patch b/pkgs/tools/audio/beets/badfiles-plugin-nix-paths.patch new file mode 100644 index 00000000000..6956183344c --- /dev/null +++ b/pkgs/tools/audio/beets/badfiles-plugin-nix-paths.patch @@ -0,0 +1,21 @@ +diff --git i/beetsplug/badfiles.py w/beetsplug/badfiles.py +index 36b45de3..5208b696 100644 +--- i/beetsplug/badfiles.py ++++ w/beetsplug/badfiles.py +@@ -71,14 +71,14 @@ class BadFiles(BeetsPlugin): + return status, errors, [line for line in output.split("\n") if line] + + def check_mp3val(self, path): +- status, errors, output = self.run_command(["mp3val", path]) ++ status, errors, output = self.run_command(["@mp3val@/bin/mp3val", path]) + if status == 0: + output = [line for line in output if line.startswith("WARNING:")] + errors = len(output) + return status, errors, output + + def check_flac(self, path): +- return self.run_command(["flac", "-wst", path]) ++ return self.run_command(["@flac@/bin/flac", "-wst", path]) + + def check_custom(self, command): + def checker(path): diff --git a/pkgs/tools/audio/beets/bash-completion-always-print.patch b/pkgs/tools/audio/beets/bash-completion-always-print.patch new file mode 100644 index 00000000000..7bc3e57117e --- /dev/null +++ b/pkgs/tools/audio/beets/bash-completion-always-print.patch @@ -0,0 +1,43 @@ +diff --git i/beets/ui/commands.py w/beets/ui/commands.py +index 4d010f4b..0b023585 100755 +--- i/beets/ui/commands.py ++++ w/beets/ui/commands.py +@@ -1741,20 +1741,6 @@ default_commands.append(config_cmd) + def print_completion(*args): + for line in completion_script(default_commands + plugins.commands()): + print_(line, end=u'') +- if not any(map(os.path.isfile, BASH_COMPLETION_PATHS)): +- log.warning(u'Warning: Unable to find the bash-completion package. ' +- u'Command line completion might not work.') +- +-BASH_COMPLETION_PATHS = map(syspath, [ +- u'/etc/bash_completion', +- u'/usr/share/bash-completion/bash_completion', +- u'/usr/local/share/bash-completion/bash_completion', +- # SmartOS +- u'/opt/local/share/bash-completion/bash_completion', +- # Homebrew (before bash-completion2) +- u'/usr/local/etc/bash_completion', +-]) +- + + def completion_script(commands): + """Yield the full completion shell script as strings. +diff --git i/test/test_ui.py w/test/test_ui.py +index 5cfed1fd..9d3dc458 100644 +--- i/test/test_ui.py ++++ w/test/test_ui.py +@@ -1230,12 +1230,7 @@ class CompletionTest(_common.TestCase, TestHelper): + stdout=subprocess.PIPE, env=env) + + # Load bash_completion library. +- for path in commands.BASH_COMPLETION_PATHS: +- if os.path.exists(util.syspath(path)): +- bash_completion = path +- break +- else: +- self.skipTest(u'bash-completion script not found') ++ self.skipTest(u'bash-completion script not found') + try: + with open(util.syspath(bash_completion), 'rb') as f: + tester.stdin.writelines(f) diff --git a/pkgs/tools/audio/beets/compatibility-with-breaking-changes-to-the-ast-module.patch b/pkgs/tools/audio/beets/compatibility-with-breaking-changes-to-the-ast-module.patch deleted file mode 100644 index 4865b6f6234..00000000000 --- a/pkgs/tools/audio/beets/compatibility-with-breaking-changes-to-the-ast-module.patch +++ /dev/null @@ -1,55 +0,0 @@ -From 771ce704ebeac4cd9bd74b3ddde9fb01f3dc7eb4 Mon Sep 17 00:00:00 2001 -From: wisp3rwind <17089248+wisp3rwind@users.noreply.github.com> -Date: Tue, 9 Jun 2020 19:34:31 +0200 -Subject: [PATCH] compatibility with breaking changes to the ast module - -new in 3.10, also backported to 3.8 and 3.9: https://github.com/python/cpython/pull/20649 -In fact, our generation of some Literals has been invalid since Python -3.4, fix that too. ---- - beets/util/functemplate.py | 29 ++++++++++++++++++++--------- - 1 file changed, 20 insertions(+), 9 deletions(-) - -diff --git a/beets/util/functemplate.py b/beets/util/functemplate.py -index af22b790..266534a9 100644 ---- a/beets/util/functemplate.py -+++ b/beets/util/functemplate.py -@@ -73,15 +73,26 @@ def ex_literal(val): - """An int, float, long, bool, string, or None literal with the given - value. - """ -- if val is None: -- return ast.Name('None', ast.Load()) -- elif isinstance(val, six.integer_types): -- return ast.Num(val) -- elif isinstance(val, bool): -- return ast.Name(bytes(val), ast.Load()) -- elif isinstance(val, six.string_types): -- return ast.Str(val) -- raise TypeError(u'no literal for {0}'.format(type(val))) -+ if sys.version_info[:2] < (3, 4): -+ if val is None: -+ return ast.Name('None', ast.Load()) -+ elif isinstance(val, six.integer_types): -+ return ast.Num(val) -+ elif isinstance(val, bool): -+ return ast.Name(bytes(val), ast.Load()) -+ elif isinstance(val, six.string_types): -+ return ast.Str(val) -+ raise TypeError(u'no literal for {0}'.format(type(val))) -+ elif sys.version_info[:2] < (3, 6): -+ if val in [None, True, False]: -+ return ast.NameConstant(val) -+ elif isinstance(val, six.integer_types): -+ return ast.Num(val) -+ elif isinstance(val, six.string_types): -+ return ast.Str(val) -+ raise TypeError(u'no literal for {0}'.format(type(val))) -+ else: -+ return ast.Constant(val) - - - def ex_varassign(name, expr): --- -2.27.0 - diff --git a/pkgs/tools/audio/beets/convert-plugin-ffmpeg-path.patch b/pkgs/tools/audio/beets/convert-plugin-ffmpeg-path.patch new file mode 100644 index 00000000000..bcc77179d79 --- /dev/null +++ b/pkgs/tools/audio/beets/convert-plugin-ffmpeg-path.patch @@ -0,0 +1,43 @@ +diff --git i/beetsplug/convert.py w/beetsplug/convert.py +index 70363f6e..2962aa4f 100644 +--- i/beetsplug/convert.py ++++ w/beetsplug/convert.py +@@ -81,7 +81,7 @@ def get_format(fmt=None): + command = config['convert']['command'].as_str() + elif 'opts' in keys: + # Undocumented option for backwards compatibility with < 1.3.1. +- command = u'ffmpeg -i $source -y {0} $dest'.format( ++ command = u'@ffmpeg@/bin/ffmpeg -i $source -y {0} $dest'.format( + config['convert']['opts'].as_str() + ) + if 'extension' in keys: +@@ -121,22 +121,22 @@ class ConvertPlugin(BeetsPlugin): + u'id3v23': u'inherit', + u'formats': { + u'aac': { +- u'command': u'ffmpeg -i $source -y -vn -acodec aac ' ++ u'command': u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec aac ' + u'-aq 1 $dest', + u'extension': u'm4a', + }, + u'alac': { +- u'command': u'ffmpeg -i $source -y -vn -acodec alac $dest', ++ u'command': u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec alac $dest', + u'extension': u'm4a', + }, +- u'flac': u'ffmpeg -i $source -y -vn -acodec flac $dest', +- u'mp3': u'ffmpeg -i $source -y -vn -aq 2 $dest', ++ u'flac': u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec flac $dest', ++ u'mp3': u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -aq 2 $dest', + u'opus': +- u'ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest', ++ u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec libopus -ab 96k $dest', + u'ogg': +- u'ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest', ++ u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec libvorbis -aq 3 $dest', + u'wma': +- u'ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest', ++ u'@ffmpeg@/bin/ffmpeg -i $source -y -vn -acodec wmav2 -vn $dest', + }, + u'max_bitrate': 500, + u'auto': False, diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index 56551891a4a..f63e8823364 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -1,4 +1,4 @@ -{ stdenv, fetchFromGitHub, writeScript, glibcLocales, diffPlugins +{ stdenv, lib, fetchFromGitHub, writeScript, glibcLocales, diffPlugins, substituteAll , pythonPackages, imagemagick, gobject-introspection, gst_all_1 , runtimeShell , fetchpatch @@ -6,61 +6,70 @@ # Attributes needed for tests of the external plugins , callPackage, beets -, enableAbsubmit ? stdenv.lib.elem stdenv.hostPlatform.system essentia-extractor.meta.platforms, essentia-extractor ? null -, enableAcousticbrainz ? true -, enableAcoustid ? true -, enableBadfiles ? true, flac ? null, mp3val ? null -, enableConvert ? true, ffmpeg_3 ? null -, enableDiscogs ? true -, enableEmbyupdate ? true -, enableFetchart ? true -, enableGmusic ? true -, enableKeyfinder ? true, keyfinder-cli ? null -, enableKodiupdate ? true -, enableLastfm ? true -, enableLoadext ? true -, enableMpd ? true -, enablePlaylist ? true -, enableReplaygain ? true, bs1770gain ? null -, enableSonosUpdate ? true -, enableSubsonicupdate ? true -, enableThumbnails ? true -, enableWeb ? true +, enableAbsubmit ? lib.elem stdenv.hostPlatform.system essentia-extractor.meta.platforms, essentia-extractor ? null +, enableAcousticbrainz ? true +, enableAcoustid ? true +, enableBadfiles ? true, flac ? null, mp3val ? null +, enableBeatport ? true +, enableBpsync ? true +, enableConvert ? true, ffmpeg ? null +, enableDeezer ? true +, enableDiscogs ? true +, enableEmbyupdate ? true +, enableFetchart ? true +, enableGmusic ? true +, enableKeyfinder ? true, keyfinder-cli ? null +, enableKodiupdate ? true +, enableLastfm ? true +, enableLoadext ? true +, enableMpd ? true +, enablePlaylist ? true +, enableReplaygain ? true +, enableSonosUpdate ? true +, enableSubsonicplaylist ? true +, enableSubsonicupdate ? true +, enableThumbnails ? true +, enableWeb ? true # External plugins -, enableAlternatives ? false -, enableCheck ? false, liboggz ? null -, enableCopyArtifacts ? false -, enableExtraFiles ? false +, enableAlternatives ? false +, enableCheck ? false, liboggz ? null +, enableCopyArtifacts ? false +, enableExtraFiles ? false , bashInteractive, bash-completion }: -assert enableAbsubmit -> essentia-extractor != null; -assert enableAcoustid -> pythonPackages.pyacoustid != null; +assert enableAbsubmit -> essentia-extractor != null; +assert enableAcoustid -> pythonPackages.pyacoustid != null; assert enableBadfiles -> flac != null && mp3val != null; +assert enableBeatport -> pythonPackages.requests_oauthlib != null; +assert enableBpsync -> enableBeatport; assert enableCheck -> flac != null && mp3val != null && liboggz != null; -assert enableConvert -> ffmpeg_3 != null; -assert enableDiscogs -> pythonPackages.discogs_client != null; -assert enableFetchart -> pythonPackages.responses != null; -assert enableGmusic -> pythonPackages.gmusicapi != null; -assert enableKeyfinder -> keyfinder-cli != null; -assert enableLastfm -> pythonPackages.pylast != null; -assert enableMpd -> pythonPackages.mpd2 != null; -assert enableReplaygain -> bs1770gain != null; -assert enableSonosUpdate -> pythonPackages.soco != null; -assert enableThumbnails -> pythonPackages.pyxdg != null; -assert enableWeb -> pythonPackages.flask != null; +assert enableConvert -> ffmpeg != null; +assert enableDiscogs -> pythonPackages.discogs_client != null; +assert enableFetchart -> pythonPackages.responses != null; +assert enableGmusic -> pythonPackages.gmusicapi != null; +assert enableKeyfinder -> keyfinder-cli != null; +assert enableLastfm -> pythonPackages.pylast != null; +assert enableMpd -> pythonPackages.mpd2 != null; +assert enableReplaygain -> ffmpeg != null; +assert enableSonosUpdate -> pythonPackages.soco != null; +assert enableThumbnails -> pythonPackages.pyxdg != null; +assert enableWeb -> pythonPackages.flask != null; -with stdenv.lib; +with lib; let optionalPlugins = { absubmit = enableAbsubmit; acousticbrainz = enableAcousticbrainz; badfiles = enableBadfiles; + beatport = enableBeatport; + bpsync = enableBpsync; chroma = enableAcoustid; convert = enableConvert; + deezer = enableDeezer; discogs = enableDiscogs; embyupdate = enableEmbyupdate; fetchart = enableFetchart; @@ -75,18 +84,19 @@ let playlist = enablePlaylist; replaygain = enableReplaygain; sonosupdate = enableSonosUpdate; + subsonicplaylist = enableSubsonicplaylist; subsonicupdate = enableSubsonicupdate; thumbnails = enableThumbnails; web = enableWeb; }; pluginsWithoutDeps = [ - "beatport" "bench" "bpd" "bpm" "bucket" "cue" "duplicates" "edit" "embedart" - "export" "filefilter" "freedesktop" "fromfilename" "ftintitle" "fuzzy" + "bench" "bpd" "bpm" "bucket" "cue" "duplicates" "edit" "embedart" + "export" "filefilter" "fish" "freedesktop" "fromfilename" "ftintitle" "fuzzy" "hook" "ihate" "importadded" "importfeeds" "info" "inline" "ipfs" "lyrics" - "mbcollection" "mbsubmit" "mbsync" "metasync" "missing" "permissions" "play" + "mbcollection" "mbsubmit" "mbsync" "metasync" "missing" "parentwork" "permissions" "play" "plexupdate" "random" "rewrite" "scrub" "smartplaylist" "spotify" "the" - "types" "zero" + "types" "unimported" "zero" ]; enabledOptionalPlugins = attrNames (filterAttrs (_: id) optionalPlugins); @@ -102,28 +112,33 @@ let enableAlternatives = false; enableCopyArtifacts = false; enableExtraFiles = false; - }).overrideAttrs (stdenv.lib.const { + }).overrideAttrs (const { doInstallCheck = false; }); pluginArgs = externalTestArgs // { inherit pythonPackages; }; plugins = { - alternatives = callPackage ./alternatives-plugin.nix pluginArgs; - check = callPackage ./check-plugin.nix pluginArgs; - copyartifacts = callPackage ./copyartifacts-plugin.nix pluginArgs; - extrafiles = callPackage ./extrafiles-plugin.nix pluginArgs; + alternatives = callPackage ./plugins/alternatives.nix pluginArgs; + check = callPackage ./plugins/check.nix pluginArgs; + copyartifacts = callPackage ./plugins/copyartifacts.nix pluginArgs; + extrafiles = callPackage ./plugins/extrafiles.nix pluginArgs; }; in pythonPackages.buildPythonApplication rec { pname = "beets"; - version = "1.4.9"; + # While there is a stable version, 1.4.9, it is more than 1000 commits behind + # master and lacks many bug fixes and improvements[1]. Also important, + # unstable does not require bs1770gain[2]. + # [1]: https://discourse.beets.io/t/forming-a-beets-core-team/639 + # [2]: https://github.com/NixOS/nixpkgs/pull/90504 + version = "unstable-2020-12-22"; src = fetchFromGitHub { owner = "beetbox"; repo = "beets"; - rev = "v${version}"; - sha256 = "1qxdqbzvz97zgykzdwn78g2xyxmg0q2jdb12dnjnrwvhmjv67vi8"; + rev = "53dcb24d10788897f20c341774b474808ec2c0b6"; + sha256 = "sha256-P++NA13T2TRHW3Se10np8BSe/WRBYAKRte5xKoHKW50="; }; propagatedBuildInputs = [ @@ -137,19 +152,25 @@ in pythonPackages.buildPythonApplication rec { pythonPackages.unidecode pythonPackages.gst-python pythonPackages.pygobject3 + pythonPackages.reflink + pythonPackages.confuse + pythonPackages.mediafile gobject-introspection ] ++ optional enableAbsubmit essentia-extractor ++ optional enableAcoustid pythonPackages.pyacoustid + ++ optional enableBeatport pythonPackages.requests_oauthlib ++ optional (enableFetchart + || enableDeezer || enableEmbyupdate || enableKodiupdate || enableLoadext || enablePlaylist + || enableSubsonicplaylist || enableSubsonicupdate || enableAcousticbrainz) pythonPackages.requests ++ optional enableCheck plugins.check - ++ optional enableConvert ffmpeg_3 + ++ optional enableConvert ffmpeg ++ optional enableDiscogs pythonPackages.discogs_client ++ optional enableGmusic pythonPackages.gmusicapi ++ optional enableKeyfinder keyfinder-cli @@ -187,41 +208,35 @@ in pythonPackages.buildPythonApplication rec { ]; patches = [ - ./replaygain-default-bs1770gain.patch + # Bash completion fix for Nix + ./bash-completion-always-print.patch + # From some reason upstream assumes the program 'keyfinder-cli' is located + # in the path as `KeyFinder` ./keyfinder-default-bin.patch - ./mutagen-1.43.patch - (fetchpatch { - # Fixes failing testcases around the werkzeug component; can dropped after 1.4.9 - url = "https://github.com/beetbox/beets/commit/d43d54e21cde97f57f19486925ab56b419254cc8.patch"; - sha256 = "13n2gzmcgfi0m2ycl2r1hpczgksplnkc3y6b66vg57rx5y8nnv5c"; + ] + # We need to force ffmpeg as the default, since we do not package + # bs1770gain, and set the absolute path there, to avoid impurities. + ++ lib.optional enableReplaygain (substituteAll { + src = ./replaygain-default-ffmpeg.patch; + ffmpeg = getBin ffmpeg; }) + # Put absolute Nix paths in place + ++ lib.optional enableConvert (substituteAll { + src = ./convert-plugin-ffmpeg-path.patch; + ffmpeg = getBin ffmpeg; + }) + ++ lib.optional enableBadfiles (substituteAll { + src = ./badfiles-plugin-nix-paths.patch; + inherit mp3val flac; + }) + ; - # Fixes 548 tests due to breaking changes to the ast module - # https://github.com/beetbox/beets/pull/3621 - # Can be dropped after 1.4.9 - ./compatibility-with-breaking-changes-to-the-ast-module.patch - ]; - + # Disable failing tests postPatch = '' sed -i -e '/assertIn.*item.*path/d' test/test_info.py echo echo completion tests passed > test/rsrc/test_completion.sh - sed -i -e '/^BASH_COMPLETION_PATHS *=/,/^])$/ { - /^])$/i u"${completion}" - }' beets/ui/commands.py - '' + optionalString enableBadfiles '' - sed -i -e '/self\.run_command(\[/ { - s,"flac","${flac.bin}/bin/flac", - s,"mp3val","${mp3val}/bin/mp3val", - }' beetsplug/badfiles.py - '' + optionalString enableConvert '' - sed -i -e 's,\(util\.command_output(\)\([^)]\+\)),\1[b"${ffmpeg_3.bin}/bin/ffmpeg" if args[0] == b"ffmpeg" else args[0]] + \2[1:]),' beetsplug/convert.py - '' + optionalString enableReplaygain '' - sed -i -re ' - s!^( *cmd *= *b?['\'''"])(bs1770gain['\'''"])!\1${bs1770gain}/bin/\2! - ' beetsplug/replaygain.py - sed -i -e 's/if has_program.*bs1770gain.*:/if True:/' \ - test/test_replaygain.py + sed -i -e 's/len(mf.images)/0/' test/test_zero.py ''; postInstall = '' diff --git a/pkgs/tools/audio/beets/keyfinder-default-bin.patch b/pkgs/tools/audio/beets/keyfinder-default-bin.patch index 1ea195a678e..ec6bc3a5561 100644 --- a/pkgs/tools/audio/beets/keyfinder-default-bin.patch +++ b/pkgs/tools/audio/beets/keyfinder-default-bin.patch @@ -1,8 +1,8 @@ diff --git a/beetsplug/keyfinder.py b/beetsplug/keyfinder.py -index 34a4abc..59e8539 100644 +index 702003f0..08689cd8 100644 --- a/beetsplug/keyfinder.py +++ b/beetsplug/keyfinder.py -@@ -30,7 +30,7 @@ class KeyFinderPlugin(BeetsPlugin): +@@ -31,7 +31,7 @@ class KeyFinderPlugin(BeetsPlugin): def __init__(self): super(KeyFinderPlugin, self).__init__() self.config.add({ @@ -11,18 +11,8 @@ index 34a4abc..59e8539 100644 u'auto': True, u'overwrite': False, }) -@@ -59,8 +59,7 @@ class KeyFinderPlugin(BeetsPlugin): - continue - - try: -- output = util.command_output([bin, '-f', -- util.syspath(item.path)]) -+ output = util.command_output([bin, util.syspath(item.path)]) - except (subprocess.CalledProcessError, OSError) as exc: - self._log.error(u'execution failed: {0}', exc) - continue diff --git a/test/test_keyfinder.py b/test/test_keyfinder.py -index 57e2bcd..c1ee916 100644 +index c8735e47..d7d670a4 100644 --- a/test/test_keyfinder.py +++ b/test/test_keyfinder.py @@ -44,7 +44,7 @@ class KeyFinderTest(unittest.TestCase, TestHelper): @@ -31,6 +21,6 @@ index 57e2bcd..c1ee916 100644 command_output.assert_called_with( - ['KeyFinder', '-f', util.syspath(item.path)]) + ['keyfinder-cli', util.syspath(item.path)]) - + def test_add_key_on_import(self, command_output): - command_output.return_value = 'dbm' + command_output.return_value = util.CommandOutput(b"dbm", b"") diff --git a/pkgs/tools/audio/beets/mutagen-1.43.patch b/pkgs/tools/audio/beets/mutagen-1.43.patch deleted file mode 100644 index d0d448c15e9..00000000000 --- a/pkgs/tools/audio/beets/mutagen-1.43.patch +++ /dev/null @@ -1,40 +0,0 @@ -Backport -https://github.com/beetbox/mediafile/commit/b3343c4ee08d1251ae5e2344401a2f5892b4e868 -https://github.com/beetbox/mediafile/commit/d2fc3b59f77c515b02dfe7ad936f89264375d2b4 -to Beets 1.4.9. - -diff --git i/setup.py w/setup.py -index 79278f8b..b8d60687 100755 ---- i/setup.py -+++ w/setup.py -@@ -87,7 +87,7 @@ setup( - - install_requires=[ - 'six>=1.9', -- 'mutagen>=1.33', -+ 'mutagen>=1.43', - 'unidecode', - 'musicbrainzngs>=0.4', - 'pyyaml', -diff --git i/test/test_mediafile.py w/test/test_mediafile.py -index 36a2c53a..0ddde44e 100644 ---- i/test/test_mediafile.py -+++ w/test/test_mediafile.py -@@ -888,7 +888,7 @@ class WavpackTest(ReadWriteTestBase, unittest.TestCase): - 'bitrate': 109312, - 'format': u'WavPack', - 'samplerate': 44100, -- 'bitdepth': 0, -+ 'bitdepth': 16, - 'channels': 1, - } - -@@ -912,7 +912,7 @@ class AIFFTest(ReadWriteTestBase, unittest.TestCase): - 'bitrate': 705600, - 'format': u'AIFF', - 'samplerate': 44100, -- 'bitdepth': 0, -+ 'bitdepth': 16, - 'channels': 1, - } - diff --git a/pkgs/tools/audio/beets/alternatives-plugin.nix b/pkgs/tools/audio/beets/plugins/alternatives.nix similarity index 100% rename from pkgs/tools/audio/beets/alternatives-plugin.nix rename to pkgs/tools/audio/beets/plugins/alternatives.nix diff --git a/pkgs/tools/audio/beets/beet-check-tests.patch b/pkgs/tools/audio/beets/plugins/check-tests.patch similarity index 100% rename from pkgs/tools/audio/beets/beet-check-tests.patch rename to pkgs/tools/audio/beets/plugins/check-tests.patch diff --git a/pkgs/tools/audio/beets/check-plugin.nix b/pkgs/tools/audio/beets/plugins/check.nix similarity index 100% rename from pkgs/tools/audio/beets/check-plugin.nix rename to pkgs/tools/audio/beets/plugins/check.nix diff --git a/pkgs/tools/audio/beets/copyartifacts-plugin.nix b/pkgs/tools/audio/beets/plugins/copyartifacts.nix similarity index 100% rename from pkgs/tools/audio/beets/copyartifacts-plugin.nix rename to pkgs/tools/audio/beets/plugins/copyartifacts.nix diff --git a/pkgs/tools/audio/beets/extrafiles-plugin.nix b/pkgs/tools/audio/beets/plugins/extrafiles.nix similarity index 100% rename from pkgs/tools/audio/beets/extrafiles-plugin.nix rename to pkgs/tools/audio/beets/plugins/extrafiles.nix diff --git a/pkgs/tools/audio/beets/replaygain-default-bs1770gain.patch b/pkgs/tools/audio/beets/replaygain-default-bs1770gain.patch deleted file mode 100644 index 538f9e93303..00000000000 --- a/pkgs/tools/audio/beets/replaygain-default-bs1770gain.patch +++ /dev/null @@ -1,17 +0,0 @@ -diff --git a/beetsplug/replaygain.py b/beetsplug/replaygain.py -index 40b3a3a..9b54a5a 100644 ---- a/beetsplug/replaygain.py -+++ b/beetsplug/replaygain.py -@@ -627,11 +627,10 @@ class ReplayGainPlugin(BeetsPlugin): - super(ReplayGainPlugin, self).__init__() - self.import_stages = [self.imported] - -- # default backend is 'command' for backward-compatibility. - self.config.add({ - 'overwrite': False, - 'auto': True, -- 'backend': u'command', -+ 'backend': u'bs1770gain', - 'targetlevel': 89, - }) - diff --git a/pkgs/tools/audio/beets/replaygain-default-ffmpeg.patch b/pkgs/tools/audio/beets/replaygain-default-ffmpeg.patch new file mode 100644 index 00000000000..0ceba3c0944 --- /dev/null +++ b/pkgs/tools/audio/beets/replaygain-default-ffmpeg.patch @@ -0,0 +1,26 @@ +diff --git i/beetsplug/replaygain.py w/beetsplug/replaygain.py +index 9d6fa23c..c5800039 100644 +--- i/beetsplug/replaygain.py ++++ w/beetsplug/replaygain.py +@@ -391,7 +391,7 @@ class FfmpegBackend(Backend): + + def __init__(self, config, log): + super(FfmpegBackend, self).__init__(config, log) +- self._ffmpeg_path = "ffmpeg" ++ self._ffmpeg_path = "@ffmpeg@/bin/ffmpeg" + + # check that ffmpeg is installed + try: +@@ -1228,11 +1228,10 @@ class ReplayGainPlugin(BeetsPlugin): + def __init__(self): + super(ReplayGainPlugin, self).__init__() + +- # default backend is 'command' for backward-compatibility. + self.config.add({ + 'overwrite': False, + 'auto': True, +- 'backend': u'command', ++ 'backend': u'ffmpeg', + 'threads': cpu_count(), + 'parallel_on_import': False, + 'per_disc': False, From 264b77f005e5b84e317914c489c678431435a869 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Sat, 2 Jan 2021 16:42:04 -0800 Subject: [PATCH 07/17] beets: add lovesegfault to maintainers --- pkgs/tools/audio/beets/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index f63e8823364..ac215358227 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -296,7 +296,7 @@ in pythonPackages.buildPythonApplication rec { description = "Music tagger and library organizer"; homepage = "http://beets.io"; license = licenses.mit; - maintainers = with maintainers; [ aszlig domenkozar pjones ]; + maintainers = with maintainers; [ aszlig domenkozar lovesegfault pjones ]; platforms = platforms.linux; }; } From cea2b9eff4788e538b5dab382d6346d1836080ba Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Sun, 3 Jan 2021 01:58:39 -0800 Subject: [PATCH 08/17] beets: add doronbehar to maintainers --- pkgs/tools/audio/beets/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/tools/audio/beets/default.nix b/pkgs/tools/audio/beets/default.nix index ac215358227..f72692c845c 100644 --- a/pkgs/tools/audio/beets/default.nix +++ b/pkgs/tools/audio/beets/default.nix @@ -296,7 +296,7 @@ in pythonPackages.buildPythonApplication rec { description = "Music tagger and library organizer"; homepage = "http://beets.io"; license = licenses.mit; - maintainers = with maintainers; [ aszlig domenkozar lovesegfault pjones ]; + maintainers = with maintainers; [ aszlig domenkozar doronbehar lovesegfault pjones ]; platforms = platforms.linux; }; } From 264f7981eefac5171e75e10c13517e3241f6eb30 Mon Sep 17 00:00:00 2001 From: Bernardo Meurer Date: Sat, 2 Jan 2021 16:42:38 -0800 Subject: [PATCH 09/17] bs1770gain: nuke The package is filled with white supremacist hate speech, and the only reverse dependency on it, beets, can now use ffmpeg instead. --- .../applications/audio/bs1770gain/default.nix | 22 ------------------- pkgs/top-level/aliases.nix | 1 + pkgs/top-level/all-packages.nix | 2 -- 3 files changed, 1 insertion(+), 24 deletions(-) delete mode 100644 pkgs/applications/audio/bs1770gain/default.nix diff --git a/pkgs/applications/audio/bs1770gain/default.nix b/pkgs/applications/audio/bs1770gain/default.nix deleted file mode 100644 index 76a78935619..00000000000 --- a/pkgs/applications/audio/bs1770gain/default.nix +++ /dev/null @@ -1,22 +0,0 @@ -{ stdenv, fetchurl, ffmpeg, sox }: - -stdenv.mkDerivation rec { - pname = "bs1770gain"; - version = "0.5.2"; - - src = fetchurl { - url = "mirror://sourceforge/bs1770gain/${pname}-${version}.tar.gz"; - sha256 = "1p6yz5q7czyf9ard65sp4kawdlkg40cfscr3b24znymmhs3p7rbk"; - }; - - buildInputs = [ ffmpeg sox ]; - - NIX_CFLAGS_COMPILE = "-Wno-error"; - - meta = with stdenv.lib; { - description = "A audio/video loudness scanner implementing ITU-R BS.1770"; - license = licenses.gpl2Plus; - homepage = "http://bs1770gain.sourceforge.net/"; - platforms = platforms.all; - }; -} diff --git a/pkgs/top-level/aliases.nix b/pkgs/top-level/aliases.nix index 6f95da017ed..4a4277c2072 100644 --- a/pkgs/top-level/aliases.nix +++ b/pkgs/top-level/aliases.nix @@ -78,6 +78,7 @@ mapAliases ({ bittorrentSync = throw "bittorrentSync has been deprecated by resilio-sync."; # added 2019-06-03 bittorrentSync14 = throw "bittorrentSync14 has been deprecated by resilio-sync."; # added 2019-06-03 bittorrentSync20 = throw "bittorrentSync20 has been deprecated by resilio-sync."; # added 2019-06-03 + bs1770gain = throw "bs1770gain has been removed from nixpkgs, as it had no maintainer or reverse dependencies."; # added 2021-01-02 btc1 = throw "btc1 has been removed, it was abandoned by upstream"; # added 2020-11-03 buildPerlPackage = perlPackages.buildPerlPackage; # added 2018-10-12 buildGo112Package = throw "buildGo112Package has been removed"; # added 2020-04-26 diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index f50bab07a26..52e405344c3 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -20729,8 +20729,6 @@ in bristol = callPackage ../applications/audio/bristol { }; - bs1770gain = callPackage ../applications/audio/bs1770gain { }; - bjumblr = callPackage ../applications/audio/bjumblr { }; bschaffl = callPackage ../applications/audio/bschaffl { }; From c4b7f5d7a68348d248b832397098e9c04a7d91e1 Mon Sep 17 00:00:00 2001 From: devhell Date: Mon, 28 Dec 2020 12:23:53 +0000 Subject: [PATCH 10/17] iptraf-ng: 1.1.4 -> 1.2.1 --- .../networking/iptraf-ng/default.nix | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/pkgs/applications/networking/iptraf-ng/default.nix b/pkgs/applications/networking/iptraf-ng/default.nix index 1fc81be240b..6d61acb4982 100644 --- a/pkgs/applications/networking/iptraf-ng/default.nix +++ b/pkgs/applications/networking/iptraf-ng/default.nix @@ -1,24 +1,27 @@ -{ stdenv, fetchurl, ncurses }: +{ stdenv, fetchFromGitHub, ncurses }: stdenv.mkDerivation rec { - version = "1.1.4"; + version = "1.2.1"; pname = "iptraf-ng"; - src = fetchurl { - url = "https://fedorahosted.org/releases/i/p/iptraf-ng/${pname}-${version}.tar.gz"; - sha256 = "02gb8z9h2s6s1ybyikywz7jgb1mafdx88hijfasv3khcgkq0q53r"; + src = fetchFromGitHub { + owner = pname; + repo = pname; + rev = "v${version}"; + sha256 = "1f91w1bjaayr6ld95z2q55ny983bb0m05k1jrw2bcddvcihaiqb1"; }; buildInputs = [ ncurses ]; - configurePhase = '' - ./configure --prefix=$out/usr --sysconfdir=$out/etc \ - --localstatedir=$out/var --sbindir=$out/bin - ''; + makeFlags = [ + "DESTDIR=$(out)" + "prefix=/usr" + "sbindir=/bin" + ]; hardeningDisable = [ "format" ]; - meta = { + meta = with stdenv.lib; { description = "A console-based network monitoring utility (fork of iptraf)"; longDescription = '' IPTraf-ng is a console-based network monitoring utility. IPTraf-ng @@ -38,9 +41,9 @@ stdenv.mkDerivation rec { of the Linux kernel, so it can be used on a wide variety of supported network cards. ''; - homepage = "https://fedorahosted.org/iptraf-ng/"; - license = stdenv.lib.licenses.gpl2; - platforms = stdenv.lib.platforms.linux; - maintainers = [ stdenv.lib.maintainers.devhell ]; + homepage = "https://github.com/iptraf-ng/iptraf-ng"; + license = licenses.gpl2Only; + platforms = platforms.linux; + maintainers = with maintainers; [ devhell ]; }; } From 0df75bc04e14e4af11e0124791bfd41bbff51b88 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 20 Dec 2020 06:26:04 +0000 Subject: [PATCH 11/17] gcc 8, 10: tabs -> spaces --- pkgs/development/compilers/gcc/10/default.nix | 8 ++++---- pkgs/development/compilers/gcc/8/default.nix | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 4f05cd3144c..0e9d4338d76 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -137,10 +137,10 @@ stdenv.mkDerivation ({ ) else "") + stdenv.lib.optionalString targetPlatform.isAvr '' - makeFlagsArray+=( - 'LIMITS_H_TEST=false' - ) - ''; + makeFlagsArray+=( + 'LIMITS_H_TEST=false' + ) + ''; inherit noSysDirs staticCompiler crossStageStatic libcCross crossMingw; diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 9e6a24d1294..970896d81f1 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -134,10 +134,10 @@ stdenv.mkDerivation ({ ) else "") + stdenv.lib.optionalString targetPlatform.isAvr '' - makeFlagsArray+=( - 'LIMITS_H_TEST=false' - ) - ''; + makeFlagsArray+=( + 'LIMITS_H_TEST=false' + ) + ''; inherit noSysDirs staticCompiler crossStageStatic libcCross crossMingw; From f52263ced0937e72453e7fbce9fefb5f425f650b Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 20 Dec 2020 06:11:26 +0000 Subject: [PATCH 12/17] treewide: Start to break up static overlay We can use use `stdenv.hostPlatform.isStatic` instead, and move the logic per package. The least opionated benefit of this is that it makes it much easier to replace packages with modified ones, as there is no longer any issue of overlay order. CC @FRidh @matthewbauer --- pkgs/development/compilers/gcc/10/default.nix | 2 +- .../development/compilers/gcc/4.8/default.nix | 2 +- .../development/compilers/gcc/4.9/default.nix | 2 +- pkgs/development/compilers/gcc/6/default.nix | 2 +- pkgs/development/compilers/gcc/7/default.nix | 2 +- pkgs/development/compilers/gcc/8/default.nix | 2 +- pkgs/development/compilers/gcc/9/default.nix | 2 +- .../compilers/llvm/10/libc++/default.nix | 3 +- .../compilers/llvm/10/libc++abi.nix | 3 +- .../compilers/llvm/10/libunwind.nix | 4 +- .../compilers/llvm/11/libc++/default.nix | 3 +- .../compilers/llvm/11/libc++abi.nix | 3 +- .../compilers/llvm/11/libunwind.nix | 4 +- .../compilers/llvm/7/libc++/default.nix | 3 +- .../compilers/llvm/7/libc++abi.nix | 3 +- .../compilers/llvm/8/libc++/default.nix | 3 +- .../compilers/llvm/8/libc++abi.nix | 3 +- .../compilers/llvm/8/libunwind.nix | 4 +- .../compilers/llvm/9/libc++/default.nix | 3 +- .../compilers/llvm/9/libc++abi.nix | 3 +- .../compilers/llvm/9/libunwind.nix | 4 +- .../libraries/arrow-cpp/default.nix | 3 +- .../libraries/audiofile/default.nix | 2 +- pkgs/development/libraries/boost/generic.nix | 2 +- pkgs/development/libraries/fmt/default.nix | 4 +- pkgs/development/libraries/gflags/default.nix | 4 +- pkgs/development/libraries/gmp/5.1.x.nix | 5 +- pkgs/development/libraries/gmp/6.x.nix | 3 +- .../libraries/libbacktrace/default.nix | 5 +- .../libraries/libexecinfo/default.nix | 5 +- .../libraries/libiberty/default.nix | 4 +- .../libraries/libiconv/default.nix | 4 +- .../libraries/libjpeg-turbo/default.nix | 5 +- pkgs/development/libraries/libpfm/default.nix | 4 +- .../development/libraries/libxml2/default.nix | 2 +- .../development/libraries/libxsmm/default.nix | 2 +- .../development/libraries/ncurses/default.nix | 2 +- pkgs/development/libraries/neon/default.nix | 4 +- .../development/libraries/openssl/default.nix | 2 +- .../development/libraries/rocksdb/default.nix | 2 +- .../libraries/science/math/mkl/default.nix | 5 +- .../science/math/openblas/default.nix | 4 +- pkgs/development/libraries/thrift/default.nix | 4 +- pkgs/development/libraries/zlib/default.nix | 10 +- .../tools/misc/binutils/default.nix | 2 +- .../tools/parsing/tree-sitter/default.nix | 4 +- .../libiconv/default.nix | 4 +- pkgs/os-specific/linux/busybox/default.nix | 2 +- pkgs/os-specific/linux/libcap/default.nix | 20 ++-- pkgs/servers/gobetween/default.nix | 4 +- pkgs/tools/compression/bzip2/default.nix | 2 +- pkgs/tools/compression/lz4/default.nix | 3 +- pkgs/tools/compression/xz/default.nix | 4 +- pkgs/tools/filesystems/nixpart/0.4/parted.nix | 4 +- pkgs/tools/graphics/optipng/default.nix | 3 +- pkgs/tools/misc/hdf5/default.nix | 2 +- pkgs/tools/misc/parted/default.nix | 2 +- pkgs/tools/misc/toybox/default.nix | 2 +- pkgs/tools/networking/dropbear/default.nix | 2 +- pkgs/tools/package-management/nix/default.nix | 2 +- pkgs/tools/system/ipmitool/default.nix | 2 +- pkgs/tools/system/pciutils/default.nix | 2 +- pkgs/top-level/static.nix | 112 +----------------- 63 files changed, 136 insertions(+), 189 deletions(-) diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 0e9d4338d76..7a8aa292079 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -7,7 +7,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index 213d0c91ff3..a413ed1c778 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -7,7 +7,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man); required for Java diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 98d4b61648e..05ab2d1fd11 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -7,7 +7,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man); required for Java diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index a2f034a4827..6fe953e163f 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -8,7 +8,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? true , texinfo ? null , flex diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index 6d066044ec1..fd2961f3c93 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -6,7 +6,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index 970896d81f1..b29d4597ac5 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -6,7 +6,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index c64a9dcc3f5..22ab4f61da1 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -8,7 +8,7 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? true +, enableShared ? !stdenv.targetPlatform.isStatic , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) diff --git a/pkgs/development/compilers/llvm/10/libc++/default.nix b/pkgs/development/compilers/llvm/10/libc++/default.nix index 95711903932..3511783be89 100644 --- a/pkgs/development/compilers/llvm/10/libc++/default.nix +++ b/pkgs/development/compilers/llvm/10/libc++/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version -, enableShared ? true }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++"; diff --git a/pkgs/development/compilers/llvm/10/libc++abi.nix b/pkgs/development/compilers/llvm/10/libc++abi.nix index 00371b862ad..7335d06e4fe 100644 --- a/pkgs/development/compilers/llvm/10/libc++abi.nix +++ b/pkgs/development/compilers/llvm/10/libc++abi.nix @@ -1,5 +1,6 @@ { stdenv, cmake, fetch, libcxx, libunwind, llvm, version -, enableShared ? true }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++abi"; diff --git a/pkgs/development/compilers/llvm/10/libunwind.nix b/pkgs/development/compilers/llvm/10/libunwind.nix index b13bacb3638..75e42260b7f 100644 --- a/pkgs/development/compilers/llvm/10/libunwind.nix +++ b/pkgs/development/compilers/llvm/10/libunwind.nix @@ -1,4 +1,6 @@ -{ stdenv, version, fetch, cmake, fetchpatch, enableShared ? true }: +{ stdenv, version, fetch, cmake, fetchpatch +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation rec { pname = "libunwind"; diff --git a/pkgs/development/compilers/llvm/11/libc++/default.nix b/pkgs/development/compilers/llvm/11/libc++/default.nix index 1ce879cccb6..5c3ec87617c 100644 --- a/pkgs/development/compilers/llvm/11/libc++/default.nix +++ b/pkgs/development/compilers/llvm/11/libc++/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetch, cmake, python3, libcxxabi, llvm, fixDarwinDylibNames, version -, enableShared ? true }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++"; diff --git a/pkgs/development/compilers/llvm/11/libc++abi.nix b/pkgs/development/compilers/llvm/11/libc++abi.nix index edf83197d2c..d173b1735cb 100644 --- a/pkgs/development/compilers/llvm/11/libc++abi.nix +++ b/pkgs/development/compilers/llvm/11/libc++abi.nix @@ -1,5 +1,6 @@ { stdenv, cmake, fetch, libcxx, libunwind, llvm, version -, enableShared ? true }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++abi"; diff --git a/pkgs/development/compilers/llvm/11/libunwind.nix b/pkgs/development/compilers/llvm/11/libunwind.nix index 5a4492e803f..b22da214417 100644 --- a/pkgs/development/compilers/llvm/11/libunwind.nix +++ b/pkgs/development/compilers/llvm/11/libunwind.nix @@ -1,4 +1,6 @@ -{ stdenv, version, fetch, cmake, fetchpatch, enableShared ? true }: +{ stdenv, version, fetch, cmake, fetchpatch +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation rec { pname = "libunwind"; diff --git a/pkgs/development/compilers/llvm/7/libc++/default.nix b/pkgs/development/compilers/llvm/7/libc++/default.nix index 76baadf1c6e..ed4192a232e 100644 --- a/pkgs/development/compilers/llvm/7/libc++/default.nix +++ b/pkgs/development/compilers/llvm/7/libc++/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version -, enableShared ? ! stdenv.hostPlatform.isMusl }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++"; diff --git a/pkgs/development/compilers/llvm/7/libc++abi.nix b/pkgs/development/compilers/llvm/7/libc++abi.nix index 7f2ec528f3c..4c46aeaa191 100644 --- a/pkgs/development/compilers/llvm/7/libc++abi.nix +++ b/pkgs/development/compilers/llvm/7/libc++abi.nix @@ -1,7 +1,8 @@ { stdenv, cmake, fetch, libcxx, llvm, version , standalone ? false # on musl the shared objects don't build -, enableShared ? ! stdenv.hostPlatform.isMusl }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++abi"; diff --git a/pkgs/development/compilers/llvm/8/libc++/default.nix b/pkgs/development/compilers/llvm/8/libc++/default.nix index 01e0d8e008c..2ed54a22069 100644 --- a/pkgs/development/compilers/llvm/8/libc++/default.nix +++ b/pkgs/development/compilers/llvm/8/libc++/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version -, enableShared ? true }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++"; diff --git a/pkgs/development/compilers/llvm/8/libc++abi.nix b/pkgs/development/compilers/llvm/8/libc++abi.nix index 590872aaab6..50a38dfa967 100644 --- a/pkgs/development/compilers/llvm/8/libc++abi.nix +++ b/pkgs/development/compilers/llvm/8/libc++abi.nix @@ -1,5 +1,6 @@ { stdenv, cmake, fetch, libcxx, libunwind, llvm, version -, enableShared ? true }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++abi"; diff --git a/pkgs/development/compilers/llvm/8/libunwind.nix b/pkgs/development/compilers/llvm/8/libunwind.nix index 646cd3c3ca4..3295d392203 100644 --- a/pkgs/development/compilers/llvm/8/libunwind.nix +++ b/pkgs/development/compilers/llvm/8/libunwind.nix @@ -1,4 +1,6 @@ -{ stdenv, version, fetch, cmake, fetchpatch, enableShared ? true }: +{ stdenv, version, fetch, cmake, fetchpatch +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libunwind"; diff --git a/pkgs/development/compilers/llvm/9/libc++/default.nix b/pkgs/development/compilers/llvm/9/libc++/default.nix index c9f0e6254ab..f5c3d21e7f1 100644 --- a/pkgs/development/compilers/llvm/9/libc++/default.nix +++ b/pkgs/development/compilers/llvm/9/libc++/default.nix @@ -1,5 +1,6 @@ { lib, stdenv, fetch, cmake, python3, libcxxabi, fixDarwinDylibNames, version -, enableShared ? true }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++"; diff --git a/pkgs/development/compilers/llvm/9/libc++abi.nix b/pkgs/development/compilers/llvm/9/libc++abi.nix index 5b63560282c..13f033091be 100644 --- a/pkgs/development/compilers/llvm/9/libc++abi.nix +++ b/pkgs/development/compilers/llvm/9/libc++abi.nix @@ -1,5 +1,6 @@ { stdenv, cmake, fetch, libcxx, libunwind, llvm, version -, enableShared ? true }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation { pname = "libc++abi"; diff --git a/pkgs/development/compilers/llvm/9/libunwind.nix b/pkgs/development/compilers/llvm/9/libunwind.nix index 883c36baf06..98df98838f1 100644 --- a/pkgs/development/compilers/llvm/9/libunwind.nix +++ b/pkgs/development/compilers/llvm/9/libunwind.nix @@ -1,4 +1,6 @@ -{ stdenv, version, fetch, cmake, fetchpatch, enableShared ? true }: +{ stdenv, version, fetch, cmake, fetchpatch +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation rec { pname = "libunwind"; diff --git a/pkgs/development/libraries/arrow-cpp/default.nix b/pkgs/development/libraries/arrow-cpp/default.nix index 1d9a528b4c6..a9e738f7e9a 100644 --- a/pkgs/development/libraries/arrow-cpp/default.nix +++ b/pkgs/development/libraries/arrow-cpp/default.nix @@ -1,7 +1,8 @@ { stdenv, lib, fetchurl, fetchFromGitHub, fetchpatch, fixDarwinDylibNames , autoconf, boost, brotli, cmake, flatbuffers, gflags, glog, gtest, lz4 , perl, python3, rapidjson, snappy, thrift, utf8proc, which, zlib, zstd -, enableShared ? true }: +, enableShared ? !stdenv.hostPlatform.isStatic +}: let arrow-testing = fetchFromGitHub { diff --git a/pkgs/development/libraries/audiofile/default.nix b/pkgs/development/libraries/audiofile/default.nix index 9f945b15dec..86531a6ad25 100644 --- a/pkgs/development/libraries/audiofile/default.nix +++ b/pkgs/development/libraries/audiofile/default.nix @@ -38,7 +38,7 @@ stdenv.mkDerivation rec { # # There might be a more sensible way to do this with autotools, but I am not # smart enough to discover it. - preBuild = lib.optionalString stdenv.targetPlatform.isStatic '' + preBuild = lib.optionalString stdenv.hostPlatform.isStatic '' make -C libaudiofile $makeFlags sed -i "s/dependency_libs=.*/dependency_libs=' -lstdc++'/" libaudiofile/libaudiofile.la ''; diff --git a/pkgs/development/libraries/boost/generic.nix b/pkgs/development/libraries/boost/generic.nix index b3950cb0d30..ec3a28e2b1a 100644 --- a/pkgs/development/libraries/boost/generic.nix +++ b/pkgs/development/libraries/boost/generic.nix @@ -8,7 +8,7 @@ , enableDebug ? false , enableSingleThreaded ? false , enableMultiThreaded ? true -, enableShared ? !(stdenv.hostPlatform.libc == "msvcrt") # problems for now +, enableShared ? !(with stdenv.hostPlatform; isStatic || libc == "msvcrt") # problems for now , enableStatic ? !enableShared , enablePython ? false , enableNumpy ? false diff --git a/pkgs/development/libraries/fmt/default.nix b/pkgs/development/libraries/fmt/default.nix index 8eac88df796..2f490891433 100644 --- a/pkgs/development/libraries/fmt/default.nix +++ b/pkgs/development/libraries/fmt/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchFromGitHub, fetchpatch, cmake, enableShared ? true }: +{ stdenv, fetchFromGitHub, fetchpatch, cmake +, enableShared ? !stdenv.hostPlatform.isStatic +}: let generic = { version, sha256, patches ? [ ] }: diff --git a/pkgs/development/libraries/gflags/default.nix b/pkgs/development/libraries/gflags/default.nix index 733a572ac61..51c13f97433 100644 --- a/pkgs/development/libraries/gflags/default.nix +++ b/pkgs/development/libraries/gflags/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchFromGitHub, cmake, enableShared ? true}: +{ stdenv, fetchFromGitHub, cmake +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation rec { pname = "gflags"; diff --git a/pkgs/development/libraries/gmp/5.1.x.nix b/pkgs/development/libraries/gmp/5.1.x.nix index a027d58de39..a514934e964 100644 --- a/pkgs/development/libraries/gmp/5.1.x.nix +++ b/pkgs/development/libraries/gmp/5.1.x.nix @@ -1,4 +1,7 @@ -{ stdenv, fetchurl, m4, cxx ? true, withStatic ? true }: +{ stdenv, fetchurl, m4 +, cxx ? true +, withStatic ? stdenv.hostPlatform.isStatic +}: let inherit (stdenv.lib) optional; in diff --git a/pkgs/development/libraries/gmp/6.x.nix b/pkgs/development/libraries/gmp/6.x.nix index 10e63f733a2..522976d3ab2 100644 --- a/pkgs/development/libraries/gmp/6.x.nix +++ b/pkgs/development/libraries/gmp/6.x.nix @@ -1,7 +1,8 @@ { stdenv, fetchurl, m4 , cxx ? !stdenv.hostPlatform.useAndroidPrebuilt && !stdenv.hostPlatform.isWasm , buildPackages -, withStatic ? false }: +, withStatic ? stdenv.hostPlatform.isStatic +}: # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or diff --git a/pkgs/development/libraries/libbacktrace/default.nix b/pkgs/development/libraries/libbacktrace/default.nix index 0032941f870..ea7f4eb9fa8 100644 --- a/pkgs/development/libraries/libbacktrace/default.nix +++ b/pkgs/development/libraries/libbacktrace/default.nix @@ -1,4 +1,7 @@ -{ stdenv, callPackage, fetchFromGitHub, enableStatic ? false, enableShared ? true }: +{ stdenv, callPackage, fetchFromGitHub +, enableStatic ? stdenv.hostPlatform.isStatic +, enableShared ? !stdenv.hostPlatform.isStatic +}: let yesno = b: if b then "yes" else "no"; in stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/libexecinfo/default.nix b/pkgs/development/libraries/libexecinfo/default.nix index 9c649c223c1..feee754590b 100644 --- a/pkgs/development/libraries/libexecinfo/default.nix +++ b/pkgs/development/libraries/libexecinfo/default.nix @@ -1,4 +1,7 @@ -{ stdenv, fetchurl, fetchpatch, enableStatic ? true, enableShared ? true }: +{ stdenv, fetchurl, fetchpatch +, enableStatic ? true +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation rec { pname = "libexecinfo"; diff --git a/pkgs/development/libraries/libiberty/default.nix b/pkgs/development/libraries/libiberty/default.nix index ff26c1029ef..c7babb3038d 100644 --- a/pkgs/development/libraries/libiberty/default.nix +++ b/pkgs/development/libraries/libiberty/default.nix @@ -1,4 +1,6 @@ -{ stdenv, buildPackages, staticBuild ? false }: +{ stdenv, buildPackages +, staticBuild ? stdenv.hostPlatform.isStatic +}: let inherit (buildPackages.buildPackages) gcc; in diff --git a/pkgs/development/libraries/libiconv/default.nix b/pkgs/development/libraries/libiconv/default.nix index 87969d6b2c7..35d01cd3e82 100644 --- a/pkgs/development/libraries/libiconv/default.nix +++ b/pkgs/development/libraries/libiconv/default.nix @@ -1,6 +1,6 @@ { fetchurl, stdenv, lib -, enableStatic ? stdenv.hostPlatform.useAndroidPrebuilt -, enableShared ? !stdenv.hostPlatform.useAndroidPrebuilt +, enableStatic ? stdenv.hostPlatform.isStatic +, enableShared ? !stdenv.hostPlatform.isStatic }: # assert !stdenv.hostPlatform.isLinux || stdenv.hostPlatform != stdenv.buildPlatform; # TODO: improve on cross diff --git a/pkgs/development/libraries/libjpeg-turbo/default.nix b/pkgs/development/libraries/libjpeg-turbo/default.nix index 6aa4e049e4c..c4e81d034fc 100644 --- a/pkgs/development/libraries/libjpeg-turbo/default.nix +++ b/pkgs/development/libraries/libjpeg-turbo/default.nix @@ -1,4 +1,7 @@ -{ stdenv, fetchFromGitHub, cmake, nasm, enableStatic ? false, enableShared ? true }: +{ stdenv, fetchFromGitHub, cmake, nasm +, enableStatic ? stdenv.hostPlatform.isStatic +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/libpfm/default.nix b/pkgs/development/libraries/libpfm/default.nix index b29aeb2930a..63b826258ae 100644 --- a/pkgs/development/libraries/libpfm/default.nix +++ b/pkgs/development/libraries/libpfm/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl, enableShared ? true }: +{ stdenv, fetchurl +, enableShared ? !stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation (rec { version = "4.11.0"; diff --git a/pkgs/development/libraries/libxml2/default.nix b/pkgs/development/libraries/libxml2/default.nix index 59492887688..10ad110d24e 100644 --- a/pkgs/development/libraries/libxml2/default.nix +++ b/pkgs/development/libraries/libxml2/default.nix @@ -1,6 +1,6 @@ { stdenv, lib, fetchurl, fetchpatch , zlib, xz, libintl, python, gettext, ncurses, findXMLCatalogs -, pythonSupport ? stdenv.buildPlatform == stdenv.hostPlatform +, pythonSupport ? enableShared && stdenv.buildPlatform == stdenv.hostPlatform , icuSupport ? false, icu ? null , enableShared ? stdenv.hostPlatform.libc != "msvcrt" , enableStatic ? !enableShared, diff --git a/pkgs/development/libraries/libxsmm/default.nix b/pkgs/development/libraries/libxsmm/default.nix index 30f060405f0..5e4a56a6d4d 100644 --- a/pkgs/development/libraries/libxsmm/default.nix +++ b/pkgs/development/libraries/libxsmm/default.nix @@ -1,7 +1,7 @@ { stdenv, fetchFromGitHub, coreutils, gfortran, gnused , python3, util-linux, which -, enableStatic ? false +, enableStatic ? stdenv.hostPlatform.isStatic }: let diff --git a/pkgs/development/libraries/ncurses/default.nix b/pkgs/development/libraries/ncurses/default.nix index 0e75bfbd5b5..17a924e6e74 100644 --- a/pkgs/development/libraries/ncurses/default.nix +++ b/pkgs/development/libraries/ncurses/default.nix @@ -3,7 +3,7 @@ , abiVersion ? "6" , mouseSupport ? false , unicode ? true -, enableStatic ? stdenv.hostPlatform.useAndroidPrebuilt +, enableStatic ? stdenv.hostPlatform.isStatic , enableShared ? !enableStatic , withCxx ? !stdenv.hostPlatform.useAndroidPrebuilt diff --git a/pkgs/development/libraries/neon/default.nix b/pkgs/development/libraries/neon/default.nix index c9a2621f440..e9ce6ee18b4 100644 --- a/pkgs/development/libraries/neon/default.nix +++ b/pkgs/development/libraries/neon/default.nix @@ -1,8 +1,8 @@ { stdenv, fetchurl, libxml2, pkgconfig, perl , compressionSupport ? true, zlib ? null , sslSupport ? true, openssl ? null -, static ? false -, shared ? true +, static ? stdenv.hostPlatform.isStatic +, shared ? !stdenv.hostPlatform.isStatic }: assert compressionSupport -> zlib != null; diff --git a/pkgs/development/libraries/openssl/default.nix b/pkgs/development/libraries/openssl/default.nix index fcd12ba587d..2570c7cdb25 100644 --- a/pkgs/development/libraries/openssl/default.nix +++ b/pkgs/development/libraries/openssl/default.nix @@ -2,7 +2,7 @@ , withCryptodev ? false, cryptodev , enableSSL2 ? false , enableSSL3 ? false -, static ? false +, static ? stdenv.hostPlatform.isStatic }: # Note: this package is used for bootstrapping fetchurl, and thus diff --git a/pkgs/development/libraries/rocksdb/default.nix b/pkgs/development/libraries/rocksdb/default.nix index f17a114216b..12a731385ff 100644 --- a/pkgs/development/libraries/rocksdb/default.nix +++ b/pkgs/development/libraries/rocksdb/default.nix @@ -10,7 +10,7 @@ , zstd , enableJemalloc ? false, jemalloc , enableLite ? false -, enableShared ? true +, enableShared ? !stdenv.hostPlatform.isStatic }: stdenv.mkDerivation rec { diff --git a/pkgs/development/libraries/science/math/mkl/default.nix b/pkgs/development/libraries/science/math/mkl/default.nix index 1887d53e306..b631def3bb2 100644 --- a/pkgs/development/libraries/science/math/mkl/default.nix +++ b/pkgs/development/libraries/science/math/mkl/default.nix @@ -1,11 +1,12 @@ -{ callPackage +{ stdenv +, callPackage , stdenvNoCC , fetchurl , rpmextract , undmg , darwin , validatePkgConfig -, enableStatic ? false +, enableStatic ? stdenv.hostPlatform.isStatic }: /* diff --git a/pkgs/development/libraries/science/math/openblas/default.nix b/pkgs/development/libraries/science/math/openblas/default.nix index d670a40f321..8df04e80ceb 100644 --- a/pkgs/development/libraries/science/math/openblas/default.nix +++ b/pkgs/development/libraries/science/math/openblas/default.nix @@ -15,8 +15,8 @@ # Select a specific optimization target (other than the default) # See https://github.com/xianyi/OpenBLAS/blob/develop/TargetList.txt , target ? null -, enableStatic ? false -, enableShared ? true +, enableStatic ? stdenv.hostPlatform.isStatic +, enableShared ? !stdenv.hostPlatform.isStatic }: with stdenv.lib; diff --git a/pkgs/development/libraries/thrift/default.nix b/pkgs/development/libraries/thrift/default.nix index 1879cac96c1..f5c8f64633b 100644 --- a/pkgs/development/libraries/thrift/default.nix +++ b/pkgs/development/libraries/thrift/default.nix @@ -1,5 +1,7 @@ { stdenv, fetchurl, fetchpatch, boost, zlib, libevent, openssl, python, cmake, pkgconfig -, bison, flex, twisted, static ? false }: +, bison, flex, twisted +, static ? stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation rec { pname = "thrift"; diff --git a/pkgs/development/libraries/zlib/default.nix b/pkgs/development/libraries/zlib/default.nix index 98746968146..b780fcda393 100644 --- a/pkgs/development/libraries/zlib/default.nix +++ b/pkgs/development/libraries/zlib/default.nix @@ -1,17 +1,19 @@ { stdenv , fetchurl -# Note: If `{ static = false; shared = false; }`, upstream's default is used -# (which is building both static and shared as of zlib 1.2.11). -, shared ? true +, shared ? !stdenv.hostPlatform.isStatic , static ? true # If true, a separate .static ouput is created and the .a is moved there. # In this case `pkg-config` auto detection does not currently work if the # .static output is given as `buildInputs` to another package (#66461), because # the `.pc` file lists only the main output's lib dir. # If false, and if `{ static = true; }`, the .a stays in the main output. -, splitStaticOutput ? static +, splitStaticOutput ? shared && static }: +# Without either the build will actually still succeed because the build +# system makes an arbitrary choice, but we shouldn't be so indecisive. +assert shared || static; + # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or # cgit) that are needed here should be included directly in Nixpkgs as diff --git a/pkgs/development/tools/misc/binutils/default.nix b/pkgs/development/tools/misc/binutils/default.nix index fb3293aee44..55926852146 100644 --- a/pkgs/development/tools/misc/binutils/default.nix +++ b/pkgs/development/tools/misc/binutils/default.nix @@ -2,7 +2,7 @@ , fetchFromGitHub, fetchurl, zlib, autoreconfHook, gettext # Enabling all targets increases output size to a multiple. , withAllTargets ? false, libbfd, libopcodes -, enableShared ? true +, enableShared ? !stdenv.hostPlatform.isStatic , noSysDirs , gold ? !stdenv.buildPlatform.isDarwin || stdenv.hostPlatform == stdenv.targetPlatform , bison ? null diff --git a/pkgs/development/tools/parsing/tree-sitter/default.nix b/pkgs/development/tools/parsing/tree-sitter/default.nix index 72150b5ac0b..78fb3b7f937 100644 --- a/pkgs/development/tools/parsing/tree-sitter/default.nix +++ b/pkgs/development/tools/parsing/tree-sitter/default.nix @@ -5,8 +5,8 @@ , Security , callPackage -, enableShared ? true -, enableStatic ? false +, enableShared ? !stdenv.hostPlatform.isStatic +, enableStatic ? stdenv.hostPlatform.isStatic , webUISupport ? false }: diff --git a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix index 0532c88b66b..72ef086f599 100644 --- a/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix +++ b/pkgs/os-specific/darwin/apple-source-releases/libiconv/default.nix @@ -1,6 +1,6 @@ { stdenv, appleDerivation, lib -, enableStatic ? stdenv.targetPlatform.isiOS -, enableShared ? !stdenv.targetPlatform.isiOS +, enableStatic ? stdenv.hostPlatform.isStatic +, enableShared ? !stdenv.hostPlatform.isStatic }: appleDerivation { diff --git a/pkgs/os-specific/linux/busybox/default.nix b/pkgs/os-specific/linux/busybox/default.nix index 026ea6fd2e8..99909e6262e 100644 --- a/pkgs/os-specific/linux/busybox/default.nix +++ b/pkgs/os-specific/linux/busybox/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, buildPackages, fetchurl, fetchFromGitLab -, enableStatic ? false +, enableStatic ? stdenv.hostPlatform.isStatic , enableMinimal ? false # Allow forcing musl without switching stdenv itself, e.g. for our bootstrapping: # nix build -f pkgs/top-level/release.nix stdenvBootstrapTools.x86_64-linux.dist diff --git a/pkgs/os-specific/linux/libcap/default.nix b/pkgs/os-specific/linux/libcap/default.nix index 713c4b5d13d..ab78a3a33d8 100644 --- a/pkgs/os-specific/linux/libcap/default.nix +++ b/pkgs/os-specific/linux/libcap/default.nix @@ -1,5 +1,9 @@ -{ stdenv, lib, buildPackages, fetchurl, attr, perl, pam -, static ? stdenv.targetPlatform.isStatic }: +{ stdenv, lib, buildPackages, fetchurl, attr, perl +, usePam ? !isStatic, pam ? null +, isStatic ? stdenv.hostPlatform.isStatic +}: + +assert usePam -> pam != null; stdenv.mkDerivation rec { pname = "libcap"; @@ -10,21 +14,21 @@ stdenv.mkDerivation rec { sha256 = "1qf80lifygbnxwvqjf8jz5j24n6fqqx4ixnkbf76xs2vrmcq664j"; }; - patches = lib.optional static ./no-shared-lib.patch; + patches = lib.optional isStatic ./no-shared-lib.patch; outputs = [ "out" "dev" "lib" "man" "doc" ] - ++ lib.optional (pam != null) "pam"; + ++ lib.optional usePam "pam"; depsBuildBuild = [ buildPackages.stdenv.cc ]; nativeBuildInputs = [ perl ]; - buildInputs = [ pam ]; + buildInputs = lib.optional usePam pam; propagatedBuildInputs = [ attr ]; makeFlags = [ "lib=lib" - "PAM_CAP=${if pam == null then "no" else "yes"}" + "PAM_CAP=${if usePam then "yes" else "no"}" "BUILD_CC=$(CC_FOR_BUILD)" "CC:=$(CC)" ]; @@ -48,10 +52,10 @@ stdenv.mkDerivation rec { installFlags = [ "RAISE_SETFCAP=no" ]; postInstall = '' - ${lib.optionalString (!static) ''rm "$lib"/lib/*.a''} + ${lib.optionalString (!isStatic) ''rm "$lib"/lib/*.a''} mkdir -p "$doc/share/doc/${pname}-${version}" cp License "$doc/share/doc/${pname}-${version}/" - '' + stdenv.lib.optionalString (pam != null) '' + '' + stdenv.lib.optionalString usePam '' mkdir -p "$pam/lib/security" mv "$lib"/lib/security "$pam/lib" ''; diff --git a/pkgs/servers/gobetween/default.nix b/pkgs/servers/gobetween/default.nix index 9f28a89f51e..f429f9ad385 100644 --- a/pkgs/servers/gobetween/default.nix +++ b/pkgs/servers/gobetween/default.nix @@ -1,4 +1,6 @@ -{ buildGoModule, fetchFromGitHub, lib, enableStatic ? false }: +{ stdenv, buildGoModule, fetchFromGitHub, lib +, enableStatic ? stdenv.hostPlatform.isStatic +}: buildGoModule rec { pname = "gobetween"; diff --git a/pkgs/tools/compression/bzip2/default.nix b/pkgs/tools/compression/bzip2/default.nix index 3e20258cbbe..96d560145df 100644 --- a/pkgs/tools/compression/bzip2/default.nix +++ b/pkgs/tools/compression/bzip2/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl -, linkStatic ? (stdenv.hostPlatform.system == "i686-cygwin") +, linkStatic ? with stdenv.hostPlatform; isStatic || isCygwin , autoreconfHook }: diff --git a/pkgs/tools/compression/lz4/default.nix b/pkgs/tools/compression/lz4/default.nix index 0124a0b3d63..7fceb3854eb 100644 --- a/pkgs/tools/compression/lz4/default.nix +++ b/pkgs/tools/compression/lz4/default.nix @@ -1,5 +1,6 @@ { stdenv, fetchFromGitHub, valgrind, fetchpatch -, enableStatic ? false, enableShared ? true +, enableStatic ? stdenv.hostPlatform.isStatic +, enableShared ? !stdenv.hostPlatform.isStatic }: stdenv.mkDerivation rec { diff --git a/pkgs/tools/compression/xz/default.nix b/pkgs/tools/compression/xz/default.nix index 0b6082bb578..161619a0483 100644 --- a/pkgs/tools/compression/xz/default.nix +++ b/pkgs/tools/compression/xz/default.nix @@ -1,4 +1,6 @@ -{ stdenv, fetchurl, enableStatic ? false }: +{ stdenv, fetchurl +, enableStatic ? stdenv.hostPlatform.isStatic +}: # Note: this package is used for bootstrapping fetchurl, and thus # cannot use fetchpatch! All mutable patches (generated by GitHub or diff --git a/pkgs/tools/filesystems/nixpart/0.4/parted.nix b/pkgs/tools/filesystems/nixpart/0.4/parted.nix index 7fe1b745466..d3fc9ce96f5 100644 --- a/pkgs/tools/filesystems/nixpart/0.4/parted.nix +++ b/pkgs/tools/filesystems/nixpart/0.4/parted.nix @@ -1,5 +1,7 @@ { stdenv, fetchurl, fetchpatch, lvm2, libuuid, gettext, readline -, util-linux, check, enableStatic ? false }: +, util-linux, check +, enableStatic ? stdenv.hostPlatform.isStatic +}: stdenv.mkDerivation rec { name = "parted-3.1"; diff --git a/pkgs/tools/graphics/optipng/default.nix b/pkgs/tools/graphics/optipng/default.nix index 93c2f2c3502..571e89297c7 100644 --- a/pkgs/tools/graphics/optipng/default.nix +++ b/pkgs/tools/graphics/optipng/default.nix @@ -1,4 +1,5 @@ -{ stdenv, fetchurl, libpng, static ? false +{ stdenv, fetchurl, libpng +, static ? stdenv.hostPlatform.isStatic }: # This package comes with its own copy of zlib, libpng and pngxtern diff --git a/pkgs/tools/misc/hdf5/default.nix b/pkgs/tools/misc/hdf5/default.nix index e56108767ab..891fadac12a 100644 --- a/pkgs/tools/misc/hdf5/default.nix +++ b/pkgs/tools/misc/hdf5/default.nix @@ -6,7 +6,7 @@ , zlib ? null , szip ? null , mpi ? null -, enableShared ? true +, enableShared ? !stdenv.hostPlatform.isStatic }: # cpp and mpi options are mutually exclusive diff --git a/pkgs/tools/misc/parted/default.nix b/pkgs/tools/misc/parted/default.nix index b00a0836021..2b21b2f1427 100644 --- a/pkgs/tools/misc/parted/default.nix +++ b/pkgs/tools/misc/parted/default.nix @@ -11,7 +11,7 @@ , python3 , util-linux , check -, enableStatic ? false +, enableStatic ? stdenv.hostPlatform.isStatic }: stdenv.mkDerivation rec { diff --git a/pkgs/tools/misc/toybox/default.nix b/pkgs/tools/misc/toybox/default.nix index e7a08877e90..5ae211bd237 100644 --- a/pkgs/tools/misc/toybox/default.nix +++ b/pkgs/tools/misc/toybox/default.nix @@ -1,7 +1,7 @@ { stdenv, lib, fetchFromGitHub, which, buildPackages, - enableStatic ? false, + enableStatic ? stdenv.hostPlatform.isStatic, enableMinimal ? false, extraConfig ? "" }: diff --git a/pkgs/tools/networking/dropbear/default.nix b/pkgs/tools/networking/dropbear/default.nix index 88217302915..605e95c9392 100644 --- a/pkgs/tools/networking/dropbear/default.nix +++ b/pkgs/tools/networking/dropbear/default.nix @@ -1,5 +1,5 @@ { stdenv, lib, fetchurl, glibc, zlib -, enableStatic ? false +, enableStatic ? stdenv.hostPlatform.isStatic , sftpPath ? "/run/current-system/sw/libexec/sftp-server" }: diff --git a/pkgs/tools/package-management/nix/default.nix b/pkgs/tools/package-management/nix/default.nix index 06f5a651f69..868be79c1a4 100644 --- a/pkgs/tools/package-management/nix/default.nix +++ b/pkgs/tools/package-management/nix/default.nix @@ -22,7 +22,7 @@ common = , confDir , withLibseccomp ? lib.any (lib.meta.platformMatch stdenv.hostPlatform) libseccomp.meta.platforms, libseccomp , withAWS ? !enableStatic && (stdenv.isLinux || stdenv.isDarwin), aws-sdk-cpp - , enableStatic ? false + , enableStatic ? stdenv.hostPlatform.isStatic , name, suffix ? "", src, patches ? [] }: diff --git a/pkgs/tools/system/ipmitool/default.nix b/pkgs/tools/system/ipmitool/default.nix index b5da2db67fe..196e59953fe 100644 --- a/pkgs/tools/system/ipmitool/default.nix +++ b/pkgs/tools/system/ipmitool/default.nix @@ -1,4 +1,4 @@ -{ stdenv, lib, fetchurl, openssl, fetchpatch, static ? false }: +{ stdenv, lib, fetchurl, openssl, fetchpatch, static ? stdenv.hostPlatform.isStatic }: let pkgname = "ipmitool"; diff --git a/pkgs/tools/system/pciutils/default.nix b/pkgs/tools/system/pciutils/default.nix index cf6616417ed..c062e1f3bd0 100644 --- a/pkgs/tools/system/pciutils/default.nix +++ b/pkgs/tools/system/pciutils/default.nix @@ -1,5 +1,5 @@ { stdenv, fetchurl, pkgconfig, zlib, kmod, which -, static ? stdenv.targetPlatform.isStatic +, static ? stdenv.hostPlatform.isStatic , darwin ? null }: diff --git a/pkgs/top-level/static.nix b/pkgs/top-level/static.nix index 6720a019cbc..f1d3ea2a159 100644 --- a/pkgs/top-level/static.nix +++ b/pkgs/top-level/static.nix @@ -112,87 +112,23 @@ in { enableApp = false; }; - ncurses = super.ncurses.override { - enableStatic = true; - }; - libxml2 = super.libxml2.override ({ - enableShared = false; - enableStatic = true; - } // optionalAttrs super.stdenv.hostPlatform.isDarwin { - pythonSupport = false; - }); zlib = super.zlib.override { - static = true; - shared = false; - splitStaticOutput = false; - # Don’t use new stdenv zlib because # it doesn’t like the --disable-shared flag stdenv = super.stdenv; }; - xz = super.xz.override { - enableStatic = true; - }; - busybox = super.busybox.override { - enableStatic = true; - }; - libiberty = super.libiberty.override { - staticBuild = true; - }; - libpfm = super.libpfm.override { - enableShared = false; - }; - ipmitool = super.ipmitool.override { - static = true; - }; - neon = super.neon.override { - static = true; - shared = false; - }; - fmt = super.fmt.override { - enableShared = false; - }; gifsicle = super.gifsicle.override { static = true; }; - bzip2 = super.bzip2.override { - linkStatic = true; - }; - optipng = super.optipng.override { - static = true; - }; - openblas = super.openblas.override { - enableStatic = true; - enableShared = false; - }; - mkl = super.mkl.override { enableStatic = true; }; - nix = super.nix.override { enableStatic = true; }; - nixUnstable = super.nixUnstable.override { enableStatic = true; }; - openssl = (super.openssl_1_1.override { static = true; }).overrideAttrs (o: { + openssl = super.openssl_1_1.overrideAttrs (o: { # OpenSSL doesn't like the `--enable-static` / `--disable-shared` flags. configureFlags = (removeUnknownConfigureFlags o.configureFlags); }); - arrow-cpp = super.arrow-cpp.override { - enableShared = false; - }; boost = super.boost.override { - enableStatic = true; - enableShared = false; - # Don’t use new stdenv for boost because it doesn’t like the # --disable-shared flag stdenv = super.stdenv; }; - thrift = super.thrift.override { - static = true; - twisted = null; - }; - gmp = super.gmp.override { - withStatic = true; - }; - gflags = super.gflags.override { - enableShared = false; - }; cdo = super.cdo.override { enable_all_static = true; }; @@ -202,13 +138,6 @@ in { crc32c = super.crc32c.override { staticOnly = true; }; - parted = super.parted.override { - enableStatic = true; - }; - libiconvReal = super.libiconvReal.override { - enableShared = false; - enableStatic = true; - }; perl = super.perl.override { # Don’t use new stdenv zlib because # it doesn’t like the --disable-shared flag @@ -220,24 +149,9 @@ in { snappy = super.snappy.override { static = true; }; - lz4 = super.lz4.override { - enableShared = false; - enableStatic = true; - }; libressl = super.libressl.override { buildShared = false; }; - libjpeg_turbo = super.libjpeg_turbo.override { - enableStatic = true; - enableShared = false; - }; - - darwin = super.darwin // { - libiconv = super.darwin.libiconv.override { - enableShared = false; - enableStatic = true; - }; - }; kmod = super.kmod.override { withStatic = true; @@ -260,21 +174,6 @@ in { static = true; }; - llvmPackages_8 = super.llvmPackages_8 // { - libraries = super.llvmPackages_8.libraries // rec { - libcxxabi = super.llvmPackages_8.libraries.libcxxabi.override { - enableShared = false; - }; - libcxx = super.llvmPackages_8.libraries.libcxx.override { - enableShared = false; - inherit libcxxabi; - }; - libunwind = super.llvmPackages_8.libraries.libunwind.override { - enableShared = false; - }; - }; - }; - ocaml-ng = self.lib.mapAttrs (_: set: if set ? overrideScope' then set.overrideScope' ocamlStaticAdapter else set ) super.ocaml-ng; @@ -289,13 +188,6 @@ in { # Note: -static doesn’t work on darwin libev = super.libev.override { static = !super.stdenv.hostPlatform.isDarwin; }; - libexecinfo = super.libexecinfo.override { enableShared = false; }; - - tree-sitter = super.tree-sitter.override { - enableShared = false; - enableStatic = true; - }; - xorg = super.xorg.overrideScope' (xorgself: xorgsuper: { libX11 = xorgsuper.libX11.overrideAttrs (attrs: { depsBuildBuild = attrs.depsBuildBuild ++ [ (self.buildPackages.stdenv.cc.libc.static or null) ]; @@ -319,6 +211,4 @@ in { configureFlags = attrs.configureFlags ++ [ "--disable-shared" ]; }); }); - - libcap = super.libcap.override { pam = null; }; } From 8e482321805542e08eaf8819a6ad94ea4ba20370 Mon Sep 17 00:00:00 2001 From: John Ericson Date: Sun, 3 Jan 2021 17:51:18 +0000 Subject: [PATCH 13/17] gcc: Always pass `--enable-shared` by default I am actually a bit skeptical about this, but @matthewbauer makes the case for this in https://github.com/NixOS/nixpkgs/pull/107238#discussion_r546454453 and I'm happy to go with it not being as in the loop on static linking stuff as he is. --- pkgs/development/compilers/gcc/10/default.nix | 7 ++++++- pkgs/development/compilers/gcc/4.8/default.nix | 7 ++++++- pkgs/development/compilers/gcc/4.9/default.nix | 7 ++++++- pkgs/development/compilers/gcc/6/default.nix | 7 ++++++- pkgs/development/compilers/gcc/7/default.nix | 7 ++++++- pkgs/development/compilers/gcc/8/default.nix | 7 ++++++- pkgs/development/compilers/gcc/9/default.nix | 7 ++++++- 7 files changed, 42 insertions(+), 7 deletions(-) diff --git a/pkgs/development/compilers/gcc/10/default.nix b/pkgs/development/compilers/gcc/10/default.nix index 7a8aa292079..f346b7f4e37 100644 --- a/pkgs/development/compilers/gcc/10/default.nix +++ b/pkgs/development/compilers/gcc/10/default.nix @@ -7,7 +7,12 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? !stdenv.targetPlatform.isStatic +, # N.B. the defult is intentionally not from an `isStatic`. See + # https://gcc.gnu.org/install/configure.html - this is about target + # platform libraries not host platform ones unlike normal. But since + # we can't rebuild those without also rebuilding the compiler itself, + # we opt to always build everything unlike our usual policy. + enableShared ? true , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) diff --git a/pkgs/development/compilers/gcc/4.8/default.nix b/pkgs/development/compilers/gcc/4.8/default.nix index a413ed1c778..617a19e238b 100644 --- a/pkgs/development/compilers/gcc/4.8/default.nix +++ b/pkgs/development/compilers/gcc/4.8/default.nix @@ -7,7 +7,12 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? !stdenv.targetPlatform.isStatic +, # N.B. the defult is intentionally not from an `isStatic`. See + # https://gcc.gnu.org/install/configure.html - this is about target + # platform libraries not host platform ones unlike normal. But since + # we can't rebuild those without also rebuilding the compiler itself, + # we opt to always build everything unlike our usual policy. + enableShared ? true , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man); required for Java diff --git a/pkgs/development/compilers/gcc/4.9/default.nix b/pkgs/development/compilers/gcc/4.9/default.nix index 05ab2d1fd11..7ea80ffbeb3 100644 --- a/pkgs/development/compilers/gcc/4.9/default.nix +++ b/pkgs/development/compilers/gcc/4.9/default.nix @@ -7,7 +7,12 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? !stdenv.targetPlatform.isStatic +, # N.B. the defult is intentionally not from an `isStatic`. See + # https://gcc.gnu.org/install/configure.html - this is about target + # platform libraries not host platform ones unlike normal. But since + # we can't rebuild those without also rebuilding the compiler itself, + # we opt to always build everything unlike our usual policy. + enableShared ? true , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man); required for Java diff --git a/pkgs/development/compilers/gcc/6/default.nix b/pkgs/development/compilers/gcc/6/default.nix index 6fe953e163f..f9c5c711655 100644 --- a/pkgs/development/compilers/gcc/6/default.nix +++ b/pkgs/development/compilers/gcc/6/default.nix @@ -8,7 +8,12 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? !stdenv.targetPlatform.isStatic +, # N.B. the defult is intentionally not from an `isStatic`. See + # https://gcc.gnu.org/install/configure.html - this is about target + # platform libraries not host platform ones unlike normal. But since + # we can't rebuild those without also rebuilding the compiler itself, + # we opt to always build everything unlike our usual policy. + enableShared ? true , enableLTO ? true , texinfo ? null , flex diff --git a/pkgs/development/compilers/gcc/7/default.nix b/pkgs/development/compilers/gcc/7/default.nix index fd2961f3c93..e0be04234de 100644 --- a/pkgs/development/compilers/gcc/7/default.nix +++ b/pkgs/development/compilers/gcc/7/default.nix @@ -6,7 +6,12 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? !stdenv.targetPlatform.isStatic +, # N.B. the defult is intentionally not from an `isStatic`. See + # https://gcc.gnu.org/install/configure.html - this is about target + # platform libraries not host platform ones unlike normal. But since + # we can't rebuild those without also rebuilding the compiler itself, + # we opt to always build everything unlike our usual policy. + enableShared ? true , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) diff --git a/pkgs/development/compilers/gcc/8/default.nix b/pkgs/development/compilers/gcc/8/default.nix index b29d4597ac5..75c7982ea42 100644 --- a/pkgs/development/compilers/gcc/8/default.nix +++ b/pkgs/development/compilers/gcc/8/default.nix @@ -6,7 +6,12 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? !stdenv.targetPlatform.isStatic +, # N.B. the defult is intentionally not from an `isStatic`. See + # https://gcc.gnu.org/install/configure.html - this is about target + # platform libraries not host platform ones unlike normal. But since + # we can't rebuild those without also rebuilding the compiler itself, + # we opt to always build everything unlike our usual policy. + enableShared ? true , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) diff --git a/pkgs/development/compilers/gcc/9/default.nix b/pkgs/development/compilers/gcc/9/default.nix index 22ab4f61da1..0c649eac1db 100644 --- a/pkgs/development/compilers/gcc/9/default.nix +++ b/pkgs/development/compilers/gcc/9/default.nix @@ -8,7 +8,12 @@ , profiledCompiler ? false , langJit ? false , staticCompiler ? false -, enableShared ? !stdenv.targetPlatform.isStatic +, # N.B. the defult is intentionally not from an `isStatic`. See + # https://gcc.gnu.org/install/configure.html - this is about target + # platform libraries not host platform ones unlike normal. But since + # we can't rebuild those without also rebuilding the compiler itself, + # we opt to always build everything unlike our usual policy. + enableShared ? true , enableLTO ? true , texinfo ? null , perl ? null # optional, for texi2pod (then pod2man) From 0a922750bd77c648a803443ab281a7cd60ceac8a Mon Sep 17 00:00:00 2001 From: Luke Granger-Brown Date: Sun, 3 Jan 2021 20:22:15 +0000 Subject: [PATCH 14/17] kdeApplications.kaccounts-integration: unbreak derivation --- pkgs/applications/kde/kaccounts-integration.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/applications/kde/kaccounts-integration.nix b/pkgs/applications/kde/kaccounts-integration.nix index 9ad1b05dd92..ef69f564f12 100644 --- a/pkgs/applications/kde/kaccounts-integration.nix +++ b/pkgs/applications/kde/kaccounts-integration.nix @@ -1,7 +1,7 @@ { mkDerivation, lib, extra-cmake-modules, kdoctools, kcmutils, kcoreaddons, kwallet, accounts-qt, signond }: mkDerivation { - name = "kaccounts-integration"; + pname = "kaccounts-integration"; meta = with lib; { homepage = "https://community.kde.org/KTp/Setting_up_KAccounts"; description = "Online accounts integration"; From fe13e4fa6f588de76d22b0e95594c0905e75c99d Mon Sep 17 00:00:00 2001 From: zowoq <59103226+zowoq@users.noreply.github.com> Date: Sun, 3 Jan 2021 08:40:11 +1000 Subject: [PATCH 15/17] go_2-dev: change pname/version to use unstable format otherwise this causes problems with stable go versions and nix-env --- pkgs/development/compilers/go/2-dev.nix | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkgs/development/compilers/go/2-dev.nix b/pkgs/development/compilers/go/2-dev.nix index 44ee67ca8f6..9af08dde19e 100644 --- a/pkgs/development/compilers/go/2-dev.nix +++ b/pkgs/development/compilers/go/2-dev.nix @@ -35,8 +35,8 @@ let in stdenv.mkDerivation rec { - pname = "go"; - version = "2"; + pname = "go2-unstable"; + version = "2020-12-08"; src = fetchgit { url = https://go.googlesource.com/go; From bdd15d2a5567af057e6575d3656e9cf2485d8e5f Mon Sep 17 00:00:00 2001 From: Florian Klink Date: Sun, 3 Jan 2021 14:04:53 +0100 Subject: [PATCH 16/17] umockdev: 0.15.2 -> 0.15.4 --- pkgs/development/libraries/umockdev/default.nix | 13 +++---------- .../libraries/umockdev/disable-failed-test.patch | 13 ------------- .../libraries/umockdev/fix-test-paths.patch | 12 ------------ 3 files changed, 3 insertions(+), 35 deletions(-) delete mode 100644 pkgs/development/libraries/umockdev/disable-failed-test.patch delete mode 100644 pkgs/development/libraries/umockdev/fix-test-paths.patch diff --git a/pkgs/development/libraries/umockdev/default.nix b/pkgs/development/libraries/umockdev/default.nix index cd8c90f319d..5050650635f 100644 --- a/pkgs/development/libraries/umockdev/default.nix +++ b/pkgs/development/libraries/umockdev/default.nix @@ -17,23 +17,19 @@ stdenv.mkDerivation rec { pname = "umockdev"; - version = "0.15.2"; + version = "0.15.4"; outputs = [ "bin" "out" "dev" "doc" ]; src = fetchurl { url = "https://github.com/martinpitt/umockdev/releases/download/${version}/${pname}-${version}.tar.xz"; - sha256 = "19f21qb9ckwvlm7yzpnc0vcp092qbkms2yrafc26b9a63v4imj52"; + sha256 = "09k8jwvsphd97hcagf0zaf0hwzlzq2r8jfgbmvj55k7ylrg8hjxg"; }; mesonFlags = [ "-Dgtk_doc=true" ]; - preCheck = '' - patchShebangs tests/test-static-code - ''; - buildInputs = [ glib systemd libgudev ]; nativeBuildInputs = [ @@ -50,10 +46,7 @@ stdenv.mkDerivation rec { enableParallelBuilding = true; - # Test fail with libusb 1.0.24 - # https://github.com/NixOS/nixpkgs/issues/107420 - # https://github.com/martinpitt/umockdev/issues/115 - doCheck = false; + doCheck = true; postInstall = '' mkdir -p $doc/share/doc/umockdev/ diff --git a/pkgs/development/libraries/umockdev/disable-failed-test.patch b/pkgs/development/libraries/umockdev/disable-failed-test.patch deleted file mode 100644 index 69e74dd38b8..00000000000 --- a/pkgs/development/libraries/umockdev/disable-failed-test.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/tests/test-umockdev-vala.vala b/tests/test-umockdev-vala.vala -index 8b104b2..d9889b8 100644 ---- a/tests/test-umockdev-vala.vala -+++ b/tests/test-umockdev-vala.vala -@@ -668,7 +668,7 @@ main (string[] args) - - /* tests for mocking ioctls */ - Test.add_func ("/umockdev-testbed-vala/usbfs_ioctl_static", t_usbfs_ioctl_static); -- Test.add_func ("/umockdev-testbed-vala/usbfs_ioctl_tree", t_usbfs_ioctl_tree); -+ /* Test.add_func ("/umockdev-testbed-vala/usbfs_ioctl_tree", t_usbfs_ioctl_tree); */ - Test.add_func ("/umockdev-testbed-vala/usbfs_ioctl_tree_with_default_device", t_usbfs_ioctl_tree_with_default_device); - Test.add_func ("/umockdev-testbed-vala/usbfs_ioctl_tree_override_default_device", t_usbfs_ioctl_tree_override_default_device); - Test.add_func ("/umockdev-testbed-vala/usbfs_ioctl_tree_xz", t_usbfs_ioctl_tree_xz); diff --git a/pkgs/development/libraries/umockdev/fix-test-paths.patch b/pkgs/development/libraries/umockdev/fix-test-paths.patch deleted file mode 100644 index 53015d66268..00000000000 --- a/pkgs/development/libraries/umockdev/fix-test-paths.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -ru3 umockdev-0.13.1/tests/test-umockdev.c umockdev-0.13.1-new/tests/test-umockdev.c ---- umockdev-0.13.1/tests/test-umockdev.c 2019-08-18 20:39:39.708262517 +0300 -+++ umockdev-0.13.1-new/tests/test-umockdev.c 2019-08-18 21:04:27.688761503 +0300 -@@ -1084,7 +1084,7 @@ - - /* sys/ in other dir should not be trapped */ - errno = 0; -- dirfd = open("/run", O_RDONLY | O_DIRECTORY); -+ dirfd = open("/tmp", O_RDONLY | O_DIRECTORY); - g_assert_cmpint(openat(dirfd, "sys", O_RDONLY), <, 0); - g_assert_cmpint(errno, ==, ENOENT); - g_assert_cmpint(openat64(dirfd, "sys", O_RDONLY), <, 0); From 131e617f777101cb947f047195d9d074be95a601 Mon Sep 17 00:00:00 2001 From: Izorkin Date: Sun, 3 Jan 2021 16:36:16 +0300 Subject: [PATCH 17/17] wireshark-*: pass in overridden libpcap in all-packages.nix This allows building wireshark-* with a explicitly disabled bluezSupport in an overlay. --- pkgs/applications/networking/sniffers/wireshark/default.nix | 3 +-- pkgs/top-level/all-packages.nix | 6 +++++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkgs/applications/networking/sniffers/wireshark/default.nix b/pkgs/applications/networking/sniffers/wireshark/default.nix index 66292e20c52..cb29857e168 100644 --- a/pkgs/applications/networking/sniffers/wireshark/default.nix +++ b/pkgs/applications/networking/sniffers/wireshark/default.nix @@ -12,7 +12,6 @@ with stdenv.lib; let version = "3.4.2"; variant = if withQt then "qt" else "cli"; - pcap = libpcap.override { withBluez = stdenv.isLinux; }; in stdenv.mkDerivation { pname = "wireshark-${variant}"; @@ -39,7 +38,7 @@ in stdenv.mkDerivation { ] ++ optional withQt qt5.wrapQtAppsHook; buildInputs = [ - gettext pcre perl pcap lua5 libssh nghttp2 openssl libgcrypt + gettext pcre perl libpcap lua5 libssh nghttp2 openssl libgcrypt libgpgerror gnutls geoip c-ares python3 glib zlib makeWrapper ] ++ optionals withQt (with qt5; [ qtbase qtmultimedia qtsvg qttools ]) ++ optionals stdenv.isLinux [ libcap libnl ] diff --git a/pkgs/top-level/all-packages.nix b/pkgs/top-level/all-packages.nix index 30ab4e774a8..0e9fefe5db5 100644 --- a/pkgs/top-level/all-packages.nix +++ b/pkgs/top-level/all-packages.nix @@ -21666,12 +21666,16 @@ in wireshark = callPackage ../applications/networking/sniffers/wireshark { inherit (darwin.apple_sdk.frameworks) ApplicationServices SystemConfiguration; + libpcap = libpcap.override { withBluez = stdenv.isLinux; }; }; wireshark-qt = wireshark; # The GTK UI is deprecated by upstream. You probably want the QT version. wireshark-gtk = throw "wireshark-gtk is not supported anymore. Use wireshark-qt or wireshark-cli instead."; - wireshark-cli = wireshark.override { withQt = false; }; + wireshark-cli = wireshark.override { + withQt = false; + libpcap = libpcap.override { withBluez = stdenv.isLinux; }; + }; sngrep = callPackage ../applications/networking/sniffers/sngrep {};