Merge staging-next into staging
This commit is contained in:
commit
01b0aa0bc6
@ -1294,6 +1294,33 @@
|
||||
example.
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
Existing <literal>resholve*</literal> functions have been
|
||||
renamed and nested under <literal>pkgs.resholve</literal>.
|
||||
Update uses to:
|
||||
</para>
|
||||
<itemizedlist spacing="compact">
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>resholvePackage</literal> ->
|
||||
<literal>resholve.mkDerivation</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>resholveScript</literal> ->
|
||||
<literal>resholve.writeScript</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>resholveScriptBin</literal> ->
|
||||
<literal>resholve.writeScriptBin</literal>
|
||||
</para>
|
||||
</listitem>
|
||||
</itemizedlist>
|
||||
</listitem>
|
||||
<listitem>
|
||||
<para>
|
||||
<literal>pkgs.cosmopolitan</literal> no longer provides the
|
||||
|
@ -456,6 +456,11 @@ In addition to numerous new and upgraded packages, this release has the followin
|
||||
|
||||
See the `vscode` package for a more detailed example.
|
||||
|
||||
- Existing `resholve*` functions have been renamed and nested under `pkgs.resholve`. Update uses to:
|
||||
- `resholvePackage` -> `resholve.mkDerivation`
|
||||
- `resholveScript` -> `resholve.writeScript`
|
||||
- `resholveScriptBin` -> `resholve.writeScriptBin`
|
||||
|
||||
- `pkgs.cosmopolitan` no longer provides the `cosmoc` command. It has been moved to `pkgs.cosmoc`.
|
||||
|
||||
<!-- To avoid merge conflicts, consider adding your item at an arbitrary place in the list instead. -->
|
||||
|
@ -14,17 +14,17 @@ let
|
||||
archive_fmt = if stdenv.isDarwin then "zip" else "tar.gz";
|
||||
|
||||
sha256 = {
|
||||
x86_64-linux = "077a847p8l2yk3dpn8qqwjdch5nqm8a7fxlnwg5xzx892lr6l4ax";
|
||||
x86_64-darwin = "03gbrnkzks4if3mkpwn4yjajj3z9cax0jskhw8pz5n1mibv4kg4p";
|
||||
aarch64-linux = "0xqpc69m5jmm6dyvhlc20bpbr2czmi0pn00jxpf5md8fqxmbvj90";
|
||||
aarch64-darwin = "1zd2s841xpq5fk6bkrbqbzbcyladpp8sp7wx2spkzj1gmbjfzw4a";
|
||||
armv7l-linux = "1swbg3zklixyk3cf0nh0xcwszm9rrvw1caqzmb80lc3c7qx9qx1s";
|
||||
x86_64-linux = "1j75ivy7lwxjpfhwsikk517a9bxhrbwfy8f8liql392839qryblj";
|
||||
x86_64-darwin = "0sjsrm31rbgq9j6hnry8f69mhhwlsd7drzz5jr31ljk75vgx3j8f";
|
||||
aarch64-linux = "1ll28djzf5xvc0yin1irxzn3nkizpgfz0azknaycjar261q3akdp";
|
||||
aarch64-darwin = "0mfhbdmz0db851mab83dmq654gwgdz9p20igwm9g5h4y6zrvdhg6";
|
||||
armv7l-linux = "1vicvzdj83vcj64rla9v5n9bmi0wgz507xxch3anjszah3n7ld89";
|
||||
}.${system};
|
||||
in
|
||||
callPackage ./generic.nix rec {
|
||||
# Please backport all compatible updates to the stable release.
|
||||
# This is important for the extension ecosystem.
|
||||
version = "1.66.0";
|
||||
version = "1.66.1";
|
||||
pname = "vscode";
|
||||
|
||||
executableName = "code" + lib.optionalString isInsiders "-insiders";
|
||||
|
@ -13,10 +13,10 @@ let
|
||||
archive_fmt = if system == "x86_64-darwin" then "zip" else "tar.gz";
|
||||
|
||||
sha256 = {
|
||||
x86_64-linux = "0dv28i8mxf45n7xj4gzgh4gsx76875nxs4yfqswxij8kzz72vqfn";
|
||||
x86_64-darwin = "0xs4f1ffqcbvzw1v64f9l8i7rflz7h1j5xgjxdz6l0hw0j4aalb2";
|
||||
aarch64-linux = "1fa7g531apigp8k7fxkp2ijmhz5axx7ixzdhlwgbsb80rb2mqhi0";
|
||||
armv7l-linux = "1ry9qm6rk46s0jn7hl30jbjdhi3fshzcs0x9krd9qin7by18hhz3";
|
||||
x86_64-linux = "0r5bzy1r9f0rp2wvcb703vpcfclqn8d4n9g8p9021hz0llslfha7";
|
||||
x86_64-darwin = "15aawk2b7a5dack2bgnp4axki8y3n0ilncww15sjnvwbgk94d4pg";
|
||||
aarch64-linux = "0kq39jx9nrfikcfcylz2gcg2d89yw6gf9sc8blyg1yfimfr9jcjv";
|
||||
armv7l-linux = "0581ksdb1j9xsin7s505gk9kxhf3i5dw8yvyfkxck84wrrvfh6pq";
|
||||
}.${system};
|
||||
|
||||
sourceRoot = {
|
||||
@ -31,7 +31,7 @@ in
|
||||
|
||||
# Please backport all compatible updates to the stable release.
|
||||
# This is important for the extension ecosystem.
|
||||
version = "1.66.0";
|
||||
version = "1.66.1";
|
||||
pname = "vscodium";
|
||||
|
||||
executableName = "codium";
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "cloudflared";
|
||||
version = "2022.3.4";
|
||||
version = "2022.4.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "cloudflare";
|
||||
repo = "cloudflared";
|
||||
rev = version;
|
||||
hash = "sha256-W3XA3AOzuyHlFCps2ne4Fh2X+E48inJT4QrDJLOeD5M=";
|
||||
hash = "sha256-+40OK2q4WdvlLhoPfZH6q+pghgS7ZLmaZl2VbZK4rdA=";
|
||||
};
|
||||
|
||||
vendorSha256 = null;
|
||||
@ -22,6 +22,6 @@ buildGoModule rec {
|
||||
homepage = "https://www.cloudflare.com/products/tunnel";
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.unix;
|
||||
maintainers = with maintainers; [ bbigras enorris thoughtpolice ];
|
||||
maintainers = with maintainers; [ bbigras enorris thoughtpolice techknowlogick ];
|
||||
};
|
||||
}
|
||||
|
@ -15,16 +15,16 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "git-branchless";
|
||||
version = "0.3.10";
|
||||
version = "0.3.12";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "arxanas";
|
||||
repo = "git-branchless";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-TLqAU1/olSS59Zeb+2m9Jq19EYTO1TnbKPYciHPKO2A=";
|
||||
sha256 = "sha256-1bUHltONLfJumkxPnzGJFMMyS02LVqjpDL+KgiewyoQ=";
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-sA4KWGW4bxGUkotTWHUcRqcoaUJsSUCTK8hUkKiRcnY=";
|
||||
cargoSha256 = "sha256-3+ULHqtKAhf4AdoLPK/3IqnfOcskoh6ctlQnY1oTHJ8=";
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, resholvePackage
|
||||
, resholve
|
||||
, fetchFromGitHub
|
||||
, git
|
||||
, bash
|
||||
@ -27,7 +27,7 @@ to support their use in yadm.
|
||||
, yadm
|
||||
}:
|
||||
|
||||
resholvePackage rec {
|
||||
resholve.mkDerivation rec {
|
||||
pname = "yadm";
|
||||
version = "3.1.1";
|
||||
|
||||
|
@ -15,16 +15,16 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "i3status-rust";
|
||||
version = "0.21.8";
|
||||
version = "0.21.9";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "greshake";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-l0XfitQSmSkivEg8+XcA/+bWdy/wzIpii/Npc4p8kUw=";
|
||||
sha256 = "sha256-UbQEPY/Qzu3akWqCTdbhO8V46KyNh/4XCA+PySQyNaw=";
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-2rJ9ZZHK1acJu6r6EjuoolLJZMdBsbKgN1DNvGM7deA=";
|
||||
cargoSha256 = "sha256-Bb4kkS0eSg0ue24UIy8f0kwD9w4kSCVTd1OqwEggyVs=";
|
||||
|
||||
nativeBuildInputs = [ pkg-config makeWrapper ];
|
||||
|
||||
|
@ -62,6 +62,13 @@ stdenv.mkDerivation rec {
|
||||
sha256 = "GuIS/4mZFVQuxTtU2VtozfJx2VjPUSzcP+3Hgixu4SM=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix path to libgovf-0.1.so (and libgtk-frdp-0.1.so when enabling rdp meson option)
|
||||
# in the gir file. We patch gobject-introspection to hardcode absolute paths but
|
||||
# our Meson patch will only pass the info when install_dir is absolute as well.
|
||||
./fix-gir-lib-path.patch
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
22
pkgs/desktops/gnome/apps/gnome-boxes/fix-gir-lib-path.patch
Normal file
22
pkgs/desktops/gnome/apps/gnome-boxes/fix-gir-lib-path.patch
Normal file
@ -0,0 +1,22 @@
|
||||
--- a/subprojects/libovf-glib/govf/meson.build
|
||||
+++ b/subprojects/libovf-glib/govf/meson.build
|
||||
@@ -39,7 +39,7 @@ govf_lib = shared_library('govf-' + api_version,
|
||||
govf_sources,
|
||||
dependencies: govf_deps,
|
||||
install: true,
|
||||
- install_dir: libdir
|
||||
+ install_dir: get_option ('prefix') / libdir
|
||||
)
|
||||
|
||||
govf_dep = declare_dependency(
|
||||
--- a/subprojects/gtk-frdp/src/meson.build
|
||||
+++ b/subprojects/gtk-frdp/src/meson.build
|
||||
@@ -50,7 +50,7 @@ gtk_frdp_lib = shared_library('gtk-frdp-' + api_version,
|
||||
gtk_frdp_sources,
|
||||
dependencies: gtk_frdp_deps,
|
||||
install: true,
|
||||
- install_dir: libdir
|
||||
+ install_dir: get_option ('prefix') / libdir
|
||||
)
|
||||
|
||||
gtk_frdp_dep = declare_dependency(
|
@ -1,7 +1,6 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, fetchurl
|
||||
, fetchpatch
|
||||
, meson
|
||||
, ninja
|
||||
, pkg-config
|
||||
@ -15,27 +14,17 @@
|
||||
, gettext
|
||||
, itstool
|
||||
, desktop-file-utils
|
||||
, adwaita-icon-theme
|
||||
}:
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "hitori";
|
||||
version = "3.38.3";
|
||||
version = "3.38.4";
|
||||
|
||||
src = fetchurl {
|
||||
url = "mirror://gnome/sources/hitori/${lib.versions.majorMinor version}/${pname}-${version}.tar.xz";
|
||||
sha256 = "99cQPLBjP7ATcwExqYw646IWK5+5SZ/H8ZUS1YG/ZWk=";
|
||||
sha256 = "iZPMkfuSN4jjieA+wqp4dtFcErrZIEz2Wy/6DtOSL30=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# Fix build with meson 0.61
|
||||
# data/meson.build:3:0: ERROR: Function does not take positional arguments.
|
||||
(fetchpatch {
|
||||
url = "https://gitlab.gnome.org/GNOME/hitori/-/commit/d25728e122f1d7b985029a5ba96810c3e57c27f7.patch";
|
||||
sha256 = "LwBpFFr+vLacLTpto7PwvO1p2lku6epyEv9YZvUvW+g=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
meson
|
||||
ninja
|
||||
@ -52,7 +41,6 @@ stdenv.mkDerivation rec {
|
||||
glib
|
||||
gtk3
|
||||
cairo
|
||||
adwaita-icon-theme
|
||||
];
|
||||
|
||||
postPatch = ''
|
||||
|
@ -23,13 +23,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "switchboard-plug-keyboard";
|
||||
version = "2.6.0";
|
||||
version = "2.7.0";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "elementary";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-Bl0T+8upTdBnLs03UIimcAg0LO40KwuMZRNSM+y/3Hc=";
|
||||
sha256 = "sha256-ge87rctbd7iR9x9Xq4sMIC09DiPHbpbWBgMZUuJNWbw=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
|
@ -1,7 +1,6 @@
|
||||
{ lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
, fetchpatch
|
||||
, nix-update-script
|
||||
, pkg-config
|
||||
, meson
|
||||
@ -26,29 +25,19 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "gala";
|
||||
version = "6.3.0";
|
||||
version = "6.3.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "elementary";
|
||||
repo = pname;
|
||||
rev = version;
|
||||
sha256 = "sha256-f/WDm9/+lXgplg9tGpct4f+1cOhKgdypwiDRBhewRGw=";
|
||||
sha256 = "sha256-7RZt6gA3wyp1cxIWBYFK+fYFSZDbjHcwYa2snOmDw1Y=";
|
||||
};
|
||||
|
||||
patches = [
|
||||
# We look for plugins in `/run/current-system/sw/lib/` because
|
||||
# there are multiple plugin providers (e.g. gala and wingpanel).
|
||||
./plugins-dir.patch
|
||||
# Session crashes when switching windows with Alt+Tab
|
||||
# https://github.com/elementary/gala/issues/1312
|
||||
(fetchpatch {
|
||||
url = "https://github.com/elementary/gala/commit/cc83db8fe398feae9f3e4caa8352b65f0c8c96d4.patch";
|
||||
sha256 = "sha256-CPO3EHIzqHAV6ZLHngivCdsD8je8CK/NHznfxSEkhzc=";
|
||||
})
|
||||
# WindowSwitcher: Clear indicator background
|
||||
# https://github.com/elementary/gala/pull/1318
|
||||
(fetchpatch {
|
||||
url = "https://github.com/elementary/gala/commit/cce53acffecba795b6cc48916d4621a47996d2c9.patch";
|
||||
sha256 = "sha256-5aTZE6poo4sQMTLfk9Nhw4G4BW8i9dvpWktizRIS58Q=";
|
||||
})
|
||||
];
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -17,13 +17,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "elementary-notifications";
|
||||
version = "6.0.0";
|
||||
version = "6.0.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "elementary";
|
||||
repo = "notifications";
|
||||
rev = version;
|
||||
sha256 = "0jfppafbc8jwhhnillylicz4zfds789d8b31ifsx0qijlxa7kji9";
|
||||
sha256 = "sha256-AEcZVQPAQLa202/Yvq0GihY8BfMEH46iXeQ5u3QvuXg=";
|
||||
};
|
||||
|
||||
nativeBuildInputs = [
|
||||
|
@ -1,4 +1,4 @@
|
||||
{ resholvePackage
|
||||
{ resholve
|
||||
, lib
|
||||
, stdenv
|
||||
, fetchFromGitHub
|
||||
@ -10,7 +10,7 @@
|
||||
, doInstallCheck ? true
|
||||
}:
|
||||
|
||||
resholvePackage rec {
|
||||
resholve.mkDerivation rec {
|
||||
pname = "bats";
|
||||
version = "1.6.0";
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
{
|
||||
# general
|
||||
lib
|
||||
, resholvePackage
|
||||
, resholve
|
||||
, bash
|
||||
, doCheck ? true
|
||||
, doInstallCheck ? true
|
||||
@ -32,7 +32,7 @@ let
|
||||
'';
|
||||
|
||||
in
|
||||
resholvePackage rec {
|
||||
resholve.mkDerivation rec {
|
||||
# bashup.events doesn't version yet but it has two variants with
|
||||
# differing features/performance characteristics:
|
||||
# - branch master: a variant for bash 3.2+
|
||||
|
@ -14,13 +14,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "notcurses";
|
||||
version = "3.0.7";
|
||||
version = "3.0.8";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "dankamongmen";
|
||||
repo = "notcurses";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-tFdxQEYmSFr3GlJMud2ICToR+IB5sGnQkARUd/LtJXg=";
|
||||
sha256 = "sha256-5SNWk1iKDNbyoo413Qvzl2bGaR5Lb+q/UPbPQg7YvRU=";
|
||||
};
|
||||
|
||||
outputs = [ "out" "dev" ];
|
||||
|
34
pkgs/development/misc/datafusion/default.nix
Normal file
34
pkgs/development/misc/datafusion/default.nix
Normal file
@ -0,0 +1,34 @@
|
||||
{ stdenv
|
||||
, lib
|
||||
, rustPlatform
|
||||
, fetchFromGitHub
|
||||
}:
|
||||
let
|
||||
pname = "datafusion-cli";
|
||||
version = "unstable-2022-04-08";
|
||||
in
|
||||
rustPlatform.buildRustPackage {
|
||||
inherit pname version;
|
||||
|
||||
# TODO the crate has been yanked so not the best source
|
||||
# the repo is a workspace with a lock inside a subdirectory, making
|
||||
# compilation from github source not straightforward
|
||||
# re-evaluate strategy on release after 7.0.0
|
||||
src = fetchFromGitHub {
|
||||
owner = "apache";
|
||||
repo = "arrow-datafusion";
|
||||
rev = "9cbde6d0e30fd29f59b0a16e309bdb0843cc7c64";
|
||||
sha256 = "sha256-XXd9jvWVivOBRS0PVOU9F4RQ6MrS/q78JF4S6Htd67w=";
|
||||
};
|
||||
sourceRoot = "source/datafusion-cli";
|
||||
|
||||
cargoSha256 = "sha256-Q0SjVofl1+sex15sSU9s7PgKeHG2b0gJPSqz7YZFOVs=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "cli for Apache Arrow DataFusion";
|
||||
homepage = "https://arrow.apache.org/datafusion";
|
||||
license = licenses.asl20;
|
||||
maintainers = with maintainers; [ happysalada ];
|
||||
platforms = platforms.unix;
|
||||
};
|
||||
}
|
@ -1,9 +1,18 @@
|
||||
# Using resholve's Nix API
|
||||
resholve replaces bare references (subject to a PATH search at runtime) to external commands and scripts with absolute paths.
|
||||
|
||||
resholve converts bare executable references in shell scripts to absolute
|
||||
paths. This will hopefully make its way into the Nixpkgs manual soon, but
|
||||
until then I'll outline how to use the `resholvePackage`, `resholveScript`,
|
||||
and `resholveScriptBin` functions.
|
||||
This small super-power helps ensure script dependencies are declared, present, and don't unexpectedly shift when the PATH changes.
|
||||
|
||||
resholve is developed to enable the Nix package manager to package and integrate Shell projects, but its features are not Nix-specific and inevitably have other applications.
|
||||
|
||||
<!-- generated from resholve's repo; best to suggest edits there (or at least notify me) -->
|
||||
|
||||
This will hopefully make its way into the Nixpkgs manual soon, but
|
||||
until then I'll outline how to use the functions:
|
||||
- `resholve.mkDerivation` (formerly `resholvePackage`)
|
||||
- `resholve.writeScript` (formerly `resholveScript`)
|
||||
- `resholve.writeScriptBin` (formerly `resholveScriptBin`)
|
||||
- `resholve.phraseSolution` (new in resholve 0.8.0)
|
||||
|
||||
> Fair warning: resholve does *not* aspire to resolving all valid Shell
|
||||
> scripts. It depends on the OSH/Oil parser, which aims to support most (but
|
||||
@ -11,7 +20,7 @@ and `resholveScriptBin` functions.
|
||||
|
||||
## API Concepts
|
||||
|
||||
The main difference between `resholvePackage` and other builder functions
|
||||
The main difference between `resholve.mkDerivation` and other builder functions
|
||||
is the `solutions` attrset, which describes which scripts to resolve and how.
|
||||
Each "solution" (k=v pair) in this attrset describes one resholve invocation.
|
||||
|
||||
@ -22,70 +31,81 @@ Each "solution" (k=v pair) in this attrset describes one resholve invocation.
|
||||
> - Packages with scripts that require conflicting directives can use multiple
|
||||
> solutions to resolve the scripts separately, but produce a single package.
|
||||
|
||||
The `resholveScript` and `resholveScriptBin` functions support a _single_
|
||||
`solution` attrset. This is basically the same as any single solution in `resholvePackage`, except that it doesn't need a `scripts` attr (it is automatically added).
|
||||
`resholve.writeScript` and `resholve.writeScriptBin` support a _single_
|
||||
`solution` attrset. This is basically the same as any single solution in `resholve.mkDerivation`, except that it doesn't need a `scripts` attr (it is automatically added). `resholve.phraseSolution` also only accepts a single solution--but it _does_ still require the `scripts` attr.
|
||||
|
||||
## Basic `resholvePackage` Example
|
||||
## Basic `resholve.mkDerivation` Example
|
||||
|
||||
Here's a simple example from one of my own projects, with annotations:
|
||||
<!--
|
||||
TODO: ideally this will use a nixpkgs example; but we don't have any IN yet
|
||||
and the first package PR (bashup-events) is too complex for this context.
|
||||
-->
|
||||
Here's a simple example of how `resholve.mkDerivation` is already used in nixpkgs:
|
||||
|
||||
<!-- TODO: figure out how to pull this externally? -->
|
||||
|
||||
```nix
|
||||
{ stdenv, lib, resholvePackage, fetchFromGitHub, bashup-events44, bashInteractive_5, doCheck ? true, shellcheck }:
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, resholve
|
||||
, substituteAll
|
||||
, bash
|
||||
, coreutils
|
||||
, goss
|
||||
, which
|
||||
}:
|
||||
|
||||
resholvePackage rec {
|
||||
pname = "shellswain";
|
||||
version = "unreleased";
|
||||
resholve.mkDerivation rec {
|
||||
pname = "dgoss";
|
||||
version = "0.3.16";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
# ...
|
||||
owner = "aelsabbahy";
|
||||
repo = "goss";
|
||||
rev = "v${version}";
|
||||
sha256 = "1m5w5vwmc9knvaihk61848rlq7qgdyylzpcwi64z84rkw8qdnj6p";
|
||||
};
|
||||
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
sed -i '2i GOSS_PATH=${goss}/bin/goss' extras/dgoss/dgoss
|
||||
install -D extras/dgoss/dgoss $out/bin/dgoss
|
||||
'';
|
||||
|
||||
solutions = {
|
||||
# Give each solution a short name. This is what you'd use to
|
||||
# override its settings, and it shows in (some) error messages.
|
||||
profile = {
|
||||
# the only *required* arguments are the 3 below
|
||||
|
||||
# Specify 1 or more $out-relative script paths. Unlike many
|
||||
# builders, resholvePackage modifies the output files during
|
||||
# fixup (to correctly resolve in-package sourcing).
|
||||
scripts = [ "bin/shellswain.bash" ];
|
||||
|
||||
# "none" for no shebang, "${bash}/bin/bash" for bash, etc.
|
||||
interpreter = "none";
|
||||
|
||||
# packages resholve should resolve executables from
|
||||
inputs = [ bashup-events44 ];
|
||||
default = {
|
||||
scripts = [ "bin/dgoss" ];
|
||||
interpreter = "${bash}/bin/bash";
|
||||
inputs = [ coreutils which ];
|
||||
fake = {
|
||||
external = [ "docker" ];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
makeFlags = [ "prefix=${placeholder "out"}" ];
|
||||
|
||||
inherit doCheck;
|
||||
checkInputs = [ shellcheck ];
|
||||
|
||||
# ...
|
||||
meta = with lib; {
|
||||
homepage = "https://github.com/aelsabbahy/goss/blob/v${version}/extras/dgoss/README.md";
|
||||
description = "Convenience wrapper around goss that aims to bring the simplicity of goss to docker containers";
|
||||
license = licenses.asl20;
|
||||
platforms = platforms.linux;
|
||||
maintainers = with maintainers; [ hyzual ];
|
||||
};
|
||||
}
|
||||
```
|
||||
|
||||
## Basic `resholveScript` and `resholveScriptBin` examples
|
||||
|
||||
## Basic `resholve.writeScript` and `resholve.writeScriptBin` examples
|
||||
|
||||
Both of these functions have the same basic API. This example is a little
|
||||
trivial for now. If you have a real usage that you find helpful, please PR it.
|
||||
|
||||
```nix
|
||||
resholvedScript = resholveScript "name" {
|
||||
resholvedScript = resholve.writeScript "name" {
|
||||
inputs = [ file ];
|
||||
interpreter = "${bash}/bin/bash";
|
||||
} ''
|
||||
echo "Hello"
|
||||
file .
|
||||
'';
|
||||
resholvedScriptBin = resholveScriptBin "name" {
|
||||
resholvedScriptBin = resholve.writeScriptBin "name" {
|
||||
inputs = [ file ];
|
||||
interpreter = "${bash}/bin/bash";
|
||||
} ''
|
||||
@ -94,25 +114,56 @@ resholvedScriptBin = resholveScriptBin "name" {
|
||||
'';
|
||||
```
|
||||
|
||||
|
||||
## Basic `resholve.phraseSolution` example
|
||||
|
||||
This function has a similar API to `writeScript` and `writeScriptBin`, except it does require a `scripts` attr. It is intended to make resholve a little easier to mix into more types of build. This example is a little
|
||||
trivial for now. If you have a real usage that you find helpful, please PR it.
|
||||
|
||||
```nix
|
||||
{ stdenv, resholve, module1 }:
|
||||
|
||||
stdenv.mkDerivation {
|
||||
# pname = "testmod3";
|
||||
# version = "unreleased";
|
||||
# src = ...;
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
install conjure.sh $out/bin/conjure.sh
|
||||
${resholve.phraseSolution "conjure" {
|
||||
scripts = [ "bin/conjure.sh" ];
|
||||
interpreter = "${bash}/bin/bash";
|
||||
inputs = [ module1 ];
|
||||
fake = {
|
||||
external = [ "jq" "openssl" ];
|
||||
};
|
||||
}}
|
||||
'';
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
## Options
|
||||
|
||||
`resholvePackage` maps Nix types/idioms into the flags and environment variables
|
||||
`resholve.mkDerivation` maps Nix types/idioms into the flags and environment variables
|
||||
that the `resholve` CLI expects. Here's an overview:
|
||||
|
||||
| Option | Type | Containing |
|
||||
| ------------- | ------- | ----------------------------------------------------- |
|
||||
| scripts | list | $out-relative string paths to resolve |
|
||||
| inputs | list | packages to resolve executables from |
|
||||
| interpreter | string | 'none' or abspath for shebang |
|
||||
| prologue | file | text to insert before the first code-line |
|
||||
| epilogue | file | text to insert after the last code-line |
|
||||
| flags | list | strings to pass as flags |
|
||||
| fake | attrset | [directives](#controlling-resolution-with-directives) |
|
||||
| fix | attrset | [directives](#controlling-resolution-with-directives) |
|
||||
| keep | attrset | [directives](#controlling-resolution-with-directives) |
|
||||
| lore | string | [lore directory](#controlling-nested-resolution-with-lore) |
|
||||
| execers | list | [execer lore directive](#controlling-nested-resolution-with-lore) |
|
||||
| wrappers | list | [wrapper lore directive](#controlling-nested-resolution-with-lore) |
|
||||
| Option | Type | Containing |
|
||||
|--------|------|------------|
|
||||
| scripts | `<list>` | scripts to resolve (`$out`-relative paths) |
|
||||
| interpreter | `"none"` `<path>` | The absolute interpreter `<path>` for the script's shebang. The special value `none` ensures there is no shebang. |
|
||||
| inputs | `<packages>` | Packages to resolve external dependencies from. |
|
||||
| fake | `<directives>` | pretend some commands exist |
|
||||
| fix | `<directives>` | fix things we can't auto-fix/ignore |
|
||||
| keep | `<directives>` | keep things we can't auto-fix/ignore |
|
||||
| lore | `<directory>` | control nested resolution |
|
||||
| execer | `<statements>` | modify nested resolution |
|
||||
| wrapper | `<statements>` | modify nested resolution |
|
||||
| prologue | `<file>` | insert file before resolved script |
|
||||
| epilogue | `<file>` | insert file after resolved script |
|
||||
|
||||
<!-- TODO: section below is largely custom for nixpkgs, but I would LIKE to wurst it. -->
|
||||
|
||||
## Controlling resolution with directives
|
||||
|
||||
@ -184,6 +235,7 @@ keep = {
|
||||
};
|
||||
```
|
||||
|
||||
|
||||
> **Note:** For now, at least, you'll need to reference the manpage to completely understand these examples.
|
||||
|
||||
## Controlling nested resolution with lore
|
||||
@ -213,7 +265,7 @@ There will be more mechanisms for controlling this process in the future
|
||||
the main lever is the ability to substitute your own lore. This is how you'd
|
||||
do it piecemeal:
|
||||
|
||||
```
|
||||
```nix
|
||||
# --execer 'cannot:${openssl.bin}/bin/openssl can:${openssl.bin}/bin/c_rehash'
|
||||
execer = [
|
||||
/*
|
||||
@ -237,5 +289,6 @@ execer = [
|
||||
];
|
||||
```
|
||||
|
||||
|
||||
The format is fairly simple to generate--you can script your own generator if
|
||||
you need to modify the lore.
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ callPackage
|
||||
, writeTextFile
|
||||
, ...
|
||||
}:
|
||||
|
||||
let
|
||||
@ -7,47 +7,15 @@ let
|
||||
deps = callPackage ./deps.nix { };
|
||||
in
|
||||
rec {
|
||||
# resholve itself
|
||||
resholve = callPackage ./resholve.nix {
|
||||
inherit (source) rSrc version;
|
||||
inherit (deps.oil) oildev;
|
||||
inherit resholve-utils;
|
||||
};
|
||||
# funcs to validate and phrase invocations of resholve
|
||||
# and use those invocations to build packages
|
||||
resholve-utils = callPackage ./resholve-utils.nix {
|
||||
inherit resholve;
|
||||
};
|
||||
resholvePackage = callPackage ./resholve-package.nix {
|
||||
inherit resholve resholve-utils;
|
||||
};
|
||||
resholveScript = name: partialSolution: text:
|
||||
writeTextFile {
|
||||
inherit name text;
|
||||
executable = true;
|
||||
checkPhase = ''
|
||||
(
|
||||
PS4=$'\x1f'"\033[33m[resholve context]\033[0m "
|
||||
set -x
|
||||
${resholve-utils.makeInvocation name (partialSolution // {
|
||||
scripts = [ "${placeholder "out"}" ];
|
||||
})}
|
||||
)
|
||||
${partialSolution.interpreter} -n $out
|
||||
'';
|
||||
};
|
||||
resholveScriptBin = name: partialSolution: text:
|
||||
writeTextFile rec {
|
||||
inherit name text;
|
||||
executable = true;
|
||||
destination = "/bin/${name}";
|
||||
checkPhase = ''
|
||||
(
|
||||
cd "$out"
|
||||
PS4=$'\x1f'"\033[33m[resholve context]\033[0m "
|
||||
set -x
|
||||
: changing directory to $PWD
|
||||
${resholve-utils.makeInvocation name (partialSolution // {
|
||||
scripts = [ "bin/${name}" ];
|
||||
})}
|
||||
)
|
||||
${partialSolution.interpreter} -n $out/bin/${name}
|
||||
'';
|
||||
};
|
||||
}
|
||||
|
@ -1,37 +0,0 @@
|
||||
{ stdenv, lib, resholve, resholve-utils }:
|
||||
|
||||
{ pname
|
||||
, src
|
||||
, version
|
||||
, passthru ? { }
|
||||
, solutions
|
||||
, ...
|
||||
}@attrs:
|
||||
let
|
||||
inherit stdenv;
|
||||
|
||||
self = (stdenv.mkDerivation ((removeAttrs attrs [ "solutions" ])
|
||||
// {
|
||||
inherit pname version src;
|
||||
buildInputs = (lib.optionals (builtins.hasAttr "buildInputs" attrs) attrs.buildInputs) ++ [ resholve ];
|
||||
|
||||
# enable below for verbose debug info if needed
|
||||
# supports default python.logging levels
|
||||
# LOGLEVEL="INFO";
|
||||
/*
|
||||
subshell/PS4/set -x and : command to output resholve envs
|
||||
and invocation. Extra context makes it clearer what the
|
||||
Nix API is doing, makes nix-shell debugging easier, etc.
|
||||
*/
|
||||
preFixup = ''
|
||||
(
|
||||
cd "$out"
|
||||
PS4=$'\x1f'"\033[33m[resholve context]\033[0m "
|
||||
set -x
|
||||
: changing directory to $PWD
|
||||
${builtins.concatStringsSep "\n" (resholve-utils.makeCommands solutions)}
|
||||
)
|
||||
'';
|
||||
}));
|
||||
in
|
||||
lib.extendDerivation true passthru self
|
@ -1,4 +1,4 @@
|
||||
{ lib, resholve, binlore }:
|
||||
{ lib, stdenv, resholve, binlore, writeTextFile }:
|
||||
|
||||
rec {
|
||||
/* These functions break up the work of partially validating the
|
||||
@ -10,6 +10,7 @@ rec {
|
||||
|
||||
# for brevity / line length
|
||||
spaces = l: builtins.concatStringsSep " " l;
|
||||
colons = l: builtins.concatStringsSep ":" l;
|
||||
semicolons = l: builtins.concatStringsSep ";" l;
|
||||
|
||||
/* Throw a fit with dotted attr path context */
|
||||
@ -17,58 +18,186 @@ rec {
|
||||
throw "${builtins.concatStringsSep "." path}: ${msg}";
|
||||
|
||||
/* Special-case directive value representations by type */
|
||||
makeDirective = solution: env: name: val:
|
||||
phraseDirective = solution: env: name: val:
|
||||
if builtins.isInt val then builtins.toString val
|
||||
else if builtins.isString val then name
|
||||
else if true == val then name
|
||||
else if false == val then "" # omit!
|
||||
else if null == val then "" # omit!
|
||||
else if builtins.isList val then "${name}:${semicolons val}"
|
||||
else if builtins.isList val then "${name}:${semicolons (map lib.escapeShellArg val)}"
|
||||
else nope [ solution env name ] "unexpected type: ${builtins.typeOf val}";
|
||||
|
||||
/* Build fake/fix/keep directives from Nix types */
|
||||
makeDirectives = solution: env: val:
|
||||
lib.mapAttrsToList (makeDirective solution env) val;
|
||||
phraseDirectives = solution: env: val:
|
||||
lib.mapAttrsToList (phraseDirective solution env) val;
|
||||
|
||||
/* Custom ~search-path routine to handle relative path strings */
|
||||
relSafeBinPath = input:
|
||||
if lib.isDerivation input then ((lib.getOutput "bin" input) + "/bin")
|
||||
else if builtins.isString input then input
|
||||
else throw "unexpected type for input: ${builtins.typeOf input}";
|
||||
|
||||
/* Special-case value representation by type/name */
|
||||
makeEnvVal = solution: env: val:
|
||||
if env == "inputs" then lib.makeBinPath val
|
||||
phraseEnvVal = solution: env: val:
|
||||
if env == "inputs" then (colons (map relSafeBinPath val))
|
||||
else if builtins.isString val then val
|
||||
else if builtins.isList val then spaces val
|
||||
else if builtins.isAttrs val then spaces (makeDirectives solution env val)
|
||||
else if builtins.isAttrs val then spaces (phraseDirectives solution env val)
|
||||
else nope [ solution env ] "unexpected type: ${builtins.typeOf val}";
|
||||
|
||||
/* Shell-format each env value */
|
||||
shellEnv = solution: env: value:
|
||||
lib.escapeShellArg (makeEnvVal solution env value);
|
||||
lib.escapeShellArg (phraseEnvVal solution env value);
|
||||
|
||||
/* Build a single ENV=val pair */
|
||||
makeEnv = solution: env: value:
|
||||
phraseEnv = solution: env: value:
|
||||
"RESHOLVE_${lib.toUpper env}=${shellEnv solution env value}";
|
||||
|
||||
/* Discard attrs claimed by makeArgs */
|
||||
removeCliArgs = value:
|
||||
removeAttrs value [ "scripts" "flags" ];
|
||||
/* Discard attrs:
|
||||
- claimed by phraseArgs
|
||||
- only needed for binlore.collect
|
||||
*/
|
||||
removeUnneededArgs = value:
|
||||
removeAttrs value [ "scripts" "flags" "unresholved" ];
|
||||
|
||||
/* Verify required arguments are present */
|
||||
validateSolution = { scripts, inputs, interpreter, ... }: true;
|
||||
|
||||
/* Pull out specific solution keys to build ENV=val pairs */
|
||||
makeEnvs = solution: value:
|
||||
spaces (lib.mapAttrsToList (makeEnv solution) (removeCliArgs value));
|
||||
phraseEnvs = solution: value:
|
||||
spaces (lib.mapAttrsToList (phraseEnv solution) (removeUnneededArgs value));
|
||||
|
||||
/* Pull out specific solution keys to build CLI argstring */
|
||||
makeArgs = { flags ? [ ], scripts, ... }:
|
||||
phraseArgs = { flags ? [ ], scripts, ... }:
|
||||
spaces (flags ++ scripts);
|
||||
|
||||
phraseBinloreArgs = value:
|
||||
let
|
||||
hasUnresholved = builtins.hasAttr "unresholved" value;
|
||||
in {
|
||||
drvs = value.inputs ++
|
||||
lib.optionals hasUnresholved [ value.unresholved ];
|
||||
strip = if hasUnresholved then [ value.unresholved ] else [ ];
|
||||
};
|
||||
|
||||
/* Build a single resholve invocation */
|
||||
makeInvocation = solution: value:
|
||||
phraseInvocation = solution: value:
|
||||
if validateSolution value then
|
||||
# we pass resholve a directory
|
||||
"RESHOLVE_LORE=${binlore.collect { drvs = value.inputs; } } ${makeEnvs solution value} ${resholve}/bin/resholve --overwrite ${makeArgs value}"
|
||||
"RESHOLVE_LORE=${binlore.collect (phraseBinloreArgs value) } ${phraseEnvs solution value} ${resholve}/bin/resholve --overwrite ${phraseArgs value}"
|
||||
else throw "invalid solution"; # shouldn't trigger for now
|
||||
|
||||
injectUnresholved = solutions: unresholved: (builtins.mapAttrs (name: value: value // { inherit unresholved; } ) solutions);
|
||||
|
||||
/* Build resholve invocation for each solution. */
|
||||
makeCommands = solutions:
|
||||
lib.mapAttrsToList makeInvocation solutions;
|
||||
phraseCommands = solutions: unresholved:
|
||||
builtins.concatStringsSep "\n" (
|
||||
lib.mapAttrsToList phraseInvocation (injectUnresholved solutions unresholved)
|
||||
);
|
||||
|
||||
/*
|
||||
subshell/PS4/set -x and : command to output resholve envs
|
||||
and invocation. Extra context makes it clearer what the
|
||||
Nix API is doing, makes nix-shell debugging easier, etc.
|
||||
*/
|
||||
phraseContext = { invokable, prep ? ''cd "$out"'' }: ''
|
||||
(
|
||||
${prep}
|
||||
PS4=$'\x1f'"\033[33m[resholve context]\033[0m "
|
||||
set -x
|
||||
: invoking resholve with PWD=$PWD
|
||||
${invokable}
|
||||
)
|
||||
'';
|
||||
phraseContextForPWD = invokable: phraseContext { inherit invokable; prep = ""; };
|
||||
phraseContextForOut = invokable: phraseContext { inherit invokable; };
|
||||
|
||||
phraseSolution = name: solution: (phraseContextForOut (phraseInvocation name solution));
|
||||
phraseSolutions = solutions: unresholved:
|
||||
phraseContextForOut (phraseCommands solutions unresholved);
|
||||
|
||||
writeScript = name: partialSolution: text:
|
||||
writeTextFile {
|
||||
inherit name text;
|
||||
executable = true;
|
||||
checkPhase = ''
|
||||
${(phraseContextForPWD (
|
||||
phraseInvocation name (
|
||||
partialSolution // {
|
||||
scripts = [ "${placeholder "out"}" ];
|
||||
}
|
||||
)
|
||||
)
|
||||
)}
|
||||
${partialSolution.interpreter} -n $out
|
||||
'';
|
||||
};
|
||||
writeScriptBin = name: partialSolution: text:
|
||||
writeTextFile rec {
|
||||
inherit name text;
|
||||
executable = true;
|
||||
destination = "/bin/${name}";
|
||||
checkPhase = ''
|
||||
${phraseContextForOut (
|
||||
phraseInvocation name (
|
||||
partialSolution // {
|
||||
scripts = [ "bin/${name}" ];
|
||||
}
|
||||
)
|
||||
)
|
||||
}
|
||||
${partialSolution.interpreter} -n $out/bin/${name}
|
||||
'';
|
||||
};
|
||||
mkDerivation = { pname
|
||||
, src
|
||||
, version
|
||||
, passthru ? { }
|
||||
, solutions
|
||||
, ...
|
||||
}@attrs:
|
||||
let
|
||||
inherit stdenv;
|
||||
|
||||
/*
|
||||
Knock out our special solutions arg, but otherwise
|
||||
just build what the caller is giving us. We'll
|
||||
actually resholve it separately below (after we
|
||||
generate binlore for it).
|
||||
*/
|
||||
unresholved = (stdenv.mkDerivation ((removeAttrs attrs [ "solutions" ])
|
||||
// {
|
||||
inherit pname version src;
|
||||
}));
|
||||
in
|
||||
/*
|
||||
resholve in a separate derivation; some concerns:
|
||||
- we aren't keeping many of the user's args, so they
|
||||
can't readily set LOGLEVEL and such...
|
||||
- not sure how this affects multiple outputs
|
||||
*/
|
||||
lib.extendDerivation true passthru (stdenv.mkDerivation {
|
||||
src = unresholved;
|
||||
version = unresholved.version;
|
||||
pname = "resholved-${unresholved.pname}";
|
||||
buildInputs = [ resholve ];
|
||||
|
||||
# retain a reference to the base
|
||||
passthru = unresholved.passthru // {
|
||||
unresholved = unresholved;
|
||||
};
|
||||
|
||||
# do these imply that we should use NoCC or something?
|
||||
dontConfigure = true;
|
||||
dontBuild = true;
|
||||
|
||||
installPhase = ''
|
||||
cp -R $src $out
|
||||
'';
|
||||
|
||||
# enable below for verbose debug info if needed
|
||||
# supports default python.logging levels
|
||||
# LOGLEVEL="INFO";
|
||||
preFixup = phraseSolutions solutions unresholved;
|
||||
});
|
||||
}
|
||||
|
@ -7,14 +7,13 @@
|
||||
, version
|
||||
, oildev
|
||||
, binlore
|
||||
, resholve-utils
|
||||
}:
|
||||
|
||||
python27Packages.buildPythonApplication {
|
||||
pname = "resholve";
|
||||
inherit version;
|
||||
src = rSrc;
|
||||
format = "other";
|
||||
dontBuild = true;
|
||||
|
||||
nativeBuildInputs = [ installShellFiles ];
|
||||
|
||||
@ -32,13 +31,12 @@ python27Packages.buildPythonApplication {
|
||||
];
|
||||
|
||||
patchPhase = ''
|
||||
for file in resholve; do
|
||||
for file in setup.cfg _resholve/version.py; do
|
||||
substituteInPlace $file --subst-var-by version ${version}
|
||||
done
|
||||
'';
|
||||
|
||||
installPhase = ''
|
||||
install -Dm755 resholve $out/bin/resholve
|
||||
postInstall = ''
|
||||
installManPage resholve.1
|
||||
'';
|
||||
|
||||
@ -48,7 +46,10 @@ python27Packages.buildPythonApplication {
|
||||
rm $out/nix-support/propagated-build-inputs
|
||||
'';
|
||||
|
||||
passthru.tests = callPackage ./test.nix { inherit rSrc; inherit binlore; };
|
||||
passthru = {
|
||||
inherit (resholve-utils) mkDerivation phraseSolution writeScript writeScriptBin;
|
||||
tests = callPackage ./test.nix { inherit rSrc binlore; };
|
||||
};
|
||||
|
||||
meta = with lib; {
|
||||
description = "Resolve external shell-script dependencies";
|
||||
|
@ -3,7 +3,7 @@
|
||||
}:
|
||||
|
||||
rec {
|
||||
version = "0.6.9";
|
||||
version = "0.8.0";
|
||||
rSrc =
|
||||
# local build -> `make ci`; `make clean` to restore
|
||||
# return to remote source
|
||||
@ -14,6 +14,6 @@ rec {
|
||||
owner = "abathur";
|
||||
repo = "resholve";
|
||||
rev = "v${version}";
|
||||
hash = "sha256-y9O5w4wA/kR8zoPay9pGs3vwxNqq3JEeZmX0wBJq4UQ=";
|
||||
hash = "sha256-oWS4ZBPjgH2UvYmvHVVRcyl15r3VS964BmB89y9DGo8=";
|
||||
};
|
||||
}
|
||||
|
@ -2,10 +2,8 @@
|
||||
, stdenv
|
||||
, callPackage
|
||||
, resholve
|
||||
, resholvePackage
|
||||
, resholveScript
|
||||
, resholveScriptBin
|
||||
, shunit2
|
||||
, fetchFromGitHub
|
||||
, coreutils
|
||||
, gnused
|
||||
, gnugrep
|
||||
@ -34,46 +32,7 @@ let
|
||||
parsed_packages = [ coreutils sqlite util-linux gnused gawk findutils rlwrap gnutar bc ];
|
||||
in
|
||||
rec {
|
||||
re_shunit2 = with shunit2;
|
||||
resholvePackage {
|
||||
inherit pname src version installPhase;
|
||||
solutions = {
|
||||
shunit = {
|
||||
interpreter = "none";
|
||||
scripts = [ "bin/shunit2" ];
|
||||
inputs = [ coreutils gnused gnugrep findutils ];
|
||||
# resholve's Nix API is analogous to the CLI flags
|
||||
# documented in 'man resholve'
|
||||
fake = {
|
||||
# "missing" functions shunit2 expects the user to declare
|
||||
function = [
|
||||
"oneTimeSetUp"
|
||||
"oneTimeTearDown"
|
||||
"setUp"
|
||||
"tearDown"
|
||||
"suite"
|
||||
"noexec"
|
||||
];
|
||||
# shunit2 is both bash and zsh compatible, and in
|
||||
# some zsh-specific code it uses this non-bash builtin
|
||||
builtin = [ "setopt" ];
|
||||
};
|
||||
fix = {
|
||||
# stray absolute path; make it resolve from coreutils
|
||||
"/usr/bin/od" = true;
|
||||
};
|
||||
keep = {
|
||||
# variables invoked as commands; long-term goal is to
|
||||
# resolve the *variable*, but that is complexish, so
|
||||
# this is where we are...
|
||||
"$__SHUNIT_CMD_ECHO_ESC" = true;
|
||||
"$_SHUNIT_LINENO_" = true;
|
||||
"$SHUNIT_CMD_TPUT" = true;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
module1 = resholvePackage {
|
||||
module1 = resholve.mkDerivation {
|
||||
pname = "testmod1";
|
||||
version = "unreleased";
|
||||
|
||||
@ -97,7 +56,7 @@ rec {
|
||||
|
||||
is_it_okay_with_arbitrary_envs = "shonuff";
|
||||
};
|
||||
module2 = resholvePackage {
|
||||
module2 = resholve.mkDerivation {
|
||||
pname = "testmod2";
|
||||
version = "unreleased";
|
||||
|
||||
@ -105,19 +64,20 @@ rec {
|
||||
setSourceRoot = "sourceRoot=$(echo */tests/nix/openssl)";
|
||||
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
mkdir -p $out/bin $out/libexec
|
||||
install openssl.sh $out/bin/openssl.sh
|
||||
install libexec.sh $out/libexec/invokeme
|
||||
install profile $out/profile
|
||||
'';
|
||||
|
||||
# LOGLEVEL="DEBUG";
|
||||
solutions = {
|
||||
openssl = {
|
||||
fix = {
|
||||
aliases = true;
|
||||
};
|
||||
scripts = [ "bin/openssl.sh" ];
|
||||
scripts = [ "bin/openssl.sh" "libexec/invokeme" ];
|
||||
interpreter = "none";
|
||||
inputs = [ re_shunit2 openssl.bin ];
|
||||
inputs = [ shunit2 openssl.bin "libexec" "libexec/invokeme" ];
|
||||
execer = [
|
||||
/*
|
||||
This is the same verdict binlore will
|
||||
@ -136,7 +96,8 @@ rec {
|
||||
};
|
||||
};
|
||||
};
|
||||
module3 = resholvePackage {
|
||||
# demonstrate that we could use resholve in larger build
|
||||
module3 = stdenv.mkDerivation {
|
||||
pname = "testmod3";
|
||||
version = "unreleased";
|
||||
|
||||
@ -146,15 +107,15 @@ rec {
|
||||
installPhase = ''
|
||||
mkdir -p $out/bin
|
||||
install conjure.sh $out/bin/conjure.sh
|
||||
'';
|
||||
|
||||
solutions = {
|
||||
conjure = {
|
||||
${resholve.phraseSolution "conjure" {
|
||||
scripts = [ "bin/conjure.sh" ];
|
||||
interpreter = "${bash}/bin/bash";
|
||||
inputs = [ module1 ];
|
||||
};
|
||||
};
|
||||
fake = {
|
||||
external = [ "jq" "openssl" ];
|
||||
};
|
||||
}}
|
||||
'';
|
||||
};
|
||||
|
||||
cli = stdenv.mkDerivation {
|
||||
@ -204,14 +165,14 @@ rec {
|
||||
};
|
||||
|
||||
# Caution: ci.nix asserts the equality of both of these w/ diff
|
||||
resholvedScript = resholveScript "resholved-script" {
|
||||
resholvedScript = resholve.writeScript "resholved-script" {
|
||||
inputs = [ file ];
|
||||
interpreter = "${bash}/bin/bash";
|
||||
} ''
|
||||
echo "Hello"
|
||||
file .
|
||||
'';
|
||||
resholvedScriptBin = resholveScriptBin "resholved-script-bin" {
|
||||
resholvedScriptBin = resholve.writeScriptBin "resholved-script-bin" {
|
||||
inputs = [ file ];
|
||||
interpreter = "${bash}/bin/bash";
|
||||
} ''
|
||||
|
@ -30,8 +30,8 @@ let
|
||||
src = fetchFromGitHub {
|
||||
owner = "abathur";
|
||||
repo = "binlore";
|
||||
rev = "v0.1.4";
|
||||
hash = "sha256-+N0Bqyaj/mAwrcgFtUI8czmKo3VW6J8ZRxaPEghp7QM=";
|
||||
rev = "v0.2.0";
|
||||
hash = "sha256-bBJky7Km+mieHTqoMz3mda3KaKxr9ipYpfQqn/4w8J0=";
|
||||
};
|
||||
/*
|
||||
binlore has one one more yallbacks responsible for
|
||||
@ -57,11 +57,11 @@ let
|
||||
# since this form will make it easier to pilot other
|
||||
# uses of binlore.
|
||||
callback = lore: drv: overrides: ''
|
||||
if [[ -d "${drv}/bin" ]]; then
|
||||
if [[ -d "${drv}/bin" ]] || [[ -d "${drv}/lib" ]] || [[ -d "${drv}/libexec" ]]; then
|
||||
echo generating binlore for $drv by running:
|
||||
echo "${yara}/bin/yara ${lore.rules} ${drv}/bin | ${yallback}/bin/yallback ${lore.yallback}"
|
||||
echo "${yara}/bin/yara --scan-list --recursive ${lore.rules} <(printf '%s\n' ${drv}/{bin,lib,libexec}) | ${yallback}/bin/yallback ${lore.yallback}"
|
||||
else
|
||||
echo "failed to generate binlore for $drv (${drv}/bin doesn't exist)"
|
||||
echo "failed to generate binlore for $drv (none of ${drv}/{bin,lib,libexec} exist)"
|
||||
fi
|
||||
'' +
|
||||
/*
|
||||
@ -83,18 +83,19 @@ let
|
||||
fi
|
||||
((i--)) || true # don't break build
|
||||
done # || true # don't break build
|
||||
if [[ -d "${drv}/bin" ]]; then
|
||||
${yara}/bin/yara ${lore.rules} ${drv}/bin | ${yallback}/bin/yallback ${lore.yallback} "$filter"
|
||||
if [[ -d "${drv}/bin" ]] || [[ -d "${drv}/lib" ]] || [[ -d "${drv}/libexec" ]]; then
|
||||
${yara}/bin/yara --scan-list --recursive ${lore.rules} <(printf '%s\n' ${drv}/{bin,lib,libexec}) | ${yallback}/bin/yallback ${lore.yallback} "$filter"
|
||||
fi
|
||||
'';
|
||||
};
|
||||
overrides = (src + /overrides);
|
||||
|
||||
in rec {
|
||||
collect = { lore ? loreDef, drvs }: (runCommand "more-binlore" { } ''
|
||||
collect = { lore ? loreDef, drvs, strip ? [ ] }: (runCommand "more-binlore" { } ''
|
||||
mkdir $out
|
||||
for lorefile in ${toString lore.types}; do
|
||||
cat ${lib.concatMapStrings (x: x + "/$lorefile ") (map (make lore) (map lib.getBin drvs))} > $out/$lorefile
|
||||
cat ${lib.concatMapStrings (x: x + "/$lorefile ") (map (make lore) (map lib.getBin (builtins.filter lib.isDerivation drvs)))} > $out/$lorefile
|
||||
substituteInPlace $out/$lorefile ${lib.concatMapStrings (x: "--replace '${x}/' '' ") strip}
|
||||
done
|
||||
'');
|
||||
# TODO: echo for debug, can be removed at some point
|
||||
|
@ -2,14 +2,14 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "dprint";
|
||||
version = "0.22.2";
|
||||
version = "0.24.3";
|
||||
|
||||
src = fetchCrate {
|
||||
inherit pname version;
|
||||
sha256 = "sha256-iYqQABXd3Vra+U7cfGKBEyTXfQGwHxFSxEoDyCfKk5Y=";
|
||||
sha256 = "sha256-QWPQ48mSTAeVz+iXid5fE/nSLt1+QxJ562m3FFZ8rcU=";
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-QMOS8Pn3RwZZRtKqp077ihh91Q4VPe8alrtQ6dYIXmA=";
|
||||
cargoSha256 = "sha256-XXGtY4vzS/mkF/aRlLA7A/tsSEqXlJQgU0wJp6q/Nu8=";
|
||||
|
||||
buildInputs = lib.optionals stdenv.isDarwin [ Security ];
|
||||
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "esbuild";
|
||||
version = "0.14.29";
|
||||
version = "0.14.32";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "evanw";
|
||||
repo = "esbuild";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-v16wKi+CphROS9s3PdzzuRoh3gLfSUgincyTp38WKxQ=";
|
||||
sha256 = "sha256-NIF47eTGAC//4aPojrJbokB434MfGudi1pD+liRsA8k=";
|
||||
};
|
||||
|
||||
vendorSha256 = "sha256-QPkBR+FscUc3jOvH7olcGUhM6OW4vxawmNJuRQxPuGs=";
|
||||
|
@ -2,16 +2,16 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "jql";
|
||||
version = "3.2.0";
|
||||
version = "3.2.4";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "yamafaktory";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-U++yypq9M1C6Sh9rv3rmn/qwTXWdPFDBpjFS6eoS2L4=";
|
||||
sha256 = "sha256-wokdlmczClYwVskBDpKQyka1GiLf4JvRiooK+qo7Tv4=";
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-uyD+QBDfnZa3nfZcUAqruYqJ9nVAa5+XOPONds0ysXU=";
|
||||
cargoSha256 = "sha256-6L78LxxzqkjP9k71WmZhkhNVdKLXUwSYioKynaETTaA=";
|
||||
|
||||
meta = with lib; {
|
||||
description = "A JSON Query Language CLI tool built with Rust";
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
buildGoModule rec {
|
||||
pname = "flyctl";
|
||||
version = "0.0.310";
|
||||
version = "0.0.314";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "superfly";
|
||||
repo = "flyctl";
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-69yyH4og7FGS3+M72YhlrwjatucfGliHYcMpPi1ddjA=";
|
||||
sha256 = "sha256-UPr5crTddmR5tIzR0BulITGDbdlu3RZ1l5W007C3z+E=";
|
||||
};
|
||||
|
||||
preBuild = ''
|
||||
@ -17,7 +17,7 @@ buildGoModule rec {
|
||||
|
||||
subPackages = [ "." ];
|
||||
|
||||
vendorSha256 = "sha256-2goglOmcUud9KT5accn/AMe4xEgRN2Ep1qMfQHtlI+Q=";
|
||||
vendorSha256 = "sha256-QUi23Gmj6vdNXwINa54tfLeZ+eGWLlbAtWGj3yOnzhE=";
|
||||
|
||||
doCheck = false;
|
||||
|
||||
|
@ -20,6 +20,8 @@ self = stdenv.mkDerivation rec {
|
||||
postPatch = ''
|
||||
substituteInPlace cmake/libutils.cmake --replace /usr/bin/libtool libtool
|
||||
substituteInPlace cmake/os/Darwin.cmake --replace /usr/bin/libtool libtool
|
||||
substituteInPlace cmake/fido2.cmake \
|
||||
--replace ''$\{MY_PKG_CONFIG_EXECUTABLE\} "${pkg-config}/bin/pkg-config"
|
||||
'';
|
||||
|
||||
buildInputs = [
|
||||
|
@ -2,13 +2,13 @@
|
||||
|
||||
stdenv.mkDerivation rec {
|
||||
pname = "plpgsql_check";
|
||||
version = "2.1.2";
|
||||
version = "2.1.3";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "okbob";
|
||||
repo = pname;
|
||||
rev = "v${version}";
|
||||
sha256 = "sha256-S/b6oQPYgaM6UvloYqlwhF5rxlyKG4Vw6ejN/gK8Spg=";
|
||||
sha256 = "sha256-hVbx1eUrVQ35UzcokoqYCi6RFI5Dn7t9XH8q9VbyDbQ=";
|
||||
};
|
||||
|
||||
buildInputs = [ postgresql ];
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ lib
|
||||
, resholvePackage
|
||||
, resholve
|
||||
, fetchFromGitHub
|
||||
, asciidoc
|
||||
, bash
|
||||
@ -10,7 +10,7 @@
|
||||
, util-linux
|
||||
}:
|
||||
|
||||
resholvePackage rec {
|
||||
resholve.mkDerivation rec {
|
||||
pname = "arch-install-scripts";
|
||||
version = "24";
|
||||
|
||||
@ -43,7 +43,7 @@ resholvePackage rec {
|
||||
# the only *required* arguments are the 3 below
|
||||
|
||||
# Specify 1 or more $out-relative script paths. Unlike many
|
||||
# builders, resholvePackage modifies the output files during
|
||||
# builders, resholve.mkDerivation modifies the output files during
|
||||
# fixup (to correctly resolve in-package sourcing).
|
||||
scripts = [ "bin/arch-chroot" "bin/genfstab" "bin/pacstrap" ];
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
{ lib
|
||||
, fetchFromGitHub
|
||||
, resholvePackage
|
||||
, resholve
|
||||
, substituteAll
|
||||
, bash
|
||||
, coreutils
|
||||
@ -8,7 +8,7 @@
|
||||
, which
|
||||
}:
|
||||
|
||||
resholvePackage rec {
|
||||
resholve.mkDerivation rec {
|
||||
pname = "dgoss";
|
||||
version = "0.3.16";
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
, dotnet-sdk
|
||||
, git
|
||||
, go
|
||||
, libiconv
|
||||
, nodejs
|
||||
}:
|
||||
|
||||
@ -54,6 +55,11 @@ buildPythonPackage rec {
|
||||
re-assert
|
||||
];
|
||||
|
||||
buildInputs = [
|
||||
# Required for rust test on x86_64-darwin
|
||||
libiconv
|
||||
];
|
||||
|
||||
doCheck = true;
|
||||
|
||||
postPatch = ''
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ lib
|
||||
, resholvePackage
|
||||
, resholve
|
||||
, fetchFromGitHub
|
||||
, bash
|
||||
, coreutils
|
||||
@ -9,7 +9,7 @@
|
||||
, ncurses
|
||||
}:
|
||||
|
||||
resholvePackage rec {
|
||||
resholve.mkDerivation rec {
|
||||
pname = "shunit2";
|
||||
version = "2.1.8";
|
||||
|
||||
@ -63,7 +63,7 @@ resholvePackage rec {
|
||||
interpreter, we can pre-test this. But if we go fiddle
|
||||
the interpreter later, I guess we _could_ break it.
|
||||
*/
|
||||
"$__SHUNIT_CMD_ECHO_ESC" = [ "'echo -e'" ];
|
||||
"$__SHUNIT_CMD_ECHO_ESC" = [ "echo -e" ];
|
||||
"$SHUNIT_CMD_TPUT" = [ "tput" ]; # from ncurses
|
||||
};
|
||||
keep = {
|
||||
|
@ -8,16 +8,16 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "gping";
|
||||
version = "1.3.0";
|
||||
version = "1.3.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "orf";
|
||||
repo = "gping";
|
||||
rev = "gping-v${version}";
|
||||
sha256 = "sha256-Q7M/vDhECEIQ8s8qt1U7wESqv+Im79TyZ6s2vqjU5ps=";
|
||||
sha256 = "sha256-/CH9cSOkgXxdxSN1G4Jg404KOHEYhnsSCK4QB6Zdk+A=";
|
||||
};
|
||||
|
||||
cargoSha256 = "sha256-cnmjfvMqq8VDMvjFPnjmmH57Gaqttk36AwEtuuAT6qU=";
|
||||
cargoSha256 = "sha256-2knD3MwrJKvbdovh6bd81GqHHqeAG1OFzXsLB4eO0Do=";
|
||||
|
||||
buildInputs = lib.optionals stdenv.isDarwin [ libiconv Security ];
|
||||
|
||||
|
@ -2,19 +2,19 @@
|
||||
|
||||
rustPlatform.buildRustPackage rec {
|
||||
pname = "cargo-about";
|
||||
version = "0.5.0";
|
||||
version = "0.5.1";
|
||||
|
||||
src = fetchFromGitHub {
|
||||
owner = "EmbarkStudios";
|
||||
repo = "cargo-about";
|
||||
rev = version;
|
||||
sha256 = "sha256-M09X7UwrTtrOhOphhpGHSAqxneY50jNrFKJCeBQhRfc=";
|
||||
sha256 = "sha256-T8Hhody0jMmZb6/xMkSvKCv4STZPbcrf/UB3APspYDM=";
|
||||
};
|
||||
|
||||
# enable pkg-config feature of zstd
|
||||
cargoPatches = [ ./zstd-pkg-config.patch ];
|
||||
|
||||
cargoSha256 = "sha256-E1+OfVAzrezXoUz9Nlyhdq1xxEWm4UJhVyp+nG7UmYY=";
|
||||
cargoSha256 = "sha256-x/HzDYNy0FDxJmhjSUUEiyahM7Sw27aC+ULP/Ii0X/8=";
|
||||
|
||||
nativeBuildInputs = [ pkg-config ];
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
{ lib
|
||||
, resholvePackage
|
||||
, resholve
|
||||
, fetchFromGitHub
|
||||
, bc
|
||||
, coreutils
|
||||
@ -13,7 +13,7 @@
|
||||
, findutils
|
||||
}:
|
||||
|
||||
resholvePackage rec {
|
||||
resholve.mkDerivation rec {
|
||||
pname = "pdf2odt";
|
||||
version = "20170207";
|
||||
|
||||
|
@ -1042,6 +1042,12 @@ mapAliases ({
|
||||
redshift-wlr = throw "redshift-wlr has been replaced by gammastep"; # Added 2021-12-25
|
||||
reicast = throw "reicast has been removed from nixpkgs as it is unmaintained, please use flycast instead"; # Added 2022-03-07
|
||||
renpy = throw "renpy has been removed from nixpkgs, it was unmaintained and the latest packaged version required python2"; # Added 2022-01-12
|
||||
|
||||
# 3 resholve aliases below added 2022-04-08; drop after 2022-11-30?
|
||||
resholvePackage = throw "resholvePackage has been renamed to resholve.mkDerivation";
|
||||
resholveScript = throw "resholveScript has been renamed to resholve.writeScript";
|
||||
resholveScriptBin = throw "resholveScriptBin has been renamed to resholve.writeScriptBin";
|
||||
|
||||
residualvm = throw "residualvm was merged to scummvm code in 2018-06-15; consider using scummvm"; # Added 2021-11-27
|
||||
retroArchCores = throw "retroArchCores has been removed. Please use overrides instead, e.g.: `retroarch.override { cores = with libretro; [ ... ]; }`"; # Added 2021-11-19
|
||||
retroshare06 = retroshare;
|
||||
|
@ -2872,6 +2872,8 @@ with pkgs;
|
||||
|
||||
dasher = callPackage ../applications/accessibility/dasher { };
|
||||
|
||||
datafusion-cli = callPackage ../development/misc/datafusion { };
|
||||
|
||||
datamash = callPackage ../tools/misc/datamash { };
|
||||
|
||||
datasette = with python3Packages; toPythonApplication datasette;
|
||||
@ -9544,7 +9546,7 @@ with pkgs;
|
||||
rescuetime = libsForQt5.callPackage ../applications/misc/rescuetime { };
|
||||
|
||||
inherit (callPackage ../development/misc/resholve { })
|
||||
resholve resholvePackage resholveScript resholveScriptBin;
|
||||
resholve;
|
||||
|
||||
restool = callPackage ../os-specific/linux/restool {};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user