This reverts commitwip/yesmanf19b7b03a0
, reversing changes made to572a864d02
. Sorry. I pushed the wrong staging-next (the one that had my master merged in). This was not intended.
parent
f19b7b03a0
commit
c2fca99f97
@ -0,0 +1,51 @@ |
||||
#! @perl@/bin/perl -w @perlFlags@ |
||||
|
||||
use strict; |
||||
use DBI; |
||||
use DBD::SQLite; |
||||
use String::ShellQuote; |
||||
use Config; |
||||
|
||||
my $program = $ARGV[0]; |
||||
|
||||
my $dbPath = "@dbPath@"; |
||||
|
||||
my $dbh = DBI->connect("dbi:SQLite:dbname=$dbPath", "", "") |
||||
or die "cannot open database `$dbPath'"; |
||||
$dbh->{RaiseError} = 0; |
||||
$dbh->{PrintError} = 0; |
||||
|
||||
my $system = $ENV{"NIX_SYSTEM"} // $Config{myarchname}; |
||||
|
||||
my $res = $dbh->selectall_arrayref( |
||||
"select package from Programs where system = ? and name = ?", |
||||
{ Slice => {} }, $system, $program); |
||||
|
||||
if (!defined $res || scalar @$res == 0) { |
||||
print STDERR "$program: command not found\n"; |
||||
} elsif (scalar @$res == 1) { |
||||
my $package = @$res[0]->{package}; |
||||
if ($ENV{"NIX_AUTO_INSTALL"} // "") { |
||||
print STDERR <<EOF; |
||||
The program ‘$program’ is currently not installed. It is provided by |
||||
the package ‘$package’, which I will now install for you. |
||||
EOF |
||||
; |
||||
exit 126 if system("nix-env", "-iA", "nixos.$package") == 0; |
||||
} elsif ($ENV{"NIX_AUTO_RUN"} // "") { |
||||
exec("nix-shell", "-p", $package, "--run", shell_quote("exec", @ARGV)); |
||||
} else { |
||||
print STDERR <<EOF; |
||||
The program ‘$program’ is currently not installed. You can install it by typing: |
||||
nix-env -iA nixos.$package |
||||
EOF |
||||
} |
||||
} else { |
||||
print STDERR <<EOF; |
||||
The program ‘$program’ is currently not installed. It is provided by |
||||
several packages. You can install it by typing one of the following: |
||||
EOF |
||||
print STDERR " nix-env -iA nixos.$_->{package}\n" foreach @$res; |
||||
} |
||||
|
||||
exit 127; |
@ -1,18 +0,0 @@ |
||||
{ stdenv, rustPlatform, pkgconfig, sqlite |
||||
, dbPath ? "/nix/var/nix/profiles/per-user/root/channels/nixos/programs.sqlite" }: |
||||
|
||||
rustPlatform.buildRustPackage { |
||||
name = "command-not-found"; |
||||
src = ./rust; |
||||
|
||||
DB_PATH = dbPath; |
||||
NIX_SYSTEM = stdenv.system; |
||||
|
||||
postInstall = '' |
||||
strip $out/bin/command-not-found |
||||
''; |
||||
|
||||
buildInputs = [ sqlite ]; |
||||
nativeBuildInputs = [ pkgconfig ]; |
||||
cargoSha256 = "13q61bb4b1q40g424pbssyp3ln79q1a33vmyz9s9wlqnac34cibd"; |
||||
} |
@ -1,131 +0,0 @@ |
||||
# This file is automatically @generated by Cargo. |
||||
# It is not intended for manual editing. |
||||
[[package]] |
||||
name = "bitflags" |
||||
version = "1.2.1" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
|
||||
[[package]] |
||||
name = "command-not-found" |
||||
version = "0.1.0" |
||||
dependencies = [ |
||||
"rusqlite 0.23.1 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
] |
||||
|
||||
[[package]] |
||||
name = "fallible-iterator" |
||||
version = "0.2.0" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
|
||||
[[package]] |
||||
name = "fallible-streaming-iterator" |
||||
version = "0.1.9" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
|
||||
[[package]] |
||||
name = "libc" |
||||
version = "0.2.70" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
|
||||
[[package]] |
||||
name = "libsqlite3-sys" |
||||
version = "0.18.0" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
dependencies = [ |
||||
"pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
"vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
] |
||||
|
||||
[[package]] |
||||
name = "linked-hash-map" |
||||
version = "0.5.3" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
|
||||
[[package]] |
||||
name = "lru-cache" |
||||
version = "0.1.2" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
dependencies = [ |
||||
"linked-hash-map 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
] |
||||
|
||||
[[package]] |
||||
name = "memchr" |
||||
version = "2.3.3" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
|
||||
[[package]] |
||||
name = "pkg-config" |
||||
version = "0.3.17" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
|
||||
[[package]] |
||||
name = "rusqlite" |
||||
version = "0.23.1" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
dependencies = [ |
||||
"bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
"fallible-iterator 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
"fallible-streaming-iterator 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
"libsqlite3-sys 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
"lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
"memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
"smallvec 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
"time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
] |
||||
|
||||
[[package]] |
||||
name = "smallvec" |
||||
version = "1.4.0" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
|
||||
[[package]] |
||||
name = "time" |
||||
version = "0.1.43" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
dependencies = [ |
||||
"libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
"winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
] |
||||
|
||||
[[package]] |
||||
name = "vcpkg" |
||||
version = "0.2.8" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
|
||||
[[package]] |
||||
name = "winapi" |
||||
version = "0.3.8" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
dependencies = [ |
||||
"winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
"winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)", |
||||
] |
||||
|
||||
[[package]] |
||||
name = "winapi-i686-pc-windows-gnu" |
||||
version = "0.4.0" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
|
||||
[[package]] |
||||
name = "winapi-x86_64-pc-windows-gnu" |
||||
version = "0.4.0" |
||||
source = "registry+https://github.com/rust-lang/crates.io-index" |
||||
|
||||
[metadata] |
||||
"checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" |
||||
"checksum fallible-iterator 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "4443176a9f2c162692bd3d352d745ef9413eec5782a80d8fd6f8a1ac692a07f7" |
||||
"checksum fallible-streaming-iterator 0.1.9 (registry+https://github.com/rust-lang/crates.io-index)" = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" |
||||
"checksum libc 0.2.70 (registry+https://github.com/rust-lang/crates.io-index)" = "3baa92041a6fec78c687fa0cc2b3fae8884f743d672cf551bed1d6dac6988d0f" |
||||
"checksum libsqlite3-sys 0.18.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1e704a02bcaecd4a08b93a23f6be59d0bd79cd161e0963e9499165a0a35df7bd" |
||||
"checksum linked-hash-map 0.5.3 (registry+https://github.com/rust-lang/crates.io-index)" = "8dd5a6d5999d9907cda8ed67bbd137d3af8085216c2ac62de5be860bd41f304a" |
||||
"checksum lru-cache 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "31e24f1ad8321ca0e8a1e0ac13f23cb668e6f5466c2c57319f6a5cf1cc8e3b1c" |
||||
"checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" |
||||
"checksum pkg-config 0.3.17 (registry+https://github.com/rust-lang/crates.io-index)" = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" |
||||
"checksum rusqlite 0.23.1 (registry+https://github.com/rust-lang/crates.io-index)" = "45d0fd62e1df63d254714e6cb40d0a0e82e7a1623e7a27f679d851af092ae58b" |
||||
"checksum smallvec 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7cb5678e1615754284ec264d9bb5b4c27d2018577fd90ac0ceb578591ed5ee4" |
||||
"checksum time 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)" = "ca8a50ef2360fbd1eeb0ecd46795a87a19024eb4b53c5dc916ca1fd95fe62438" |
||||
"checksum vcpkg 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "3fc439f2794e98976c88a2a2dafce96b930fe8010b0a256b3c2199a773933168" |
||||
"checksum winapi 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)" = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" |
||||
"checksum winapi-i686-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" |
||||
"checksum winapi-x86_64-pc-windows-gnu 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" |
@ -1,10 +0,0 @@ |
||||
[package] |
||||
name = "command-not-found" |
||||
version = "0.1.0" |
||||
edition = "2018" |
||||
|
||||
[dependencies] |
||||
rusqlite = "0.*.*" |
||||
|
||||
[profile.release] |
||||
lto = true |
@ -1,52 +0,0 @@ |
||||
use rusqlite::{params, Connection, Result}; |
||||
use std::env; |
||||
use std::process::exit; |
||||
|
||||
const NIX_SYSTEM: &str = env!("NIX_SYSTEM"); |
||||
const DB_PATH: &str = env!("DB_PATH"); |
||||
|
||||
fn query_packages(system: &str, program: &str) -> Result<Vec<String>> { |
||||
Ok(Connection::open(DB_PATH)? |
||||
.prepare("select package from Programs where system = ? and name = ?;")? |
||||
.query_map(params![system, program], |row| row.get("package"))? |
||||
.collect::<Result<Vec<String>>>()?) |
||||
} |
||||
|
||||
fn run_app() -> i32 { |
||||
let args: Vec<_> = env::args().collect(); |
||||
if args.len() < 2 { |
||||
eprintln!("USAGE: {} PROGRAMNAME", args[0]); |
||||
return 1; |
||||
} |
||||
let program = &args[1]; |
||||
let system = env::var("NIX_SYSTEM").unwrap_or_else(|_| NIX_SYSTEM.to_string()); |
||||
let packages = match query_packages(&system, program) { |
||||
Ok(packages) => packages, |
||||
Err(err) => { |
||||
eprintln!("Failed to query package database: {}", err); |
||||
return 1; |
||||
} |
||||
}; |
||||
if packages.is_empty() { |
||||
eprintln!("{}: command not found", program); |
||||
} else { |
||||
let advice = if packages.len() > 1 { |
||||
"It is provided by several packages. You can install it by typing on of the of following commands:" |
||||
} else { |
||||
"You can install it by typing:" |
||||
}; |
||||
eprintln!( |
||||
"The program '{}' is currently not installed. {}", |
||||
program, advice |
||||
); |
||||
for pkg in packages { |
||||
eprintln!(" nix-env -iA nixos.{}", pkg); |
||||
} |
||||
} |
||||
|
||||
127 |
||||
} |
||||
|
||||
fn main() { |
||||
exit(run_app()); |
||||
} |
File diff suppressed because it is too large
Load Diff
@ -1,35 +0,0 @@ |
||||
From 5dd2593369645b11a9dc03e1930617d2f5dbd039 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?J=C3=B6rg=20Thalheim?= <joerg@thalheim.io>
|
||||
Date: Wed, 11 Nov 2020 11:48:49 +0100
|
||||
Subject: [PATCH] hardcode json file path
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Signed-off-by: Jörg Thalheim <joerg@thalheim.io>
|
||||
---
|
||||
wee_slack.py | 8 +-------
|
||||
1 file changed, 1 insertion(+), 7 deletions(-)
|
||||
|
||||
diff --git a/wee_slack.py b/wee_slack.py
|
||||
index a3d779c..5942289 100644
|
||||
--- a/wee_slack.py
|
||||
+++ b/wee_slack.py
|
||||
@@ -5136,13 +5136,7 @@ def create_slack_debug_buffer():
|
||||
|
||||
def load_emoji():
|
||||
try:
|
||||
- weechat_dir = w.info_get('weechat_dir', '')
|
||||
- weechat_sharedir = w.info_get('weechat_sharedir', '')
|
||||
- local_weemoji, global_weemoji = ('{}/weemoji.json'.format(path)
|
||||
- for path in (weechat_dir, weechat_sharedir))
|
||||
- path = (global_weemoji if os.path.exists(global_weemoji) and
|
||||
- not os.path.exists(local_weemoji) else local_weemoji)
|
||||
- with open(path, 'r') as ef:
|
||||
+ with open('@out@/share/wee-slack/weemoji.json', 'r') as ef:
|
||||
emojis = json.loads(ef.read())
|
||||
if 'emoji' in emojis:
|
||||
print_error('The weemoji.json file is in an old format. Please update it.')
|
||||
--
|
||||
2.29.0
|
||||
|
@ -0,0 +1,12 @@ |
||||
--- a/wee_slack.py
|
||||
+++ b/wee_slack.py
|
||||
@@ -4560,8 +4560,7 @@
|
||||
|
||||
def load_emoji():
|
||||
try:
|
||||
- DIR = w.info_get('weechat_dir', '')
|
||||
- with open('{}/weemoji.json'.format(DIR), 'r') as ef:
|
||||
+ with open('@out@/share/wee-slack/weemoji.json', 'r') as ef:
|
||||
emojis = json.loads(ef.read())
|
||||
if 'emoji' in emojis:
|
||||
print_error('The weemoji.json file is in an old format. Please update it.')
|
@ -1,26 +0,0 @@ |
||||
{ stdenv, fetchurl, undmg }: |
||||
|
||||
stdenv.mkDerivation { |
||||
pname = "iina"; |
||||
version = "1.1.2"; |
||||
|
||||
src = fetchurl { |
||||
url = "https://github.com/iina/iina/releases/download/v1.0.7-beta2/IINA.v1.0.7-beta2.dmg"; |
||||
sha256 = "1w0l3b1kar9zglqkildcqhlwara6zy2p3x79kqa2d0b43nqka82n"; |
||||
}; |
||||
|
||||
buildInputs = [ undmg ]; |
||||
installPhase = '' |
||||
mkdir -p "$out/Applications/IINA.app" |
||||
cp -R . "$out/Applications/IINA.app" |
||||
chmod +x "$out/Applications/IINA.app/Contents/MacOS/IINA" |
||||
''; |
||||
|
||||
meta = with stdenv.lib; { |
||||
description = "The modern video player for macOS."; |
||||
homepage = "http://https://iina.io/"; |
||||
license = licenses.gpl3; |
||||
platforms = platforms.darwin; |
||||
maintainers = with maintainers; [ mic92 ]; |
||||
}; |
||||
} |
@ -1,16 +0,0 @@ |
||||
{ lib |
||||
, buildPythonPackage |
||||
, keystone |
||||
}: |
||||
|
||||
buildPythonPackage rec { |
||||
inherit (keystone) pname src version buildInputs nativeBuildInputs; |
||||
|
||||
dontUseCmakeConfigure = 1; |
||||
preBuild = "cd bindings/python"; |
||||
|
||||
meta = with lib; { |
||||
inherit (keystone.meta) description license homepage; |
||||
maintainers = [ maintainers.mic92 ]; |
||||
}; |
||||
} |
@ -1,31 +0,0 @@ |
||||
{ lib |
||||
, buildPythonPackage |
||||
, fetchPypi |
||||
, numpy |
||||
, cython |
||||
}: |
||||
|
||||
buildPythonPackage rec { |
||||
pname = "pyworld"; |
||||
version = "0.2.12"; |
||||
|
||||
src = fetchPypi { |
||||
inherit pname version; |
||||
sha256 = "896c910696975855578d855f490f94d7a57119e0a75f7f15e11fdf58ba891627"; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ |
||||
cython |
||||
]; |
||||
|
||||
propagatedBuildInputs = [ |
||||
numpy |
||||
]; |
||||
|
||||
meta = with lib; { |
||||
description = "PyWorld is a Python wrapper for WORLD vocoder"; |
||||
homepage = https://github.com/JeremyCCHsu/Python-Wrapper-for-World-Vocoder; |
||||
license = licenses.mit; |
||||
maintainers = [ maintainers.mic92 ]; |
||||
}; |
||||
} |
@ -1,42 +0,0 @@ |
||||
{ stdenv, lib, fetchFromGitHub, python3, installShellFiles }: |
||||
|
||||
stdenv.mkDerivation rec { |
||||
pname = "amazon-ec2-utils"; |
||||
version = "1.3"; |
||||
|
||||
src = fetchFromGitHub { |
||||
owner = "aws"; |
||||
repo = "amazon-ec2-utils"; |
||||
rev = version; |
||||
sha256 = "sha256-uxKnbdKGhS32kY3mA7YYtDRwKcEjNZPJUYQExZTqtxE="; |
||||
}; |
||||
|
||||
buildInputs = [ python3 ]; |
||||
# TODO next version will have manpages |
||||
#nativeBuildInputs = [ installShellFiles ]; |
||||
|
||||
installPhase = '' |
||||
# https://github.com/aws/amazon-ec2-utils/blob/8eb2effb1aea2280264d66ae58b3e156e6d429f9/amazon-ec2-utils.spec#L74 |
||||
install -D --target $out/etc/udev/rules.d *.rules |
||||
install -D --target $out/bin ec2-metadata ebsnvme-id ec2udev-vbd ec2udev-vcpu |
||||
install -D --target $out/lib/udev/ ec2nvme-nsid |
||||
# TODO next version will have manpages |
||||
#installManPage doc/* |
||||
''; |
||||
|
||||
postFixup = '' |
||||
for i in $out/etc/udev/rules.d/*.rules; do |
||||
substituteInPlace "$i" \ |
||||
--replace '/sbin' "$out/bin" |
||||
done |
||||
substituteInPlace "$out/etc/udev/rules.d/70-ec2-nvme-devices.rules" \ |
||||
--replace 'ec2nvme-nsid' "$out/lib/udev/ec2nvme-nsid" |
||||
''; |
||||
|
||||
meta = { |
||||
description = "A set of tools for running in EC2"; |
||||
homepage = "https://aws.amazon.com/amazon-linux-ami/"; |
||||
license = lib.licenses.asl20; |
||||
maintainers = with lib.maintainers; [ thefloweringash ]; |
||||
}; |
||||
} |
@ -0,0 +1,47 @@ |
||||
{ stdenv, lib, rpmextract, fetchurl, python2, tree }: |
||||
|
||||
stdenv.mkDerivation { |
||||
name = "ec2-utils"; |
||||
version = "0.5.1"; |
||||
|
||||
# The url can be determined by booting an "Amazon Linux 2" and running: |
||||
# > yumdownloader --urls ec2-utils |
||||
src = fetchurl { |
||||
url = "http://amazonlinux.ap-northeast-1.amazonaws.com/blobstore/a3b4d2c35c2300518fe10381a05b3bd7936ff5cdd3d351143a11bf84073d9e00/ec2-utils-0.5-1.amzn2.0.1.noarch.rpm"; |
||||
sha256 = "004y7l3q9gqi78a53lykrpsnz4yp7dds1083w67m2013bk1x5d53"; |
||||
}; |
||||
|
||||
nativeBuildInputs = [ rpmextract ]; |
||||
|
||||
buildInputs = [ python2 ]; |
||||
|
||||
unpackPhase = '' |
||||
mkdir source |
||||
cd source |
||||
rpmextract "$src" |
||||
''; |
||||
|
||||
installPhase = '' |
||||
mkdir $out |
||||
|
||||
mv --target-directory $out \ |
||||
etc sbin usr/bin usr/lib |
||||
''; |
||||
|
||||
postFixup = '' |
||||
for i in $out/etc/udev/rules.d/*.rules; do |
||||
substituteInPlace "$i" \ |
||||
--replace '/sbin' "$out/bin" |
||||
done |
||||
|
||||
substituteInPlace "$out/etc/udev/rules.d/70-ec2-nvme-devices.rules" \ |
||||
--replace 'ec2nvme-nsid' "$out/lib/udev/ec2nvme-nsid" |
||||
''; |
||||
|
||||
meta = { |
||||
description = "A set of tools for running in EC2"; |
||||
homepage = "https://aws.amazon.com/amazon-linux-ami/"; |
||||
license = lib.licenses.asl20; |
||||
maintainers = with lib.maintainers; [ thefloweringash ]; |
||||
}; |
||||
} |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue