Merge staging-next into staging

This commit is contained in:
github-actions[bot] 2022-11-07 00:04:07 +00:00 committed by GitHub
commit 822bf096f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
92 changed files with 10273 additions and 4107 deletions

View File

@ -183,14 +183,13 @@ rec {
seccompSupport = false;
hostCpuTargets = [ "${final.qemuArch}-linux-user" ];
};
wine-name = "wine${toString final.parsed.cpu.bits}";
wine = (pkgs.winePackagesFor wine-name).minimal;
wine = (pkgs.winePackagesFor "wine${toString final.parsed.cpu.bits}").minimal;
in
if final.parsed.kernel.name == pkgs.stdenv.hostPlatform.parsed.kernel.name &&
pkgs.stdenv.hostPlatform.canExecute final
then "${pkgs.runtimeShell} -c '\"$@\"' --"
else if final.isWindows
then "${wine}/bin/${wine-name}"
then "${wine}/bin/wine${lib.optionalString (final.parsed.cpu.bits == 64) "64"}"
else if final.isLinux && pkgs.stdenv.hostPlatform.isLinux
then "${qemu-user}/bin/qemu-${final.qemuArch}"
else if final.isWasi

View File

@ -1655,6 +1655,15 @@
githubId = 214787;
name = "Herwig Hochleitner";
};
benesim = {
name = "Benjamin Isbarn";
email = "benjamin.isbarn@gmail.com";
github = "benesim";
githubId = 29384538;
keys = [{
fingerprint = "D35E C9CE E631 638F F1D8 B401 6F0E 410D C3EE D02";
}];
};
benley = {
email = "benley@gmail.com";
github = "benley";

View File

@ -643,6 +643,15 @@
maintainer to update the package.
</para>
</listitem>
<listitem>
<para>
ppd files in <literal>pkgs.cups-drv-rastertosag-gdi</literal>
are now gzipped. If you refer to such a ppd file with its path
(e.g. via
<link xlink:href="options.html#opt-hardware.printers.ensurePrinters">hardware.printers.ensurePrinters</link>)
you will need to append <literal>.gz</literal> to the path.
</para>
</listitem>
<listitem>
<para>
xow package removed along with the

View File

@ -210,6 +210,8 @@ Available as [services.patroni](options.html#opt-services.patroni.enable).
- riak package removed along with `services.riak` module, due to lack of maintainer to update the package.
- ppd files in `pkgs.cups-drv-rastertosag-gdi` are now gzipped. If you refer to such a ppd file with its path (e.g. via [hardware.printers.ensurePrinters](options.html#opt-hardware.printers.ensurePrinters)) you will need to append `.gz` to the path.
- xow package removed along with the `hardware.xow` module, due to the project being deprecated in favor of `xone`, which is available via the `hardware.xone` module.
- dd-agent package removed along with the `services.dd-agent` module, due to the project being deprecated in favor of `datadog-agent`, which is available via the `services.datadog-agent` module.

View File

@ -3,7 +3,7 @@ import sys
options = json.load(sys.stdin)
for (name, value) in options.items():
print('##', name.replace('<', '\\<').replace('>', '\\>'))
print('##', name.replace('<', '&lt;').replace('>', '&gt;'))
print(value['description'])
print()
if 'type' in value:

View File

@ -201,7 +201,7 @@ in
serviceConfig = {
ExecStart = "@${cfg.package}/bin/consul consul agent -config-dir /etc/consul.d"
+ concatMapStrings (n: " -config-file ${n}") configFiles;
ExecReload = "${cfg.package}/bin/consul reload";
ExecReload = "${pkgs.coreutils}/bin/kill -HUP $MAINPID";
PermissionsStartOnly = true;
User = if cfg.dropPrivileges then "consul" else null;
Restart = "on-failure";

View File

@ -54,7 +54,7 @@ in {
smtps = {
port = mkOption {
type = types.port;
default = 445;
default = 465;
description = lib.mdDoc ''
The SMTPS server port.
'';

View File

@ -1,8 +1,5 @@
{ lib, pkgs }: {
mariadbPackages = lib.filterAttrs (n: _: lib.hasPrefix "mariadb" n) (pkgs.callPackage ../../../pkgs/servers/sql/mariadb {
inherit (pkgs.darwin) cctools;
inherit (pkgs.darwin.apple_sdk.frameworks) CoreServices;
});
mariadbPackages = lib.filterAttrs (n: _: lib.hasPrefix "mariadb" n) (import ../../../pkgs/servers/sql/mariadb pkgs);
mysqlPackages = {
inherit (pkgs) mysql80;
};

View File

@ -20,7 +20,7 @@
stdenv.mkDerivation rec {
pname = "squeekboard";
version = "1.17.0";
version = "1.20.0";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
@ -28,18 +28,23 @@ stdenv.mkDerivation rec {
owner = "Phosh";
repo = pname;
rev = "v${version}";
sha256 = "sha256-U46OQ0bXkXv6za8vUZxtbxJKqiF/X/xxJsqQGpnRIpg=";
sha256 = "sha256-wx3fKRX/SPYGAFuR9u03JAvVRhtYIPUvW8mAsCdx83I=";
};
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src;
cargoUpdateHook = ''
cat Cargo.toml.in Cargo.deps > Cargo.toml
cat Cargo.toml.in Cargo.deps.newer > Cargo.toml
cp Cargo.lock.newer Cargo.lock
'';
name = "${pname}-${version}";
sha256 = "sha256-4q8MW1n/xu538+R5ZlA+p/hd6pOQPKj7jOFwnuMc7sk=";
sha256 = "sha256-BbNkapqnqEW/NglrCse10Tm80SXYVQWWrOC5dTN6oi0=";
};
mesonFlags = [
"-Dnewer=true"
];
nativeBuildInputs = [
meson
ninja
@ -67,7 +72,7 @@ stdenv.mkDerivation rec {
description = "A virtual keyboard supporting Wayland";
homepage = "https://source.puri.sm/Librem5/squeekboard";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ artturin ];
maintainers = with maintainers; [ artturin tomfitzhenry ];
platforms = platforms.linux;
};
}

View File

@ -1,4 +1,4 @@
{ stdenv, lib, fetchgit, pkg-config, meson, ninja
{ stdenv, lib, fetchgit, pkg-config, meson, ninja, wrapGAppsHook
, enchant, gtkmm3, libchamplain, libgcrypt, shared-mime-info }:
stdenv.mkDerivation rec {
@ -16,6 +16,7 @@ stdenv.mkDerivation rec {
ninja
pkg-config
shared-mime-info # for update-mime-database
wrapGAppsHook
];
buildInputs = [

View File

@ -25,7 +25,11 @@ let
sha256 = "sha256-/EWJC3hFIBqwHa9z4nMWR7CpoaqYY+pvw+1vcq4F0LU=";
};
};
aarch64-darwin = {
x86_64-darwin = {
stable = fetchurl {
url = "https://dl.discordapp.net/apps/osx/${version}/Discord.dmg";
sha256 = "1jvlxmbfqhslsr16prsgbki77kq7i3ipbkbn67pnwlnis40y9s7p";
};
ptb = fetchurl {
url = "https://dl-ptb.discordapp.net/apps/osx/${version}/DiscordPTB.dmg";
sha256 = "sha256-LS7KExVXkOv8O/GrisPMbBxg/pwoDXIOo1dK9wk1yB8=";
@ -35,15 +39,7 @@ let
sha256 = "0mqpk1szp46mih95x42ld32rrspc6jx1j7qdaxf01whzb3d4pi9l";
};
};
# Stable does not (yet) provide aarch64-darwin support. PTB and Canary, however, do.
x86_64-darwin =
aarch64-darwin
// {
stable = fetchurl {
url = "https://dl.discordapp.net/apps/osx/${version}/Discord.dmg";
sha256 = "1jvlxmbfqhslsr16prsgbki77kq7i3ipbkbn67pnwlnis40y9s7p";
};
};
aarch64-darwin = x86_64-darwin;
};
src = srcs.${stdenv.hostPlatform.system}.${branch};
@ -54,8 +50,7 @@ let
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
maintainers = with maintainers; [ MP2E devins2518 artturin infinidoge ];
platforms = [ "x86_64-linux" "x86_64-darwin" ]
++ lib.optionals (branch != "stable") [ "aarch64-darwin" ];
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
};
package =
if stdenv.isLinux

View File

@ -1,14 +1,14 @@
{ lib, stdenvNoCC, fetchFromGitHub, python3 }:
stdenvNoCC.mkDerivation rec {
pname = "mpv_thumbnail_script";
version = "0.4.9";
pname = "mpv-thumbnail-script";
version = "0.5.1";
src = fetchFromGitHub {
owner = "marzzzello";
repo = pname;
repo = "mpv_thumbnail_script";
rev = version;
sha256 = "0dgfrb8ypc5vlq35kzn423fm6l6348ivl85vb6j3ccc9a51xprw3";
sha256 = "sha256-0nqV8vY3cBOJkLRoQ33Cc+4+vSK45i9yWbhKiQIuVSw=";
};
nativeBuildInputs = [ python3 ];

View File

@ -0,0 +1,25 @@
{ lib
, makeSetupHook
, which
, callPackage
}:
let
patchPpdFilesHook = makeSetupHook
{
name = "patch-ppd-files";
substitutions.which = lib.attrsets.getBin which;
substitutions.awkscript = ./patch-ppd-lines.awk;
}
./patch-ppd-hook.sh;
in
patchPpdFilesHook.overrideAttrs (
lib.trivial.flip
lib.attrsets.recursiveUpdate
{
passthru.tests.test = callPackage ./test.nix {};
meta.description = "setup hook to patch executable paths in ppd files";
meta.maintainers = [ lib.maintainers.yarny ];
}
)

View File

@ -0,0 +1,183 @@
fixupOutputHooks+=(_patchPpdFileCommands4fixupOutputHooks)
# Install a hook for the `fixupPhase`:
# If the variable `ppdFileCommands` contains a list of
# executable names, the hook calls `patchPpdFileCommands`
# on each output's `/share/cups/model` and `/share/ppds`
# directories in order to replace calls to those executables.
_patchPpdFileCommands4fixupOutputHooks () {
[[ -n $ppdFileCommands ]] || return 0
if [[ -d $prefix/share/cups/model ]]; then
patchPpdFileCommands "$prefix/share/cups/model" $ppdFileCommands
fi
if [[ -d $prefix/share/ppds ]]; then
patchPpdFileCommands "$prefix/share/ppds" $ppdFileCommands
fi
}
# patchPpdFileCommands PPD-ROOT PROGNAME...
#
# Look for ppd files in the directory PPD-ROOT.
# Descend into subdirectories, even if they are symlinks.
# However, ignore ppd files that don't belong to the same
# prefix ($NIX_STORE/$package_name) as PPD-ROOT-DIR does,
# to avoid stepping into other package's directories.
# ppd files may be gzipped; if the are,
# uncompress them, later recompress them.
# Skip symlinks to ppd files.
# PPD-ROOT may also be a single ppd file.
#
# Look for the PROGNAME executable in outputs and `buildInputs`,
# then look for PROGNAME invocations in the ppd files,
# without path or with common paths like `/usr/bin/$PROGNAME`.
# Replace those invocations with an absolute path to the
# corresponding executable from the outputs or `buildInputs`.
# Executables are searched where CUPS would search them,
# i.e., in `/bin` and `/lib/cups/filter`.
#
# As soon as an executable's path is replaced as
# described above, the package containing the binary
# is added to the list of propagated build inputs.
# This ensures the executable's package is still
# recognized as runtime dependency of the ppd file
# even if the ppd file is compressed lateron.
#
# PROGNAME may not contain spaces or tabs.
# The function will also likely fail or produce
# broken results if PROGNAME contains characters that
# require shell or regex escaping (e.g. a backslash).
patchPpdFileCommands () {
local bin binnew binold binoldgrep cupspath path ppdroot ppdrootprefix
# we will store some temporary data here
pushd "$(mktemp -d --tmpdir patch-ppd-file-commands.XXXX)"
# remember the ppd root path
[[ "$1" == $NIX_STORE/* ]] # ensure it's a store directory
ppdroot=$1
shift # now "$@" is the list of binaries
ppdrootprefix=${ppdroot%"/${ppdroot#"$NIX_STORE"/*/}"}
# create `cupspath` (where we should look for binaries),
# with these priorities
# * outputs of current build before buildInputs
# * `/lib/cups/filter' before `/bin`
# * add HOST_PATH at end, so we don't miss anything
for path in $outputs; do
addToSearchPath cupspath "${!path}/lib/cups/filter"
addToSearchPath cupspath "${!path}/bin"
done
for path in ${pkgsHostTarget+"${pkgsHostTarget[@]}"}; do
addToSearchPath cupspath "$path/lib/cups/filter"
addToSearchPath cupspath "$path/bin"
done
while read -r -d : path; do
addToSearchPath cupspath "$path"
done <<< "${HOST_PATH:+"${HOST_PATH}:"}"
# create list of compressed ppd files
# so we can recompress them later
find -L "$ppdroot" -type f -iname '*.ppd.gz' '!' -xtype l -print0 > gzipped
# decompress gzipped ppd files
echo "patchPpdFileCommands: decompressing $(grep -cz '^' < gzipped) gzipped ppd file(s) in $ppdroot"
xargs -0r -n 64 -P "$NIX_BUILD_CORES" gunzip < gzipped
# create list of all ppd files to be checked
find -L "$ppdroot" -type f -iname '*.ppd' '!' -xtype l -print0 > ppds
for bin in "$@"; do
# discover new path
binnew=$(PATH=$cupspath '@which@/bin/which' "$bin")
echo "patchPpdFileCommands: located binary $binnew"
# for each binary, we look for the name itself, but
# also for a couple of common paths that might be used
for binold in {/usr,}/{lib/cups/filter,sbin,bin}/"$bin" "$bin"; do
# escape regex characters in the old command string
binoldgrep=$(sed 's,[]$.*[\^],\\&,g' <<< "$binold")
# ...and surround old command with some regex
# that singles out shell command invocations
# to avoid replacing other strings that might contain the
# command name by accident (like "perl" in "perl-script")
binoldgrep='\(^\|[;&| '$'\t''"`(]\)'"$binoldgrep"'\($\|[);&| '$'\t''"`<>]\)'
# this string is used to *quickly* filter out
# unaffected files before the (slower) awk script runs;
# note that a similar regex is build in the awk script;
# if `binoldgrep` is changed, the awk script should also be checked
# create list of likely affected files
# (might yield exit status != 0 if there are no matches)
xargs -0r grep -lZ "$binoldgrep" < ppds > ppds-to-patch || true
echo "patchPpdFileCommands: $(grep -cz '^' < ppds-to-patch) ppd file(s) contain $binold"
# actually patch affected ppd files with awk;
# this takes some time but can be parallelized;
# speed up with LC_ALL=C, https://stackoverflow.com/a/33850386
LC_ALL=C xargs -0r -n 64 -P "$NIX_BUILD_CORES" \
awk -i inplace -v old="${binold//\\/\\\\}" -v new="${binnew//\\/\\\\}" -f "@awkscript@" \
< ppds-to-patch
done
# create list of affected files
xargs -0r grep -lZF "$binnew" < ppds > patched-ppds || true
echo "patchPpdFileCommands: $(grep -cz '^' < patched-ppds) ppd file(s) patched with $binnew"
# if the new command is contained in a file,
# remember the new path so we can add it to
# the list of propagated dependencies later
if [[ -s patched-ppds ]]; then
printf '%s\0' "${binnew%"/${binnew#"${NIX_STORE}"/*/}"}" >> dependencies
fi
done
# recompress ppd files that have been decompressed before
echo "patchPpdFileCommands: recompressing $(grep -cz '^' < gzipped) gzipped ppd file(s)"
# we can't just hand over the paths of the uncompressed files
# to gzip as it would add the lower-cased extension ".gz"
# even for files where the original was named ".GZ"
xargs -0r -n 1 -P "$NIX_BUILD_CORES" \
"$SHELL" -c 'gzip -9nS ".${0##*.}" "${0%.*}"' \
< gzipped
# enlist dependencies for propagation;
# this is needed in case ppd files are compressed later
# (Nix won't find dependency paths in compressed files)
if [[ -s dependencies ]]; then
# weed out duplicates from the dependency list first
sort -zu dependencies > sorted-dependencies
mkdir -p "$ppdrootprefix/nix-support"
while IFS= read -r -d '' path; do
printWords "$path" >> "$ppdrootprefix/nix-support/propagated-build-inputs"
# stdenv writes it's own `propagated-build-inputs`,
# based on the variable `propagatedBuildInputs`,
# but only to one output (`outputDev`).
# So we also add our dependencies to that variable.
# If our file survives as written above, great!
# If stdenv overwrits it,
# our dependencies will still be added to the file.
# The end result might contain too many
# propagated dependencies for multi-output packages,
# but never a broken package.
propagatedBuildInputs+=("$path")
done < sorted-dependencies
fi
popd
}

View File

@ -0,0 +1,50 @@
BEGIN {
# ppd file keys are separated from their values by a colon,
# but "options" may reside between the key name and the colon;
# options are separated from the key by spaces
# (we also permit tabs to be on the safe side)
FS = "[: \t]";
# escape regex characters in the old and new command strings
gsub(/[]\\.^$(){}|*+?[]/, "\\\\&", old);
gsub(/\\/, "\\\\&", new);
# ...and surround old command with some regex
# that singles out shell command invocations
# to avoid replacing other strings that might contain the
# command name by accident (like "perl" in "perl-script")
new = "\\1" new "\\2";
old = "(^|[;&| \\t\"`(])" old "($|[);&| \\t\"`<>])";
# note that a similar regex is build in the shell script to
# filter out unaffected files before this awk script is called;
# if the regex here is changed, the shell script should also be checked
# list of PPD keys that contain executable names or scripts, see
# https://refspecs.linuxfoundation.org/LSB_4.0.0/LSB-Printing/LSB-Printing/ppdext.html
# https://www.cups.org/doc/spec-ppd.html
cmds["*APAutoSetupTool"] = "";
cmds["*APPrinterLowInkTool"] = "";
cmds["*FoomaticRIPCommandLine"] = "";
cmds["*FoomaticRIPPostPipe"] = "";
cmds["*cupsFilter"] = "";
cmds["*cupsFilter2"] = "";
cmds["*cupsPreFilter"] = "";
}
# since comments always start with "*%",
# this mechanism also properly recognizes (and ignores) them
{
# if the current line starts a new key,
# check if it is a command-containing key;
# also reset the `isCmd` flag if a new file begins
if ($0 ~ /^\*/ || FNR == 1) { isCmd = ($1 in cmds) }
# replace commands if the current keys might contain commands
if (isCmd) { $0 = gensub(old, new, "g") }
print
}

View File

@ -0,0 +1,40 @@
{ substituteAll
, diffutils
, stdenv
, patchPpdFilesHook
}:
let
input = substituteAll {
src = ./test.ppd;
keep = "cmp";
patch = "cmp";
pathkeep = "/bin/cmp";
pathpatch = "/bin/cmp";
};
output = substituteAll {
src = ./test.ppd;
keep = "cmp";
patch = "${diffutils}/bin/cmp";
pathkeep = "/bin/cmp";
pathpatch = "${diffutils}/bin/cmp";
};
in
stdenv.mkDerivation {
name = "${patchPpdFilesHook.name}-test";
buildInputs = [ diffutils ];
nativeBuildInputs = [ diffutils patchPpdFilesHook ];
dontUnpack = true;
dontInstall = true;
ppdFileCommands = [ "cmp" ];
preFixup = ''
install -D "${input}" "${placeholder "out"}/share/cups/model/test.ppd"
install -D "${input}" "${placeholder "out"}/share/ppds/test.ppd"
'';
postFixup = ''
diff --color --report-identical-files "${output}" "${placeholder "out"}/share/cups/model/test.ppd"
diff --color --report-identical-files "${output}" "${placeholder "out"}/share/ppds/test.ppd"
'';
}

View File

@ -0,0 +1,22 @@
*% This comment: might look like a command @keep@
*% but it should be left untouched
*SomeKey: do not replace this @keep@
*APAutoSetupTool: do replace this @patch@
*FoomaticRIPCommandLine: "patch also @patch@
in a multi-line command @patch@
and another line @patch@
*SomeKey: "stop patching on new non-command key @keep@
and remember the key in the next line @keep@"
*cupsFilter option: recognize keys with options @patch@
*cupsFilter : handle strange spacing;@patch@
*cupsFilter : handle tabulator @patch@
*cupsFilter: patch common paths @pathpatch@
*cupsFilter: patch quoted commands "@patch@"
*cupsFilter: patch commands in subshell (@patch@)
*cupsFilter: patch commands in subshell `@pathpatch@`
*cupsFilter: keep uncommon paths /fancy/@pathkeep@
*cupsFilter: keep entangled commands-@keep@
*cupsFilter: keep entangled commands\@keep@
*cupsFilter: keep entangled commands @keep@()
*cupsFilter: keep entangled commands @pathkeep@-cmd
*%cupsFilter: This comment should also be left as is @pathkeep@

View File

@ -14,6 +14,7 @@
, numactl
, perl
, python3
, python3Packages
, rocclr
, rocm-comgr
, rocm-device-libs
@ -29,13 +30,13 @@
let
hip = stdenv.mkDerivation rec {
pname = "hip";
version = "5.3.0";
version = "5.3.1";
src = fetchFromGitHub {
owner = "ROCm-Developer-Tools";
repo = "HIP";
rev = "rocm-${version}";
hash = "sha256-UAodlVUiTU4n/EyvTIuQekTGh4izmBjKCRXOHXVKY4M=";
hash = "sha256-kmRvrwnT0h2dBMI+H9d1vmeW3TmDBD+qW4YYhaMV2dE=";
};
patches = [
@ -109,17 +110,17 @@ let
in
stdenv.mkDerivation rec {
pname = "hip";
version = "5.3.0";
version = "5.3.1";
src = fetchFromGitHub {
owner = "ROCm-Developer-Tools";
repo = "hipamd";
rev = "rocm-${version}";
hash = "sha256-gZGZiDP/HbdmzLQkG9Jq9lyMP9hoD6UzTMiX9cUmQNA=";
hash = "sha256-i7hT/j+V0LT6Va2XcQyyKXF1guoIyhcOHvn842wCRx4=";
};
nativeBuildInputs = [ cmake python3 makeWrapper perl ];
buildInputs = [ libxml2 numactl libglvnd libX11 ];
buildInputs = [ libxml2 numactl libglvnd libX11 python3Packages.cppheaderparser ];
propagatedBuildInputs = [
clang
llvm

View File

@ -1,12 +1,12 @@
{ stdenv, lib, buildPackages, fetchFromGitHub, callPackage, wrapCCWith, overrideCC }:
let
version = "5.3.0";
version = "5.3.1";
src = fetchFromGitHub {
owner = "RadeonOpenCompute";
repo = "llvm-project";
rev = "rocm-${version}";
hash = "sha256-MN7W4Gl6+a1nCozdn9gMzIXOiBPquoOP87x26boeSCA=";
hash = "sha256-IKo7N8wWvh5PBrZ2mh1Vu5s3uUXhanqYtC4qLV/+JBs=";
};
in rec {
clang = wrapCCWith rec {

View File

@ -111,19 +111,14 @@ let
};
self = mkDerivation rec {
version = "7.1.0";
version = "7.3.0";
pname = "octave";
src = fetchurl {
url = "mirror://gnu/octave/${pname}-${version}.tar.gz";
sha256 = "sha256-1KnYHz9ntKbgfLeoDcsQrV6RdvzDB2LHCoFYCmS4sLY=";
sha256 = "sha256-bhSkZJ1wr0WrZg+Mu/ZFqvHsM/JfiL/aRpfLF+RAxPU=";
};
patches = [
# https://savannah.gnu.org/bugs/?func=detailitem&item_id=62436
./patches/bug62436.patch
];
buildInputs = [
readline
ncurses

View File

@ -0,0 +1,44 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, rocm-cmake
, rocm-device-libs
, clang
}:
stdenv.mkDerivation rec {
pname = "clang-ocl";
rocmVersion = "5.3.1";
version = rocmVersion;
src = fetchFromGitHub {
owner = "RadeonOpenCompute";
repo = "clang-ocl";
rev = "rocm-${rocmVersion}";
hash = "sha256-uMSvcVJj+me2E+7FsXZ4l4hTcK6uKEegXpkHGcuist0=";
};
nativeBuildInputs = [
cmake
rocm-cmake
clang
];
buildInputs = [
rocm-device-libs
];
cmakeFlags = [
"-DCMAKE_C_COMPILER=clang"
"-DCMAKE_CXX_COMPILER=clang++"
];
meta = with lib; {
description = "OpenCL compilation with clang compiler";
homepage = "https://github.com/RadeonOpenCompute/clang-ocl";
license = with licenses; [ mit ];
maintainers = with maintainers; [ Madouura ];
broken = rocmVersion != clang.version;
};
}

View File

@ -0,0 +1,91 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, rocm-cmake
, hip
, openmp
, gtest ? null
, buildTests ? false
, buildExamples ? false
, gpuTargets ? null # gpuTargets = [ "gfx803" "gfx900" "gfx1030" ... ]
}:
assert buildTests -> gtest != null;
# Several tests seem to either not compile or have a race condition
# Undefined reference to symbol '_ZTIN7testing4TestE'
# Try removing this next update
assert buildTests == false;
stdenv.mkDerivation rec {
pname = "composable_kernel";
version = "unstable-2022-11-02";
outputs = [
"out"
] ++ lib.optionals buildTests [
"test"
] ++ lib.optionals buildExamples [
"example"
];
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "composable_kernel";
rev = "79aa3fb1793c265c59d392e916baa851a55521c8";
hash = "sha256-vIfMdvRYCTqrjMGSb7gQfodzLw2wf3tGoCAa5jtfbvw=";
};
nativeBuildInputs = [
cmake
rocm-cmake
hip
];
buildInputs = [
openmp
] ++ lib.optionals buildTests [
gtest
];
cmakeFlags = [
"-DCMAKE_C_COMPILER=hipcc"
"-DCMAKE_CXX_COMPILER=hipcc"
] ++ lib.optionals (gpuTargets != null) [
"-DGPU_TARGETS=${lib.strings.concatStringsSep ";" gpuTargets}"
];
# No flags to build selectively it seems...
postPatch = ''
substituteInPlace test/CMakeLists.txt \
--replace "include(googletest)" ""
substituteInPlace CMakeLists.txt \
--replace "enable_testing()" ""
'' + lib.optionalString (!buildTests) ''
substituteInPlace CMakeLists.txt \
--replace "add_subdirectory(test)" ""
'' + lib.optionalString (!buildExamples) ''
substituteInPlace CMakeLists.txt \
--replace "add_subdirectory(example)" ""
'';
postInstall = ''
mkdir -p $out/bin
mv bin/ckProfiler $out/bin
'' + lib.optionalString buildTests ''
mkdir -p $test/bin
mv bin/test_* $test/bin
'' + lib.optionalString buildExamples ''
mkdir -p $example/bin
mv bin/example_* $example/bin
'';
meta = with lib; {
description = "Performance portable programming model for machine learning tensor operators";
homepage = "https://github.com/ROCmSoftwarePlatform/composable_kernel";
license = with licenses; [ mit ];
maintainers = with maintainers; [ Madouura ];
};
}

View File

@ -0,0 +1,89 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, rocm-cmake
, rocm-runtime
, rocm-device-libs
, rocm-comgr
, rocprim
, hip
, gtest ? null
, gbenchmark ? null
, buildTests ? false
, buildBenchmarks ? false
}:
assert buildTests -> gtest != null;
assert buildBenchmarks -> gbenchmark != null;
# CUB can also be used as a backend instead of rocPRIM.
stdenv.mkDerivation rec {
pname = "hipcub";
rocmVersion = "5.3.1";
version = "2.12.0-${rocmVersion}";
outputs = [
"out"
] ++ lib.optionals buildTests [
"test"
] ++ lib.optionals buildBenchmarks [
"benchmark"
];
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "hipCUB";
rev = "rocm-${rocmVersion}";
hash = "sha256-/GMZKbMD1sZQCM2FulM9jiJQ8ByYZinn0C8d/deFh0g=";
};
nativeBuildInputs = [
cmake
rocm-cmake
hip
];
buildInputs = [
rocm-runtime
rocm-device-libs
rocm-comgr
rocprim
] ++ lib.optionals buildTests [
gtest
] ++ lib.optionals buildBenchmarks [
gbenchmark
];
cmakeFlags = [
"-DCMAKE_CXX_COMPILER=hipcc"
"-DHIP_ROOT_DIR=${hip}"
# Manually define CMAKE_INSTALL_<DIR>
# See: https://github.com/NixOS/nixpkgs/pull/197838
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
] ++ lib.optionals buildTests [
"-DBUILD_TEST=ON"
] ++ lib.optionals buildBenchmarks [
"-DBUILD_BENCHMARK=ON"
];
postInstall = lib.optionalString buildTests ''
mkdir -p $test/bin
mv $out/bin/test_* $test/bin
'' + lib.optionalString buildBenchmarks ''
mkdir -p $benchmark/bin
mv $out/bin/benchmark_* $benchmark/bin
'' + lib.optionalString (buildTests || buildBenchmarks) ''
rmdir $out/bin
'';
meta = with lib; {
description = "Thin wrapper library on top of rocPRIM or CUB";
homepage = "https://github.com/ROCmSoftwarePlatform/hipCUB";
license = with licenses; [ bsd3 ];
maintainers = with maintainers; [ Madouura ];
broken = rocmVersion != hip.version;
};
}

View File

@ -0,0 +1,132 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, rocm-cmake
, rocm-runtime
, rocm-device-libs
, rocm-comgr
, rocsparse
, hip
, gfortran
, git
, fetchzip ? null
, gtest ? null
, buildTests ? false
}:
assert buildTests -> fetchzip != null;
assert buildTests -> gtest != null;
# This can also use cuSPARSE as a backend instead of rocSPARSE
let
matrices = lib.optionalAttrs buildTests import ./deps.nix {
inherit fetchzip;
mirror1 = "https://sparse.tamu.edu/MM";
mirror2 = "https://www.cise.ufl.edu/research/sparse/MM";
};
in stdenv.mkDerivation rec {
pname = "hipsparse";
rocmVersion = "5.3.1";
version = "2.3.1-${rocmVersion}";
outputs = [
"out"
] ++ lib.optionals buildTests [
"test"
];
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "hipSPARSE";
rev = "rocm-${rocmVersion}";
hash = "sha256-Phcihat774ZSAe1QetE/GSZzGlnCnvS9GwsHBHCaD4c=";
};
nativeBuildInputs = [
cmake
rocm-cmake
hip
gfortran
];
buildInputs = [
rocm-runtime
rocm-device-libs
rocm-comgr
rocsparse
git
] ++ lib.optionals buildTests [
gtest
];
cmakeFlags = [
"-DCMAKE_CXX_COMPILER=hipcc"
# Manually define CMAKE_INSTALL_<DIR>
# See: https://github.com/NixOS/nixpkgs/pull/197838
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
] ++ lib.optionals buildTests [
"-DBUILD_CLIENTS_TESTS=ON"
];
# We have to manually generate the matrices
# CMAKE_MATRICES_DIR seems to be reset in clients/tests/CMakeLists.txt
postPatch = ''
substituteInPlace clients/common/utility.cpp \
--replace "#ifdef __cpp_lib_filesystem" " #if true"
'' + lib.optionalString buildTests ''
mkdir -p matrices
ln -s ${matrices.matrix-01}/*.mtx matrices
ln -s ${matrices.matrix-02}/*.mtx matrices
ln -s ${matrices.matrix-03}/*.mtx matrices
ln -s ${matrices.matrix-04}/*.mtx matrices
ln -s ${matrices.matrix-05}/*.mtx matrices
ln -s ${matrices.matrix-06}/*.mtx matrices
ln -s ${matrices.matrix-07}/*.mtx matrices
ln -s ${matrices.matrix-08}/*.mtx matrices
ln -s ${matrices.matrix-09}/*.mtx matrices
ln -s ${matrices.matrix-10}/*.mtx matrices
ln -s ${matrices.matrix-11}/*.mtx matrices
ln -s ${matrices.matrix-12}/*.mtx matrices
ln -s ${matrices.matrix-13}/*.mtx matrices
ln -s ${matrices.matrix-14}/*.mtx matrices
ln -s ${matrices.matrix-15}/*.mtx matrices
ln -s ${matrices.matrix-16}/*.mtx matrices
ln -s ${matrices.matrix-17}/*.mtx matrices
ln -s ${matrices.matrix-18}/*.mtx matrices
ln -s ${matrices.matrix-19}/*.mtx matrices
# Not used by the original cmake, causes an error
rm matrices/*_b.mtx
echo "deps/convert.cpp -> deps/mtx2csr"
hipcc deps/convert.cpp -O3 -o deps/mtx2csr
for mat in $(ls -1 matrices | cut -d "." -f 1); do
echo "mtx2csr: $mat.mtx -> $mat.bin"
deps/mtx2csr matrices/$mat.mtx matrices/$mat.bin
unlink matrices/$mat.mtx
done
substituteInPlace clients/tests/CMakeLists.txt \
--replace "\''${PROJECT_BINARY_DIR}/matrices" "/build/source/matrices"
'';
postInstall = lib.optionalString buildTests ''
mkdir -p $test/bin
mv $out/bin/hipsparse-test $test/bin
mv /build/source/matrices $test
rmdir $out/bin
'';
meta = with lib; {
description = "ROCm SPARSE marshalling library";
homepage = "https://github.com/ROCmSoftwarePlatform/hipSPARSE";
license = with licenses; [ mit ];
maintainers = with maintainers; [ Madouura ];
broken = rocmVersion != hip.version;
};
}

View File

@ -0,0 +1,177 @@
{ fetchzip
, mirror1
, mirror2
}:
{
matrix-01 = fetchzip {
sha256 = "sha256-AHur5ZIDZTFRrO2GV0ieXrffq4KUiGWiZ59pv0fUtEQ=";
urls = [
"${mirror1}/SNAP/amazon0312.tar.gz"
"${mirror2}/SNAP/amazon0312.tar.gz"
];
};
matrix-02 = fetchzip {
sha256 = "sha256-0rSxaN4lQcdaCLsvlgicG70FXUxXeERPiEmQ4MzbRdE=";
urls = [
"${mirror1}/Muite/Chebyshev4.tar.gz"
"${mirror2}/Muite/Chebyshev4.tar.gz"
];
};
matrix-03 = fetchzip {
sha256 = "sha256-hDzDWDUnHEyFedX/tMNq83ZH8uWyM4xtZYUUAD3rizo=";
urls = [
"${mirror1}/FEMLAB/sme3Dc.tar.gz"
"${mirror2}/FEMLAB/sme3Dc.tar.gz"
];
};
matrix-04 = fetchzip {
sha256 = "sha256-GmN2yOt/MoX01rKe05aTyB3ypUP4YbQGOITZ0BqPmC0=";
urls = [
"${mirror1}/Williams/webbase-1M.tar.gz"
"${mirror2}/Williams/webbase-1M.tar.gz"
];
};
matrix-05 = fetchzip {
sha256 = "sha256-gQNjfVyWzNM9RwImJGhkhahRmZz74LzDs1oijL7mI7k=";
urls = [
"${mirror1}/Williams/mac_econ_fwd500.tar.gz"
"${mirror2}/Williams/mac_econ_fwd500.tar.gz"
];
};
matrix-06 = fetchzip {
sha256 = "sha256-87cdZjntNcTuz5BtO59irhcuRbPllWSbhCEX3Td02qc=";
urls = [
"${mirror1}/Williams/mc2depi.tar.gz"
"${mirror2}/Williams/mc2depi.tar.gz"
];
};
matrix-07 = fetchzip {
sha256 = "sha256-WRamuJX3D8Tm+k0q67RjUDG3DeNAxhKiaPkk5afY5eU=";
urls = [
"${mirror1}/Bova/rma10.tar.gz"
"${mirror2}/Bova/rma10.tar.gz"
];
};
matrix-08 = fetchzip {
sha256 = "sha256-5dhkm293Mc3lzakKxHy5W5XIn4Rw+gihVh7gyrjEHXo=";
urls = [
"${mirror1}/JGD_BIBD/bibd_22_8.tar.gz"
"${mirror2}/JGD_BIBD/bibd_22_8.tar.gz"
];
};
matrix-09 = fetchzip {
sha256 = "sha256-czjLWCjXAjZCk5TGYHaEkwSAzQu3TQ3QyB6eNKR4G88=";
urls = [
"${mirror1}/Hamm/scircuit.tar.gz"
"${mirror2}/Hamm/scircuit.tar.gz"
];
};
matrix-10 = fetchzip {
sha256 = "sha256-bYuLnJViAIcIejAkh69/bsNAVIDU4wfTLtD+nmHd6FM=";
urls = [
"${mirror1}/Sandia/ASIC_320k.tar.gz"
"${mirror2}/Sandia/ASIC_320k.tar.gz"
];
};
matrix-11 = fetchzip {
sha256 = "sha256-aDwn8P1khYjo2Agbq5m9ZBInJUxf/knJNvyptt0fak0=";
urls = [
"${mirror1}/GHS_psdef/bmwcra_1.tar.gz"
"${mirror2}/GHS_psdef/bmwcra_1.tar.gz"
];
};
matrix-12 = fetchzip {
sha256 = "sha256-8OJqA/byhlAZd869TPUzZFdsOiwOoRGfKyhM+RMjXoY=";
urls = [
"${mirror1}/HB/nos1.tar.gz"
"${mirror2}/HB/nos1.tar.gz"
];
};
matrix-13 = fetchzip {
sha256 = "sha256-FS0rKqmg+uHwsM/yGfQLBdd7LH/rUrdutkNGBD/Mh1I=";
urls = [
"${mirror1}/HB/nos2.tar.gz"
"${mirror2}/HB/nos2.tar.gz"
];
};
matrix-14 = fetchzip {
sha256 = "sha256-DANnlrNJikrI7Pst9vRedtbuxepyHmCIu2yhltc4Qcs=";
urls = [
"${mirror1}/HB/nos3.tar.gz"
"${mirror2}/HB/nos3.tar.gz"
];
};
matrix-15 = fetchzip {
sha256 = "sha256-21mUgqjWGUfYgiWwSrKh9vH8Vdt3xzcefmqYNYRpxiY=";
urls = [
"${mirror1}/HB/nos4.tar.gz"
"${mirror2}/HB/nos4.tar.gz"
];
};
matrix-16 = fetchzip {
sha256 = "sha256-FOuXvGqBBFNkVS6cexmkluret54hCfCOdK+DOZllE4c=";
urls = [
"${mirror1}/HB/nos5.tar.gz"
"${mirror2}/HB/nos5.tar.gz"
];
};
matrix-17 = fetchzip {
sha256 = "sha256-+7NI1rA/qQxYPpjXKHvAaCZ+LSaAJ4xuJvMRMBEUYxg=";
urls = [
"${mirror1}/HB/nos6.tar.gz"
"${mirror2}/HB/nos6.tar.gz"
];
};
matrix-18 = fetchzip {
sha256 = "sha256-q3NxJjbwGGcFiQ9nhWfUKgZmdVwCfPmgQoqy0AqOsNc=";
urls = [
"${mirror1}/HB/nos7.tar.gz"
"${mirror2}/HB/nos7.tar.gz"
];
};
matrix-19 = fetchzip {
sha256 = "sha256-0GAN6qmVfD+tprIigzuUUUwm5KVhkN9X65wMEvFltDY=";
urls = [
"${mirror1}/DNVS/shipsec1.tar.gz"
"${mirror2}/DNVS/shipsec1.tar.gz"
];
};
}

View File

@ -0,0 +1,129 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, rocm-cmake
, rocm-opencl-runtime
, clang
, texlive ? null
, doxygen ? null
, sphinx ? null
, python3Packages ? null
, openblas ? null
, buildDocs ? false
, buildTests ? false
, buildBenchmarks ? false
}:
assert buildDocs -> texlive != null;
assert buildDocs -> doxygen != null;
assert buildDocs -> sphinx != null;
assert buildDocs -> python3Packages != null;
assert buildTests -> openblas != null;
let
latex = lib.optionalAttrs buildDocs (texlive.combine {
inherit (texlive) scheme-small
latexmk
tex-gyre
fncychap
wrapfig
capt-of
framed
needspace
tabulary
varwidth
titlesec;
});
in stdenv.mkDerivation rec {
pname = "miopengemm";
rocmVersion = "5.3.1";
version = rocmVersion;
outputs = [
"out"
] ++ lib.optionals buildDocs [
"docs"
] ++ lib.optionals buildTests [
"test"
] ++ lib.optionals buildBenchmarks [
"benchmark"
];
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "MIOpenGEMM";
rev = "rocm-${rocmVersion}";
hash = "sha256-AiRzOMYRA/0nbQomyq4oOEwNZdkPYWRA2W6QFlctvFc=";
};
nativeBuildInputs = [
cmake
rocm-cmake
clang
];
buildInputs = [
rocm-opencl-runtime
] ++ lib.optionals buildDocs [
latex
doxygen
sphinx
python3Packages.sphinx_rtd_theme
python3Packages.breathe
] ++ lib.optionals buildTests [
openblas
];
cmakeFlags = [
"-DCMAKE_C_COMPILER=clang"
"-DCMAKE_CXX_COMPILER=clang++"
# Manually define CMAKE_INSTALL_<DIR>
# See: https://github.com/NixOS/nixpkgs/pull/197838
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
] ++ lib.optionals buildTests [
"-DOPENBLAS=ON"
] ++ lib.optionals buildBenchmarks [
"-DAPI_BENCH_MIOGEMM=ON"
# Needs https://github.com/CNugteren/CLBlast
# "-DAPI_BENCH_CLBLAST=ON"
# Needs https://github.com/openai/triton
# "-DAPI_BENCH_ISAAC=ON"
];
# Unfortunately, it seems like we have to call make on these manually
postBuild = lib.optionalString buildDocs ''
export HOME=$(mktemp -d)
make doc
'' + lib.optionalString buildTests ''
make check
'' + lib.optionalString buildBenchmarks ''
make examples
'';
postInstall = lib.optionalString buildTests ''
mkdir -p $test/bin
find tests -executable -type f -exec mv {} $test/bin \;
patchelf --set-rpath ${lib.makeLibraryPath buildInputs}:$out/lib $test/bin/*
'' + lib.optionalString buildBenchmarks ''
mkdir -p $benchmark/bin
find examples -executable -type f -exec mv {} $benchmark/bin \;
patchelf --set-rpath ${lib.makeLibraryPath buildInputs}:$out/lib $benchmark/bin/*
'';
postFixup = lib.optionalString buildDocs ''
mkdir -p $docs/share/doc/miopengemm
mv ../doc/html $docs/share/doc/miopengemm
mv ../doc/pdf/miopengemm.pdf $docs/share/doc/miopengemm
'';
meta = with lib; {
description = "OpenCL general matrix multiplication API for ROCm";
homepage = "https://github.com/ROCmSoftwarePlatform/MIOpenGEMM";
license = with licenses; [ mit ];
maintainers = with maintainers; [ Madouura ];
broken = rocmVersion != clang.version;
};
}

View File

@ -0,0 +1,84 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, rocm-cmake
, rocm-runtime
, rocm-device-libs
, rocm-comgr
, rocm-smi
, hip
, gtest
, chrpath ? null
, buildTests ? false
}:
assert buildTests -> chrpath != null;
stdenv.mkDerivation rec {
pname = "rccl";
rocmVersion = "5.3.1";
version = "2.12.10-${rocmVersion}";
outputs = [
"out"
] ++ lib.optionals buildTests [
"test"
];
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "rccl";
rev = "rocm-${rocmVersion}";
hash = "sha256-whRXGD8oINDYhFs8+hEWKWoGNqacGlyy7xi8peA8Qsk=";
};
nativeBuildInputs = [
cmake
rocm-cmake
hip
];
buildInputs = [
rocm-runtime
rocm-device-libs
rocm-comgr
rocm-smi
gtest
] ++ lib.optionals buildTests [
chrpath
];
cmakeFlags = [
"-DCMAKE_C_COMPILER=hipcc"
"-DCMAKE_CXX_COMPILER=hipcc"
# Manually define CMAKE_INSTALL_<DIR>
# See: https://github.com/NixOS/nixpkgs/pull/197838
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
] ++ lib.optionals buildTests [
"-DBUILD_TESTS=ON"
];
# Replace the manually set parallel jobs to NIX_BUILD_CORES
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "8 P" "$NIX_BUILD_CORES P" \
--replace "8)" "$NIX_BUILD_CORES)"
'';
postInstall = lib.optionalString buildTests ''
mkdir -p $test/bin
mv $out/bin/* $test/bin
rmdir $out/bin
'';
meta = with lib; {
description = "ROCm communication collectives library";
homepage = "https://github.com/ROCmSoftwarePlatform/rccl";
license = with licenses; [ bsd2 bsd3 ];
maintainers = with maintainers; [ Madouura ];
broken = rocmVersion != hip.version;
};
}

View File

@ -0,0 +1,136 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, rocm-cmake
, rocm-runtime
, rocm-device-libs
, rocm-comgr
, hip
, python3
, tensile ? null
, msgpack ? null
, libxml2 ? null
, llvm ? null
, python3Packages ? null
, gtest ? null
, gfortran ? null
, buildTensile ? true
, buildTests ? false
, buildBenchmarks ? false
, tensileLogic ? "asm_full"
, tensileCOVersion ? "V3"
, tensileSepArch ? true
, tensileLazyLib ? true
, tensileLibFormat ? "msgpack"
, gpuTargets ? [ "all" ]
}:
assert buildTensile -> tensile != null;
assert buildTensile -> msgpack != null;
assert buildTensile -> libxml2 != null;
assert buildTensile -> llvm != null;
assert buildTensile -> python3Packages != null;
assert buildTests -> gtest != null;
assert buildTests -> gfortran != null;
# Tests and benchmarks are a can of worms that I will tackle in a different PR
# It involves completely rewriting the amd-blis derivation
assert buildTests == false;
assert buildBenchmarks == false;
stdenv.mkDerivation rec {
pname = "rocblas";
rocmVersion = "5.3.1";
version = "2.45.0-${rocmVersion}";
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "rocBLAS";
rev = "rocm-${rocmVersion}";
hash = "sha256-GeeICEI1dNE6D+nUUlBtUncLkPowAa5n+bsy160EtaU=";
};
# We currently need this patch due to faulty toolchain includes
# See: https://github.com/ROCmSoftwarePlatform/rocBLAS/issues/1277
patches = [
(fetchpatch {
name = "only-std_norm-from-rocblas_complex.patch";
url = "https://github.com/ROCmSoftwarePlatform/rocBLAS/commit/44b99c6df26002139ca9ec68ee1fc8899c7b001f.patch";
hash = "sha256-vSZkVYY951fqfOThKFqnYBasWMblS6peEJZ6sFMCk9k=";
})
];
nativeBuildInputs = [
cmake
rocm-cmake
hip
];
buildInputs = [
rocm-runtime
rocm-device-libs
rocm-comgr
python3
] ++ lib.optionals buildTensile [
msgpack
libxml2
llvm
python3Packages.pyyaml
python3Packages.msgpack
] ++ lib.optionals buildTests [
gtest
gfortran
];
cmakeFlags = [
"-DCMAKE_C_COMPILER=hipcc"
"-DCMAKE_CXX_COMPILER=hipcc"
"-Dpython=python3"
"-DAMDGPU_TARGETS=${lib.strings.concatStringsSep ";" gpuTargets}"
"-DBUILD_WITH_TENSILE=${if buildTensile then "ON" else "OFF"}"
# Manually define CMAKE_INSTALL_<DIR>
# See: https://github.com/NixOS/nixpkgs/pull/197838
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
] ++ lib.optionals buildTensile [
"-DVIRTUALENV_HOME_DIR=/build/source/tensile"
"-DTensile_TEST_LOCAL_PATH=/build/source/tensile"
"-DTensile_ROOT=/build/source/tensile/lib/python${python3.pythonVersion}/site-packages/Tensile"
"-DTensile_LOGIC=${tensileLogic}"
"-DTensile_CODE_OBJECT_VERSION=${tensileCOVersion}"
"-DTensile_SEPARATE_ARCHITECTURES=${if tensileSepArch then "ON" else "OFF"}"
"-DTensile_LAZY_LIBRARY_LOADING=${if tensileLazyLib then "ON" else "OFF"}"
"-DTensile_LIBRARY_FORMAT=${tensileLibFormat}"
] ++ lib.optionals buildTests [
"-DBUILD_CLIENTS_TESTS=ON"
] ++ lib.optionals buildBenchmarks [
"-DBUILD_CLIENTS_BENCHMARKS=ON"
];
# Tensile REALLY wants to write to the nix directory if we include it normally
# We need to manually fixup the path so tensile will generate .co and .dat files
postPatch = lib.optionalString buildTensile ''
export PATH=${llvm}/bin:$PATH
cp -a ${tensile} tensile
chmod +w -R tensile
# Rewrap Tensile
substituteInPlace tensile/bin/{.t*,.T*,*} \
--replace "${tensile}" "/build/source/tensile"
substituteInPlace CMakeLists.txt \
--replace "include(virtualenv)" "" \
--replace "virtualenv_install(\''${Tensile_TEST_LOCAL_PATH})" ""
'';
meta = with lib; {
description = "BLAS implementation for ROCm platform";
homepage = "https://github.com/ROCmSoftwarePlatform/rocBLAS";
license = with licenses; [ mit ];
maintainers = with maintainers; [ Madouura ];
broken = rocmVersion != hip.version;
};
}

View File

@ -7,13 +7,13 @@
stdenv.mkDerivation rec {
pname = "rocclr";
version = "5.3.0";
version = "5.3.1";
src = fetchFromGitHub {
owner = "ROCm-Developer-Tools";
repo = "ROCclr";
rev = "rocm-${version}";
hash = "sha256-l14+l8FkiFmGuRZ9dyD/PEYH9nHVRRg1vMXMnVhg3K4=";
hash = "sha256-dmL9krI/gHGQdOZ53+bQ7WjKcmJ+fZZP0lzF8ITLT4E=";
};
patches = [

View File

@ -0,0 +1,114 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, rocm-cmake
, rocm-runtime
, rocm-device-libs
, rocm-comgr
, hip
, sqlite
, python3
, gtest ? null
, boost ? null
, fftw ? null
, fftwFloat ? null
, llvmPackages ? null
, buildTests ? false
, buildBenchmarks ? false
}:
assert buildTests -> gtest != null;
assert buildBenchmarks -> fftw != null;
assert buildBenchmarks -> fftwFloat != null;
assert (buildTests || buildBenchmarks) -> boost != null;
assert (buildTests || buildBenchmarks) -> llvmPackages != null;
stdenv.mkDerivation rec {
pname = "rocfft";
rocmVersion = "5.3.1";
version = "1.0.18-${rocmVersion}";
outputs = [
"out"
] ++ lib.optionals buildTests [
"test"
] ++ lib.optionals buildBenchmarks [
"benchmark"
];
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "rocFFT";
rev = "rocm-${rocmVersion}";
hash = "sha256-jb2F1fRe+YLloYJ/KtzrptUDhmdBDBtddeW/g55owKM=";
};
nativeBuildInputs = [
cmake
rocm-cmake
hip
];
buildInputs = [
rocm-runtime
rocm-device-libs
rocm-comgr
sqlite
python3
] ++ lib.optionals buildTests [
gtest
] ++ lib.optionals (buildTests || buildBenchmarks) [
boost
fftw
fftwFloat
llvmPackages.openmp
];
propogatedBuildInputs = lib.optionals buildTests [
fftw
fftwFloat
];
cmakeFlags = [
"-DCMAKE_C_COMPILER=hipcc"
"-DCMAKE_CXX_COMPILER=hipcc"
"-DUSE_HIP_CLANG=ON"
"-DSQLITE_USE_SYSTEM_PACKAGE=ON"
# Manually define CMAKE_INSTALL_<DIR>
# See: https://github.com/NixOS/nixpkgs/pull/197838
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
] ++ lib.optionals buildTests [
"-DBUILD_CLIENTS_TESTS=ON"
] ++ lib.optionals buildBenchmarks [
"-DBUILD_CLIENTS_RIDER=ON"
"-DBUILD_CLIENTS_SAMPLES=ON"
];
postInstall = lib.optionalString buildTests ''
mkdir -p $test/{bin,lib/fftw}
cp -a $out/bin/* $test/bin
ln -s ${fftw}/lib/libfftw*.so $test/lib/fftw
ln -s ${fftwFloat}/lib/libfftw*.so $test/lib/fftw
rm -r $out/lib/fftw
rm $test/bin/{rocfft_rtc_helper,*-rider} || true
'' + lib.optionalString buildBenchmarks ''
mkdir -p $benchmark/bin
cp -a $out/bin/* $benchmark/bin
rm $benchmark/bin/{rocfft_rtc_helper,*-test} || true
'' + lib.optionalString (buildTests || buildBenchmarks ) ''
mv $out/bin/rocfft_rtc_helper $out
rm -r $out/bin/*
mv $out/rocfft_rtc_helper $out/bin
'';
meta = with lib; {
description = "FFT implementation for ROCm ";
homepage = "https://github.com/ROCmSoftwarePlatform/rocFFT";
license = with licenses; [ mit ];
maintainers = with maintainers; [ Madouura ];
broken = rocmVersion != hip.version;
};
}

View File

@ -2,7 +2,7 @@
stdenv.mkDerivation rec {
pname = "rocm-comgr";
version = "5.3.0";
version = "5.3.1";
src = fetchFromGitHub {
owner = "RadeonOpenCompute";

View File

@ -8,7 +8,7 @@
stdenv.mkDerivation rec {
pname = "rocm-device-libs";
version = "5.3.0";
version = "5.3.1";
src = fetchFromGitHub {
owner = "RadeonOpenCompute";

View File

@ -22,7 +22,7 @@
stdenv.mkDerivation rec {
pname = "rocm-opencl-runtime";
version = "5.3.0";
version = "5.3.1";
src = fetchFromGitHub {
owner = "RadeonOpenCompute";

View File

@ -15,7 +15,7 @@
stdenv.mkDerivation rec {
pname = "rocm-runtime";
version = "5.3.0";
version = "5.3.1";
src = fetchFromGitHub {
owner = "RadeonOpenCompute";

View File

@ -9,7 +9,7 @@
stdenv.mkDerivation rec {
pname = "rocm-thunk";
version = "5.3.0";
version = "5.3.1";
src = fetchFromGitHub {
owner = "RadeonOpenCompute";

View File

@ -0,0 +1,85 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, rocm-cmake
, rocm-runtime
, rocm-device-libs
, rocm-comgr
, hip
, gtest ? null
, gbenchmark ? null
, buildTests ? false
, buildBenchmarks ? false
}:
assert buildTests -> gtest != null;
assert buildBenchmarks -> gbenchmark != null;
stdenv.mkDerivation rec {
pname = "rocprim";
rocmVersion = "5.3.1";
version = "2.11.0-${rocmVersion}";
outputs = [
"out"
] ++ lib.optionals buildTests [
"test"
] ++ lib.optionals buildBenchmarks [
"benchmark"
];
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "rocPRIM";
rev = "rocm-${rocmVersion}";
hash = "sha256-aapvj9bwwlg7VJfnH1PVR8DulMcJh1xR6B4rPPGU6Q4=";
};
nativeBuildInputs = [
cmake
rocm-cmake
hip
];
buildInputs = [
rocm-runtime
rocm-device-libs
rocm-comgr
] ++ lib.optionals buildTests [
gtest
] ++ lib.optionals buildBenchmarks [
gbenchmark
];
cmakeFlags = [
"-DCMAKE_CXX_COMPILER=hipcc"
# Manually define CMAKE_INSTALL_<DIR>
# See: https://github.com/NixOS/nixpkgs/pull/197838
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
] ++ lib.optionals buildTests [
"-DBUILD_TEST=ON"
] ++ lib.optionals buildBenchmarks [
"-DBUILD_BENCHMARK=ON"
];
postInstall = lib.optionalString buildTests ''
mkdir -p $test/bin
mv $out/bin/test_* $test/bin
'' + lib.optionalString buildBenchmarks ''
mkdir -p $benchmark/bin
mv $out/bin/benchmark_* $benchmark/bin
'' + lib.optionalString (buildTests || buildBenchmarks) ''
rmdir $out/bin
'';
meta = with lib; {
description = "ROCm parallel primitives";
homepage = "https://github.com/ROCmSoftwarePlatform/rocPRIM";
license = with licenses; [ mit ];
maintainers = with maintainers; [ Madouura ];
broken = rocmVersion != hip.version;
};
}

View File

@ -0,0 +1,148 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, rocm-cmake
, rocm-runtime
, rocm-device-libs
, rocm-comgr
, rocprim
, hip
, gfortran
, git
, fetchzip ? null
, gtest ? null
, boost ? null
, python3Packages ? null
, buildTests ? false
, buildBenchmarks ? false # Seems to depend on tests
}:
assert (buildTests || buildBenchmarks) -> fetchzip != null;
assert (buildTests || buildBenchmarks) -> gtest != null;
assert (buildTests || buildBenchmarks) -> boost != null;
assert (buildTests || buildBenchmarks) -> python3Packages != null;
let
matrices = lib.optionalAttrs (buildTests || buildBenchmarks) import ./deps.nix {
inherit fetchzip;
mirror1 = "https://sparse.tamu.edu/MM";
mirror2 = "https://www.cise.ufl.edu/research/sparse/MM";
};
in stdenv.mkDerivation rec {
pname = "rocsparse";
rocmVersion = "5.3.1";
version = "2.3.2-${rocmVersion}";
outputs = [
"out"
] ++ lib.optionals (buildTests || buildBenchmarks) [
"test"
] ++ lib.optionals buildBenchmarks [
"benchmark"
];
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "rocSPARSE";
rev = "rocm-${rocmVersion}";
hash = "sha256-1069oBrIpZ4M9CAkzoQ9a5j3WlCXErirTbgTUZuT6b0=";
};
nativeBuildInputs = [
cmake
rocm-cmake
hip
gfortran
];
buildInputs = [
rocm-runtime
rocm-device-libs
rocm-comgr
rocprim
git
] ++ lib.optionals (buildTests || buildBenchmarks) [
gtest
boost
python3Packages.python
python3Packages.pyyaml
];
cmakeFlags = [
"-DCMAKE_CXX_COMPILER=hipcc"
# Manually define CMAKE_INSTALL_<DIR>
# See: https://github.com/NixOS/nixpkgs/pull/197838
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
] ++ lib.optionals (buildTests || buildBenchmarks) [
"-DBUILD_CLIENTS_TESTS=ON"
"-DCMAKE_MATRICES_DIR=/build/source/matrices"
"-Dpython=python3"
] ++ lib.optionals buildBenchmarks [
"-DBUILD_CLIENTS_BENCHMARKS=ON"
];
# We have to manually generate the matrices
postPatch = lib.optionalString (buildTests || buildBenchmarks) ''
mkdir -p matrices
ln -s ${matrices.matrix-01}/*.mtx matrices
ln -s ${matrices.matrix-02}/*.mtx matrices
ln -s ${matrices.matrix-03}/*.mtx matrices
ln -s ${matrices.matrix-04}/*.mtx matrices
ln -s ${matrices.matrix-05}/*.mtx matrices
ln -s ${matrices.matrix-06}/*.mtx matrices
ln -s ${matrices.matrix-07}/*.mtx matrices
ln -s ${matrices.matrix-08}/*.mtx matrices
ln -s ${matrices.matrix-09}/*.mtx matrices
ln -s ${matrices.matrix-10}/*.mtx matrices
ln -s ${matrices.matrix-11}/*.mtx matrices
ln -s ${matrices.matrix-12}/*.mtx matrices
ln -s ${matrices.matrix-13}/*.mtx matrices
ln -s ${matrices.matrix-14}/*.mtx matrices
ln -s ${matrices.matrix-15}/*.mtx matrices
ln -s ${matrices.matrix-16}/*.mtx matrices
ln -s ${matrices.matrix-17}/*.mtx matrices
ln -s ${matrices.matrix-18}/*.mtx matrices
ln -s ${matrices.matrix-19}/*.mtx matrices
ln -s ${matrices.matrix-20}/*.mtx matrices
ln -s ${matrices.matrix-21}/*.mtx matrices
ln -s ${matrices.matrix-22}/*.mtx matrices
ln -s ${matrices.matrix-23}/*.mtx matrices
ln -s ${matrices.matrix-24}/*.mtx matrices
# Not used by the original cmake, causes an error
rm matrices/*_b.mtx
echo "deps/convert.cpp -> deps/mtx2csr"
hipcc deps/convert.cpp -O3 -o deps/mtx2csr
for mat in $(ls -1 matrices | cut -d "." -f 1); do
echo "mtx2csr: $mat.mtx -> $mat.csr"
deps/mtx2csr matrices/$mat.mtx matrices/$mat.csr
unlink matrices/$mat.mtx
done
'';
postInstall = lib.optionalString buildBenchmarks ''
mkdir -p $benchmark/bin
cp -a $out/bin/* $benchmark/bin
rm $benchmark/bin/rocsparse-test
'' + lib.optionalString (buildTests || buildBenchmarks) ''
mkdir -p $test/bin
mv $out/bin/* $test/bin
rm $test/bin/rocsparse-bench || true
mv /build/source/matrices $test
rmdir $out/bin
'';
meta = with lib; {
description = "ROCm SPARSE implementation";
homepage = "https://github.com/ROCmSoftwarePlatform/rocSPARSE";
license = with licenses; [ mit ];
maintainers = with maintainers; [ Madouura ];
broken = rocmVersion != hip.version;
};
}

View File

@ -0,0 +1,222 @@
{ fetchzip
, mirror1
, mirror2
}:
{
matrix-01 = fetchzip {
sha256 = "sha256-AHur5ZIDZTFRrO2GV0ieXrffq4KUiGWiZ59pv0fUtEQ=";
urls = [
"${mirror1}/SNAP/amazon0312.tar.gz"
"${mirror2}/SNAP/amazon0312.tar.gz"
];
};
matrix-02 = fetchzip {
sha256 = "sha256-0rSxaN4lQcdaCLsvlgicG70FXUxXeERPiEmQ4MzbRdE=";
urls = [
"${mirror1}/Muite/Chebyshev4.tar.gz"
"${mirror2}/Muite/Chebyshev4.tar.gz"
];
};
matrix-03 = fetchzip {
sha256 = "sha256-hDzDWDUnHEyFedX/tMNq83ZH8uWyM4xtZYUUAD3rizo=";
urls = [
"${mirror1}/FEMLAB/sme3Dc.tar.gz"
"${mirror2}/FEMLAB/sme3Dc.tar.gz"
];
};
matrix-04 = fetchzip {
sha256 = "sha256-GmN2yOt/MoX01rKe05aTyB3ypUP4YbQGOITZ0BqPmC0=";
urls = [
"${mirror1}/Williams/webbase-1M.tar.gz"
"${mirror2}/Williams/webbase-1M.tar.gz"
];
};
matrix-05 = fetchzip {
sha256 = "sha256-gQNjfVyWzNM9RwImJGhkhahRmZz74LzDs1oijL7mI7k=";
urls = [
"${mirror1}/Williams/mac_econ_fwd500.tar.gz"
"${mirror2}/Williams/mac_econ_fwd500.tar.gz"
];
};
matrix-06 = fetchzip {
sha256 = "sha256-87cdZjntNcTuz5BtO59irhcuRbPllWSbhCEX3Td02qc=";
urls = [
"${mirror1}/Williams/mc2depi.tar.gz"
"${mirror2}/Williams/mc2depi.tar.gz"
];
};
matrix-07 = fetchzip {
sha256 = "sha256-WRamuJX3D8Tm+k0q67RjUDG3DeNAxhKiaPkk5afY5eU=";
urls = [
"${mirror1}/Bova/rma10.tar.gz"
"${mirror2}/Bova/rma10.tar.gz"
];
};
matrix-08 = fetchzip {
sha256 = "sha256-5dhkm293Mc3lzakKxHy5W5XIn4Rw+gihVh7gyrjEHXo=";
urls = [
"${mirror1}/JGD_BIBD/bibd_22_8.tar.gz"
"${mirror2}/JGD_BIBD/bibd_22_8.tar.gz"
];
};
matrix-09 = fetchzip {
sha256 = "sha256-czjLWCjXAjZCk5TGYHaEkwSAzQu3TQ3QyB6eNKR4G88=";
urls = [
"${mirror1}/Hamm/scircuit.tar.gz"
"${mirror2}/Hamm/scircuit.tar.gz"
];
};
matrix-10 = fetchzip {
sha256 = "sha256-bYuLnJViAIcIejAkh69/bsNAVIDU4wfTLtD+nmHd6FM=";
urls = [
"${mirror1}/Sandia/ASIC_320k.tar.gz"
"${mirror2}/Sandia/ASIC_320k.tar.gz"
];
};
matrix-11 = fetchzip {
sha256 = "sha256-aDwn8P1khYjo2Agbq5m9ZBInJUxf/knJNvyptt0fak0=";
urls = [
"${mirror1}/GHS_psdef/bmwcra_1.tar.gz"
"${mirror2}/GHS_psdef/bmwcra_1.tar.gz"
];
};
matrix-12 = fetchzip {
sha256 = "sha256-8OJqA/byhlAZd869TPUzZFdsOiwOoRGfKyhM+RMjXoY=";
urls = [
"${mirror1}/HB/nos1.tar.gz"
"${mirror2}/HB/nos1.tar.gz"
];
};
matrix-13 = fetchzip {
sha256 = "sha256-FS0rKqmg+uHwsM/yGfQLBdd7LH/rUrdutkNGBD/Mh1I=";
urls = [
"${mirror1}/HB/nos2.tar.gz"
"${mirror2}/HB/nos2.tar.gz"
];
};
matrix-14 = fetchzip {
sha256 = "sha256-DANnlrNJikrI7Pst9vRedtbuxepyHmCIu2yhltc4Qcs=";
urls = [
"${mirror1}/HB/nos3.tar.gz"
"${mirror2}/HB/nos3.tar.gz"
];
};
matrix-15 = fetchzip {
sha256 = "sha256-21mUgqjWGUfYgiWwSrKh9vH8Vdt3xzcefmqYNYRpxiY=";
urls = [
"${mirror1}/HB/nos4.tar.gz"
"${mirror2}/HB/nos4.tar.gz"
];
};
matrix-16 = fetchzip {
sha256 = "sha256-FOuXvGqBBFNkVS6cexmkluret54hCfCOdK+DOZllE4c=";
urls = [
"${mirror1}/HB/nos5.tar.gz"
"${mirror2}/HB/nos5.tar.gz"
];
};
matrix-17 = fetchzip {
sha256 = "sha256-+7NI1rA/qQxYPpjXKHvAaCZ+LSaAJ4xuJvMRMBEUYxg=";
urls = [
"${mirror1}/HB/nos6.tar.gz"
"${mirror2}/HB/nos6.tar.gz"
];
};
matrix-18 = fetchzip {
sha256 = "sha256-q3NxJjbwGGcFiQ9nhWfUKgZmdVwCfPmgQoqy0AqOsNc=";
urls = [
"${mirror1}/HB/nos7.tar.gz"
"${mirror2}/HB/nos7.tar.gz"
];
};
matrix-19 = fetchzip {
sha256 = "sha256-0GAN6qmVfD+tprIigzuUUUwm5KVhkN9X65wMEvFltDY=";
urls = [
"${mirror1}/DNVS/shipsec1.tar.gz"
"${mirror2}/DNVS/shipsec1.tar.gz"
];
};
matrix-20 = fetchzip {
sha256 = "sha256-f28Du/Urxsiq5NkRmRO10Zz9vvGRjEchquzHzbZpZ7U=";
urls = [
"${mirror1}/Cote/mplate.tar.gz"
"${mirror2}/Cote/mplate.tar.gz"
];
};
matrix-21 = fetchzip {
sha256 = "sha256-O+Wy0NfCU1hVUOfNR1dJpvDHLBwwa301IRJDrQJnhak=";
urls = [
"${mirror1}/Bai/qc2534.tar.gz"
"${mirror2}/Bai/qc2534.tar.gz"
];
};
matrix-22 = fetchzip {
sha256 = "sha256-oxMnt8U5Cf1ILWcBdU6W9jdSMMm+U6bIVl8nm3n3+OA=";
urls = [
"${mirror1}/Chevron/Chevron2.tar.gz"
"${mirror2}/Chevron/Chevron2.tar.gz"
];
};
matrix-23 = fetchzip {
sha256 = "sha256-MFD9BxFI/3IS7yatW121BAI04fbqrXpgYDT5UKjeKcU=";
urls = [
"${mirror1}/Chevron/Chevron3.tar.gz"
"${mirror2}/Chevron/Chevron3.tar.gz"
];
};
matrix-24 = fetchzip {
sha256 = "sha256-ikS8O51pe1nt3BNyhvfvqCbVL0+bg/da9bqGqeBDkTg=";
urls = [
"${mirror1}/Chevron/Chevron4.tar.gz"
"${mirror2}/Chevron/Chevron4.tar.gz"
];
};
}

View File

@ -0,0 +1,91 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, rocm-cmake
, rocm-runtime
, rocm-device-libs
, rocm-comgr
, rocprim
, hip
, gtest ? null
, buildTests ? false
, buildBenchmarks ? false
}:
assert buildTests -> gtest != null;
# Doesn't seem to work, thousands of errors compiling with no clear fix
# Is this an upstream issue? We don't seem to be missing dependencies
assert buildTests == false;
assert buildBenchmarks == false;
stdenv.mkDerivation rec {
pname = "rocthrust";
rocmVersion = "5.3.1";
version = "2.16.0-${rocmVersion}";
# Comment out these outputs until tests/benchmarks are fixed (upstream?)
# outputs = [
# "out"
# ] ++ lib.optionals buildTests [
# "test"
# ] ++ lib.optionals buildBenchmarks [
# "benchmark"
# ];
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "rocThrust";
rev = "rocm-${rocmVersion}";
hash = "sha256-cT0VyEVz86xR6qubAY2ncTxtCRTwXrNTWcFyf3mV+y0=";
};
nativeBuildInputs = [
cmake
rocm-cmake
rocprim
hip
];
buildInputs = [
rocm-runtime
rocm-device-libs
rocm-comgr
] ++ lib.optionals buildTests [
gtest
];
cmakeFlags = [
"-DCMAKE_CXX_COMPILER=hipcc"
"-DHIP_ROOT_DIR=${hip}"
# Manually define CMAKE_INSTALL_<DIR>
# See: https://github.com/NixOS/nixpkgs/pull/197838
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_LIBDIR=lib"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
] ++ lib.optionals buildTests [
"-DBUILD_TEST=ON"
] ++ lib.optionals buildBenchmarks [
"-DBUILD_BENCHMARKS=ON"
];
# Comment out these outputs until tests/benchmarks are fixed (upstream?)
# postInstall = lib.optionalString buildTests ''
# mkdir -p $test/bin
# mv $out/bin/test_* $test/bin
# '' + lib.optionalString buildBenchmarks ''
# mkdir -p $benchmark/bin
# mv $out/bin/benchmark_* $benchmark/bin
# '' + lib.optionalString (buildTests || buildBenchmarks) ''
# rmdir $out/bin
# '';
meta = with lib; {
description = "ROCm parallel algorithm library";
homepage = "https://github.com/ROCmSoftwarePlatform/rocThrust";
license = with licenses; [ asl20 ];
maintainers = with maintainers; [ Madouura ];
broken = rocmVersion != hip.version;
};
}

View File

@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, cmake
, libX11
, freetype
@ -30,6 +31,14 @@ stdenv.mkDerivation rec {
sha256 = "sha256-Xt2Ct4vV459AsSvJxQfwMsNs6iA5y3epT95pLWJGeSk=";
};
patches = [
(fetchpatch {
url = "https://github.com/macports/macports-ports/raw/4df1fc235a708ff28200ffc0a39120974ed4b6e1/multimedia/sfml/files/patch-apple-silicon.diff";
extraPrefix = "";
sha256 = "sha256-9dNawJaYtkugR+2NvhQOhgsf6w9ZXHkBgsDRh8yAJc0=";
})
];
nativeBuildInputs = [ cmake ];
buildInputs = [ freetype libjpeg openal flac libvorbis glew ]
++ lib.optional stdenv.isLinux udev

View File

@ -0,0 +1,34 @@
{ lib
, stdenv
, fetchFromGitHub
, buildPythonPackage
, pyyaml
, msgpack
, pandas
}:
buildPythonPackage rec {
pname = "tensile";
rocmVersion = "5.3.1";
version = "4.34.0-${rocmVersion}";
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "Tensile";
rev = "rocm-${rocmVersion}";
hash = "sha256-QWt/zzBrZKM8h3MTnbLX4vN3p6cCQvo67U1C2yqAQxw=";
};
buildInputs = [
pyyaml
msgpack
pandas
];
meta = with lib; {
description = "GEMMs and tensor contractions";
homepage = "https://github.com/ROCmSoftwarePlatform/Tensile";
license = with licenses; [ mit ];
maintainers = with maintainers; [ Madouura ];
};
}

View File

@ -247,6 +247,7 @@
, "patch-package"
, "peerflix"
, "peerflix-server"
, {"photoprism-frontend": "../../servers/photoprism"}
, "pkg"
, "pm2"
, "pnpm"

File diff suppressed because it is too large Load Diff

View File

@ -364,6 +364,10 @@ final: prev: {
'';
};
photoprism-frontend = prev."photoprism-frontend-../../servers/photoprism".override {
meta.broken = true; # use the top-level package instead
};
pnpm = prev.pnpm.override {
nativeBuildInputs = [ pkgs.buildPackages.makeWrapper ];

View File

@ -12,7 +12,7 @@
buildPythonPackage rec {
pname = "aioesphomeapi";
version = "11.4.2";
version = "11.4.3";
format = "setuptools";
disabled = pythonOlder "3.9";
@ -21,7 +21,7 @@ buildPythonPackage rec {
owner = "esphome";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-dYogEs9cU+h6oPu9PImHTLvyaJ3kNAOgKNdN44HeqWY=";
hash = "sha256-g901qWU6aiaV0kLmtWJffXZrOsKjvOGI0TOgQFzuuPA=";
};
postPatch = ''

View File

@ -54,6 +54,11 @@ buildPythonPackage rec {
"dask_glm/tests/test_utils.py"
];
disabledTests = [
# missing fixture with distributed>=2022.8.0
"test_determinism_distributed"
];
meta = with lib; {
description = "Generalized Linear Models with Dask";
homepage = "https://github.com/dask/dask-glm/";

View File

@ -2,6 +2,7 @@
, stdenv
, bokeh
, buildPythonPackage
, click
, cloudpickle
, distributed
, fastparquet
@ -26,19 +27,28 @@
buildPythonPackage rec {
pname = "dask";
version = "2022.9.1";
version = "2022.10.2";
format = "setuptools";
disabled = pythonOlder "3.7";
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "dask";
repo = pname;
rev = version;
hash = "sha256-4Tok9eYhi2FF+8bpKnwKT3KIRGHIMtxczTkZ6qD8x7g=";
hash = "sha256-zHJR2WjHigUMWtRJW25+gk1fKGKedU53BBjwx5zaodA=";
};
patches = [
(fetchpatch {
# Fix test_repartition_npartitions on platforms other than x86-64
url = "https://github.com/dask/dask/commit/65f40ad461c57065f981e6213e33b1d13cc9bc8f.patch";
hash = "sha256-KyTSms4ik1kYtL+I/huAxD+zK2AAuPkwmHA9FYk601Y=";
})
];
propagatedBuildInputs = [
click
cloudpickle
fsspec
packaging
@ -109,6 +119,8 @@ buildPythonPackage rec {
"test_read_dir_nometa"
] ++ [
"test_chunksize_files"
# TypeError: 'ArrowStringArray' with dtype string does not support reduction 'min'
"test_set_index_string"
];
__darwinAllowLocalNetworking = true;

View File

@ -11,7 +11,7 @@
buildPythonPackage rec {
pname = "dbus-fast";
version = "1.64.0";
version = "1.72.0";
format = "pyproject";
disabled = pythonOlder "3.7";
@ -20,7 +20,7 @@ buildPythonPackage rec {
owner = "Bluetooth-Devices";
repo = pname;
rev = "v${version}";
hash = "sha256-y/H4TYCicn6Gvv+F4ogqhNWK2mZxEVNGCY4pJAfjq9s=";
hash = "sha256-7KsikrHfk0EGtLOzO8qGyU8ZzqNshijDJgnDLn16Eis=";
};
nativeBuildInputs = [

View File

@ -21,14 +21,14 @@
buildPythonPackage rec {
pname = "distributed";
version = "2022.9.1";
version = "2022.10.2";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-upj1TipRhhvulyuhX4bfbQSWar9m7Xu3mIsi48G+ewE=";
hash = "sha256-U/Clv276uaWrM0XNkT9tPz1OpETuLtvqMxx/75b9Z9A=";
};
postPatch = ''

View File

@ -13,7 +13,7 @@
buildPythonPackage rec {
pname = "gcal-sync";
version = "3.0.0";
version = "4.0.0";
format = "setuptools";
disabled = pythonOlder "3.9";
@ -22,7 +22,7 @@ buildPythonPackage rec {
owner = "allenporter";
repo = "gcal_sync";
rev = "refs/tags/${version}";
hash = "sha256-xRmNV06gMdPPHcvgJTvxPZBUi1BbFTnwZpzXLBluBYo=";
hash = "sha256-HHRBH/cEQEyl5AV6RguItdm5AjBwkZ0RqispeWll7VI=";
};
propagatedBuildInputs = [

View File

@ -15,7 +15,7 @@
buildPythonPackage rec {
pname = "ical";
version = "4.1.0";
version = "4.1.1";
format = "setuptools";
disabled = pythonOlder "3.9";
@ -24,7 +24,7 @@ buildPythonPackage rec {
owner = "allenporter";
repo = pname;
rev = "refs/tags/${version}";
hash = "sha256-pZtjGWmEVcHSCgiVTKoEaRvec02cz3x93W+UXx3J8gE=";
hash = "sha256-yPFFOhAscLvhKo7sgXtH1HwcDYq8kWKHzrr3ep857Io=";
};
propagatedBuildInputs = [

View File

@ -21,7 +21,7 @@
buildPythonPackage rec {
pname = "plugwise";
version = "0.25.6";
version = "0.26.0";
format = "setuptools";
disabled = pythonOlder "3.7";
@ -30,7 +30,7 @@ buildPythonPackage rec {
owner = pname;
repo = "python-plugwise";
rev = "refs/tags/v${version}";
sha256 = "sha256-n7+cEJC/RIbA4e5b19HncFOhzWhUZ8etxYsiER7zd8E=";
sha256 = "sha256-WDjZZFl64tYZ7cy7xcLEX2/87TJSOw71QSro6cgE98s=";
};
propagatedBuildInputs = [

View File

@ -0,0 +1,39 @@
{ lib
, buildPythonPackage
, fetchFromGitHub
, poetry-core
, pythonOlder
}:
buildPythonPackage rec {
pname = "pylint-venv";
version = "2.3.0";
format = "pyproject";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "jgosmann";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-x36OsTRzrN3NWrMpJ34ZHRsw4cQlo49AnJNr5kP8/aQ=";
};
nativeBuildInputs = [
poetry-core
];
# Module has no tests
doCheck = false;
pythonImportsCheck = [
"pylint_venv"
];
meta = with lib; {
description = "Module to make pylint respect virtual environments";
homepage = "https://github.com/jgosmann/pylint-venv/";
license = with licenses; [ mit ];
maintainers = with maintainers; [ fab ];
};
}

View File

@ -15,7 +15,7 @@
buildPythonPackage rec {
pname = "pywebview";
version = "3.6.3";
version = "3.7";
format = "setuptools";
disabled = pythonOlder "3.5";
@ -23,8 +23,8 @@ buildPythonPackage rec {
src = fetchFromGitHub {
owner = "r0x0r";
repo = "pywebview";
rev = version;
hash = "sha256-qOLK4MHdpmcCazCNfojncD8XH7OJB2H/pIW5XAJAlDo=";
rev = "refs/tags/${version}";
hash = "sha256-RRq6b0hqAzig/WwFK0VsrhHO6ar8HhMdAEIosPPNUQg=";
};
nativeBuildInputs = [

View File

@ -1,25 +1,30 @@
{ lib
, buildPythonPackage
, pythonOlder
, fetchFromGitHub
, inflection
, pbr
, tinycss2
, pytestCheckHook
, pytest-mock
, pytestCheckHook
, pythonOlder
, tinycss2
}:
buildPythonPackage rec {
pname = "qstylizer";
version = "0.2.1";
version = "0.2.2";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "blambright";
repo = pname;
rev = version;
sha256 = "sha256-iEMxBpS9gOPubd9O8zpVmR5B7+UZJFkPuOtikO1a9v0=";
hash = "sha256-QJ4xhaAoVO4/VncXKzI8Q5f/rPfctJ8CvfedkQVgZgQ=";
};
PBR_VERSION = version;
nativeBuildInputs = [
pbr
];
@ -34,12 +39,12 @@ buildPythonPackage rec {
pytest-mock
];
preBuild = ''
export PBR_VERSION=${version}
'';
pythonImportsCheck = [
"qstylizer"
];
meta = with lib; {
description = "Qt stylesheet generation utility for PyQt/PySide ";
description = "Qt stylesheet generation utility for PyQt/PySide";
homepage = "https://github.com/blambright/qstylizer";
license = licenses.mit;
maintainers = with maintainers; [ drewrisinger ];

View File

@ -1,29 +1,47 @@
{ lib, buildPythonPackage, fetchPypi, qtpy, six, pyqt5, pytest }:
{ lib
, buildPythonPackage
, fetchFromGitHub
, pyqt5
, pytestCheckHook
, pythonOlder
, qtpy
}:
buildPythonPackage rec {
pname = "QtAwesome";
version = "1.1.1";
pname = "qtawesome";
version = "1.2.1";
format = "setuptools";
src = fetchPypi {
inherit pname version;
sha256 = "ec02e200231fa68a146a93845890aa0432a7edcba14bf811ff6975cf9acdab5d";
disabled = pythonOlder "3.7";
src = fetchFromGitHub {
owner = "spyder-ide";
repo = pname;
rev = "refs/tags/v${version}";
hash = "sha256-KcYCXrTP8ED5j/VTLTw7a8zotDSqIu9ultmwp8Ip5nM=";
};
propagatedBuildInputs = [ qtpy six ];
propagatedBuildInputs = [
pyqt5
qtpy
];
checkInputs = [ pyqt5 pytest ];
checkInputs = [
pytestCheckHook
];
checkPhase = ''
py.test
'';
# Requires https://github.com/boylea/qtbot
# Requires https://github.com/boylea/qtbot which is unmaintained
doCheck = false;
pythonImportsCheck = [
"qtawesome"
];
meta = with lib; {
description = "Iconic fonts in PyQt and PySide applications";
homepage = "https://github.com/spyder-ide/qtawesome";
license = licenses.mit;
maintainers = with maintainers; [ ];
platforms = platforms.linux; # fails on Darwin
};
}

View File

@ -1,38 +1,57 @@
{ lib
, buildPythonPackage
, fetchPypi
, nose
, isPy27
, mock
, traitlets
, ipykernel
, jupyter_core
, jupyter-client
, pygments
, ipykernel
, pyqt5
, pytestCheckHook
, pythonOlder
, pyzmq
, qtpy
, traitlets
}:
buildPythonPackage rec {
pname = "qtconsole";
version = "5.3.2";
version = "5.4.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-jq3wEug6sBgpWAPCR8arfqzT1aseHYig83/c/auSlaM=";
hash = "sha256-V3SOov0mMgoLd626IBMc+7E4GMfJbYP6/LEQ/1X1izU=";
};
checkInputs = [ nose ] ++ lib.optionals isPy27 [mock];
propagatedBuildInputs = [traitlets jupyter_core jupyter-client pygments ipykernel pyqt5 qtpy];
propagatedBuildInputs = [
ipykernel
jupyter_core
jupyter-client
pygments
pyqt5
pyzmq
qtpy
traitlets
];
checkInputs = [
pytestCheckHook
];
# : cannot connect to X server
doCheck = false;
meta = {
pythonImportsCheck = [
"qtconsole"
];
meta = with lib; {
description = "Jupyter Qt console";
homepage = "https://jupyter.org/";
license = lib.licenses.bsd3;
platforms = lib.platforms.unix;
maintainers = with lib.maintainers; [ fridh ];
homepage = "https://qtconsole.readthedocs.io/";
license = licenses.bsd3;
maintainers = with maintainers; [ fridh ];
platforms = platforms.unix;
};
}

View File

@ -1,30 +1,53 @@
{ lib, buildPythonPackage, fetchPypi, cloudpickle, ipykernel, wurlitzer,
jupyter-client, pyzmq }:
{ lib
, buildPythonPackage
, cloudpickle
, fetchPypi
, ipykernel
, ipython
, jupyter-client
, packaging
, pythonOlder
, pyxdg
, pyzmq
, wurlitzer
}:
buildPythonPackage rec {
pname = "spyder-kernels";
version = "2.3.3";
version = "2.4.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-7luJo7S/n88jDJRhJx1WuF5jhmeRHrrdxinbBbXuRxc=";
hash = "sha256-O9MvvjChUKucztvVvrbd04veHZqHeNpS9+30ILv7jlE=";
};
propagatedBuildInputs = [
cloudpickle
ipykernel
wurlitzer
ipython
jupyter-client
packaging
pyxdg
pyzmq
wurlitzer
];
postPatch = ''
substituteInPlace setup.py --replace "ipython>=7.31.1,<8" "ipython"
substituteInPlace setup.py \
--replace "ipykernel>=6.16.1,<7" "ipykernel" \
--replace "ipython>=7.31.1,<8" "ipython"
'';
# No tests
doCheck = false;
pythonImportsCheck = [
"spyder_kernels"
];
meta = with lib; {
description = "Jupyter kernels for Spyder's console";
homepage = "https://docs.spyder-ide.org/current/ipythonconsole.html";

View File

@ -21,6 +21,7 @@
, psutil
, pygments
, pylint
, pylint-venv
, pyls-spyder
, pyopengl
, pyqtwebengine
@ -45,14 +46,14 @@
buildPythonPackage rec {
pname = "spyder";
version = "5.3.3";
version = "5.4.0";
format = "setuptools";
disabled = pythonOlder "3.7";
src = fetchPypi {
inherit pname version;
hash = "sha256-vWhwn07zgHX7/7uAz0ekNwnAiKLECCBzBq47TtTaHfE=";
hash = "sha256-nZ+rw5qALSdu+nbaAtGA7PLW6XjcjeZvuPd4a5WtZkw=";
};
nativeBuildInputs = [
@ -75,6 +76,7 @@ buildPythonPackage rec {
numpydoc
psutil
pygments
pylint-venv
pyls-spyder
pyopengl
pyqtwebengine

View File

@ -13,11 +13,11 @@
buildPythonPackage rec {
pname = "stestr";
version = "4.0.0";
version = "4.0.1";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-A2Y+q62KcxaoRJFo78WCVmpdOvnHf8QALX3IPnf28q0=";
sha256 = "sha256-wsHHO/x8/KORJxWeP7x0GTrr8s0C2KBCfy5YZI42zyY=";
};
postPatch = ''

View File

@ -16,6 +16,9 @@ buildPythonPackage rec {
dontBuild = true;
dontInstall = true;
preConfigure = ''
pythonOutputDistPhase() { touch $dist; }
'';
checkInputs = [
stestr

View File

@ -33,10 +33,14 @@ buildPythonPackage rec {
# developers' hardware
"test_architecture"
# https://github.com/joblib/threadpoolctl/issues/128
"test_threadpool_limits_by_prefix"
"test_controller_info_actualized"
"test_command_line_command_flag"
"test_command_line_import_flag"
"test_controller_info_actualized"
"test_set_threadpool_limits_by_api"
"test_set_threadpool_limits_no_limit"
"test_threadpool_limits_by_prefix"
"test_threadpool_limits_function_with_side_effect"
"test_threadpool_limits_manual_restore"
];
pythonImportsCheck = [

View File

@ -8,7 +8,9 @@
, virtualenv
, setuptools-scm
, toml
, tomli
, filelock
, pythonOlder
}:
buildPythonPackage rec {
@ -16,7 +18,8 @@ buildPythonPackage rec {
version = "3.26.0";
buildInputs = [ setuptools-scm ];
propagatedBuildInputs = [ packaging pluggy py six virtualenv toml filelock ];
propagatedBuildInputs = [ packaging pluggy py six virtualenv filelock ]
++ lib.optional (pythonOlder "3.11") tomli;
doCheck = false;

View File

@ -2,7 +2,7 @@
stdenv.mkDerivation rec {
pname = "rocm-cmake";
version = "5.3.0";
version = "5.3.1";
src = fetchFromGitHub {
owner = "RadeonOpenCompute";

View File

@ -0,0 +1,14 @@
This small Nix-specific patch removes a source of impurity from source code,
namely the date and time of compilation.
diff -Naur uctags-old/main/options.c uctags-new/main/options.c
--- uctags-old/main/options.c 1969-12-31 21:00:01.000000000 -0300
+++ uctags-new/main/options.c 2022-11-06 11:43:00.028550121 -0300
@@ -1609,7 +1609,6 @@
printf ("Universal Ctags is derived from Exuberant Ctags.\n");
printf ("Exuberant Ctags 5.8, Copyright (C) 1996-2009 Darren Hiebert\n");
- printf (" Compiled: %s, %s\n", __DATE__, __TIME__);
printf (" URL: %s\n", PROGRAM_URL);
printFeatureList ();

View File

@ -1,55 +1,83 @@
{ lib, stdenv, buildPackages, fetchFromGitHub, autoreconfHook, coreutils, pkg-config, perl, python3Packages, libiconv, jansson }:
{ lib
, stdenv
, autoreconfHook
, buildPackages
, coreutils
, fetchFromGitHub
, jansson
, libiconv
, perl
, pkg-config
, python3
, libseccomp
, libyaml
, pcre2
, libxml2
}:
stdenv.mkDerivation rec {
stdenv.mkDerivation (finalAttrs: {
pname = "universal-ctags";
version = "5.9.20220814.0";
version = "5.9.20221106.0";
src = fetchFromGitHub {
owner = "universal-ctags";
repo = "ctags";
rev = "p${version}";
sha256 = "sha256-U1PjmBb99v7N+Dd7n2r1Xx09yflf0OxRlb4f1Sg0UvI=";
rev = "p${finalAttrs.version}";
hash = "sha256-6piWdofvlX+ysXmRPnQc7PlZuHSyVqdVxOztY2+Pcss=";
};
depsBuildBuild = [ buildPackages.stdenv.cc ];
nativeBuildInputs = [ autoreconfHook pkg-config python3Packages.docutils ];
buildInputs = [ jansson ] ++ lib.optional stdenv.isDarwin libiconv;
depsBuildBuild = [
buildPackages.stdenv.cc
];
# to generate makefile.in
autoreconfPhase = ''
./autogen.sh
'';
nativeBuildInputs = [
autoreconfHook
perl
pkg-config
(python3.withPackages (p: [ p.docutils ]))
];
buildInputs = [
libseccomp
libyaml
pcre2
libxml2
jansson
]
++ lib.optional stdenv.isDarwin libiconv;
configureFlags = [ "--enable-tmpdir=/tmp" ];
postPatch = ''
# Remove source of non-determinism
substituteInPlace main/options.c \
--replace "printf (\" Compiled: %s, %s\n\", __DATE__, __TIME__);" ""
patches = [
./000-nixos-specific.patch
];
postPatch = ''
substituteInPlace Tmain/utils.sh \
--replace /bin/echo ${coreutils}/bin/echo
# Remove git-related housekeeping from check phase
substituteInPlace makefiles/testing.mak \
--replace "check: tmain units tlib man-test check-genfile" \
"check: tmain units tlib man-test"
'';
postConfigure = ''
sed -i 's|/usr/bin/env perl|${perl}/bin/perl|' misc/optlib2c
patchShebangs misc/*
'';
doCheck = true;
checkFlags = [
"man-test" "tlib" "tmain" "tutil" "units"
];
meta = with lib; {
homepage = "https://docs.ctags.io/en/latest/";
description = "A maintained ctags implementation";
homepage = "https://ctags.io/";
longDescription = ''
Universal Ctags (abbreviated as u-ctags) is a maintained implementation of
ctags. ctags generates an index (or tag) file of language objects found in
source files for programming languages. This index makes it easy for text
editors and other tools to locate the indexed items.
'';
license = licenses.gpl2Plus;
maintainers = [ maintainers.AndersonTorres ];
platforms = platforms.unix;
# universal-ctags is preferred over emacs's ctags
priority = 1;
mainProgram = "ctags";
maintainers = [ maintainers.mimame ];
priority = 1; # over the emacs implementation
};
}
})

View File

@ -1,12 +0,0 @@
--- a/Tmain/sorted-help-message.d/run.sh 2017-01-10 11:20:51.515093465 +0100
+++ b/Tmain/sorted-help-message.d/run.sh 2017-01-10 11:17:56.639213720 +0100
@@ -27,7 +27,7 @@
extract_long_options()
{
sed -n '/Usage:/,$p' | \
- sed -n 's/\(^ --[:alnum:][<>[:alnum:]_-]*\).*/\1/p'
+ sed -n 's/\(^ --[[:alnum:]][<>[:alnum:]_-]*\).*/\1/p'
}
extract_debug_options()

View File

@ -7,7 +7,7 @@
# compilers to determine the desired target.
, defaultTargets ? []}:
stdenv.mkDerivation rec {
version = "5.3.0";
version = "5.3.1";
pname = "rocminfo";
src = fetchFromGitHub {
owner = "RadeonOpenCompute";

View File

@ -2,14 +2,14 @@
rustPlatform.buildRustPackage rec {
pname = "svd2rust";
version = "0.27.1";
version = "0.27.2";
src = fetchCrate {
inherit pname version;
sha256 = "sha256-Tnow5NjeDyz4oMY+UMs2TDquLTioElhSNzbC6eEYpTs=";
sha256 = "sha256-6HcJ9NPUPcVLZT8zpYxIPJ4UkqwaqPNWva8/wnaUrt8=";
};
cargoSha256 = "sha256-sN3uJTU9h9Ls2fygz6My3hao77lQFdNkA0gkUevV7Jc=";
cargoSha256 = "sha256-fsLRpRvdiZyOsxnfAc5xt63rLW5lwwQt+lxmZT7XIAc=";
meta = with lib; {
description = "Generate Rust register maps (`struct`s) from SVD files";

View File

@ -3,6 +3,7 @@
, fetchpatch
, cups
, python3Packages
, patchPpdFilesHook
}:
python3Packages.buildPythonApplication rec {
@ -20,9 +21,9 @@ python3Packages.buildPythonApplication rec {
})
];
format = "other";
nativeBuildInputs = [ (lib.getBin cups) ];
nativeBuildInputs = [ (lib.getBin cups) patchPpdFilesHook ];
# The source image also brings pre-built ppd files,
# be we prefer to generate from source where possible, so
# but we prefer to generate from source where possible, so
# the following line generates ppd files from the drv file.
postBuild = ''
ppdc -v -d . -I "${cups}/share/cups/ppdc" rastertosag-gdi.drv
@ -35,6 +36,10 @@ python3Packages.buildPythonApplication rec {
ln -vst "${placeholder "out"}/lib/cups/filter/" "${placeholder "out"}/bin/rastertosag-gdi"
runHook postInstall
'';
ppdFileCommands = [ "rastertosag-gdi" ];
postFixup = ''
gzip -9nv "${placeholder "out"}/share/cups/model/rastertosag-gdi"/*.ppd
'';
meta = {
description = "CUPS driver for Ricoh Aficio SP 1000S and SP 1100S printers";
downloadPage = "https://www.openprinting.org/download/printing/rastertosag-gdi/";

View File

@ -0,0 +1,94 @@
{ lib
, perlPackages
, fetchFromGitHub
, withCupsAccess ? false # needed to access local cups server
, cups
, cups-filters
, curl
, withSocketAccess ? false # needed to access network printers
, netcat-gnu
, withSMBAccess ? false # needed to access SMB-connected printers
, samba
, autoconf
, automake
, file
, makeWrapper
}:
perlPackages.buildPerlPackage {
pname = "foomatic-db-engine";
version = "unstable-2022-05-03";
src = fetchFromGitHub {
# there is also a daily snapshot at the `downloadPage`,
# but it gets deleted quickly and would provoke 404 errors
owner = "OpenPrinting";
repo = "foomatic-db-engine";
rev = "2e6f14b54748fa121a4d2e3d480010e10b070c5a";
hash = "sha256-m7FQTxWmawbtm24h8UqznGKXgX41JhOtyyFMRwEhm5k=";
};
outputs = [ "out" ];
propagatedBuildInputs = [
perlPackages.Clone
perlPackages.DBI
perlPackages.XMLLibXML
];
buildInputs =
# provide some "cups-*" commands to `foomatic-{configure,printjob}`
# so that they can manage a local cups server (add queues, add jobs...)
lib.optionals withCupsAccess [ cups cups-filters curl ]
# the commands `foomatic-{configure,getpjloptions}` need
# netcat if they are used to query or alter a network
# printer via AppSocket/HP JetDirect protocol
++ lib.optional withSocketAccess netcat-gnu
# `foomatic-configure` can be used to access printers that are
# shared via the SMB protocol, but it needs the `smbclient` binary
++ lib.optional withSMBAccess samba
;
nativeBuildInputs = [ autoconf automake file makeWrapper ];
# sed-substitute indirection is more robust against
# characters in paths that might need escaping
prePatch = ''
sed -Ei 's|^(S?BINSEARCHPATH=).+$|\1"@PATH@"|g' configure.ac
substituteInPlace configure.ac --subst-var PATH
touch Makefile.PL # `buildPerlPackage` fails unless this exists
'';
preConfigure = ''
./make_configure
'';
configureFlags = [
"--sysconfdir=${placeholder "out"}/etc"
"LIBDIR=${placeholder "out"}/share/foomatic"
"PERLPREFIX=${placeholder "out"}"
];
postFixup = ''
for bin in "${placeholder "out"}/bin"/*; do
test '!' -L "$bin" || continue # skip symlink
wrapProgram "$bin" --set PERL5LIB "$PERL5LIB"
done
'';
doCheck = false; # no tests, would fail
meta = {
description = "OpenPrinting printer support database engine";
downloadPage = "https://www.openprinting.org/download/foomatic/";
homepage = "https://openprinting.github.io/projects/02-foomatic/";
license = lib.licenses.gpl2Only;
maintainers = [ lib.maintainers.yarny ];
longDescription = ''
Foomatic's database engine generates PPD files
from the data in Foomatic's XML database.
It also contains scripts to directly
generate print queues and handle jobs.
'';
};
}

View File

@ -0,0 +1,86 @@
{ lib
, stdenv
, fetchFromGitHub
, autoconf
, automake
, perl
}:
stdenv.mkDerivation {
pname = "foomatic-db-nonfree";
version = "unstable-2015-06-05";
src = fetchFromGitHub {
# there is also a daily snapshot at the `downloadPage`,
# but it gets deleted quickly and would provoke 404 errors
owner = "OpenPrinting";
repo = "foomatic-db-nonfree";
rev = "6ddae02ac89240c019f8b5026cfe70e30fd2b3db";
hash = "sha256-cRZH0CXg03FEqUJdxaNnPVXjf8+ct86PjhL59WQbw60=";
};
nativeBuildInputs = [ autoconf automake perl ];
# sed-substitute indirection is more robust against
# characters in paths that might need escaping
postPatch = ''
sed -Ei -e 's|^(S?BINSEARCHPATH=).+$|\1"@PATH@"|g' \
-e 's|^(DATASEARCHPATH=).+$|\1"@DATA@"|g' configure.ac
substituteInPlace configure.ac \
--subst-var PATH \
--subst-var-by DATA "${placeholder "out"}/share"
'';
preConfigure = ''
mkdir -p "${placeholder "out"}/share/foomatic/db/source"
./make_configure
'';
# make ppd files available to cups,
# use a package-specific subdirectory to avoid
# conflicts with other ppd-containing packages
postInstall = ''
if ! [[ -d "${placeholder "out"}/share/foomatic/db/source/PPD" ]]; then
echo "failed to create share/foomatic/db/source/PPD"
exit 1
fi
mkdir -p "${placeholder "out"}/share/cups/model"
ln -s "${placeholder "out"}/share/foomatic/db/source/PPD" \
"${placeholder "out"}/share/cups/model/foomatic-db-nonfree"
'';
# we might patch ppd file commands with `patchPpdFilesHook`,
# but the only command "rastertophaser6100" isn't packaged yet
# compress ppd files
postFixup = ''
echo 'compressing ppd files'
find -H "${placeholder "out"}/share/cups/model/foomatic-db-nonfree" -type f -iname '*.ppd' -print0 \
| xargs -0r -n 64 -P "$NIX_BUILD_CORES" gzip -9n
'';
meta = {
description = "OpenPrinting printer support database (unfree content)";
downloadPage = "https://www.openprinting.org/download/foomatic/";
homepage = "https://openprinting.github.io/projects/02-foomatic/";
license = lib.licenses.unfree;
maintainers = [ lib.maintainers.yarny ];
# list printer manufacturers here so people
# searching for ppd files can find this package
longDescription = ''
The collected knowledge about printers,
drivers, and driver options in XML files,
used by `foomatic-db-engine` to generate PPD files.
This is a package of PPD and Foomatic XML files
that may have restrictions that keep them
from being used on a variety of machines
for licensing and other non-technical reasons.
The XML files in this package enable `foomatic-db-ppds`
to create about 120 additional PPD files, for printer from
Dell, Genicom, Lexmark, Oce, Tektronix and Xerox.
Besides the XML files, this package contains
about 130 PPD files, for printers from
Dell, Genicom, Lexmark, Oce and Xerox.
'';
};
}

View File

@ -0,0 +1,122 @@
{ lib
, foomatic-db
, foomatic-db-nonfree
, buildEnv
, foomatic-db-engine
, stdenv
, cups-filters
, ghostscript
, netpbm
, perl
, psutils
, patchPpdFilesHook
, withNonfreeDb ? false # include foomatic-db-nonfree ppd files
}:
let
foomatic-db-packages = [ foomatic-db ] ++
lib.lists.optional withNonfreeDb foomatic-db-nonfree;
foomatic-db-combined = buildEnv {
name = "foomatic-db-combined";
paths = foomatic-db-packages;
pathsToLink = [ "/share/foomatic" ];
# `foomatic-db-combined` is a nativeBuildInput of `foomatic-db-ppds`.
# The setup hook defined here helps scripts in
# `foomatic-db-engine` to find the database.
postBuild = ''
mkdir -p "${placeholder "out"}"/{etc/cups,nix-support}
cat >> "${placeholder "out"}/nix-support/setup-hook" << eof
export FOOMATICDB="${placeholder "out"}/share/foomatic"
eof
'';
};
# the effective license is `free` if all database
# packages have free licenses, `unfree` otherwise
isFree = lib.trivial.pipe foomatic-db-packages [
(lib.lists.map (lib.attrsets.attrByPath [ "meta" "license" ] lib.licenses.unfree))
(lib.lists.all (lib.attrsets.attrByPath [ "free" ] true))
];
in
stdenv.mkDerivation {
pname = "foomatic-db-ppds";
# the effective version is simply the
# highest version of all database packages
version = lib.trivial.pipe foomatic-db-packages [
(lib.lists.map (lib.attrsets.getAttr "version"))
(lib.lists.sort lib.strings.versionOlder)
lib.lists.reverseList
lib.lists.head
];
buildInputs = [
cups-filters
ghostscript
netpbm
perl
psutils
];
nativeBuildInputs = [
foomatic-db-combined
foomatic-db-engine
patchPpdFilesHook
];
dontUnpack = true;
installPhase = ''
runHook preInstall
mkdir -p "${placeholder "out"}/share/cups/model"
foomatic-compiledb -j "$NIX_BUILD_CORES" -d "${placeholder "out"}/share/cups/model/foomatic-db-ppds"
runHook postInstall
'';
# Comments indicate the respective
# package the command is contained in.
ppdFileCommands = [
"cat" "echo" # coreutils
"foomatic-rip" # cups-filters or foomatic-filters
"gs" # ghostscript
"pnmflip" "pnmgamma" "pnmnoraw" # netpbm
"perl" # perl
"psresize" # psutils
# These commands aren't packaged yet.
# ppd files using these likely won't work.
#"c2050" "c2070" "cjet" "lm1100"
#"pbm2l2030" "pbm2lwxl" "rastertophaser6100"
];
# compress ppd files
postFixup = ''
echo 'compressing ppd files'
find -H "${placeholder "out"}/share/cups/model/foomatic-db-ppds" -type f -iname '*.ppd' -print0 \
| xargs -0r -n 64 -P "$NIX_BUILD_CORES" gzip -9n
'';
meta = {
description = "OpenPrinting ppd files";
homepage = "https://openprinting.github.io/projects/02-foomatic/";
license = if isFree then lib.licenses.free else lib.licenses.unfree;
maintainers = [ lib.maintainers.yarny ];
# list printer manufacturers here so people
# searching for ppd files can find this package
longDescription = ''
All PPD files available in
OpenPrinting's Foomatic database.
This package contains about 8,800 PPD files,
for printers from
Alps, Anitech, Apollo, Apple, Avery, Brother, Canon,
Citizen, CItoh, Compaq, DEC, Dell, Dymo-CoStar, Epson,
Fujitsu, FujiXerox, Generic, Genicom, Gestetner,
Heidelberg, Hitachi, HP, IBM, Imagen, Imagistics,
InfoPrint, Infotec, Kodak, KONICAMINOLTA, Kyocera, Lanier,
Lexmark, Minolta, MinoltaQMS, Mitsubishi, NEC, NRG, Oce,
Oki, Olivetti, Panasonic, PCPI, Pentax, QMS, Raven, Ricoh,
Samsung, Savin, Seiko, Sharp, SiPix, Sony, Star, Tally,
Tektronix, TexasInstruments, Toshiba, Xante and Xerox.
'';
};
}

View File

@ -0,0 +1,102 @@
{ lib
, stdenv
, fetchFromGitHub
, cups
, cups-filters
, ghostscript
, gnused
, perl
, autoconf
, automake
, patchPpdFilesHook
}:
stdenv.mkDerivation {
pname = "foomatic-db";
version = "unstable-2022-10-03";
src = fetchFromGitHub {
# there is also a daily snapshot at the `downloadPage`,
# but it gets deleted quickly and would provoke 404 errors
owner = "OpenPrinting";
repo = "foomatic-db";
rev = "2a3c4d1bf7eadc42f936ce8989c1dd2973ea9669";
hash = "sha256-in0/j1nAQvM0NowBIBx3jj5WVMPIfZAeAk1SkuA3tjA=";
};
buildInputs = [ cups cups-filters ghostscript gnused perl ];
nativeBuildInputs = [ autoconf automake patchPpdFilesHook perl ];
# sed-substitute indirection is more robust
# against characters in paths that might need escaping
postPatch = ''
sed -Ei -e 's|^(S?BINSEARCHPATH=).+$|\1"@PATH@"|g' \
-e 's|^(DATASEARCHPATH=).+$|\1"@DATA@"|g' configure.ac
substituteInPlace configure.ac \
--subst-var PATH \
--subst-var-by DATA "${placeholder "out"}/share"
'';
preConfigure = ''
mkdir -p "${placeholder "out"}/share/foomatic/db/source"
./make_configure
'';
# don't let the intaller gzip ppd files as we would
# have to unzip them later in order to patch them
configureFlags = [ "--disable-gzip-ppds" ];
# make ppd files available to cups,
# use a package-specific subdirectory to avoid
# conflicts with other ppd-containing packages
postInstall = ''
if ! [[ -d "${placeholder "out"}/share/foomatic/db/source/PPD" ]]; then
echo "failed to create share/foomatic/db/source/PPD"
exit 1
fi
mkdir -p "${placeholder "out"}/share/cups/model"
ln -s "${placeholder "out"}/share/foomatic/db/source/PPD" \
"${placeholder "out"}/share/cups/model/foomatic-db"
'';
# Comments indicate the respective
# package the command is contained in.
ppdFileCommands = [
"cat" "date" "printf" # coreutils
"rastertohp" # cups
"foomatic-rip" # cups-filters or foomatic-filters
"gs" # ghostscript
"sed" # gnused
"perl" # perl
];
# compress ppd files
postFixup = ''
echo 'compressing ppd files'
find -H "${placeholder "out"}/share/cups/model/foomatic-db" -type f -iname '*.ppd' -print0 \
| xargs -0r -n 64 -P "$NIX_BUILD_CORES" gzip -9n
'';
meta = {
description = "OpenPrinting printer support database (free content)";
downloadPage = "https://www.openprinting.org/download/foomatic/";
homepage = "https://openprinting.github.io/projects/02-foomatic/";
license = lib.licenses.free; # mostly GPL and MIT, see README in source dir
maintainers = [ lib.maintainers.yarny ];
# list printer manufacturers here so people
# searching for ppd files can find this package
longDescription = ''
The collected knowledge about printers,
drivers, and driver options in XML files,
used by `foomatic-db-engine` to generate PPD files.
PPD files generated from the XML files in this package
are contained in the package 'foomatic-db-ppds'.
Besides the XML files, this package contains
about 6,600 PPD files, for printers from
Brother, Canon, Epson, Gestetner, HP, InfoPrint,
Infotec, KONICA_MINOLTA, Kyocera, Lanier, Lexmark, NRG,
Oce, Oki, Ricoh, Samsung, Savin, Sharp, Toshiba and Utax.
'';
};
}

View File

@ -1,4 +1,9 @@
{ stdenv, lib, fetchzip, cups }:
{ lib
, stdenv
, cups
, fetchzip
, patchPpdFilesHook
}:
let
platform =
@ -23,7 +28,11 @@ stdenv.mkDerivation {
sha256 = "0z1pbgidkibv4j21z0ys8cq1lafc6687syqa07qij2qd8zp15wiz";
};
nativeBuildInputs = [ patchPpdFilesHook ];
installPhase = ''
runHook preInstall
tar -xvf ${platform}/Global/English.tar.gz
install -Dm755 English/rastertokpsl $out/lib/cups/filter/rastertokpsl
patchelf \
@ -33,13 +42,13 @@ stdenv.mkDerivation {
mkdir -p $out/share/cups/model/Kyocera
cd English
for i in *.ppd; do
sed -i $i -e \
"s,/usr/lib/cups/filter/rastertokpsl,$out/lib/cups/filter/rastertokpsl,g"
cp $i $out/share/cups/model/Kyocera
done;
cp *.ppd $out/share/cups/model/Kyocera
runHook postInstall
'';
ppdFileCommands = [ "rastertokpsl" ];
meta = with lib; {
description = "CUPS drivers for several Kyocera FS-{1020,1025,1040,1060,1120,1125} printers";
homepage = "https://www.kyoceradocumentsolutions.ru/index/service_support/download_center.false.driver.FS1040._.EN.html#";

View File

@ -23,6 +23,7 @@ in stdenv.mkDerivation rec {
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -R ${arch}/{gettext,pstosecps,rastertospl,smfpnetdiscovery,usbresetter} $out/bin
@ -82,6 +83,8 @@ in stdenv.mkDerivation rec {
cd $out/share/cups
ln -s ../ppd .
ln -s ppd model
runHook postInstall
'';
preFixup = ''

View File

@ -22,6 +22,7 @@ in stdenv.mkDerivation rec {
];
installPhase = ''
runHook preInstall
mkdir -p $out/bin
cp -R ${arch}/{gettext,pstosecps,rastertospl,smfpnetdiscovery,usbresetter} $out/bin
@ -65,6 +66,8 @@ in stdenv.mkDerivation rec {
cd $out/share/cups
ln -s ../ppd .
ln -s ppd model
runHook postInstall
'';
preFixup = ''

View File

@ -11,7 +11,13 @@
# }
# (This advice was tested on the 1st November 2016.)
{ lib, stdenv, fetchurl, cups, libusb-compat-0_1 }:
{ lib
, stdenv
, cups
, libusb-compat-0_1
, fetchurl
, patchPpdFilesHook
}:
# Do not bump lightly! Visit <http://www.bchemnet.com/suldr/supported.html>
# to see what will break when upgrading. Consider a new versioned attribute.
@ -28,10 +34,14 @@ in stdenv.mkDerivation rec {
sha256 = "1vv3pzvqpg1dq3xjr8161x2yp3v7ca75vil56ranhw5pkjwq66x0";
};
nativeBuildInputs = [ patchPpdFilesHook ];
dontPatchELF = true;
dontStrip = true;
installPhase = ''
runHook preInstall
cd Linux/${installationPath}
mkdir -p $out/lib/cups/{backend,filter}
install -Dm755 mfp $out/lib/cups/backend/
@ -63,15 +73,18 @@ in stdenv.mkDerivation rec {
mkdir -p $out/share/cups/model/samsung
cd -
cd ../noarch/at_opt/share/ppd
for i in *.ppd; do
sed -i $i -e \
"s,pstosecps,$out/lib/cups/filter/pstosecps,g; \
s,pstospl,$out/lib/cups/filter/pstospl,g; \
s,rastertospl,$out/lib/cups/filter/rastertospl,g"
done;
cp -r ./* $out/share/cups/model/samsung
runHook postInstall
'';
ppdFileCommands = [
"pstosecps"
"pstospl"
"pstosplc"
"rastertospl"
];
meta = with lib; {
description = "Samsung's Linux printing drivers; includes binaries without source code";
homepage = "http://www.samsung.com/";

View File

@ -43,5 +43,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl2Only;
platforms = platforms.linux;
maintainers = with maintainers; [ izorkin ajs124 ];
mainProgram = "nft";
};
}

View File

@ -0,0 +1,38 @@
{ lib, buildGoModule, coreutils, libtensorflow, src, version, ... }:
buildGoModule rec {
inherit src version;
pname = "photoprism-backend";
buildInputs = [
coreutils
libtensorflow
];
ldflags = [
"-s"
"-w"
"-X main.version=${version}"
];
postPatch = ''
substituteInPlace internal/commands/passwd.go --replace '/bin/stty' "${coreutils}/bin/stty"
'';
vendorSha256 = "sha256-x1WfBxjGg4HKnzN0xEY43hgwdS6yf1AFo3GlW8e7nrM=";
subPackages = [ "cmd/photoprism" ];
# https://github.com/mattn/go-sqlite3/issues/822
CGO_CFLAGS = "-Wno-return-local-addr";
# https://github.com/tensorflow/tensorflow/issues/43847
CGO_LDFLAGS = "-fuse-ld=gold";
meta = with lib; {
homepage = "https://photoprism.app";
description = "Photoprism's backend";
license = licenses.agpl3Only;
maintainers = with maintainers; [ benesim ];
};
}

View File

@ -0,0 +1,86 @@
{ pkgs, lib, stdenv, fetchFromGitHub, fetchzip, darktable, rawtherapee, ffmpeg, libheif, exiftool, nixosTests, makeWrapper }:
let
version = "221102-905925b4d";
pname = "photoprism";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = version;
sha256 = "sha256-xyyV16yYlKIMINmVDtiQJmnbEQ12wjzn6p90f4+GpWk=";
};
libtensorflow = pkgs.callPackage ./libtensorflow.nix { };
backend = pkgs.callPackage ./backend.nix { inherit libtensorflow src version; };
frontend = pkgs.callPackage ./frontend.nix { inherit src version; };
fetchModel = { name, sha256 }:
fetchzip {
inherit sha256;
url = "https://dl.photoprism.org/tensorflow/${name}.zip";
stripRoot = false;
};
facenet = fetchModel {
name = "facenet";
sha256 = "sha256-aS5kkNhxOLSLTH/ipxg7NAa1w9X8iiG78jmloR1hpRo=";
};
nasnet = fetchModel {
name = "nasnet";
sha256 = "sha256-bF25jPmZLyeSWy/CGXZE/VE2UupEG2q9Jmr0+1rUYWE=";
};
nsfw = fetchModel {
name = "nsfw";
sha256 = "sha256-zy/HcmgaHOY7FfJUY6I/yjjsMPHR2Ote9ppwqemBlfg=";
};
assets_path = "$out/share/${pname}";
in
stdenv.mkDerivation {
inherit pname version;
buildInputs = [
makeWrapper
];
dontUnpack = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out/bin ${assets_path}
# install backend
ln -s ${backend}/bin/photoprism $out/bin/photoprism
wrapProgram $out/bin/photoprism \
--set PHOTOPRISM_ASSETS_PATH ${assets_path} \
--set PHOTOPRISM_DARKTABLE_BIN ${darktable}/bin/darktable-cli \
--set PHOTOPRISM_RAWTHERAPEE_BIN ${rawtherapee}/bin/rawtherapee-cli \
--set PHOTOPRISM_HEIFCONVERT_BIN ${libheif}/bin/heif-convert \
--set PHOTOPRISM_FFMPEG_BIN ${ffmpeg}/bin/ffmpeg \
--set PHOTOPRISM_EXIFTOOL_BIN ${exiftool}/bin/exiftool
# install frontend
ln -s ${frontend}/assets/* ${assets_path}
# install tensorflow models
ln -s ${nasnet}/nasnet ${assets_path}
ln -s ${nsfw}/nsfw ${assets_path}
ln -s ${facenet}/facenet ${assets_path}
runHook postInstall
'';
passthru.tests.photoprism = nixosTests.photoprism;
meta = with lib; {
homepage = "https://photoprism.app";
description = "Personal Photo Management powered by Go and Google TensorFlow";
inherit (libtensorflow.meta) platforms;
license = licenses.agpl3Only;
maintainers = with maintainers; [ benesim ];
};
}

View File

@ -0,0 +1,47 @@
{ lib, nodePackages, nodejs-14_x, stdenv, src, version, ... }:
let
nodeDependencies = nodePackages.photoprism-frontend.override {
inherit version;
name = "photoprism-frontend-dependencies";
# Workaround for lack of sourceRoot option in buildNodePackage.
src = "${src}/frontend";
meta.broken = false;
};
in
stdenv.mkDerivation {
inherit src version;
pname = "photoprism-frontend";
buildInputs = [ nodejs-14_x ];
buildPhase = ''
runHook preBuild
pushd frontend
ln -s ${nodeDependencies}/lib/node_modules/photoprism/node_modules ./node_modules
export PATH="${nodeDependencies}/lib/node_modules/photoprism/node_modules/.bin:$PATH"
NODE_ENV=production npm run build
popd
runHook postBuild
'';
installPhase = ''
runHook preInstall
mkdir $out
cp -r assets $out/
runHook postInstall
'';
meta = with lib; {
homepage = "https://photoprism.app";
description = "Photoprism's frontend";
license = licenses.agpl3Only;
maintainers = with maintainers; [ benesim ];
};
}

View File

@ -0,0 +1,85 @@
{ lib, stdenv, fetchurl, ... }:
let
inherit (stdenv.hostPlatform) system;
in
stdenv.mkDerivation rec {
pname = "libtensorflow-photoprism";
version = "1.15.2";
srcs = [
# Photoprism-packaged libtensorflow tarball (with pre-built libs for both arm64 and amd64)
# We need this specific version because of https://github.com/photoprism/photoprism/issues/222
(fetchurl {
sha256 = {
x86_64-linux = "sha256-bZAC3PJxqcjuGM4RcNtzYtkg3FD3SrO5beDsPoKenzc=";
aarch64-linux = "sha256-qnj4vhSWgrk8SIjzIH1/4waMxMsxMUvqdYZPaSaUJRk=";
}.${system};
url = let
systemName = {
x86_64-linux = "amd64";
aarch64-linux = "arm64";
}.${system};
in "https://dl.photoprism.app/tensorflow/${systemName}/libtensorflow-${systemName}-${version}.tar.gz";
})
# Upstream tensorflow tarball (with .h's photoprism's tarball is missing)
(fetchurl {
url = "https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-linux-x86_64-1.15.0.tar.gz";
sha256 = "sha256-3sv9WnCeztNSP1XM+iOTN6h+GrPgAO/aNhfbeeEDTe0=";
})
];
sourceRoot = ".";
unpackPhase = ''
sources=($srcs)
mkdir downstream upstream
tar xf ''${sources[0]} --directory downstream
tar xf ''${sources[1]} --directory upstream
mv downstream/lib .
mv upstream/{include,LICENSE,THIRD_PARTY_TF_C_LICENSES} .
rm -r downstream upstream
cd lib
ln -sT libtensorflow.so{,.1}
ln -sT libtensorflow_framework.so{,.1}
cd ..
'';
# Patch library to use our libc, libstdc++ and others
patchPhase = let
rpath = lib.makeLibraryPath [ stdenv.cc.libc stdenv.cc.cc.lib ];
in ''
chmod -R +w lib
patchelf --set-rpath "${rpath}:$out/lib" lib/libtensorflow.so
patchelf --set-rpath "${rpath}" lib/libtensorflow_framework.so
'';
buildPhase = ''
# Write pkg-config file.
mkdir lib/pkgconfig
cat > lib/pkgconfig/tensorflow.pc << EOF
Name: TensorFlow
Version: ${version}
Description: Library for computation using data flow graphs for scalable machine learning
Requires:
Libs: -L$out/lib -ltensorflow
Cflags: -I$out/include/tensorflow
EOF
'';
installPhase = ''
mkdir -p $out
cp -r LICENSE THIRD_PARTY_TF_C_LICENSES lib include $out
'';
meta = with lib; {
homepage = "https://dl.photoprism.app/tensorflow/";
description = "Libtensorflow version for usage with photoprism backend";
platforms = [ "x86_64-linux" "aarch64-linux" ];
license = licenses.asl20;
maintainers = with maintainers; [ benesim ];
};
}

View File

@ -0,0 +1,123 @@
{
"name": "photoprism",
"version": "1.0.0",
"description": "AI-Powered Photos App",
"author": "PhotoPrism UG",
"license": "AGPL-3.0",
"private": true,
"scripts": {
"watch": "webpack --watch",
"build": "webpack --node-env=production",
"trace": "webpack --stats-children",
"debug": "webpack --stats-error-details",
"lint": "eslint --cache src/ *.js",
"fmt": "eslint --cache --fix src/ *.js .eslintrc.js",
"test": "karma start",
"upgrade": "npm --depth 10 update && npm audit fix",
"testcafe": "testcafe",
"acceptance-local": "testcafe chromium --selector-timeout 5000 -S -s tests/acceptance/screenshots tests/acceptance",
"gettext-extract": "gettext-extract --output src/locales/translations.pot $(find ${SRC:-src} -type f \\( -iname \\*.vue -o -iname \\*.js \\) -not -path src/common/vm.js)",
"gettext-compile": "gettext-compile --output src/locales/translations.json src/locales/*.po"
},
"dependencies": {
"@babel/cli": "^7.19.3",
"@babel/core": "^7.19.3",
"@babel/eslint-parser": "^7.19.1",
"@babel/plugin-proposal-class-properties": "^7.18.6",
"@babel/plugin-proposal-object-rest-spread": "^7.19.4",
"@babel/plugin-transform-runtime": "^7.19.1",
"@babel/preset-env": "^7.19.4",
"@babel/register": "^7.18.9",
"@babel/runtime": "^7.19.4",
"@lcdp/offline-plugin": "^5.1.1",
"@vvo/tzdb": "^6.71.0",
"axios": "^0.27.2",
"axios-mock-adapter": "^1.21.2",
"babel-loader": "^8.2.5",
"babel-plugin-istanbul": "^6.1.1",
"browserslist": "^4.21.4",
"chai": "^4.3.6",
"cheerio": "1.0.0-rc.10",
"chrome-finder": "^1.0.7",
"core-js": "^3.25.5",
"cross-env": "^7.0.3",
"css-loader": "^6.7.1",
"cssnano": "^5.1.13",
"easygettext": "^2.17.0",
"eslint": "^8.25.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-standard": "^17.0.0",
"eslint-formatter-pretty": "^4.1.0",
"eslint-plugin-html": "^7.1.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-prettier-vue": "^4.2.0",
"eslint-plugin-promise": "^6.1.0",
"eslint-plugin-vue": "^9.6.0",
"eslint-webpack-plugin": "^3.2.0",
"eventsource-polyfill": "^0.9.6",
"file-loader": "^6.2.0",
"file-saver": "^2.0.5",
"hls.js": "^1.2.4",
"i": "^0.3.7",
"karma": "^6.4.1",
"karma-chrome-launcher": "^3.1.1",
"karma-coverage-istanbul-reporter": "^3.0.3",
"karma-htmlfile-reporter": "^0.3.8",
"karma-mocha": "^2.0.1",
"karma-verbose-reporter": "^0.0.8",
"karma-webpack": "^5.0.0",
"luxon": "^3.0.4",
"maplibre-gl": "^2.4.0",
"memoize-one": "^6.0.0",
"mini-css-extract-plugin": "^2.6.1",
"minimist": ">=1.2.5",
"mocha": "^10.1.0",
"node-storage-shim": "^2.0.1",
"photoswipe": "^4.1.3",
"postcss": "^8.4.18",
"postcss-import": "^15.0.0",
"postcss-loader": "^7.0.1",
"postcss-preset-env": "^7.8.2",
"postcss-reporter": "^7.0.5",
"postcss-url": "^10.1.3",
"prettier": "^2.7.1",
"pubsub-js": "^1.9.4",
"regenerator-runtime": "^0.13.10",
"resolve-url-loader": "^5.0.0",
"sass": "^1.55.0",
"sass-loader": "^13.1.0",
"server": "^1.0.37",
"sockette": "^2.0.6",
"style-loader": "^3.3.1",
"svg-url-loader": "^8.0.0",
"tar": "^6.1.11",
"url-loader": "^4.1.1",
"util": "^0.12.5",
"vue": "^2.6.14",
"vue-fullscreen": "^2.5.2",
"vue-gettext": "^2.1.12",
"vue-infinite-scroll": "^2.0.2",
"vue-loader": "^15.9.8",
"vue-loader-plugin": "^1.3.0",
"vue-luxon": "^0.10.0",
"vue-router": "^3.5.2",
"vue-style-loader": "^4.1.3",
"vue-template-compiler": "^2.7.10",
"vue2-filters": "^0.14.0",
"vuetify": "^1.5.24",
"webpack": "^5.74.0",
"webpack-bundle-analyzer": "^4.6.1",
"webpack-cli": "^4.10.0",
"webpack-hot-middleware": "^2.25.2",
"webpack-manifest-plugin": "^5.0.0",
"webpack-md5-hash": "^0.0.6",
"webpack-merge": "^5.8.0"
},
"engines": {
"node": ">= 16.0.0",
"npm": ">= 8.0.0",
"yarn": "please use npm"
},
"browserslist": ">0.25% and last 2 years"
}

View File

@ -11,6 +11,12 @@ stdenv.mkDerivation rec {
sha256 = "sha256-AZWgi81PV4rkqc4Nkff4ZzHGNNVrgQU0ci1yGyqe7Lc=";
};
# libtool.m4 only matches macOS 10.*
postPatch = lib.optionalString (stdenv.isDarwin && stdenv.isAarch64) ''
substituteInPlace configure \
--replace "10.*)" "*)"
'';
buildInputs = [ postgresql sqlite zlib ncurses openssl readline ]
++ lib.optionals stdenv.hostPlatform.isDarwin [
CoreFoundation

View File

@ -1,5 +1,6 @@
{ fetchFromGitHub
, lib
, stdenv
, python3Packages
}:
python3Packages.buildPythonApplication rec {
@ -36,6 +37,9 @@ python3Packages.buildPythonApplication rec {
disabledTests = [
# Assertion error
"test_help_output"
] ++ lib.optionals stdenv.isDarwin [
# FsOperationFailed
"test_get_file_mode"
];
meta = with lib; {

View File

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "pspg";
version = "5.5.8";
version = "5.5.9";
src = fetchFromGitHub {
owner = "okbob";
repo = pname;
rev = version;
sha256 = "sha256-D7aQXP95ax1m4Tmm6ipOLen4WnFcyn4HU0BkTEPCcj4=";
sha256 = "sha256-/tzv5/UvIkIUbFAlbNUDSd90DvpjGPcMh5ooDfZal80=";
};
nativeBuildInputs = [ pkg-config installShellFiles ];

View File

@ -0,0 +1,49 @@
{ lib, stdenv, fetchFromGitHub, rustPlatform, makeWrapper, darwin, networkmanager, iw, Security }:
rustPlatform.buildRustPackage rec {
pname = "ifwifi";
version = "1.0.3";
src = fetchFromGitHub {
owner = "araujobsd";
repo = "ifwifi";
rev = "${version}";
sha256 = "sha256-RYxBlqG8yV7ZhqTkWbzrGI/ZJRF55JN+kUlqFj/Bs7s=";
};
cargoSha256 = "sha256-ys4tXP46pTXj9LSVISBRX+9xj7ijJddS86YzHHzK+jQ=";
nativeBuildInputs = [ makeWrapper ];
buildInputs = lib.optional stdenv.isDarwin Security;
postInstall = ''
wrapProgram "$out/bin/ifwifi" \
--prefix PATH : "${lib.makeBinPath (
# `ifwifi` runtime dep
[ networkmanager ]
# `wifiscanner` crate's runtime deps
++ (lib.optional stdenv.isLinux iw)
# ++ (lib.optional stdenv.isDarwin airport) # airport isn't packaged
)}"
'';
doCheck = true;
meta = with lib; {
description = "A simple wrapper over nmcli using wifiscanner made in rust";
longDescription = ''
In the author's words:
I felt bothered because I never remember the long and tedious command
line to setup my wifi interface. So, I wanted to develop something
using rust to simplify the usage of nmcli, and I met the wifiscanner
project that gave me almost everything I wanted to create this tool.
'';
homepage = "https://github.com/araujobsd/ifwifi";
license = with licenses; [ bsd2 ];
maintainers = with maintainers; [ blaggacao ];
# networkmanager doesn't work on darwin
# even though the `wifiscanner` crate would work
platforms = with platforms; linux; # ++ darwin;
};
}

View File

@ -81,8 +81,8 @@ in
};
openvpn = generic {
version = "2.5.6";
sha256 = "0gdd88rcan9vfiwkzsqn6fxxdim7kb1bsxrcra59c5xksprpwfik";
version = "2.5.8";
sha256 = "1cixqm4gn2d1v8qkbww75j30fzvxz13gc7whcmz54i0x4fvibwx6";
extraBuildInputs = [ openssl ];
};
}

View File

@ -2,7 +2,7 @@
stdenv.mkDerivation rec {
pname = "rocm-smi";
version = "5.3.0";
version = "5.3.1";
src = fetchFromGitHub {
owner = "RadeonOpenCompute";

View File

@ -1076,6 +1076,8 @@ with pkgs;
{ name = "validate-pkg-config"; deps = [ findutils pkg-config ]; }
../build-support/setup-hooks/validate-pkg-config.sh;
patchPpdFilesHook = callPackage ../build-support/setup-hooks/patch-ppd-files {};
#package writers
writers = callPackage ../build-support/writers {};
@ -4738,6 +4740,8 @@ with pkgs;
photon = callPackage ../tools/networking/photon { };
photoprism = callPackage ../servers/photoprism { };
piglit = callPackage ../tools/graphics/piglit { };
pika = callPackage ../applications/graphics/pika { };
@ -7936,6 +7940,10 @@ with pkgs;
iftop = callPackage ../tools/networking/iftop { };
ifwifi = callPackage ../tools/networking/ifwifi {
inherit (darwin.apple_sdk.frameworks) Security;
};
ifuse = callPackage ../tools/filesystems/ifuse { };
ideviceinstaller = callPackage ../tools/misc/ideviceinstaller { };
idevicerestore = callPackage ../tools/misc/idevicerestore { };
@ -14843,6 +14851,14 @@ with pkgs;
rgbds = callPackage ../development/compilers/rgbds { };
composable_kernel = callPackage ../development/libraries/composable_kernel {
inherit (llvmPackages) openmp;
};
clang-ocl = callPackage ../development/libraries/clang-ocl {
inherit (llvmPackages_rocm) clang;
};
rgxg = callPackage ../tools/text/rgxg { };
rocclr = callPackage ../development/libraries/rocclr { };
@ -14851,6 +14867,12 @@ with pkgs;
inherit (llvmPackages_rocm) clang llvm;
};
hipcub = callPackage ../development/libraries/hipcub { };
hipsparse = callPackage ../development/libraries/hipsparse { };
rccl = callPackage ../development/libraries/rccl { };
rocm-cmake = callPackage ../development/tools/build-managers/rocm-cmake { };
rocm-comgr = callPackage ../development/libraries/rocm-comgr {
@ -14879,6 +14901,24 @@ with pkgs;
rocmlir = callPackage ../development/libraries/rocmlir { };
rocprim = callPackage ../development/libraries/rocprim { };
rocsparse = callPackage ../development/libraries/rocsparse { };
rocfft = callPackage ../development/libraries/rocfft { };
tensile = python3Packages.callPackage ../development/libraries/tensile { };
rocblas = callPackage ../development/libraries/rocblas {
inherit (llvmPackages_rocm) llvm;
};
miopengemm = callPackage ../development/libraries/miopengemm {
inherit (llvmPackages_rocm) clang;
};
rocthrust = callPackage ../development/libraries/rocthrust { };
rtags = callPackage ../development/tools/rtags {
inherit (darwin) apple_sdk;
};
@ -36326,6 +36366,12 @@ with pkgs;
epson-workforce-635-nx625-series = callPackage ../misc/drivers/epson-workforce-635-nx625-series { };
foomatic-db = callPackage ../misc/cups/drivers/foomatic-db {};
foomatic-db-engine = callPackage ../misc/cups/drivers/foomatic-db-engine {};
foomatic-db-nonfree = callPackage ../misc/cups/drivers/foomatic-db-nonfree {};
foomatic-db-ppds = callPackage ../misc/cups/drivers/foomatic-db-ppds {};
foomatic-db-ppds-withNonfreeDb = callPackage ../misc/cups/drivers/foomatic-db-ppds { withNonfreeDb = true; };
gutenprint = callPackage ../misc/drivers/gutenprint { };
gutenprintBin = callPackage ../misc/drivers/gutenprint/bin.nix { };

View File

@ -8004,16 +8004,18 @@ self: super: with self; {
pylink-square = callPackage ../development/python-modules/pylink-square { };
pylint = callPackage ../development/python-modules/pylint { };
pylint-celery = callPackage ../development/python-modules/pylint-celery { };
pylint-django = callPackage ../development/python-modules/pylint-django { };
pylint-flask = callPackage ../development/python-modules/pylint-flask { };
pylint = callPackage ../development/python-modules/pylint { };
pylint-plugin-utils = callPackage ../development/python-modules/pylint-plugin-utils { };
pylint-venv = callPackage ../development/python-modules/pylint-venv { };
pylitterbot = callPackage ../development/python-modules/pylitterbot { };
py-libzfs = callPackage ../development/python-modules/py-libzfs { };