Merge master into staging-next

This commit is contained in:
github-actions[bot] 2020-12-30 12:24:47 +00:00 committed by GitHub
commit 099a83caba
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
43 changed files with 952 additions and 144 deletions

View file

@ -0,0 +1,73 @@
{ stdenv
, fetchurl
, pkg-config
, gtk3
, gtkspell3
, isocodes
, goocanvas2
, intltool
, itstool
, libxml2
, gnome3
, python3
, gobject-introspection
, wrapGAppsHook
, tesseract4
, extraOcrEngines ? [] # other supported engines are: ocrad gocr cuneiform
}:
stdenv.mkDerivation rec {
pname = "ocrfeeder";
version = "0.8.3";
src = fetchurl {
url = "mirror://gnome/sources/${pname}/${stdenv.lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
sha256 = "12f5gnq92ffnd5zaj04df7jrnsdz1zn4zcgpbf5p9qnd21i2y529";
};
nativeBuildInputs = [
pkg-config
wrapGAppsHook
intltool
itstool
libxml2
];
buildInputs = [
gtk3
gobject-introspection
goocanvas2
gtkspell3
isocodes
(python3.withPackages(ps: with ps; [
pyenchant
sane
pillow
reportlab
odfpy
pygobject3
]))
];
# https://gitlab.gnome.org/GNOME/ocrfeeder/-/issues/22
postConfigure = ''
substituteInPlace src/ocrfeeder/util/constants.py \
--replace /usr/share/xml/iso-codes ${isocodes}/share/xml/iso-codes
'';
enginesPath = stdenv.lib.makeBinPath ([
tesseract4
] ++ extraOcrEngines);
preFixup = ''
gappsWrapperArgs+=(--prefix PATH : "${enginesPath}")
'';
meta = with stdenv.lib; {
homepage = "https://wiki.gnome.org/Apps/OCRFeeder";
description = "Complete Optical Character Recognition and Document Analysis and Recognition program";
maintainers = with maintainers; [ doronbehar ];
license = licenses.gpl3Plus;
platforms = platforms.linux;
};
}

View file

@ -25,6 +25,11 @@ mkDerivation rec {
url = "https://github.com/dangvd/ksmoothdock/commit/00799bef8a1c1fe61ef9274866267d9fe9194041.patch";
sha256 = "1nmb7gf1ggzicxz8k4fd67xhwjy404myqzjpgjym66wqxm0arni4";
})
# Pull request to fix build on Qt 5.15 https://github.com/dangvd/ksmoothdock/pull/123
(fetchpatch {
url = "https://github.com/dangvd/ksmoothdock/commit/259527aacadb0fd9110d4425b9bf41a15bedce72.patch";
sha256 = "12nj58v9qqrynarn3gpywih3w27mr4n51z1b8mh0rfbnd2kib8dc";
})
];
nativeBuildInputs = [ cmake extra-cmake-modules ];

View file

@ -0,0 +1,36 @@
{ stdenv, fetchFromGitHub, pkg-config, glib }:
stdenv.mkDerivation rec {
pname = "tiramisu";
version = "1.0";
src = fetchFromGitHub {
owner = "Sweets";
repo = pname;
rev = version;
sha256 = "0aw17riwgrhsmcndzh7sw2zw8xvn3d203c2gcrqi9nk5pa7fwp9m";
};
postPatch = ''
sed -i 's/printf(element_delimiter)/printf("%s", element_delimiter)/' src/output.c
'';
buildInputs = [ glib ];
nativeBuildInputs = [ pkg-config ];
makeFlags = [ "PREFIX=$(out)" ];
meta = with stdenv.lib; {
description = "Desktop notifications, the UNIX way";
longDescription = ''
tiramisu is a notification daemon based on dunst that outputs notifications
to STDOUT in order to allow the user to process notifications any way they
prefer.
'';
homepage = "https://github.com/Sweets/tiramisu";
license = licenses.mit;
platforms = platforms.linux;
maintainers = with maintainers; [ wishfort36 ];
};
}

View file

@ -2,23 +2,22 @@
rustPlatform.buildRustPackage rec {
pname = "cntr";
version = "1.2.1";
version = "1.4.1";
src = fetchFromGitHub {
owner = "Mic92";
repo = "cntr";
rev = version;
sha256 = "0dhfz7aj3cqi974ybf0axchih40rzrs9m8bxhwz1hgig57aisfc0";
sha256 = "sha256-4ogyOKuz6702/sOQNvE+UP+cvQrPPU3VjL4b0FUfRNw=";
};
cargoSha256 = "088drkpkgq8psv5j6igxyhfvvbalzg6nd98r9z0nxkawck5i2clz";
cargoSha256 = "sha256-lblvun2T1qpFiowld77Ti2MFPzhs5pOWWRbErORXYCM=";
meta = with stdenv.lib; {
description = "A container debugging tool based on FUSE";
homepage = "https://github.com/Mic92/cntr";
license = licenses.mit;
# aarch64 support will be fixed soon
platforms = [ "x86_64-linux" ];
platforms = platforms.linux;
maintainers = [ maintainers.mic92 ];
};
}

View file

@ -43,6 +43,7 @@ const gchar *create_tmpdir() {
void pivot_host(const gchar *guest) {
g_autofree gchar *point = g_build_filename(guest, "host", NULL);
fail_if(g_mkdir(point, 0755));
fail_if(mount(0, "/", 0, MS_PRIVATE | MS_REC, 0));
fail_if(pivot_root(guest, point));
}
@ -56,6 +57,7 @@ void bind_mount_item(const gchar *host, const gchar *guest, const gchar *name) {
void bind(const gchar *host, const gchar *guest) {
mount_tmpfs(guest);
pivot_host(guest);
g_autofree gchar *host_dir = g_build_filename("/host", host, NULL);
@ -105,7 +107,11 @@ int main(gint argc, gchar **argv) {
uid_t uid = getuid();
gid_t gid = getgid();
if (unshare(CLONE_NEWNS | CLONE_NEWUSER) < 0) {
int namespaces = CLONE_NEWNS;
if (uid != 0) {
namespaces |= CLONE_NEWUSER;
}
if (unshare(namespaces) < 0) {
int unshare_errno = errno;
g_message("Requires Linux version >= 3.19 built with CONFIG_USER_NS");
@ -116,9 +122,11 @@ int main(gint argc, gchar **argv) {
fail("unshare", unshare_errno);
}
spit("/proc/self/setgroups", "deny");
spit("/proc/self/uid_map", "%d %d 1", uid, uid);
spit("/proc/self/gid_map", "%d %d 1", gid, gid);
if (uid != 0) {
spit("/proc/self/setgroups", "deny");
spit("/proc/self/uid_map", "%d %d 1", uid, uid);
spit("/proc/self/gid_map", "%d %d 1", gid, gid);
}
// If there is a /host directory, assume this is nested chrootenv and use it as host instead.
gboolean nested_host = g_file_test("/host", G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR);

View file

@ -3,10 +3,8 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux)
* use host version of ar, which is given by environment variable
* build system uses stamp.os and stamp.oS files, which only differ in case;
this fails on macOS, so replace .oS with .o_S
* libintl.h does not exist (and is not needed) on macOS
--- glibc-2.27/Makefile.in 2018-02-01 17:17:18.000000000 +0100
+++ glibc-2.27/Makefile.in 2019-02-15 17:38:27.022965553 +0100
--- glibc-2.32/Makefile.in 2018-02-01 17:17:18.000000000 +0100
+++ glibc-2.32/Makefile.in 2020-12-27 18:21:30.000000000 +0100
@@ -6,9 +6,11 @@
.PHONY: all install bench
@ -20,9 +18,9 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux)
LC_ALL=C; export LC_ALL; \
$(MAKE) -r PARALLELMFLAGS="$(PARALLELMFLAGS)" -C $(srcdir) objdir=`pwd` $@
--- glibc-2.27/Makerules 2018-02-01 17:17:18.000000000 +0100
+++ glibc-2.27/Makerules 2019-02-15 17:43:11.196039000 +0100
@@ -915,8 +915,8 @@
--- glibc-2.32/Makerules 2018-02-01 17:17:18.000000000 +0100
+++ glibc-2.32/Makerules 2020-12-27 18:21:30.000000000 +0100
@@ -847,8 +847,8 @@
ifndef objects
# Create the stamp$o files to keep the parent makefile happy.
@ -33,7 +31,7 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux)
$(make-target-directory)
rm -f $@; > $@
else
@@ -927,7 +927,7 @@
@@ -859,7 +859,7 @@
# The parent will then actually add them all to the archive in the
# archive rule, below.
define o-iterator-doit
@ -42,7 +40,7 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux)
endef
define do-stamp
$(make-target-directory)
@@ -943,14 +943,14 @@
@@ -875,14 +875,14 @@
# on the stamp files built above.
define o-iterator-doit
$(common-objpfx)$(patsubst %,$(libtype$o),c): \
@ -59,7 +57,7 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux)
ifndef subdir
$(subdirs-stamps): subdir_lib;
endif
@@ -961,7 +961,7 @@
@@ -893,7 +893,7 @@
# This makes all the object files.
.PHONY: objects objs libobjs extra-objs
objects objs: libobjs extra-objs
@ -68,7 +66,7 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux)
extra-objs: $(addprefix $(objpfx),$(extra-objs))
# Canned sequence for building an extra library archive.
@@ -1615,7 +1615,7 @@
@@ -1499,7 +1499,7 @@
$(rmobjs)
define rmobjs
$(foreach o,$(object-suffixes-for-libc),
@ -77,27 +75,3 @@ enable cross-compilation of glibc on Darwin (build=Darwin, host=Linux)
endef
# Also remove the dependencies and generated source files.
--- glibc-2.27/sunrpc/rpc_main.c 2019-02-15 17:32:43.710244513 +0100
+++ glibc-2.27/sunrpc/rpc_main.c 2019-02-15 17:23:57.139617796 +0100
@@ -38,7 +38,9 @@
#include <stdio.h>
#include <string.h>
#include <unistd.h>
+#ifndef __APPLE__
#include <libintl.h>
+#endif
#include <locale.h>
#include <ctype.h>
#include <sys/types.h>
--- glibc-2.27/sunrpc/rpc_scan.c 2019-02-15 17:32:54.845490606 +0100
+++ glibc-2.27/sunrpc/rpc_scan.c 2019-02-15 17:24:54.288066644 +0100
@@ -37,7 +37,9 @@
#include <stdio.h>
#include <ctype.h>
#include <string.h>
+#ifndef __APPLE__
#include <libintl.h>
+#endif
#include "rpc_scan.h"
#include "rpc_parse.h"
#include "rpc_util.h"

View file

@ -0,0 +1,49 @@
{ stdenv, cmake, pkgconfig, pandoc, libunistring, ncurses, ffmpeg,
fetchFromGitHub, lib,
multimediaSupport ? true
}:
let
version = "2.1.0";
in
stdenv.mkDerivation {
pname = "notcurses";
inherit version;
outputs = [ "out" "dev" ];
nativeBuildInputs = [ cmake pkgconfig pandoc ];
buildInputs = [ libunistring ncurses ]
++ lib.optional multimediaSupport ffmpeg;
cmakeFlags =
[ "-DUSE_QRCODEGEN=OFF" ]
++ lib.optional (!multimediaSupport) "-DUSE_MULTIMEDIA=none";
src = fetchFromGitHub {
owner = "dankamongmen";
repo = "notcurses";
rev = "v${version}";
sha256 = "0jvngg40c1sqf85kqy6ya0vflpxsj7j4g6cw609992rifaghxiny";
};
meta = {
description = "blingful TUIs and character graphics";
longDescription = ''
A library facilitating complex TUIs on modern terminal emulators,
supporting vivid colors, multimedia, and Unicode to the maximum degree
possible. Things can be done with Notcurses that simply can't be done
with NCURSES.
It is not a source-compatible X/Open Curses implementation, nor a
replacement for NCURSES on existing systems.
'';
homepage = "https://github.com/dankamongmen/notcurses";
license = lib.licenses.asl20;
platforms = lib.platforms.all;
maintainers = with lib.maintainers; [ jb55 ];
};
}

View file

@ -3,7 +3,7 @@
buildPythonPackage rec {
pname = "adb-shell";
version = "0.2.3";
version = "0.3.0";
disabled = !isPy3k;
@ -12,7 +12,7 @@ buildPythonPackage rec {
owner = "JeffLIrion";
repo = "adb_shell";
rev = "v${version}";
sha256 = "1ay598avmg656cxnc9phdx43z1plsrfjf9png9jwjwyhyjjiqxil";
sha256 = "0qnlhcd58zxh39cd5xzdx8yc5hc0pf8kix4rbn4avsapwb0l75n2";
};
propagatedBuildInputs = [ aiofiles cryptography libusb1 pyasn1 rsa ];

View file

@ -53,7 +53,8 @@ buildPythonPackage rec {
# Compile mypy with mypyc, which makes mypy about 4 times faster. The compiled
# version is also the default in the wheels on Pypi that include binaries.
MYPY_USE_MYPYC = "1";
# is64bit: unfortunately the build would exhaust all possible memory on i686-linux.
MYPY_USE_MYPYC = stdenv.buildPlatform.is64bit;
meta = with stdenv.lib; {
description = "Optional static typing for Python";

View file

@ -0,0 +1,27 @@
{ lib
, buildPythonPackage
, fetchPypi
, saneBackends
}:
buildPythonPackage rec {
pname = "sane";
version = "2.8.2";
src = fetchPypi {
inherit version;
pname = "python-sane";
sha256 = "0sri01h9sld6w7vgfhwp29n5w19g6idz01ba2giwnkd99k1y2iqg";
};
buildInputs = [
saneBackends
];
meta = with lib; {
homepage = "https://github.com/python-pillow/Sane";
description = "Python interface to the SANE scanner and frame grabber ";
license = licenses.mit;
maintainers = with maintainers; [ doronbehar ];
};
}

View file

@ -1,30 +1,50 @@
{ buildPythonPackage
, fetchPypi
, six
{ stdenv
, buildPythonPackage
, fetchFromGitHub
, ninja
, which
, libjpeg_turbo
, libpng
, numpy
, scipy
, pillow
, pytorch
, lib
, pytest
}:
buildPythonPackage rec {
version = "0.2.1";
pname = "torchvision";
pname = "torchvision";
version = "0.8.2";
format = "wheel";
src = fetchPypi {
inherit pname version;
format = "wheel";
sha256 = "18gvdabkmzfjg47ns0lw38mf85ry28nq1mas5rzlwvb4l5zmw2ms";
src = fetchFromGitHub {
owner = "pytorch";
repo = "vision";
rev = "v${version}";
sha256 = "0yhpbq7linrk2qp5jxsvlgkmwa5bn38s9kcswy4jzvmx1fjbkpq0";
};
propagatedBuildInputs = [ six numpy pillow pytorch ];
nativeBuildInputs = [ libpng ninja which ];
meta = {
TORCHVISION_INCLUDE = "${libjpeg_turbo.dev}/include/";
TORCHVISION_LIBRARY = "${libjpeg_turbo}/lib/";
buildInputs = [ libjpeg_turbo libpng ];
propagatedBuildInputs = [ numpy pillow pytorch scipy ];
# tries to download many datasets for tests
doCheck = false;
checkPhase = ''
HOME=$TMPDIR py.test test --ignore=test/test_datasets_download.py
'';
checkInputs = [ pytest ];
meta = with stdenv.lib; {
description = "PyTorch vision library";
homepage = "https://pytorch.org/";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ ericsagnes ];
homepage = "https://pytorch.org/";
license = licenses.bsd3;
maintainers = with maintainers; [ ericsagnes SuperSandro2000 ];
};
}

View file

@ -1,6 +1,6 @@
{ lib, stdenv
, fetchgit, fetchFromGitHub, fetchurl
, writeShellScript, runCommand, which
, writeShellScript, runCommand, which, formats
, rustPlatform, jq, nix-prefetch-git, xe, curl, emscripten
, Security
, callPackage
@ -29,7 +29,7 @@ let
};
update-all-grammars = import ./update.nix {
inherit writeShellScript nix-prefetch-git curl jq xe src;
inherit writeShellScript nix-prefetch-git curl jq xe src formats lib;
};
fetchGrammar = (v: fetchgit {inherit (v) url rev sha256 fetchSubmodules; });
@ -43,14 +43,22 @@ let
builtGrammars = let
change = name: grammar:
callPackage ./library.nix {} {
callPackage ./grammar.nix {} {
language = name;
inherit version;
source = fetchGrammar grammar;
};
in
# typescript doesn't have parser.c in the same place as others
lib.mapAttrs change (removeAttrs (import ./grammars) ["typescript"]);
lib.mapAttrs change (removeAttrs (import ./grammars) [
# TODO these don't have parser.c in the same place as others.
# They might require more elaborate builds?
# /nix/…/src/parser.c: No such file or directory
"tree-sitter-typescript"
# /nix/…/src/parser.c: No such file or directory
"tree-sitter-ocaml"
# /nix/…/src/parser.c:1:10: fatal error: tree_sitter/parser.h: No such file or directory
"tree-sitter-razor"
]);
in rustPlatform.buildRustPackage {
pname = "tree-sitter";
@ -93,6 +101,11 @@ in rustPlatform.buildRustPackage {
};
inherit grammars;
inherit builtGrammars;
tests = {
# make sure all grammars build
builtGrammars = lib.recurseIntoAttrs builtGrammars;
};
};
meta = {

View file

@ -15,7 +15,7 @@
stdenv.mkDerivation {
pname = "tree-sitter-${language}-library";
pname = "${language}-grammar";
inherit version;
src = source;

View file

@ -1,18 +1,31 @@
{
bash = (builtins.fromJSON (builtins.readFile ./tree-sitter-bash.json));
c = (builtins.fromJSON (builtins.readFile ./tree-sitter-c.json));
cpp = (builtins.fromJSON (builtins.readFile ./tree-sitter-cpp.json));
embedded-template = (builtins.fromJSON (builtins.readFile ./tree-sitter-embedded-template.json));
go = (builtins.fromJSON (builtins.readFile ./tree-sitter-go.json));
html = (builtins.fromJSON (builtins.readFile ./tree-sitter-html.json));
java = (builtins.fromJSON (builtins.readFile ./tree-sitter-java.json));
javascript = (builtins.fromJSON (builtins.readFile ./tree-sitter-javascript.json));
jsdoc = (builtins.fromJSON (builtins.readFile ./tree-sitter-jsdoc.json));
json = (builtins.fromJSON (builtins.readFile ./tree-sitter-json.json));
lua = (builtins.fromJSON (builtins.readFile ./tree-sitter-lua.json));
php = (builtins.fromJSON (builtins.readFile ./tree-sitter-php.json));
python = (builtins.fromJSON (builtins.readFile ./tree-sitter-python.json));
ruby = (builtins.fromJSON (builtins.readFile ./tree-sitter-ruby.json));
rust = (builtins.fromJSON (builtins.readFile ./tree-sitter-rust.json));
typescript = (builtins.fromJSON (builtins.readFile ./tree-sitter-typescript.json));
tree-sitter-agda = (builtins.fromJSON (builtins.readFile ./tree-sitter-agda.json));
tree-sitter-bash = (builtins.fromJSON (builtins.readFile ./tree-sitter-bash.json));
tree-sitter-c = (builtins.fromJSON (builtins.readFile ./tree-sitter-c.json));
tree-sitter-c-sharp = (builtins.fromJSON (builtins.readFile ./tree-sitter-c-sharp.json));
tree-sitter-cpp = (builtins.fromJSON (builtins.readFile ./tree-sitter-cpp.json));
tree-sitter-css = (builtins.fromJSON (builtins.readFile ./tree-sitter-css.json));
tree-sitter-embedded-template = (builtins.fromJSON (builtins.readFile ./tree-sitter-embedded-template.json));
tree-sitter-fluent = (builtins.fromJSON (builtins.readFile ./tree-sitter-fluent.json));
tree-sitter-go = (builtins.fromJSON (builtins.readFile ./tree-sitter-go.json));
tree-sitter-haskell = (builtins.fromJSON (builtins.readFile ./tree-sitter-haskell.json));
tree-sitter-html = (builtins.fromJSON (builtins.readFile ./tree-sitter-html.json));
tree-sitter-java = (builtins.fromJSON (builtins.readFile ./tree-sitter-java.json));
tree-sitter-javascript = (builtins.fromJSON (builtins.readFile ./tree-sitter-javascript.json));
tree-sitter-jsdoc = (builtins.fromJSON (builtins.readFile ./tree-sitter-jsdoc.json));
tree-sitter-json = (builtins.fromJSON (builtins.readFile ./tree-sitter-json.json));
tree-sitter-julia = (builtins.fromJSON (builtins.readFile ./tree-sitter-julia.json));
tree-sitter-lua = (builtins.fromJSON (builtins.readFile ./tree-sitter-lua.json));
tree-sitter-ocaml = (builtins.fromJSON (builtins.readFile ./tree-sitter-ocaml.json));
tree-sitter-php = (builtins.fromJSON (builtins.readFile ./tree-sitter-php.json));
tree-sitter-python = (builtins.fromJSON (builtins.readFile ./tree-sitter-python.json));
tree-sitter-ql = (builtins.fromJSON (builtins.readFile ./tree-sitter-ql.json));
tree-sitter-razor = (builtins.fromJSON (builtins.readFile ./tree-sitter-razor.json));
tree-sitter-regex = (builtins.fromJSON (builtins.readFile ./tree-sitter-regex.json));
tree-sitter-ruby = (builtins.fromJSON (builtins.readFile ./tree-sitter-ruby.json));
tree-sitter-rust = (builtins.fromJSON (builtins.readFile ./tree-sitter-rust.json));
tree-sitter-scala = (builtins.fromJSON (builtins.readFile ./tree-sitter-scala.json));
tree-sitter-swift = (builtins.fromJSON (builtins.readFile ./tree-sitter-swift.json));
tree-sitter-typescript = (builtins.fromJSON (builtins.readFile ./tree-sitter-typescript.json));
tree-sitter-verilog = (builtins.fromJSON (builtins.readFile ./tree-sitter-verilog.json));
}

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-agda",
"rev": "d710ff14d15ddee3764fd73a0837c6c4c8c913e9",
"date": "2019-09-20T18:06:06+08:00",
"path": "/nix/store/wqz9v9znaiwhhqi19hgig9bn0yvl4i9s-tree-sitter-agda",
"sha256": "1wpfj47l97pxk3i9rzdylqipy849r482fnj3lmx8byhalv7z1vm6",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-c-sharp",
"rev": "b8bff2a389ecc098dbb7e8abee492816a5eb42db",
"date": "2020-11-15T07:54:17+00:00",
"path": "/nix/store/h5p71g661hbyzcdcj6xff8y5pcsivpa4-tree-sitter-c-sharp",
"sha256": "0x78s2wgd8b6pwjzbmc9fgp0ivdmxv39wikig1m55slai6yq51wh",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -1,9 +1,9 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-cpp",
"rev": "fb8250eef8b4cf1ce104806c50dc206e388b0e72",
"date": "2020-11-02T09:46:58-08:00",
"path": "/nix/store/qmza43f0fraa111bg50vaxsgnrs5kqs1-tree-sitter-cpp",
"sha256": "1sbk5a2p1fh6798naiswsap6fpj7n7bqhwd3xdyi35xf613qpwsi",
"rev": "a35a275df92e7583df38f2de2562361f2b69987e",
"date": "2020-12-13T11:27:21-08:00",
"path": "/nix/store/l0mv4q1xdxz94ym1nl73y52i1yr9zcgi-tree-sitter-cpp",
"sha256": "130vizybkm11j3lpzmf183myz0vjxq75mpy6qz48rrkidhnrlryk",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-css",
"rev": "23f2cb97d47860c517f67f03e1f4b621d5bd2085",
"date": "2020-05-14T14:44:30-07:00",
"path": "/nix/store/r5pkz9kly0mhgrmqzdzdsr6d1dpqavld-tree-sitter-css",
"sha256": "17svpf36p0p7spppzhm3fi833zpdl2l1scg34r6d4vcbv7dknrjy",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-fluent",
"rev": "858fdd6f1e81992e00d3541bfb31bac9365d7a47",
"date": "2018-06-18T13:00:38-07:00",
"path": "/nix/store/zbj8abdlrqi9swm8qn8rhpqmjwcz145f-tree-sitter-fluent",
"sha256": "0528v9w0cs73p9048xrddb1wpdhr92sn1sw8yyqfrq5sq0danr9k",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-haskell",
"rev": "2a0aa1cb5f1b787a4056a29fa0791e87846e33fb",
"date": "2018-11-03T09:56:20-07:00",
"path": "/nix/store/9xszs4xi51qr72laxr67zxnh8y2br0gy-tree-sitter-haskell",
"sha256": "0z0nfip5m0yrjgm49j5nld7jkgyjdmps101xhbng39pwfnh1av83",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -1,9 +1,9 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-javascript",
"rev": "852f11b394804ac2a8986f8bcaafe77753635667",
"date": "2020-10-27T13:43:40-04:00",
"path": "/nix/store/7a9nd3prxbv2izvilqdxf58his097ak7-tree-sitter-javascript",
"sha256": "1cdqx75fm7fvna0iymw7n03a7f6gayfg97qwqz3himi0775fz9ir",
"rev": "3f8b62f9befd3cb3b4cb0de22f6595a0aadf76ca",
"date": "2020-12-02T10:20:20-08:00",
"path": "/nix/store/c17bf7sjq95lank5ygbglv8j48i5z9w3-tree-sitter-javascript",
"sha256": "0fjq1jzrzd8c8rfxkh2s25gnqlyc19k3a8i3r1129kakisn1288k",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-julia",
"rev": "6a0863f1ce3fcf6f99dc0addb7886dcbd27c5a48",
"date": "2020-09-08T19:39:52-07:00",
"path": "/nix/store/xn5nii9mi2aw7xdabyxlglha2vk12h1w-tree-sitter-julia",
"sha256": "07ds4wzgvnkgkq07izdglkk8lgpqrylvrs96afnwxi56bnzs8sbv",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -1,9 +1,9 @@
{
"url": "https://github.com/nvim-treesitter/tree-sitter-lua",
"rev": "278b0ea1f1f3d86afc86faaca0cbbf6c01182a54",
"date": "2020-09-08T18:29:23+02:00",
"path": "/nix/store/xkaqsw030bf6zd6pivrzrg3d50j1ka1k-tree-sitter-lua",
"sha256": "0i8jdp0bbl02h58hfhpild4v3rvy8yk5r5l90navvfxw4ad4f6f3",
"rev": "97b757ad3546d68dc1131e6ffb9b1d2a750eea29",
"date": "2020-11-25T21:23:57+01:00",
"path": "/nix/store/irz0dikk9dahkayi41chcznqq1i3wr84-tree-sitter-lua",
"sha256": "1nhg139vk3xm6ip4mhr29z0rprfg4q417z2vlvkz3m9wp8gppzls",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-ocaml",
"rev": "4ec9ee414dadc2b6e7325a9f8124d02f6cd8c250",
"date": "2020-09-18T02:13:40+02:00",
"path": "/nix/store/dszjdnwnbziqxav2khs85026msm6fasz-tree-sitter-ocaml",
"sha256": "0wy85940fhmrnz7c1gk6xkipm8ixzalq5q4i7mcc6wnjiiwq60gx",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -1,9 +1,9 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-python",
"rev": "d245768132eb6cb74d8a394ca4d29dc57169b096",
"date": "2020-10-27T13:20:04-04:00",
"path": "/nix/store/afv7ibxpf5c2shafa89cnza88hsfb7kj-tree-sitter-python",
"sha256": "075r5i2id2rn76xm3pcrn5cpvj63dlaxcpvphig39a4c9f9hrpdx",
"rev": "65b486b42fe0188e4be344092151042bf1bc6d9a",
"date": "2020-12-15T09:33:20-08:00",
"path": "/nix/store/k9jziqzyxq2bv55pwl03jcmmca83fjyp-tree-sitter-python",
"sha256": "1yxqdlmp0jybm7vvza1ni5a320vrviqkd14pnpcrg9ilzq23mlsh",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-ql",
"rev": "a0d688d62dcb9cbc7c53f0d98343c458b3776b3d",
"date": "2020-09-16T12:56:09-07:00",
"path": "/nix/store/dfdaf6wg80dfw5fvdiir7n9nj6j30g3g-tree-sitter-ql",
"sha256": "0f6rfhrbvpg8czfa7mld45by3rp628bs6fyl47a8mn18w6x0n5g2",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-razor",
"rev": "60edbd8e798e416f5226a746396efa6a8614fa9b",
"date": "2016-07-08T15:17:50-07:00",
"path": "/nix/store/2vkxw48wc0xf07awi65r4rg2m1lpqq6c-tree-sitter-razor",
"sha256": "1ldsn9nxldxkxdy7irywx88d6a56q05f6907lypzass07piyqp2i",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-regex",
"rev": "be2e415b5716615530234d179dc27c32b7a1d86b",
"date": "2020-05-14T15:05:54-07:00",
"path": "/nix/store/acbcq9lgh5pf6hq3329fa253yfvaj6ji-tree-sitter-regex",
"sha256": "0qxbafbwfj64bwhj3455jgkidpdzqwrlsqm3rckq2pi75flnkv42",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -1,9 +1,9 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-ruby",
"rev": "f86d90cce578e28c824afdcdbdca7d031b88c0b0",
"date": "2020-11-02T20:49:49-08:00",
"path": "/nix/store/gs0hhb1dlgmv0y60zyyz7ki30yvpddfx-tree-sitter-ruby",
"sha256": "1n1irdjfmv27p5ia2vqzv8zfsq19pxi0as0wrkb7z7s1lqr1gwrb",
"rev": "bb572f60e9538bd11fbde95a54f97522073f1e06",
"date": "2020-12-20T12:25:50-08:00",
"path": "/nix/store/hkjgvxh8l4drk1z4zkhmd0wcj876x5y1-tree-sitter-ruby",
"sha256": "198sfmrb3mxvpfmlwmwfmb3qs075ih0bjmr0ffrdy4nqm4a00cb8",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View file

@ -1,9 +1,9 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-rust",
"rev": "cf47ff80cbd8bdc6dd649a005c5f5d73f9c347e2",
"date": "2020-11-04T06:23:40-08:00",
"path": "/nix/store/8cvjxw8cz5jrkqwvgq88r7rfm269xwk1-tree-sitter-rust",
"sha256": "0yzcag0yy3ncxwpnb3fmsw8bxaidp7z8kbl8wwaxaj2vvxxf6sam",
"rev": "8746bd4b584b8063ee8e445bf31015e887417d33",
"date": "2020-11-23T17:16:42-08:00",
"path": "/nix/store/1zzxvza23wsdyazw47lhjvrs0za6wjpn-tree-sitter-rust",
"sha256": "0bhxfyq8ycnp90pqvr6cf3gpq1vax8a34kaq85dmbrc6ar8a7ap6",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-scala",
"rev": "211bb726bb5857f872247b600c7c1808e641a8d4",
"date": "2020-07-13T13:31:00-07:00",
"path": "/nix/store/6q66gzabxazr2581dgp4pp5wwyk2p6mw-tree-sitter-scala",
"sha256": "096ps5za8gxmq61gdd3xdk8cif07vb4v8asls2kdwm6jazm82777",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-swift",
"rev": "a22fa5e19bae50098e2252ea96cba3aba43f4c58",
"date": "2019-10-24T19:04:02-06:00",
"path": "/nix/store/pk5xk8yp6vanbar75bhfrs104w0k1ph0-tree-sitter-swift",
"sha256": "14b40lmwrnyvdz2wiv684kfh4fvqfhbj1dgrx81ppmy7hsz7jcq7",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -1,9 +1,9 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-typescript",
"rev": "73afadbd117a8e8551758af9c3a522ef46452119",
"date": "2020-10-20T12:15:52-07:00",
"path": "/nix/store/wrgp1j5l50cigv5cmlxikw693a55i6g9-tree-sitter-typescript",
"sha256": "0dsbmcvjzys9s229drp1l8anram7d6nsx1nixl5m9znw54hr4w9p",
"rev": "a3a4becef889692724bb1c2191f8fc4bce6573f9",
"date": "2020-12-15T13:34:55-08:00",
"path": "/nix/store/dra5wbhgxkkhphm1mhgv87hsfw0g18nw-tree-sitter-typescript",
"sha256": "0ir7lmzwnbf1zwbl4bfsib1jilg8pvfc1nabaq2n2rixvghlvf3d",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false

View file

@ -0,0 +1,10 @@
{
"url": "https://github.com/tree-sitter/tree-sitter-verilog",
"rev": "ad551aae2649da56582bc0557478a7dc979c0be3",
"date": "2020-10-13T17:40:47-07:00",
"path": "/nix/store/nfaxfqrqkxpwaq8rnk7kcp28nnj8y6m2-tree-sitter-verilog",
"sha256": "0cy29i200rnc34d237s19r6a1n5vv4d3wgwpbywxg6ahcankc34m",
"fetchSubmodules": false,
"deepClone": false,
"leaveDotGit": false
}

View file

@ -1,66 +1,188 @@
{ writeShellScript, nix-prefetch-git
{ writeShellScript, nix-prefetch-git, formats, lib
, curl, jq, xe
, src }:
let
# print all the grammar names mentioned in the fetch-fixtures script
getGrammarNames = writeShellScript "get-grammars.sh" ''
# Grammars we want to fetch from the tree-sitter github orga
knownTreeSitterOrgGrammarRepos = [
"tree-sitter-javascript"
"tree-sitter-c"
"tree-sitter-swift"
"tree-sitter-json"
"tree-sitter-cpp"
"tree-sitter-ruby"
"tree-sitter-razor"
"tree-sitter-go"
"tree-sitter-c-sharp"
"tree-sitter-python"
"tree-sitter-typescript"
"tree-sitter-rust"
"tree-sitter-bash"
"tree-sitter-php"
"tree-sitter-java"
"tree-sitter-scala"
"tree-sitter-ocaml"
"tree-sitter-julia"
"tree-sitter-agda"
"tree-sitter-fluent"
"tree-sitter-html"
"tree-sitter-haskell"
"tree-sitter-regex"
"tree-sitter-css"
"tree-sitter-verilog"
"tree-sitter-jsdoc"
"tree-sitter-ql"
"tree-sitter-embedded-template"
];
knownTreeSitterOrgGrammarReposJson = jsonFile "known-tree-sitter-org-grammar-repos" knownTreeSitterOrgGrammarRepos;
# repos of the tree-sitter github orga we want to ignore (not grammars)
ignoredTreeSitterOrgRepos = [
"tree-sitter"
"tree-sitter-cli"
# this is the haskell language bindings, tree-sitter-haskell is the grammar
"haskell-tree-sitter"
# this is the ruby language bindings, tree-sitter-ruby is the grammar
"ruby-tree-sitter"
# this is the (unmaintained) rust language bindings, tree-sitter-rust is the grammar
"rust-tree-sitter"
# this is the nodejs language bindings, tree-sitter-javascript is the grammar
"node-tree-sitter"
# this is the python language bindings, tree-sitter-python is the grammar
"py-tree-sitter"
# afl fuzzing for tree sitter
"afl-tree-sitter"
# archived
"highlight-schema"
# website
"tree-sitter.github.io"
];
ignoredTreeSitterOrgReposJson = jsonFile "ignored-tree-sitter-org-repos" ignoredTreeSitterOrgRepos;
# Additional grammars that are not in the official github orga.
# If you need a grammar that already exists in the official orga,
# make sure to give it a different name.
otherGrammars = {
"tree-sitter-lua" = {
orga = "nvim-treesitter";
repo = "tree-sitter-lua";
};
};
allGrammars =
let
treeSitterOrgaGrammars =
lib.listToAttrs (map (repo:
{ name = repo;
value = {
orga = "tree-sitter";
inherit repo;
};
})
knownTreeSitterOrgGrammarRepos);
in
mergeAttrsUnique otherGrammars treeSitterOrgaGrammars;
# TODO: move to lib
mergeAttrsUnique = left: right:
let intersect = lib.intersectLists (lib.attrNames left) (lib.attrNames right); in
assert
lib.assertMsg (intersect == [])
(lib.concatStringsSep "\n" [
"mergeAttrsUnique: keys in attrset overlapping:"
"left: ${lib.generators.toPretty {} (lib.getAttrs intersect left)}"
"right: ${lib.generators.toPretty {} (lib.getAttrs intersect right)}"
]);
left // right;
jsonFile = name: val: (formats.json {}).generate name val;
# check the tree-sitter orga repos
checkTreeSitterRepos = writeShellScript "get-grammars.sh" ''
set -euo pipefail
sed -ne 's/^fetch_grammar \(\S*\).*$/\1/p' \
${src}/script/fetch-fixtures
res=$(${jq}/bin/jq \
--slurpfile known "${knownTreeSitterOrgGrammarReposJson}" \
--slurpfile ignore "${ignoredTreeSitterOrgReposJson}" \
'. - ($known[0] + $ignore[0])' \
)
if [ ! "$res" == "[]" ]; then
echo "These repositories are neither known nor ignored:" 1>&2
echo "$res" 1>&2
exit 1
fi
'';
# TODO
urlEscape = x: x;
# TODO
urlEscapeSh = writeShellScript "escape-url" ''printf '%s' "$1"'';
# generic bash script to find the latest github release for a repo
latestGithubRelease = { owner }: writeShellScript "latest-github-release" ''
latestGithubRelease = { orga, repo }: writeShellScript "latest-github-release" ''
set -euo pipefail
repo="$1"
res=$(${curl}/bin/curl \
--silent \
"https://api.github.com/repos/${urlEscape owner}/$(${urlEscapeSh} "$repo")/releases/latest")
if [[ "$(printf "%s" "$res" | ${jq}/bin/jq '.message')" =~ "rate limit" ]]; then
"https://api.github.com/repos/${urlEscape orga}/${urlEscape repo}/releases/latest")
if [[ "$(printf "%s" "$res" | ${jq}/bin/jq '.message?')" =~ "rate limit" ]]; then
echo "rate limited" >&2
fi
release=$(printf "%s" "$res" | ${jq}/bin/jq '.tag_name')
# github sometimes returns an empty list even tough there are releases
if [ "$release" = "null" ]; then
echo "uh-oh, latest for $repo is not there, using HEAD" >&2
echo "uh-oh, latest for ${orga + "/" + repo} is not there, using HEAD" >&2
release="HEAD"
fi
echo "$release"
'';
# update one tree-sitter grammar repo and print their nix-prefetch-git output
updateGrammar = { owner }: writeShellScript "update-grammar.sh" ''
# find the latest repos of a github organization
latestGithubRepos = { orga }: writeShellScript "latest-github-repos" ''
set -euo pipefail
repo="$1"
latest="$(${latestGithubRelease { inherit owner; }} "$repo")"
echo "Fetching latest release ($latest) of $repo " >&2
res=$(${curl}/bin/curl \
--silent \
'https://api.github.com/orgs/${urlEscape orga}/repos?per_page=100')
if [[ "$(printf "%s" "$res" | ${jq}/bin/jq '.message?')" =~ "rate limit" ]]; then
echo "rate limited" >&2 #
fi
printf "%s" "$res" | ${jq}/bin/jq 'map(.name)' \
|| echo "failed $res"
'';
# update one tree-sitter grammar repo and print their nix-prefetch-git output
updateGrammar = { orga, repo }: writeShellScript "update-grammar.sh" ''
set -euo pipefail
latest="$(${latestGithubRelease { inherit orga repo; }})"
echo "Fetching latest release ($latest) of ${repo} " >&2
${nix-prefetch-git}/bin/nix-prefetch-git \
--quiet \
--no-deepClone \
--url "https://github.com/${urlEscape owner}/$(${urlEscapeSh} "$repo")" \
--url "https://github.com/${urlEscape orga}/${urlEscape repo}" \
--rev "$latest"
'';
foreachSh = attrs: f:
lib.concatMapStringsSep "\n" f
(lib.mapAttrsToList (k: v: { name = k; } // v) attrs);
update-all-grammars = writeShellScript "update-all-grammars.sh" ''
set -euo pipefail
grammarNames=$(${getGrammarNames})
echo "fetching list of grammars" 1>&2
treeSitterRepos=$(${latestGithubRepos { orga = "tree-sitter"; }})
echo "checking the tree-sitter repo list against the grammars we know" 1>&2
printf '%s' "$treeSitterRepos" | ${checkTreeSitterRepos}
outputDir="${toString ./.}/grammars"
echo "writing files to $outputDir" 1>&2
mkdir -p "$outputDir"
updateCommand=$(printf \
'${updateGrammar { owner = "tree-sitter"; }} "$1" > "%s/$1.json"' \
"$outputDir")
printf '%s' "$grammarNames" \
| ${xe}/bin/xe printf "tree-sitter-%s\n" {} \
| ${xe}/bin/xe -j2 -s "$updateCommand"
${foreachSh allGrammars
({name, orga, repo}: ''${updateGrammar { inherit orga repo; }} > $outputDir/${name}.json'')}
( echo "{"
printf '%s' "$grammarNames" \
| ${xe}/bin/xe -s 'printf " %s = (builtins.fromJSON (builtins.readFile ./tree-sitter-%s.json));\n" "$1" "$1"'
${foreachSh allGrammars
({name, ...}: ''
# indentation hack
printf " %s = (builtins.fromJSON (builtins.readFile ./%s.json));\n" "${name}" "${name}"'')}
echo "}" ) \
> "$outputDir/default.nix"
'';

View file

@ -0,0 +1,41 @@
{ stdenv, lib, fetchFromGitHub, cmake
, gettext, vorbis-tools
, xmlstarlet, doxygen, python3 }:
stdenv.mkDerivation rec {
pname = "colobot-data";
version = "0.1.12-alpha";
src = fetchFromGitHub {
owner = "colobot";
repo = "colobot-data";
rev = "colobot-gold-${version}";
sha256 = "1vm33s52ymwd03x24i9bqiglw5v3wgd7rlzyx9r5ww0nnqzwbwi6";
};
nativeBuildInputs = [ cmake vorbis-tools xmlstarlet doxygen python3 ];
buildInputs = [ gettext ];
enableParallelBuilding = false;
# Build procedure requires the data folder
patchPhase = ''
cp -r $src localSrc
chmod +w localSrc/help/bots/po
find -type d -exec chmod +w {} \;
for po in localSrc/help/{bots,cbot,object,generic,programs}/po/* localSrc/levels/*{/*/*,}/po/*; do
rm $po
touch $po
done
# skip music
rm localSrc/music/CMakeLists.txt
cd localSrc
'';
meta = with stdenv.lib; {
homepage = "https://colobot.info/";
description = "Game data for colobot";
license = licenses.gpl3;
maintainers = with maintainers; [ freezeboy ];
platforms = platforms.linux;
};
}

View file

@ -0,0 +1,41 @@
{ stdenv, fetchFromGitHub, cmake, boost, SDL2, SDL2_image, SDL2_ttf, libpng
, glew, gettext, libsndfile, libvorbis, libogg, physfs, openal
, xmlstarlet, doxygen, python3, callPackage }:
let
colobot-data = callPackage ./data.nix {};
in
stdenv.mkDerivation rec {
pname = "colobot";
# Maybe require an update to package colobot-data as well
# in file data.nix next to this one
version = "0.1.12-alpha";
src = fetchFromGitHub {
owner = "colobot";
repo = "colobot";
rev = "colobot-gold-${version}";
sha256 = "0viq5s4zqs33an7rdmc3anf74ml7mwwcwf60alhvp9hj5jr547s2";
};
nativeBuildInputs = [ cmake xmlstarlet doxygen python3 ];
buildInputs = [ boost SDL2 SDL2_image SDL2_ttf libpng glew gettext libsndfile libvorbis libogg physfs openal ];
enableParallelBuilding = false;
# The binary ends in games directoy
postInstall = ''
mv $out/games $out/bin
for contents in ${colobot-data}/share/games/colobot/*; do
ln -s $contents $out/share/games/colobot
done
'';
meta = with stdenv.lib; {
homepage = "https://colobot.info/";
description = "Colobot: Gold Edition is a real-time strategy game, where you can program your bots";
license = licenses.gpl3;
maintainers = with maintainers; [ freezeboy ];
platforms = platforms.linux;
};
}

View file

@ -37,6 +37,8 @@ stdenv.mkDerivation {
./linux-5.1.patch
# source: https://salsa.debian.org/Herrie82-guest/broadcom-sta/-/commit/247307926e5540ad574a17c062c8da76990d056f
./linux-5.6.patch
# source: https://gist.github.com/joanbm/5c640ac074d27fd1d82c74a5b67a1290
./linux-5.9.patch
./null-pointer-fix.patch
./gcc.patch
];

View file

@ -0,0 +1,184 @@
diff --git a/src/wl/sys/wl_cfg80211_hybrid.c b/src/wl/sys/wl_cfg80211_hybrid.c
index 4b3298f..c45ad48 100644
--- a/src/wl/sys/wl_cfg80211_hybrid.c
+++ b/src/wl/sys/wl_cfg80211_hybrid.c
@@ -41,6 +41,7 @@
#include <wlioctl.h>
#include <proto/802.11.h>
#include <wl_cfg80211_hybrid.h>
+#include <wl_linux.h>
#define EVENT_TYPE(e) dtoh32((e)->event_type)
#define EVENT_FLAGS(e) dtoh16((e)->flags)
@@ -442,30 +443,7 @@ static void key_endian_to_host(struct wl_wsec_key *key)
static s32
wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
{
- struct ifreq ifr;
- struct wl_ioctl ioc;
- mm_segment_t fs;
- s32 err = 0;
-
- BUG_ON(len < sizeof(int));
-
- memset(&ioc, 0, sizeof(ioc));
- ioc.cmd = cmd;
- ioc.buf = arg;
- ioc.len = len;
- strcpy(ifr.ifr_name, dev->name);
- ifr.ifr_data = (caddr_t)&ioc;
-
- fs = get_fs();
- set_fs(KERNEL_DS);
-#if defined(WL_USE_NETDEV_OPS)
- err = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
-#else
- err = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
-#endif
- set_fs(fs);
-
- return err;
+ return wlc_ioctl_internal(dev, cmd, arg, len);
}
static s32
diff --git a/src/wl/sys/wl_iw.c b/src/wl/sys/wl_iw.c
index 9c3c74e..e346b15 100644
--- a/src/wl/sys/wl_iw.c
+++ b/src/wl/sys/wl_iw.c
@@ -37,6 +37,7 @@ typedef const struct si_pub si_t;
#include <wl_dbg.h>
#include <wl_iw.h>
+#include <wl_linux.h>
extern bool wl_iw_conn_status_str(uint32 event_type, uint32 status,
uint32 reason, char* stringBuf, uint buflen);
@@ -103,29 +104,7 @@ dev_wlc_ioctl(
int len
)
{
- struct ifreq ifr;
- wl_ioctl_t ioc;
- mm_segment_t fs;
- int ret;
-
- memset(&ioc, 0, sizeof(ioc));
- ioc.cmd = cmd;
- ioc.buf = arg;
- ioc.len = len;
-
- strcpy(ifr.ifr_name, dev->name);
- ifr.ifr_data = (caddr_t) &ioc;
-
- fs = get_fs();
- set_fs(KERNEL_DS);
-#if defined(WL_USE_NETDEV_OPS)
- ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
-#else
- ret = dev->do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
-#endif
- set_fs(fs);
-
- return ret;
+ return wlc_ioctl_internal(dev, cmd, arg, len);
}
static int
diff --git a/src/wl/sys/wl_linux.c b/src/wl/sys/wl_linux.c
index c990c70..5bb9480 100644
--- a/src/wl/sys/wl_linux.c
+++ b/src/wl/sys/wl_linux.c
@@ -1664,10 +1664,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
goto done2;
}
- if (segment_eq(get_fs(), KERNEL_DS))
- buf = ioc.buf;
-
- else if (ioc.buf) {
+ if (ioc.buf) {
if (!(buf = (void *) MALLOC(wl->osh, MAX(ioc.len, WLC_IOCTL_MAXLEN)))) {
bcmerror = BCME_NORESOURCE;
goto done2;
@@ -1688,7 +1685,7 @@ wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
WL_UNLOCK(wl);
done1:
- if (ioc.buf && (ioc.buf != buf)) {
+ if (ioc.buf) {
if (copy_to_user(ioc.buf, buf, ioc.len))
bcmerror = BCME_BADADDR;
MFREE(wl->osh, buf, MAX(ioc.len, WLC_IOCTL_MAXLEN));
@@ -1701,6 +1698,39 @@ done2:
return (OSL_ERROR(bcmerror));
}
+int
+wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len)
+{
+ wl_info_t *wl;
+ wl_if_t *wlif;
+ int bcmerror;
+
+ if (!dev)
+ return -ENETDOWN;
+
+ wl = WL_INFO(dev);
+ wlif = WL_DEV_IF(dev);
+ if (wlif == NULL || wl == NULL || wl->dev == NULL)
+ return -ENETDOWN;
+
+ bcmerror = 0;
+
+ WL_TRACE(("wl%d: wlc_ioctl_internal: cmd 0x%x\n", wl->pub->unit, cmd));
+
+ WL_LOCK(wl);
+ if (!capable(CAP_NET_ADMIN)) {
+ bcmerror = BCME_EPERM;
+ } else {
+ bcmerror = wlc_ioctl(wl->wlc, cmd, buf, len, wlif->wlcif);
+ }
+ WL_UNLOCK(wl);
+
+ ASSERT(VALID_BCMERROR(bcmerror));
+ if (bcmerror != 0)
+ wl->pub->bcmerror = bcmerror;
+ return (OSL_ERROR(bcmerror));
+}
+
static struct net_device_stats*
wl_get_stats(struct net_device *dev)
{
diff --git a/src/wl/sys/wl_linux.h b/src/wl/sys/wl_linux.h
index 5b1048e..c8c1f41 100644
--- a/src/wl/sys/wl_linux.h
+++ b/src/wl/sys/wl_linux.h
@@ -22,6 +22,7 @@
#define _wl_linux_h_
#include <wlc_types.h>
+#include <wlc_pub.h>
typedef struct wl_timer {
struct timer_list timer;
@@ -187,6 +188,7 @@ extern irqreturn_t wl_isr(int irq, void *dev_id, struct pt_regs *ptregs);
extern int __devinit wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent);
extern void wl_free(wl_info_t *wl);
extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
+extern int wlc_ioctl_internal(struct net_device *dev, int cmd, void *buf, int len);
extern struct net_device * wl_netdev_get(wl_info_t *wl);
#endif
diff --git a/src/wl/sys/wlc_pub.h b/src/wl/sys/wlc_pub.h
index 53a98b8..2b5a029 100644
--- a/src/wl/sys/wlc_pub.h
+++ b/src/wl/sys/wlc_pub.h
@@ -24,6 +24,7 @@
#include <wlc_types.h>
#include <wlc_utils.h>
+#include <siutils.h>
#include "proto/802.11.h"
#include "proto/bcmevent.h"

View file

@ -0,0 +1,56 @@
{ lib
, fetchFromGitLab
, mkDerivation
, qtbase
, cmake
, kconfig
, kio
, kiconthemes
, kxmlgui
, ki18n
, kguiaddons
, extra-cmake-modules
, boost
, shared-mime-info
, rrdtool
, breeze-icons
}:
mkDerivation rec {
pname = "kcollectd";
version = "0.11.99.0";
src = fetchFromGitLab {
owner = "aerusso";
repo = pname;
rev = "v${version}";
sha256 = "0h4ymvzihzbmyv3z0bp28g94wxc6c7lgi3my0xbka3advxr811gn";
};
nativeBuildInputs = [
cmake
extra-cmake-modules
shared-mime-info
];
buildInputs = [
qtbase
kconfig
kio
kxmlgui
kiconthemes
ki18n
kguiaddons
boost
rrdtool
# otherwise some buttons are blank
breeze-icons
];
meta = with lib; {
description = "A graphical frontend to collectd";
homepage = "https://www.antonioerusso.com/projects/kcollectd/";
maintainers = [ maintainers.symphorien ];
license = [ lib.licenses.gpl3Plus ];
platforms = lib.platforms.linux;
};
}

View file

@ -196,6 +196,8 @@ in
corgi = callPackage ../development/tools/corgi { };
colobot = callPackage ../games/colobot {};
colorz = callPackage ../tools/misc/colorz { };
colorpicker = callPackage ../tools/misc/colorpicker { };
@ -2521,6 +2523,8 @@ in
ocrmypdf = callPackage ../tools/text/ocrmypdf { };
ocrfeeder = callPackage ../applications/graphics/ocrfeeder { };
onboard = callPackage ../applications/misc/onboard { };
oneshot = callPackage ../tools/networking/oneshot { };
@ -5176,7 +5180,7 @@ in
peruse = libsForQt5.callPackage ../tools/misc/peruse { };
ksmoothdock = libsForQt514.callPackage ../applications/misc/ksmoothdock { };
ksmoothdock = libsForQt5.callPackage ../applications/misc/ksmoothdock { };
kstars = libsForQt5.callPackage ../applications/science/astronomy/kstars { };
@ -5437,6 +5441,8 @@ in
file-rename = callPackage ../tools/filesystems/file-rename { };
kcollectd = libsForQt5.callPackage ../tools/misc/kcollectd {};
kea = callPackage ../tools/networking/kea { };
keysmith = libsForQt5.callPackage ../tools/security/keysmith { };
@ -15206,6 +15212,8 @@ in
notify-sharp = callPackage ../development/libraries/notify-sharp { };
notcurses = callPackage ../development/libraries/notcurses { };
ncurses5 = ncurses.override {
abiVersion = "5";
};
@ -22147,6 +22155,8 @@ in
swaylock-effects = callPackage ../applications/window-managers/sway/lock-effects.nix { };
tiramisu = callPackage ../applications/misc/tiramisu { };
waybar = callPackage ../applications/misc/waybar {};
hikari = callPackage ../applications/window-managers/hikari { };

View file

@ -134,13 +134,13 @@ with self; {
vicious = toLuaModule(stdenv.mkDerivation rec {
pname = "vicious";
version = "2.3.1";
version = "2.5.0";
src = fetchFromGitHub {
owner = "Mic92";
repo = "vicious";
rev = "v${version}";
sha256 = "1yzhjn8rsvjjsfycdc993ms6jy2j5jh7x3r2ax6g02z5n0anvnbx";
sha256 = "0lb90334mz0my8ydsmnsnkki0xr58kinsg0hf9d6k4b0vjfi0r0a";
};
buildInputs = [ lua ];

View file

@ -6562,6 +6562,10 @@ in {
salmon-mail = callPackage ../development/python-modules/salmon-mail { };
sane = callPackage ../development/python-modules/sane {
inherit (pkgs) saneBackends;
};
sampledata = callPackage ../development/python-modules/sampledata { };
samplerate = callPackage ../development/python-modules/samplerate { };