Skip to content
This repository was archived by the owner on Apr 12, 2021. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: f9c81b5c1485
Choose a base ref
...
head repository: NixOS/nixpkgs-channels
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2ac5fab26478
Choose a head ref
  • 11 commits
  • 12 files changed
  • 8 contributors

Commits on May 5, 2019

  1. [WIP] usb_modeswitch

    thefloweringash committed May 5, 2019
    Copy the full SHA
    178f455 View commit details

Commits on Jan 13, 2020

  1. Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    a6d5765 View commit details
  2. pavucontrol: Use system style

    Flakebi committed Jan 13, 2020
    Copy the full SHA
    475e516 View commit details
  3. waybar: Use system style

    Flakebi committed Jan 13, 2020
    Copy the full SHA
    cb89549 View commit details
  4. pythonPackages.onnx: init at version 1.6.0

    acairncross authored and Jon committed Jan 13, 2020
    Copy the full SHA
    74a3ff5 View commit details

Commits on Jan 14, 2020

  1. Copy the full SHA
    a8144b1 View commit details
  2. Merge pull request #77640 from anderslundstedt/master

    spotifyd: 0.2.20 -> 0.2.23
    marsam authored Jan 14, 2020
    Copy the full SHA
    1801241 View commit details
  3. linux: 5.5-rc5 -> 5.5-rc6

    NeQuissimus committed Jan 14, 2020
    Copy the full SHA
    7184df6 View commit details
  4. Merge pull request #60981 from thefloweringash/usb-modeswitch

    usb_modeswitch: fixes
    peterhoeg authored Jan 14, 2020
    Copy the full SHA
    41d333e View commit details
  5. Merge pull request #73548 from Flakebi/style

    pavucontrol, waybar: Use system style
    jtojnar authored Jan 14, 2020
    Copy the full SHA
    078f33b View commit details
  6. pencil: 3.0.4 -> 3.1.0

    Flakebi authored and bjornfor committed Jan 14, 2020
    Copy the full SHA
    2ac5fab View commit details
13 changes: 13 additions & 0 deletions nixos/modules/hardware/usb-wwan.nix
Original file line number Diff line number Diff line change
@@ -21,6 +21,19 @@ with lib;
###### implementation

config = mkIf config.hardware.usbWwan.enable {
# Attaches device specific handlers.
services.udev.packages = with pkgs; [ usb-modeswitch-data ];

# Triggered by udev, usb-modeswitch creates systemd services via a
# template unit in the usb-modeswitch package.
systemd.packages = with pkgs; [ usb-modeswitch ];

# The systemd service requires the usb-modeswitch-data. The
# usb-modeswitch package intends to discover this via the
# filesystem at /usr/share/usb_modeswitch, and merge it with user
# configuration in /etc/usb_modeswitch.d. Configuring the correct
# path in the package is difficult, as it would cause a cyclic
# dependency.
environment.etc."usb_modeswitch.d".source = "${pkgs.usb-modeswitch-data}/share/usb_modeswitch";
};
}
12 changes: 3 additions & 9 deletions pkgs/applications/audio/pavucontrol/default.nix
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{ fetchurl, stdenv, pkgconfig, intltool, libpulseaudio, gtkmm3
, libcanberra-gtk3, makeWrapper, gnome3 }:
, libcanberra-gtk3, gnome3, wrapGAppsHook }:

stdenv.mkDerivation rec {
pname = "pavucontrol";
@@ -10,16 +10,10 @@ stdenv.mkDerivation rec {
sha256 = "1qhlkl3g8d7h72xjskii3g1l7la2cavwp69909pzmbi2jyn5pi4g";
};

preFixup = ''
wrapProgram "$out/bin/pavucontrol" \
--set GDK_PIXBUF_MODULE_FILE "$GDK_PIXBUF_MODULE_FILE" \
--prefix XDG_DATA_DIRS : "$XDG_ICON_DIRS"
'';

buildInputs = [ libpulseaudio gtkmm3 libcanberra-gtk3 makeWrapper
buildInputs = [ libpulseaudio gtkmm3 libcanberra-gtk3
gnome3.adwaita-icon-theme ];

nativeBuildInputs = [ pkgconfig intltool ];
nativeBuildInputs = [ pkgconfig intltool wrapGAppsHook ];

configureFlags = [ "--disable-lynx" ];

6 changes: 3 additions & 3 deletions pkgs/applications/audio/spotifyd/default.nix
Original file line number Diff line number Diff line change
@@ -6,16 +6,16 @@

rustPlatform.buildRustPackage rec {
pname = "spotifyd";
version = "0.2.20";
version = "0.2.23";

src = fetchFromGitHub {
owner = "Spotifyd";
repo = "spotifyd";
rev = "v${version}";
sha256 = "1hf4wpk7r0s4jpjhxaz67y1hd8jx9ns5imd85r3cdg4lxf3j5gph";
sha256 = "0xxr21avgr4pvlr5vgb68jmad5xy5kqvaxfzh0qn1jpiax7y3avm";
};

cargoSha256 = "1h3fis47hmxvppiv1icjhgp48nd46gayfcmzfjs34q6jask90n0w";
cargoSha256 = "1ykmn7zzwn9my96bbxwkparab5lck1zzdkpafil2mmrjyvyi40da";

cargoBuildFlags = [
"--no-default-features"
116 changes: 59 additions & 57 deletions pkgs/applications/graphics/pencil/default.nix
Original file line number Diff line number Diff line change
@@ -1,97 +1,99 @@
{ stdenv, fetchurl, lib, makeWrapper,
{ stdenv, fetchurl, lib, makeWrapper, wrapGAppsHook,
# build dependencies
alsaLib, atk, cairo, cups, dbus, expat, fontconfig,
freetype, gdk-pixbuf, glib, gnome2, nspr, nss, xorg,
glibc, systemd
alsaLib, atk, at-spi2-atk, at-spi2-core, cairo, cups, dbus, expat, fontconfig,
freetype, gdk-pixbuf, glib, glibc, gtk3, libuuid, nspr, nss, pango,
xorg, systemd
}:
let

stdenv.mkDerivation rec {
version = "3.0.4";
deps = [
alsaLib
atk
at-spi2-atk
at-spi2-core
cairo
cups
dbus
expat
fontconfig
freetype
gdk-pixbuf
glib
glibc
gtk3
libuuid
nspr
nss
pango
xorg.libX11
xorg.libxcb
xorg.libXScrnSaver
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
stdenv.cc.cc.lib
stdenv.cc.cc
];

in stdenv.mkDerivation rec {
version = "3.1.0";
pname = "pencil";

src = fetchurl {
url = "http://pencil.evolus.vn/dl/V${version}/Pencil_${version}_amd64.deb";
sha256 = "58e2b794c615ea8715d8374f177e19c87f7071e359826ec34a59836d537a62fd";
url = "http://pencil.evolus.vn/dl/V${version}.ga/pencil_${version}.ga_amd64.deb";
sha256 = "01ae54b1a1351b909eb2366c6ec00816e1deba370e58f35601cf7368f10aaba3";
};

sourceRoot = ".";

unpackCmd = ''
ar p "$src" data.tar.xz | tar xJ
ar p "$src" data.tar.gz | tar xz
'';

dontBuild = true;

nativeBuildInputs = [ makeWrapper ];
nativeBuildInputs = [ makeWrapper wrapGAppsHook ];

buildInputs = deps;

installPhase = ''
mkdir -p $out/bin
cp -R usr/share opt $out/
mkdir -p $out/bin $out/opt $out/share/applications
cp -R usr/share $out/
cp -R opt/pencil*/ $out/opt/pencil
cp $out/opt/pencil/pencil.desktop $out/share/applications/
# fix the path in the desktop file
substituteInPlace \
$out/share/applications/pencil.desktop \
--replace /opt/ $out/opt/
# symlink the binary to bin/
ln -s $out/opt/Pencil/pencil $out/bin/pencil
ln -s $out/opt/pencil/pencil $out/bin/pencil
'';


preFixup = let
packages = [
alsaLib
atk
cairo
cups
dbus
expat
fontconfig
freetype
gdk-pixbuf
glib
gnome2.GConf
gnome2.gtk
gnome2.pango
nspr
nss
xorg.libX11
xorg.libXScrnSaver
xorg.libXcomposite
xorg.libXcursor
xorg.libXdamage
xorg.libXext
xorg.libXfixes
xorg.libXi
xorg.libXrandr
xorg.libXrender
xorg.libXtst
stdenv.cc.cc.lib
stdenv.cc.cc
glibc
];
packages = deps;
libPathNative = lib.makeLibraryPath packages;
libPath64 = lib.makeSearchPathOutput "lib" "lib64" packages;
libPath = "${libPathNative}:${libPath64}";
in ''
# patch executable
patchelf \
--set-interpreter "$(cat $NIX_CC/nix-support/dynamic-linker)" \
--set-rpath "${libPath}:$out/opt/Pencil" \
$out/opt/Pencil/pencil
# patch libnode
patchelf \
--set-rpath "${libPath}" \
$out/opt/Pencil/libnode.so
# libffmpeg is for some reason not executable
chmod a+x $out/opt/Pencil/libffmpeg.so
--set-rpath "${libPath}:$out/opt/pencil" \
$out/opt/pencil/pencil
# fix missing libudev
ln -s ${systemd.lib}/lib/libudev.so.1 $out/opt/Pencil/libudev.so.1
wrapProgram $out/opt/Pencil/pencil \
--prefix LD_LIBRARY_PATH : $out/opt/Pencil
ln -s ${systemd.lib}/lib/libudev.so.1 $out/opt/pencil/libudev.so.1
wrapProgram $out/opt/pencil/pencil \
--prefix LD_LIBRARY_PATH : $out/opt/pencil
'';

meta = with stdenv.lib; {
4 changes: 2 additions & 2 deletions pkgs/applications/misc/waybar/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{ stdenv, fetchFromGitHub, meson, pkgconfig, ninja
{ stdenv, fetchFromGitHub, meson, pkgconfig, ninja, wrapGAppsHook
, wayland, wlroots, gtkmm3, libinput, libsigcxx, jsoncpp, fmt, scdoc, spdlog, gtk-layer-shell
, traySupport ? true, libdbusmenu-gtk3
, pulseSupport ? false, libpulseaudio
@@ -19,7 +19,7 @@
};

nativeBuildInputs = [
meson ninja pkgconfig scdoc
meson ninja pkgconfig scdoc wrapGAppsHook
];

buildInputs = with stdenv.lib;
78 changes: 78 additions & 0 deletions pkgs/development/python-modules/onnx/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{ lib
, fetchpatch
, buildPythonPackage
, fetchPypi
, pythonOlder
, isPy27
, cmake
, protobuf
, numpy
, six
, typing-extensions
, typing
, pytestrunner
, pytest
, nbval
, tabulate
}:

buildPythonPackage rec {
pname = "onnx";
version = "1.6.0";

# Due to Protobuf packaging issues this build of Onnx with Python 2 gives
# errors on import
disabled = isPy27;

src = fetchPypi {
inherit pname version;
sha256 = "0ig33jl3591041lyylxp52yi20rfrcqx3i030hd6al8iabzc721v";
};

# Remove the unqualified requirement for the typing package for running the
# tests. typing is already required for the installation, where it is
# correctly qualified so as to only be required for sufficiently old Python
# versions.
# This patch should be in the next release (>1.6).
patches = [
(fetchpatch {
url = "https://github.com/onnx/onnx/commit/c963586d0f8dd5740777b2fd06f04ec60816de9f.patch";
sha256 = "1hl26cw5zckc91gmh0bdah87jyprccxiw0f4i5h1gwkq28hm6wbj";
})
];

nativeBuildInputs = [ cmake ];

propagatedBuildInputs = [
protobuf
numpy
six
typing-extensions
] ++ lib.optional (pythonOlder "3.5") [ typing ];

checkInputs = [
pytestrunner
pytest
nbval
tabulate
];

postPatch = ''
patchShebangs tools/protoc-gen-mypy.py
'';

# The executables are just utility scripts that aren't too important
postInstall = ''
rm -r $out/bin
'';

# The setup.py does all the configuration (running CMake)
dontConfigure = true;

meta = {
homepage = http://onnx.ai;
description = "Open Neural Network Exchange";
license = lib.licenses.mit;
maintainers = [ lib.maintainers.acairncross ];
};
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,294 @@
diff --git a/Makefile b/Makefile
index 463a11f..f20072c 100644
--- a/Makefile
+++ b/Makefile
@@ -5,11 +5,11 @@ CFLAGS += -Wall
LIBS = `pkg-config --libs --cflags libusb-1.0`
RM = /bin/rm -f
OBJS = usb_modeswitch.c
-PREFIX = $(DESTDIR)/usr
-ETCDIR = $(DESTDIR)/etc
+PREFIX = /usr/local
+ETCDIR = $(PREFIX)/etc
SYSDIR = $(ETCDIR)/systemd/system
UPSDIR = $(ETCDIR)/init
-UDEVDIR = $(DESTDIR)/lib/udev
+UDEVDIR = $(PREFIX)/lib/udev
SBINDIR = $(PREFIX)/sbin
MANDIR = $(PREFIX)/share/man/man1
VPATH = jimtcl
@@ -22,10 +22,17 @@ endif
JIM_CONFIGURE_OPTS = --disable-lineedit \
--with-out-jim-ext="stdlib posix load signal syslog" --prefix=/usr

+USE_UPSTART=$(shell if command -v initctl > /dev/null; then echo "true"; fi)
+USE_SYSTEMD=$(shell if command -v systemctl > /dev/null; then echo "true"; fi)
+
.PHONY: clean install install-common uninstall \
script shared static \
dispatcher-script dispatcher-shared dispatcher-static \
- install-script install-shared install-static
+ install-script install-shared install-static \
+ install-upstart install-systemd \
+ configure-dispatcher configure-script \
+ configure-upstart configure-systemd \
+ configure

all: script

@@ -46,7 +53,25 @@ jim/libjim.a:
cd jim && CFLAGS="$(CFLAGS)" CC="$(CC)" ./configure $(JIM_CONFIGURE_OPTS)
$(MAKE) -C jim lib

-dispatcher-script: usb_modeswitch.tcl
+configure-dispatcher:
+ sed -i \
+ -e 's,^\(set setup(sbindir) \).*$$,\1$(SBINDIR),' \
+ -e 's,^\(set setup(etcdir) \).*$$,\1$(ETCDIR),' \
+ usb_modeswitch.tcl
+
+configure-script:
+ sed -i -e 's,^\(SBINDIR=\).*$$,\1$(SBINDIR),' usb_modeswitch.sh
+
+configure-systemd:
+ sed -i -e 's,@sbindir@,$(SBINDIR),' usb_modeswitch@.service
+
+configure-upstart:
+ sed -i -e 's,@sbindir@,$(SBINDIR),' usb-modeswitch-upstart.conf
+
+configure: configure-dispatcher configure-script \
+ configure-systemd configure-upstart
+
+dispatcher-script: configure-dispatcher usb_modeswitch.tcl
sed 's_!/usr/bin/tclsh_!'"$(TCL)"'_' < usb_modeswitch.tcl > usb_modeswitch_dispatcher

dispatcher-shared: jim/libjim.so dispatcher.c usb_modeswitch.string
@@ -55,7 +80,7 @@ dispatcher-shared: jim/libjim.so dispatcher.c usb_modeswitch.string
dispatcher-static: jim/libjim.a dispatcher.c usb_modeswitch.string
$(CC) dispatcher.c $(LDFLAGS) jim/libjim.a -Ijim -o usb_modeswitch_dispatcher $(CFLAGS)

-usb_modeswitch.string: usb_modeswitch.tcl
+usb_modeswitch.string: configure-dispatcher usb_modeswitch.tcl
$(HOST_TCL) make_string.tcl usb_modeswitch.tcl > $@

clean:
@@ -76,16 +101,28 @@ ums-clean:
# If the systemd folder is present, install the service for starting the dispatcher
# If not, use the dispatcher directly from the udev rule as in previous versions

-install-common: $(PROG) usb_modeswitch_dispatcher
- install -D --mode=755 usb_modeswitch $(SBINDIR)/usb_modeswitch
- install -D --mode=755 usb_modeswitch.sh $(UDEVDIR)/usb_modeswitch
- install -D --mode=644 usb_modeswitch.conf $(ETCDIR)/usb_modeswitch.conf
- install -D --mode=644 usb_modeswitch.1 $(MANDIR)/usb_modeswitch.1
- install -D --mode=644 usb_modeswitch_dispatcher.1 $(MANDIR)/usb_modeswitch_dispatcher.1
- install -D --mode=755 usb_modeswitch_dispatcher $(SBINDIR)/usb_modeswitch_dispatcher
+install-common: $(PROG) configure usb_modeswitch_dispatcher
+ install -D --mode=755 usb_modeswitch $(DESTDIR)$(SBINDIR)/usb_modeswitch
+ install -D --mode=755 usb_modeswitch.sh $(DESTDIR)$(UDEVDIR)/usb_modeswitch
+ install -D --mode=644 usb_modeswitch.conf $(DESTDIR)$(ETCDIR)/usb_modeswitch.conf
+ install -D --mode=644 usb_modeswitch.1 $(DESTDIR)$(MANDIR)/usb_modeswitch.1
+ install -D --mode=644 usb_modeswitch_dispatcher.1 $(DESTDIR)$(MANDIR)/usb_modeswitch_dispatcher.1
+ install -D --mode=755 usb_modeswitch_dispatcher $(DESTDIR)$(SBINDIR)/usb_modeswitch_dispatcher
install -d $(DESTDIR)/var/lib/usb_modeswitch
- test -d $(UPSDIR) -a -e /sbin/initctl && install --mode=644 usb-modeswitch-upstart.conf $(UPSDIR) || test 1
- test -d $(SYSDIR) -a \( -e /usr/bin/systemctl -o -e /bin/systemctl \) && install --mode=644 usb_modeswitch@.service $(SYSDIR) || test 1
+
+install-upstart:
+ install -D --mode=644 usb-modeswitch-upstart.conf $(DESTDIR)$(UPSDIR)/usb-modeswitch-upstart.conf
+
+install-systemd:
+ install -D --mode=644 usb_modeswitch@.service $(DESTDIR)$(SYSDIR)/usb_modeswitch@.service
+
+ifeq ($(USE_UPSTART),true)
+install-common: install-upstart
+endif
+
+ifeq ($(USE_SYSTEMD),true)
+install-common: install-systemd
+endif

install: install-script

@@ -96,10 +133,10 @@ install-shared: dispatcher-shared install-common
install-static: dispatcher-static install-common

uninstall:
- $(RM) $(SBINDIR)/usb_modeswitch
- $(RM) $(SBINDIR)/usb_modeswitch_dispatcher
- $(RM) $(UDEVDIR)/usb_modeswitch
- $(RM) $(ETCDIR)/usb_modeswitch.conf
- $(RM) $(MANDIR)/usb_modeswitch.1
+ $(RM) $(DESTDIR)$(SBINDIR)/usb_modeswitch
+ $(RM) $(DESTDIR)$(SBINDIR)/usb_modeswitch_dispatcher
+ $(RM) $(DESTDIR)$(UDEVDIR)/usb_modeswitch
+ $(RM) $(DESTDIR)$(ETCDIR)/usb_modeswitch.conf
+ $(RM) $(DESTDIR)$(MANDIR)/usb_modeswitch.1
$(RM) -R $(DESTDIR)/var/lib/usb_modeswitch
- $(RM) $(SYSDIR)/usb_modeswitch@.service
+ $(RM) $(DESTDIR)$(SYSDIR)/usb_modeswitch@.service
diff --git a/usb-modeswitch-upstart.conf b/usb-modeswitch-upstart.conf
index 0d82b69..1c177b4 100644
--- a/usb-modeswitch-upstart.conf
+++ b/usb-modeswitch-upstart.conf
@@ -1,5 +1,5 @@
start on usb-modeswitch-upstart
task
script
- exec /usr/sbin/usb_modeswitch_dispatcher --switch-mode $UMS_PARAM
+ exec @sbindir@/usb_modeswitch_dispatcher --switch-mode $UMS_PARAM
end script
diff --git a/usb_modeswitch.sh b/usb_modeswitch.sh
index eb3fa3e..0e93166 100755
--- a/usb_modeswitch.sh
+++ b/usb_modeswitch.sh
@@ -1,5 +1,9 @@
#!/bin/sh
# part of usb_modeswitch 2.5.2
+
+# Compile time configuration, injected by the Makefile
+SBINDIR=/usr/sbin
+
device_in()
{
if [ ! -e /var/lib/usb_modeswitch/$1 ]; then
@@ -37,7 +41,7 @@ if [ $(expr "$1" : "--.*") ]; then
v_id=$3
fi
fi
-PATH=/sbin:/usr/sbin:$PATH
+
case "$1" in
--driver-bind)
# driver binding code removed
@@ -46,9 +50,7 @@ case "$1" in
--symlink-name)
device_in "link_list" $v_id $p_id
if [ "$?" = "1" ]; then
- if [ -e "/usr/sbin/usb_modeswitch_dispatcher" ]; then
- exec usb_modeswitch_dispatcher $1 $2 2>>/dev/null
- fi
+ exec $SBINDIR/usb_modeswitch_dispatcher $1 $2 2>>/dev/null
fi
exit 0
;;
@@ -61,15 +63,13 @@ if [ "$p2" = "" -a "$p1" != "" ]; then
p2=$p1
fi

-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-init_path=`readlink -f /sbin/init`
-if [ `basename $init_path` = "systemd" ]; then
+if command -v systemctl > /dev/null; then
systemctl --no-block start usb_modeswitch@$p2.service
-elif [ -e "/etc/init/usb-modeswitch-upstart.conf" ]; then
+elif command -v initctl > /dev/null; then
initctl emit --no-wait usb-modeswitch-upstart UMS_PARAM=$p2
else
# only old distros, new udev will kill all subprocesses
exec 1<&- 2<&- 5<&- 7<&-
- exec usb_modeswitch_dispatcher --switch-mode $p2 &
+ exec $SBINDIR/usb_modeswitch_dispatcher --switch-mode $p2 &
fi
exit 0
diff --git a/usb_modeswitch.tcl b/usb_modeswitch.tcl
index d2ee50c..8a48751 100755
--- a/usb_modeswitch.tcl
+++ b/usb_modeswitch.tcl
@@ -12,6 +12,16 @@
# Part of usb-modeswitch-2.5.2 package
# (C) Josua Dietze 2009-2017

+# Compile-time configuration, injected by the Makefile.
+set setup(sbindir) /usr/sbin
+set setup(etcdir) /etc
+
+# External dependency default location
+set setup(dbdir) /usr/share/usb_modeswitch
+
+# Derived configuration
+set setup(dbdir_etc) $setup(etcdir)/usb_modeswitch.d
+
set arg0 [lindex $argv 0]
if [regexp {\.tcl$} $arg0] {
if [file exists $arg0] {
@@ -91,10 +101,8 @@ if {![regexp {(.*?):.*$} $arg1 d device]} {
}
set flags(logwrite) 1

-set setup(dbdir) /usr/share/usb_modeswitch
-set setup(dbdir_etc) /etc/usb_modeswitch.d
if {![file exists $setup(dbdir)] && ![file exists $setup(dbdir_etc)]} {
- Log "\nError: no config database found in /usr/share or /etc. Exit"
+ Log "\nError: no config database found in $setup(dbdir) or $setup(dbdir_etc). Exit"
SafeExit
}

@@ -261,7 +269,7 @@ if {$config(NoMBIMCheck)==0 && $usb(bNumConfigurations) > 1} {
if [CheckMBIM] {
Log " driver for MBIM devices is available"
Log "Find MBIM configuration number ..."
- if [catch {set cfgno [exec /usr/sbin/usb_modeswitch -j -Q $busParam $devParam -v $usb(idVendor) -p $usb(idProduct)]} err] {
+ if [catch {set cfgno [exec $setup(sbindir)/usb_modeswitch -j -Q $busParam $devParam -v $usb(idVendor) -p $usb(idProduct)]} err] {
Log "Error when trying to find MBIM configuration, switch to legacy modem mode"
} else {
set cfgno [string trim $cfgno]
@@ -297,7 +305,7 @@ if {$report == ""} {
# Now we are actually switching
if $flags(logging) {
Log "Command line:\nusb_modeswitch -W -D $configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f \$flags(config)"
- catch {set report [exec /usr/sbin/usb_modeswitch -W -D $configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f "$flags(config)" 2>@1]} report
+ catch {set report [exec $setup(sbindir)/usb_modeswitch -W -D $configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f "$flags(config)" 2>@1]} report
Log "\nVerbose debug output of usb_modeswitch and libusb follows"
Log "(Note that some USB errors are to be expected in the process)"
Log "--------------------------------"
@@ -305,7 +313,7 @@ if {$report == ""} {
Log "--------------------------------"
Log "(end of usb_modeswitch output)\n"
} else {
- catch {set report [exec /usr/sbin/usb_modeswitch -Q -D $configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f "$flags(config)" 2>@1]} report
+ catch {set report [exec $setup(sbindir)/usb_modeswitch -Q -D $configParam $busParam $devParam -v $usb(idVendor) -p $usb(idProduct) -f "$flags(config)" 2>@1]} report
}
}

@@ -498,9 +506,9 @@ return 1

proc {ParseGlobalConfig} {} {

-global flags
+global flags setup
set configFile ""
-set places [list /etc/usb_modeswitch.conf /etc/sysconfig/usb_modeswitch /etc/default/usb_modeswitch]
+set places [list $setup(etcdir)/usb_modeswitch.conf $setup(etcdir)/sysconfig/usb_modeswitch $setup(etcdir)/default/usb_modeswitch]
foreach cfg $places {
if [file exists $cfg] {
set configFile $cfg
@@ -897,10 +905,12 @@ proc {SysLog} {msg} {

global flags
if {![info exists flags(logger)]} {
- set flags(logger) ""
- foreach fn {/bin/logger /usr/bin/logger} {
- if [file exists $fn] {
- set flags(logger) $fn
+ set flags(logger) [exec sh -c "command -v logger || true"]
+ if {$flags(logger) == ""} {
+ foreach fn {/bin/logger /usr/bin/logger} {
+ if [file exists $fn] {
+ set flags(logger) $fn
+ }
}
}
Log "Logger is $flags(logger)"
diff --git a/usb_modeswitch@.service b/usb_modeswitch@.service
index f74a8bf..90cb96a 100644
--- a/usb_modeswitch@.service
+++ b/usb_modeswitch@.service
@@ -3,6 +3,6 @@ Description=USB_ModeSwitch_%i

[Service]
Type=oneshot
-ExecStart=/usr/sbin/usb_modeswitch_dispatcher --switch-mode %i
+ExecStart=@sbindir@/usb_modeswitch_dispatcher --switch-mode %i
#ExecStart=/bin/echo %i

7 changes: 5 additions & 2 deletions pkgs/development/tools/misc/usb-modeswitch/data.nix
Original file line number Diff line number Diff line change
@@ -9,10 +9,13 @@ stdenv.mkDerivation rec {
sha256 = "1ygahl3r26r38ai8yyblq9nhf3v5i6n6r6672p5wf88wg5h9n0rz";
};

inherit (usb-modeswitch) makeFlags;
makeFlags = [
"PREFIX=$(out)"
"DESTDIR=$(out)"
];

prePatch = ''
sed -i 's@usb_modeswitch@${usb-modeswitch}/bin/usb_modeswitch@g' 40-usb_modeswitch.rules
sed -i 's@usb_modeswitch@${usb-modeswitch}/lib/udev/usb_modeswitch@g' 40-usb_modeswitch.rules
'';

# we add tcl here so we can patch in support for new devices by dropping config into
30 changes: 22 additions & 8 deletions pkgs/development/tools/misc/usb-modeswitch/default.nix
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{ stdenv, fetchurl, pkgconfig, libusb1 }:
{ stdenv, lib, fetchurl, pkgconfig, makeWrapper
, libusb1, tcl, utillinux, coreutils, bash }:

stdenv.mkDerivation rec {
pname = "usb-modeswitch";
@@ -9,19 +10,32 @@ stdenv.mkDerivation rec {
sha256 = "18wbbxc5cfsmikba0msdvd5qlaga27b32nhrzicyd9mdddp265f2";
};

patches = [ ./configurable-usb-modeswitch.patch ];

# Remove attempts to write to /etc and /var/lib.
postPatch = ''
sed -i \
-e '/^\tinstall .* usb_modeswitch.conf/s,$(ETCDIR),$(out)/etc,' \
-e '\,^\tinstall -d .*/var/lib/usb_modeswitch,d' \
Makefile
'';

makeFlags = [
"DESTDIR=$(out)"
"PREFIX=$(out)"
"ETCDIR=/etc"
"USE_UPSTART=false"
"USE_SYSTEMD=true"
"SYSDIR=$(out)/lib/systemd/system"
"UDEVDIR=$(out)/lib/udev"
];

# make clean: we always build from source. It should be necessary on x86_64 only
preConfigure = ''
find -type f | xargs sed 's@/bin/rm@rm@g' -i
make clean
postFixup = ''
wrapProgram $out/bin/usb_modeswitch_dispatcher \
--set PATH ${lib.makeBinPath [ utillinux coreutils bash ]}
'';

buildInputs = [ libusb1 ];
nativeBuildInputs = [ pkgconfig ];
buildInputs = [ libusb1 tcl ];
nativeBuildInputs = [ pkgconfig makeWrapper ];

meta = with stdenv.lib; {
description = "A mode switching tool for controlling 'multi-mode' USB devices";
4 changes: 2 additions & 2 deletions pkgs/os-specific/linux/kernel/linux-libre.nix
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{ stdenv, lib, fetchsvn, linux
, scripts ? fetchsvn {
url = "https://www.fsfla.org/svn/fsfla/software/linux-libre/releases/branches/";
rev = "17192";
sha256 = "0hyd7wp73w4555d42xcvk4x4nxrfckbzah2ckb4d2aqzxab87789";
rev = "17198";
sha256 = "0cr7jpag6kr3iili5zmv1iimi5a1c175dcj8qvhcspwkbv7f17mp";
}
, ...
}:
4 changes: 2 additions & 2 deletions pkgs/os-specific/linux/kernel/linux-testing.nix
Original file line number Diff line number Diff line change
@@ -3,15 +3,15 @@
with stdenv.lib;

buildLinux (args // rec {
version = "5.5-rc5";
version = "5.5-rc6";
extraMeta.branch = "5.5";

# modDirVersion needs to be x.y.z, will always add .0
modDirVersion = if (modDirVersionArg == null) then builtins.replaceStrings ["-"] [".0-"] version else modDirVersionArg;

src = fetchurl {
url = "https://git.kernel.org/torvalds/t/linux-${version}.tar.gz";
sha256 = "0h5ks0c0pdl0awiysqja6ky5ykhjcdicc01wi01wzhjklq9j0lmq";
sha256 = "0y4rsxynn0qprrsxy4v5vr4ihhavn43yqqp1qfrrxsfw15djncc2";
};

# Should the testing kernels ever be built on Hydra?
2 changes: 2 additions & 0 deletions pkgs/top-level/python-packages.nix
Original file line number Diff line number Diff line change
@@ -903,6 +903,8 @@ in {

oauthenticator = callPackage ../development/python-modules/oauthenticator { };

onnx = callPackage ../development/python-modules/onnx { };

ordered-set = callPackage ../development/python-modules/ordered-set { };

ortools = (toPythonModule (pkgs.or-tools.override {