Merge master into haskell-updates

This commit is contained in:
github-actions[bot] 2023-10-11 00:12:13 +00:00 committed by GitHub
commit 5e07b9a951
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
323 changed files with 6224 additions and 9641 deletions

View File

@ -542,6 +542,36 @@ rec {
attrs:
map (name: f name attrs.${name}) (attrNames attrs);
/*
Deconstruct an attrset to a list of name-value pairs as expected by [`builtins.listToAttrs`](https://nixos.org/manual/nix/stable/language/builtins.html#builtins-listToAttrs).
Each element of the resulting list is an attribute set with these attributes:
- `name` (string): The name of the attribute
- `value` (any): The value of the attribute
The following is always true:
```nix
builtins.listToAttrs (attrsToList attrs) == attrs
```
:::{.warning}
The opposite is not always true. In general expect that
```nix
attrsToList (builtins.listToAttrs list) != list
```
This is because the `listToAttrs` removes duplicate names and doesn't preserve the order of the list.
:::
Example:
attrsToList { foo = 1; bar = "asdf"; }
=> [ { name = "bar"; value = "asdf"; } { name = "foo"; value = 1; } ]
Type:
attrsToList :: AttrSet -> [ { name :: String; value :: Any; } ]
*/
attrsToList = mapAttrsToList nameValuePair;
/* Like `mapAttrs`, except that it recursively applies itself to
the *leaf* attributes of a potentially-nested attribute set:

View File

@ -81,8 +81,8 @@ let
inherit (self.attrsets) attrByPath hasAttrByPath setAttrByPath
getAttrFromPath attrVals attrValues getAttrs catAttrs filterAttrs
filterAttrsRecursive foldlAttrs foldAttrs collect nameValuePair mapAttrs
mapAttrs' mapAttrsToList concatMapAttrs mapAttrsRecursive mapAttrsRecursiveCond
genAttrs isDerivation toDerivation optionalAttrs
mapAttrs' mapAttrsToList attrsToList concatMapAttrs mapAttrsRecursive
mapAttrsRecursiveCond genAttrs isDerivation toDerivation optionalAttrs
zipAttrsWithNames zipAttrsWith zipAttrs recursiveUpdateUntil
recursiveUpdate matchAttrs overrideExisting showAttrPath getOutput getBin
getLib getDev getMan chooseDevOutputs zipWithNames zip

View File

@ -20,6 +20,10 @@ let
expr = (builtins.tryEval (builtins.seq expr "didn't throw"));
expected = { success = false; value = false; };
};
testingEval = expr: {
expr = (builtins.tryEval expr).success;
expected = true;
};
testingDeepThrow = expr: testingThrow (builtins.deepSeq expr expr);
testSanitizeDerivationName = { name, expected }:
@ -816,6 +820,26 @@ runTests {
expected = { a = 1; b = 2; };
};
testListAttrsReverse = let
exampleAttrs = {foo=1; bar="asdf"; baz = [1 3 3 7]; fnord=null;};
exampleSingletonList = [{name="foo"; value=1;}];
in {
expr = {
isReverseToListToAttrs = builtins.listToAttrs (attrsToList exampleAttrs) == exampleAttrs;
isReverseToAttrsToList = attrsToList (builtins.listToAttrs exampleSingletonList) == exampleSingletonList;
testDuplicatePruningBehaviour = attrsToList (builtins.listToAttrs [{name="a"; value=2;} {name="a"; value=1;}]);
};
expected = {
isReverseToAttrsToList = true;
isReverseToListToAttrs = true;
testDuplicatePruningBehaviour = [{name="a"; value=2;}];
};
};
testAttrsToListsCanDealWithFunctions = testingEval (
attrsToList { someFunc= a: a + 1;}
);
# GENERATORS
# these tests assume attributes are converted to lists
# in alphabetical order

View File

@ -793,6 +793,12 @@
githubId = 5053729;
name = "Alias Gram";
};
alias-dev = {
email = "alias-dev@protonmail.com";
github = "alias-dev";
githubId = 30437811;
name = "Alex Andrews";
};
alibabzo = {
email = "alistair.bill@gmail.com";
github = "alistairbill";
@ -14143,6 +14149,12 @@
githubId = 406946;
name = "Valentin Lorentz";
};
prominentretail = {
email = "me@jakepark.me";
github = "ProminentRetail";
githubId = 94048404;
name = "Jake Park";
};
proofconstruction = {
email = "source@proof.construction";
github = "proofconstruction";

View File

@ -26,7 +26,7 @@ directory which is scanned by the ICL loader for ICD files. For example:
```ShellSession
$ export \
OCL_ICD_VENDORS=`nix-build '<nixpkgs>' --no-out-link -A rocm-opencl-icd`/etc/OpenCL/vendors/
OCL_ICD_VENDORS=`nix-build '<nixpkgs>' --no-out-link -A rocmPackages.clr.icd`/etc/OpenCL/vendors/
```
The second mechanism is to add the OpenCL driver package to
@ -50,13 +50,13 @@ Platform Vendor Advanced Micro Devices, Inc.
Modern AMD [Graphics Core
Next](https://en.wikipedia.org/wiki/Graphics_Core_Next) (GCN) GPUs are
supported through the rocm-opencl-icd package. Adding this package to
supported through the rocmPackages.clr.icd package. Adding this package to
[](#opt-hardware.opengl.extraPackages)
enables OpenCL support:
```nix
hardware.opengl.extraPackages = [
rocm-opencl-icd
rocmPackages.clr.icd
];
```

View File

@ -528,7 +528,7 @@ The only required parameter is `name`.
: A string representation of the type function name.
`definition`
`description`
: Description of the type used in documentation. Give information of
the type and any of its arguments.

View File

@ -26,6 +26,9 @@
[`sudo-rs`]: https://github.com/memorysafety/sudo-rs/
- All [ROCm](https://rocm.docs.amd.com/en/latest/) packages have been updated to 5.7.0.
- [ROCm](https://rocm.docs.amd.com/en/latest/) package attribute sets are versioned: `rocmPackages` -> `rocmPackages_5`.
## New Services {#sec-release-23.11-new-services}
- [MCHPRS](https://github.com/MCHPR/MCHPRS), a multithreaded Minecraft server built for redstone. Available as [services.mchprs](#opt-services.mchprs.enable).
@ -148,6 +151,17 @@
- `consul` has been updated to `1.16.0`. See the [release note](https://github.com/hashicorp/consul/releases/tag/v1.16.0) for more details. Once a new Consul version has started and upgraded its data directory, it generally cannot be downgraded to the previous version.
- `llvmPackages_rocm` has been moved to `rocmPackages.llvm`.
- `hip`, `rocm-opencl-runtime`, `rocm-opencl-icd`, and `rocclr` have been combined into `rocmPackages.clr`.
- `clang-ocl`, `clr`, `composable_kernel`, `hipblas`, `hipcc`, `hip-common`, `hipcub`,
`hipfft`, `hipfort`, `hipify`, `hipsolver`, `hipsparse`, `migraphx`, `miopen`, `miopengemm`,
`rccl`, `rdc`, `rocalution`, `rocblas`, `rocdgbapi`, `rocfft`, `rocgdb`, `rocm-cmake`,
`rocm-comgr`, `rocm-core`, `rocm-device-libs`, `rocminfo`, `rocmlir`, `rocm-runtime`,
`rocm-smi`, `rocm-thunk`, `rocprim`, `rocprofiler`, `rocrand`, `rocr-debug-agent`,
`rocsolver`, `rocsparse`, `rocthrust`, `roctracer`, `rocwmma`, and `tensile` have been moved to `rocmPackages`.
- `himalaya` has been updated to `0.8.0`, which drops the native TLS support (in favor of Rustls) and add OAuth 2.0 support. See the [release note](https://github.com/soywod/himalaya/releases/tag/v0.8.0) for more details.
- `nix-prefetch-git` now ignores global and user git config, to improve reproducibility.

View File

@ -34,9 +34,6 @@ evalConfigArgs@
in lib.optional (e != "") (import e)
}:
let pkgs_ = pkgs;
in
let
inherit (lib) optional;
@ -58,8 +55,9 @@ let
nixpkgs.system = lib.mkDefault system;
})
++
(optional (pkgs_ != null) {
_module.args.pkgs = lib.mkForce pkgs_;
(optional (pkgs != null) {
# This should be default priority, so it conflicts with any user-defined pkgs.
nixpkgs.pkgs = pkgs;
})
);
};
@ -109,10 +107,10 @@ let
nixosWithUserModules = noUserModules.extendModules { modules = allUserModules; };
withExtraArgs = nixosSystem: nixosSystem // {
withExtraAttrs = configuration: configuration // {
inherit extraArgs;
inherit (nixosSystem._module.args) pkgs;
extendModules = args: withExtraArgs (nixosSystem.extendModules args);
inherit (configuration._module.args) pkgs;
extendModules = args: withExtraAttrs (configuration.extendModules args);
};
in
withWarnings (withExtraArgs nixosWithUserModules)
withWarnings (withExtraAttrs nixosWithUserModules)

View File

@ -330,6 +330,20 @@ let
administrator before being able to use the system again.
'';
};
linger = mkOption {
type = types.bool;
default = false;
description = lib.mdDoc ''
Whether to enable lingering for this user. If true, systemd user
units will start at boot, rather than starting at login and stopping
at logout. This is the declarative equivalent of running
`loginctl enable-linger` for this user.
If false, user units will not be started until the user logs in, and
may be stopped on logout depending on the settings in `logind.conf`.
'';
};
};
config = mkMerge
@ -663,6 +677,20 @@ in {
'';
};
system.activationScripts.update-lingering = let
lingerDir = "/var/lib/systemd/linger";
lingeringUsers = map (u: u.name) (attrValues (flip filterAttrs cfg.users (n: u: u.linger)));
lingeringUsersFile = builtins.toFile "lingering-users"
(concatStrings (map (s: "${s}\n")
(sort (a: b: a < b) lingeringUsers))); # this sorting is important for `comm` to work correctly
in stringAfter [ "users" ] ''
if [ -e ${lingerDir} ] ; then
cd ${lingerDir}
ls ${lingerDir} | sort | comm -3 -1 ${lingeringUsersFile} - | xargs -r ${pkgs.systemd}/bin/loginctl disable-linger
ls ${lingerDir} | sort | comm -3 -2 ${lingeringUsersFile} - | xargs -r ${pkgs.systemd}/bin/loginctl enable-linger
fi
'';
# Warn about user accounts with deprecated password hashing schemes
system.activationScripts.hashes = {
deps = [ "users" ];

View File

@ -5,7 +5,6 @@ stdenv.mkDerivation {
name = "security-wrapper";
buildInputs = [ linuxHeaders ];
dontUnpack = true;
hardeningEnable = [ "pie" ];
CFLAGS = [
''-DSOURCE_PROG="${sourceProg}"''
] ++ (if debug then [

View File

@ -12,7 +12,9 @@ let
usePostgresql = cfg.settings.database.name == "psycopg2";
hasLocalPostgresDB = let args = cfg.settings.database.args; in
usePostgresql && (!(args ? host) || (elem args.host [ "localhost" "127.0.0.1" "::1" ]));
usePostgresql
&& (!(args ? host) || (elem args.host [ "localhost" "127.0.0.1" "::1" ]))
&& config.services.postgresql.enable;
hasWorkers = cfg.workers != { };
listenerSupportsResource = resource: listener:
@ -944,23 +946,6 @@ in {
by synapse in `services.matrix-synapse.settings.listeners` or in one of the workers!
'';
}
{
assertion = hasLocalPostgresDB -> config.services.postgresql.enable;
message = ''
Cannot deploy matrix-synapse with a configuration for a local postgresql database
and a missing postgresql service. Since 20.03 it's mandatory to manually configure the
database (please read the thread in https://github.com/NixOS/nixpkgs/pull/80447 for
further reference).
If you
- try to deploy a fresh synapse, you need to configure the database yourself. An example
for this can be found in <nixpkgs/nixos/tests/matrix/synapse.nix>
- update your existing matrix-synapse instance, you simply need to add `services.postgresql.enable = true`
to your configuration.
For further information about this update, please read the release-notes of 20.03 carefully.
'';
}
{
assertion = hasWorkers -> cfg.settings.redis.enabled;
message = ''
@ -1034,9 +1019,11 @@ in {
partOf = [ "matrix-synapse.target" ];
wantedBy = [ "matrix-synapse.target" ];
unitConfig.ReloadPropagatedFrom = "matrix-synapse.target";
requires = optional hasLocalPostgresDB "postgresql.service";
}
else {
after = [ "network-online.target" ] ++ optional hasLocalPostgresDB "postgresql.service";
requires = optional hasLocalPostgresDB "postgresql.service";
wantedBy = [ "multi-user.target" ];
};
baseServiceConfig = {
@ -1070,7 +1057,7 @@ in {
ProtectKernelTunables = true;
ProtectProc = "invisible";
ProtectSystem = "strict";
ReadWritePaths = [ cfg.dataDir ];
ReadWritePaths = [ cfg.dataDir cfg.settings.media_store_path ];
RemoveIPC = true;
RestrictAddressFamilies = [ "AF_INET" "AF_INET6" "AF_UNIX" ];
RestrictNamespaces = true;

View File

@ -39,7 +39,7 @@ let
daemonService = appName: args:
{ description = "Samba Service Daemon ${appName}";
after = [ (mkIf (cfg.enableNmbd && "${appName}" == "smbd") "samba-nmbd.service") ];
after = [ (mkIf (cfg.enableNmbd && "${appName}" == "smbd") "samba-nmbd.service") "network.target" ];
requiredBy = [ "samba.target" ];
partOf = [ "samba.target" ];

View File

@ -1,27 +1,25 @@
#! @python3@/bin/python3 -B
import argparse
import shutil
import os
import sys
import errno
import subprocess
import glob
import tempfile
import errno
import warnings
import ctypes
libc = ctypes.CDLL("libc.so.6")
import re
import datetime
import errno
import glob
import os
import os.path
from typing import NamedTuple, List, Optional
from packaging import version
import re
import shutil
import subprocess
import sys
import warnings
from typing import NamedTuple
libc = ctypes.CDLL("libc.so.6")
class SystemIdentifier(NamedTuple):
profile: Optional[str]
profile: str | None
generation: int
specialisation: Optional[str]
specialisation: str | None
def copy_if_not_exists(source: str, dest: str) -> None:
@ -29,13 +27,13 @@ def copy_if_not_exists(source: str, dest: str) -> None:
shutil.copyfile(source, dest)
def generation_dir(profile: Optional[str], generation: int) -> str:
def generation_dir(profile: str | None, generation: int) -> str:
if profile:
return "/nix/var/nix/profiles/system-profiles/%s-%d-link" % (profile, generation)
else:
return "/nix/var/nix/profiles/system-%d-link" % (generation)
def system_dir(profile: Optional[str], generation: int, specialisation: Optional[str]) -> str:
def system_dir(profile: str | None, generation: int, specialisation: str | None) -> str:
d = generation_dir(profile, generation)
if specialisation:
return os.path.join(d, "specialisation", specialisation)
@ -49,7 +47,7 @@ initrd {initrd}
options {kernel_params}
"""
def generation_conf_filename(profile: Optional[str], generation: int, specialisation: Optional[str]) -> str:
def generation_conf_filename(profile: str | None, generation: int, specialisation: str | None) -> str:
pieces = [
"nixos",
profile or None,
@ -60,22 +58,24 @@ def generation_conf_filename(profile: Optional[str], generation: int, specialisa
return "-".join(p for p in pieces if p) + ".conf"
def write_loader_conf(profile: Optional[str], generation: int, specialisation: Optional[str]) -> None:
def write_loader_conf(profile: str | None, generation: int, specialisation: str | None) -> None:
with open("@efiSysMountPoint@/loader/loader.conf.tmp", 'w') as f:
if "@timeout@" != "":
f.write("timeout @timeout@\n")
f.write("default %s\n" % generation_conf_filename(profile, generation, specialisation))
if not @editor@:
f.write("editor 0\n");
f.write("console-mode @consoleMode@\n");
f.write("editor 0\n")
f.write("console-mode @consoleMode@\n")
f.flush()
os.fsync(f.fileno())
os.rename("@efiSysMountPoint@/loader/loader.conf.tmp", "@efiSysMountPoint@/loader/loader.conf")
def profile_path(profile: Optional[str], generation: int, specialisation: Optional[str], name: str) -> str:
def profile_path(profile: str | None, generation: int, specialisation: str | None, name: str) -> str:
return os.path.realpath("%s/%s" % (system_dir(profile, generation, specialisation), name))
def copy_from_profile(profile: Optional[str], generation: int, specialisation: Optional[str], name: str, dry_run: bool = False) -> str:
def copy_from_profile(profile: str | None, generation: int, specialisation: str | None, name: str, dry_run: bool = False) -> str:
store_file_path = profile_path(profile, generation, specialisation, name)
suffix = os.path.basename(store_file_path)
store_dir = os.path.basename(os.path.dirname(store_file_path))
@ -85,7 +85,7 @@ def copy_from_profile(profile: Optional[str], generation: int, specialisation: O
return efi_file_path
def describe_generation(profile: Optional[str], generation: int, specialisation: Optional[str]) -> str:
def describe_generation(profile: str | None, generation: int, specialisation: str | None) -> str:
try:
with open(profile_path(profile, generation, specialisation, "nixos-version")) as f:
nixos_version = f.read()
@ -106,7 +106,7 @@ def describe_generation(profile: Optional[str], generation: int, specialisation:
return description
def write_entry(profile: Optional[str], generation: int, specialisation: Optional[str],
def write_entry(profile: str | None, generation: int, specialisation: str | None,
machine_id: str, current: bool) -> None:
kernel = copy_from_profile(profile, generation, specialisation, "kernel")
initrd = copy_from_profile(profile, generation, specialisation, "initrd")
@ -145,18 +145,12 @@ def write_entry(profile: Optional[str], generation: int, specialisation: Optiona
description=describe_generation(profile, generation, specialisation)))
if machine_id is not None:
f.write("machine-id %s\n" % machine_id)
f.flush()
os.fsync(f.fileno())
os.rename(tmp_path, entry_file)
def mkdir_p(path: str) -> None:
try:
os.makedirs(path)
except OSError as e:
if e.errno != errno.EEXIST or not os.path.isdir(path):
raise
def get_generations(profile: Optional[str] = None) -> List[SystemIdentifier]:
def get_generations(profile: str | None = None) -> list[SystemIdentifier]:
gen_list = subprocess.check_output([
"@nix@/bin/nix-env",
"--list-generations",
@ -179,7 +173,7 @@ def get_generations(profile: Optional[str] = None) -> List[SystemIdentifier]:
return configurations[-configurationLimit:]
def get_specialisations(profile: Optional[str], generation: int, _: Optional[str]) -> List[SystemIdentifier]:
def get_specialisations(profile: str | None, generation: int, _: str | None) -> list[SystemIdentifier]:
specialisations_dir = os.path.join(
system_dir(profile, generation, None), "specialisation")
if not os.path.exists(specialisations_dir):
@ -187,9 +181,9 @@ def get_specialisations(profile: Optional[str], generation: int, _: Optional[str
return [SystemIdentifier(profile, generation, spec) for spec in os.listdir(specialisations_dir)]
def remove_old_entries(gens: List[SystemIdentifier]) -> None:
rex_profile = re.compile("^@efiSysMountPoint@/loader/entries/nixos-(.*)-generation-.*\.conf$")
rex_generation = re.compile("^@efiSysMountPoint@/loader/entries/nixos.*-generation-([0-9]+)(-specialisation-.*)?\.conf$")
def remove_old_entries(gens: list[SystemIdentifier]) -> None:
rex_profile = re.compile(r"^@efiSysMountPoint@/loader/entries/nixos-(.*)-generation-.*\.conf$")
rex_generation = re.compile(r"^@efiSysMountPoint@/loader/entries/nixos.*-generation-([0-9]+)(-specialisation-.*)?\.conf$")
known_paths = []
for gen in gens:
known_paths.append(copy_from_profile(*gen, "kernel", True))
@ -210,7 +204,7 @@ def remove_old_entries(gens: List[SystemIdentifier]) -> None:
os.unlink(path)
def get_profiles() -> List[str]:
def get_profiles() -> list[str]:
if os.path.isdir("/nix/var/nix/profiles/system-profiles/"):
return [x
for x in os.listdir("/nix/var/nix/profiles/system-profiles/")
@ -218,11 +212,7 @@ def get_profiles() -> List[str]:
else:
return []
def main() -> None:
parser = argparse.ArgumentParser(description='Update @distroName@-related systemd-boot files')
parser.add_argument('default_config', metavar='DEFAULT-CONFIG', help='The default @distroName@ config to boot')
args = parser.parse_args()
def install_bootloader(args: argparse.Namespace) -> None:
try:
with open("/etc/machine-id") as machine_file:
machine_id = machine_file.readlines()[0]
@ -273,21 +263,15 @@ def main() -> None:
if available_match is None:
raise Exception("could not determine systemd-boot version")
installed_version = version.parse(installed_match.group(1))
available_version = version.parse(available_match.group(1))
installed_version = installed_match.group(1)
available_version = available_match.group(1)
# systemd 252 has a regression that leaves some machines unbootable, so we skip that update.
# The fix is in 252.2
# See https://github.com/systemd/systemd/issues/25363 and https://github.com/NixOS/nixpkgs/pull/201558#issuecomment-1348603263
if installed_version < available_version:
if version.parse('252') <= available_version < version.parse('252.2'):
print("skipping systemd-boot update to %s because of known regression" % available_version)
else:
print("updating systemd-boot from %s to %s" % (installed_version, available_version))
subprocess.check_call(["@systemd@/bin/bootctl", "--esp-path=@efiSysMountPoint@"] + bootctl_flags + ["update"])
print("updating systemd-boot from %s to %s" % (installed_version, available_version))
subprocess.check_call(["@systemd@/bin/bootctl", "--esp-path=@efiSysMountPoint@", "update"])
mkdir_p("@efiSysMountPoint@/efi/nixos")
mkdir_p("@efiSysMountPoint@/loader/entries")
os.makedirs("@efiSysMountPoint@/efi/nixos", exist_ok=True)
os.makedirs("@efiSysMountPoint@/loader/entries", exist_ok=True)
gens = get_generations()
for profile in get_profiles():
@ -324,17 +308,26 @@ def main() -> None:
os.rmdir(actual_root)
os.rmdir(root)
mkdir_p("@efiSysMountPoint@/efi/nixos/.extra-files")
os.makedirs("@efiSysMountPoint@/efi/nixos/.extra-files", exist_ok=True)
subprocess.check_call("@copyExtraFiles@")
# Since fat32 provides little recovery facilities after a crash,
# it can leave the system in an unbootable state, when a crash/outage
# happens shortly after an update. To decrease the likelihood of this
# event sync the efi filesystem after each update.
rc = libc.syncfs(os.open("@efiSysMountPoint@", os.O_RDONLY))
if rc != 0:
print("could not sync @efiSysMountPoint@: {}".format(os.strerror(rc)), file=sys.stderr)
def main() -> None:
parser = argparse.ArgumentParser(description='Update @distroName@-related systemd-boot files')
parser.add_argument('default_config', metavar='DEFAULT-CONFIG', help='The default @distroName@ config to boot')
args = parser.parse_args()
try:
install_bootloader(args)
finally:
# Since fat32 provides little recovery facilities after a crash,
# it can leave the system in an unbootable state, when a crash/outage
# happens shortly after an update. To decrease the likelihood of this
# event sync the efi filesystem after each update.
rc = libc.syncfs(os.open("@efiSysMountPoint@", os.O_RDONLY))
if rc != 0:
print("could not sync @efiSysMountPoint@: {}".format(os.strerror(rc)), file=sys.stderr)
if __name__ == '__main__':

View File

@ -7,14 +7,12 @@ let
efi = config.boot.loader.efi;
python3 = pkgs.python3.withPackages (ps: [ ps.packaging ]);
systemdBootBuilder = pkgs.substituteAll {
src = ./systemd-boot-builder.py;
isExecutable = true;
inherit python3;
inherit (pkgs) python3;
systemd = config.systemd.package;
@ -52,7 +50,7 @@ let
};
checkedSystemdBootBuilder = pkgs.runCommand "systemd-boot" {
nativeBuildInputs = [ pkgs.mypy python3 ];
nativeBuildInputs = [ pkgs.mypy ];
} ''
install -m755 ${systemdBootBuilder} $out
mypy \

View File

@ -19,7 +19,7 @@ import ./make-test-python.nix ({ pkgs, lib, ... }:
python3Packages.pytest
python3Packages.pytest-mock
python3Packages.pytest-timeout
python3Packages.factory_boy
python3Packages.factory-boy
python3Packages.docker # only needed so import does not fail
sqlite3-to-mysql
])

View File

@ -107,7 +107,7 @@ in
)
output = machine.succeed("/run/current-system/bin/switch-to-configuration boot")
assert "updating systemd-boot from 000.0-1-notnixos to " in output
assert "updating systemd-boot from 000.0-1-notnixos to " in output, "Couldn't find systemd-boot update message"
'';
};

View File

@ -3,11 +3,11 @@
stdenv.mkDerivation rec {
pname = "butt";
version = "0.1.38";
version = "0.1.39";
src = fetchurl {
url = "mirror://sourceforge/${pname}/${pname}-${version}.tar.gz";
hash = "sha256-6c4BknAh+XPaKrEfCz0oHm7lWOLV+9jiJbQx9vvtI4I=";
hash = "sha256-dh6NceHiqpN6PVwKIo2jV3qCO17P6E6QHdZGRVyd6/g=";
};
postPatch = ''

View File

@ -26,13 +26,13 @@ assert withQt -> wrapQtAppsHook != null;
stdenv.mkDerivation (finalAttrs: {
pname = "carla";
version = "2.5.6";
version = "2.5.7";
src = fetchFromGitHub {
owner = "falkTX";
repo = finalAttrs.pname;
rev = "v${finalAttrs.version}";
hash = "sha256-/ZIproky1AHJHvV62xWm0nrzNBOjvBBv93V0KespVjU=";
hash = "sha256-WDwYfDR760Maz3oWNPcPbl8L+0MIRbeqNVGH9Gg4ZYc=";
};
nativeBuildInputs = [

View File

@ -13,11 +13,11 @@
}:
stdenv.mkDerivation {
inherit pname version;
inherit pname version meta;
src = fetchurl {
url = "https://github.com/jeffvli/feishin/releases/download/v${version}/${appname}-${version}-mac-x64.zip";
hash = "sha256-J5LB4uR/NJ6ykiTqBY1VepcLujprgqwpxy7sGD0NtZw=";
hash = "sha256-6GYp9uzlR1eVRYhNU3kOmcUOPFY3J9eJPqN+TucNavA=";
};
nativeBuildInputs = [ makeWrapper unzip ];

View File

@ -8,7 +8,7 @@ let
extraArgs = removeAttrs args [ "callPackage" ];
pname = "feishin";
version = "0.3.0";
version = "0.4.1";
appname = "Feishin";
meta = with lib; {
@ -21,6 +21,7 @@ let
maintainers = with maintainers; [ onny ];
};
in if stdenv.isDarwin
in
if stdenv.isDarwin
then callPackage ./darwin.nix (extraArgs // { inherit pname appname version meta; })
else callPackage ./linux.nix (extraArgs // { inherit pname appname version meta; })

View File

@ -25,17 +25,17 @@ let
comment = "Full-featured Subsonic/Jellyfin compatible desktop music player";
icon = "feishin";
exec = "feishin %u";
categories = [ "Audio" ];
categories = [ "Audio" "AudioVideo" ];
mimeTypes = [ "x-scheme-handler/feishin" ];
};
in
stdenv.mkDerivation {
inherit pname version;
inherit pname version meta;
src = fetchurl {
url = "https://github.com/jeffvli/feishin/releases/download/v${version}/${appname}-${version}-linux-x64.tar.xz";
hash = "sha256-sl2zM24bb0yBTfCxtNGizp6Yu+L4nj/Uf669zylnPmE=";
hash = "sha256-Y8r329rO7z8V2xP/uRsjTFJfvTn+zyeAYzq6fKDxXs4=";
};

View File

@ -70,13 +70,13 @@ let
in
stdenv.mkDerivation rec {
pname = "neovim-unwrapped";
version = "0.9.2";
version = "0.9.4";
src = fetchFromGitHub {
owner = "neovim";
repo = "neovim";
rev = "v${version}";
hash = "sha256-kKstlq1BzoBAy+gy9iL1auRViJ223cVpAt5X7pUWT1U=";
hash = "sha256-Lyo98cAs7Zhx23N4s4f3zpWFKYJMmXleWpt3wiVDQZo=";
};
patches = [

View File

@ -1,164 +1,55 @@
{ stdenv, lib, makeDesktopItem
, unzip, libsecret, libXScrnSaver, libxshmfence, buildPackages
, at-spi2-atk, autoPatchelfHook, alsa-lib, mesa, nss, nspr, xorg
, systemd, fontconfig, libdbusmenu, glib, buildFHSEnv, wayland
, libglvnd, libkrb5
{ stdenv
, lib
, makeDesktopItem
, unzip
, libsecret
, libXScrnSaver
, libxshmfence
, buildPackages
, at-spi2-atk
, autoPatchelfHook
, alsa-lib
, mesa
, nss
, nspr
, xorg
, systemd
, fontconfig
, libdbusmenu
, glib
, buildFHSEnv
, wayland
, libglvnd
, libkrb5
# Populate passthru.tests
# Populate passthru.tests
, tests
# needed to fix "Save as Root"
, asar, bash
# needed to fix "Save as Root"
, asar
, bash
# Attributes inherit from specific versions
, version, src, meta, sourceRoot, commandLineArgs
, executableName, longName, shortName, pname, updateScript
# Attributes inherit from specific versions
, version
, src
, meta
, sourceRoot
, commandLineArgs
, executableName
, longName
, shortName
, pname
, updateScript
, dontFixup ? false
, rev ? null, vscodeServer ? null
, rev ? null
, vscodeServer ? null
, sourceExecutableName ? executableName
, useVSCodeRipgrep ? false
, ripgrep
}:
stdenv.mkDerivation (finalAttrs:
let
unwrapped = stdenv.mkDerivation {
inherit pname version src sourceRoot dontFixup;
passthru = {
inherit executableName longName tests updateScript;
fhs = fhs {};
fhsWithPackages = f: fhs { additionalPkgs = f; };
} // lib.optionalAttrs (vscodeServer != null) {
inherit rev vscodeServer;
};
desktopItem = makeDesktopItem {
name = executableName;
desktopName = longName;
comment = "Code Editing. Redefined.";
genericName = "Text Editor";
exec = "${executableName} %F";
icon = "vs${executableName}";
startupNotify = true;
startupWMClass = shortName;
categories = [ "Utility" "TextEditor" "Development" "IDE" ];
mimeTypes = [ "text/plain" "inode/directory" ];
keywords = [ "vscode" ];
actions.new-empty-window = {
name = "New Empty Window";
exec = "${executableName} --new-window %F";
icon = "vs${executableName}";
};
};
urlHandlerDesktopItem = makeDesktopItem {
name = executableName + "-url-handler";
desktopName = longName + " - URL Handler";
comment = "Code Editing. Redefined.";
genericName = "Text Editor";
exec = executableName + " --open-url %U";
icon = "vs${executableName}";
startupNotify = true;
categories = [ "Utility" "TextEditor" "Development" "IDE" ];
mimeTypes = [ "x-scheme-handler/vscode" ];
keywords = [ "vscode" ];
noDisplay = true;
};
buildInputs = [ libsecret libXScrnSaver libxshmfence ]
++ lib.optionals (!stdenv.isDarwin) [ alsa-lib at-spi2-atk libkrb5 mesa nss nspr systemd xorg.libxkbfile ];
runtimeDependencies = lib.optionals stdenv.isLinux [ (lib.getLib systemd) fontconfig.lib libdbusmenu wayland libsecret ];
nativeBuildInputs = [ unzip ]
++ lib.optionals stdenv.isLinux [
autoPatchelfHook
asar
# override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651
(buildPackages.wrapGAppsHook.override { inherit (buildPackages) makeWrapper; })
];
dontBuild = true;
dontConfigure = true;
noDumpEnvVars = true;
installPhase = ''
runHook preInstall
'' + (if stdenv.isDarwin then ''
mkdir -p "$out/Applications/${longName}.app" "$out/bin"
cp -r ./* "$out/Applications/${longName}.app"
ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/${sourceExecutableName}" "$out/bin/${executableName}"
'' else ''
mkdir -p "$out/lib/vscode" "$out/bin"
cp -r ./* "$out/lib/vscode"
ln -s "$out/lib/vscode/bin/${sourceExecutableName}" "$out/bin/${executableName}"
mkdir -p "$out/share/applications"
ln -s "$desktopItem/share/applications/${executableName}.desktop" "$out/share/applications/${executableName}.desktop"
ln -s "$urlHandlerDesktopItem/share/applications/${executableName}-url-handler.desktop" "$out/share/applications/${executableName}-url-handler.desktop"
# These are named vscode.png, vscode-insiders.png, etc to match the name in upstream *.deb packages.
mkdir -p "$out/share/pixmaps"
cp "$out/lib/vscode/resources/app/resources/linux/code.png" "$out/share/pixmaps/vs${executableName}.png"
# Override the previously determined VSCODE_PATH with the one we know to be correct
sed -i "/ELECTRON=/iVSCODE_PATH='$out/lib/vscode'" "$out/bin/${executableName}"
grep -q "VSCODE_PATH='$out/lib/vscode'" "$out/bin/${executableName}" # check if sed succeeded
# Remove native encryption code, as it derives the key from the executable path which does not work for us.
# The credentials should be stored in a secure keychain already, so the benefit of this is questionable
# in the first place.
rm -rf $out/lib/vscode/resources/app/node_modules/vscode-encrypt
'') + ''
runHook postInstall
'';
preFixup = ''
gappsWrapperArgs+=(
# Add gio to PATH so that moving files to the trash works when not using a desktop environment
--prefix PATH : ${glib.bin}/bin
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
--add-flags ${lib.escapeShellArg commandLineArgs}
)
'';
# See https://github.com/NixOS/nixpkgs/issues/49643#issuecomment-873853897
# linux only because of https://github.com/NixOS/nixpkgs/issues/138729
postPatch = lib.optionalString stdenv.isLinux ''
# this is a fix for "save as root" functionality
packed="resources/app/node_modules.asar"
unpacked="resources/app/node_modules"
asar extract "$packed" "$unpacked"
substituteInPlace $unpacked/@vscode/sudo-prompt/index.js \
--replace "/usr/bin/pkexec" "/run/wrappers/bin/pkexec" \
--replace "/bin/bash" "${bash}/bin/bash"
rm -rf "$packed"
# without this symlink loading JsChardet, the library that is used for auto encoding detection when files.autoGuessEncoding is true,
# fails to load with: electron/js2c/renderer_init: Error: Cannot find module 'jschardet'
# and the window immediately closes which renders VSCode unusable
# see https://github.com/NixOS/nixpkgs/issues/152939 for full log
ln -rs "$unpacked" "$packed"
'' + (let
vscodeRipgrep = if stdenv.isDarwin then
"Contents/Resources/app/node_modules.asar.unpacked/@vscode/ripgrep/bin/rg"
else
"resources/app/node_modules/@vscode/ripgrep/bin/rg";
in if !useVSCodeRipgrep then ''
rm ${vscodeRipgrep}
ln -s ${ripgrep}/bin/rg ${vscodeRipgrep}
'' else ''
chmod +x ${vscodeRipgrep}
'');
postFixup = lib.optionalString stdenv.isLinux ''
patchelf --add-needed ${libglvnd}/lib/libGLESv2.so.2 $out/lib/vscode/${executableName}
'';
inherit meta;
};
# Vscode and variants allow for users to download and use extensions
# which often include the usage of pre-built binaries.
@ -169,7 +60,7 @@ let
#
# buildFHSEnv allows for users to use the existing vscode
# extension tooling without significant pain.
fhs = { additionalPkgs ? pkgs: [] }: buildFHSEnv {
fhs = { additionalPkgs ? pkgs: [ ] }: buildFHSEnv {
# also determines the name of the wrapped command
name = executableName;
@ -197,10 +88,10 @@ let
# symlink shared assets, including icons and desktop entries
extraInstallCommands = ''
ln -s "${unwrapped}/share" "$out/"
ln -s "${finalAttrs.finalPackage}/share" "$out/"
'';
runScript = "${unwrapped}/bin/${executableName}";
runScript = "${finalAttrs.finalPackage}/bin/${executableName}";
# vscode likes to kill the parent so that the
# gui application isn't attached to the terminal session
@ -208,7 +99,7 @@ let
passthru = {
inherit executableName;
inherit (unwrapped) pname version; # for home-manager module
inherit (finalAttrs.finalPackage) pname version; # for home-manager module
};
meta = meta // {
@ -219,4 +110,145 @@ let
};
};
in
unwrapped
{
inherit pname version src sourceRoot dontFixup;
passthru = {
inherit executableName longName tests updateScript;
fhs = fhs { };
fhsWithPackages = f: fhs { additionalPkgs = f; };
} // lib.optionalAttrs (vscodeServer != null) {
inherit rev vscodeServer;
};
desktopItem = makeDesktopItem {
name = executableName;
desktopName = longName;
comment = "Code Editing. Redefined.";
genericName = "Text Editor";
exec = "${executableName} %F";
icon = "vs${executableName}";
startupNotify = true;
startupWMClass = shortName;
categories = [ "Utility" "TextEditor" "Development" "IDE" ];
mimeTypes = [ "text/plain" "inode/directory" ];
keywords = [ "vscode" ];
actions.new-empty-window = {
name = "New Empty Window";
exec = "${executableName} --new-window %F";
icon = "vs${executableName}";
};
};
urlHandlerDesktopItem = makeDesktopItem {
name = executableName + "-url-handler";
desktopName = longName + " - URL Handler";
comment = "Code Editing. Redefined.";
genericName = "Text Editor";
exec = executableName + " --open-url %U";
icon = "vs${executableName}";
startupNotify = true;
categories = [ "Utility" "TextEditor" "Development" "IDE" ];
mimeTypes = [ "x-scheme-handler/vscode" ];
keywords = [ "vscode" ];
noDisplay = true;
};
buildInputs = [ libsecret libXScrnSaver libxshmfence ]
++ lib.optionals (!stdenv.isDarwin) [ alsa-lib at-spi2-atk libkrb5 mesa nss nspr systemd xorg.libxkbfile ];
runtimeDependencies = lib.optionals stdenv.isLinux [ (lib.getLib systemd) fontconfig.lib libdbusmenu wayland libsecret ];
nativeBuildInputs = [ unzip ]
++ lib.optionals stdenv.isLinux [
autoPatchelfHook
asar
# override doesn't preserve splicing https://github.com/NixOS/nixpkgs/issues/132651
(buildPackages.wrapGAppsHook.override { inherit (buildPackages) makeWrapper; })
];
dontBuild = true;
dontConfigure = true;
noDumpEnvVars = true;
installPhase = ''
runHook preInstall
'' + (if stdenv.isDarwin then ''
mkdir -p "$out/Applications/${longName}.app" "$out/bin"
cp -r ./* "$out/Applications/${longName}.app"
ln -s "$out/Applications/${longName}.app/Contents/Resources/app/bin/${sourceExecutableName}" "$out/bin/${executableName}"
'' else ''
mkdir -p "$out/lib/vscode" "$out/bin"
cp -r ./* "$out/lib/vscode"
ln -s "$out/lib/vscode/bin/${sourceExecutableName}" "$out/bin/${executableName}"
mkdir -p "$out/share/applications"
ln -s "$desktopItem/share/applications/${executableName}.desktop" "$out/share/applications/${executableName}.desktop"
ln -s "$urlHandlerDesktopItem/share/applications/${executableName}-url-handler.desktop" "$out/share/applications/${executableName}-url-handler.desktop"
# These are named vscode.png, vscode-insiders.png, etc to match the name in upstream *.deb packages.
mkdir -p "$out/share/pixmaps"
cp "$out/lib/vscode/resources/app/resources/linux/code.png" "$out/share/pixmaps/vs${executableName}.png"
# Override the previously determined VSCODE_PATH with the one we know to be correct
sed -i "/ELECTRON=/iVSCODE_PATH='$out/lib/vscode'" "$out/bin/${executableName}"
grep -q "VSCODE_PATH='$out/lib/vscode'" "$out/bin/${executableName}" # check if sed succeeded
# Remove native encryption code, as it derives the key from the executable path which does not work for us.
# The credentials should be stored in a secure keychain already, so the benefit of this is questionable
# in the first place.
rm -rf $out/lib/vscode/resources/app/node_modules/vscode-encrypt
'') + ''
runHook postInstall
'';
preFixup = ''
gappsWrapperArgs+=(
# Add gio to PATH so that moving files to the trash works when not using a desktop environment
--prefix PATH : ${glib.bin}/bin
--add-flags "\''${NIXOS_OZONE_WL:+\''${WAYLAND_DISPLAY:+--ozone-platform-hint=auto --enable-features=WaylandWindowDecorations}}"
--add-flags ${lib.escapeShellArg commandLineArgs}
)
'';
# See https://github.com/NixOS/nixpkgs/issues/49643#issuecomment-873853897
# linux only because of https://github.com/NixOS/nixpkgs/issues/138729
postPatch = lib.optionalString stdenv.isLinux ''
# this is a fix for "save as root" functionality
packed="resources/app/node_modules.asar"
unpacked="resources/app/node_modules"
asar extract "$packed" "$unpacked"
substituteInPlace $unpacked/@vscode/sudo-prompt/index.js \
--replace "/usr/bin/pkexec" "/run/wrappers/bin/pkexec" \
--replace "/bin/bash" "${bash}/bin/bash"
rm -rf "$packed"
# without this symlink loading JsChardet, the library that is used for auto encoding detection when files.autoGuessEncoding is true,
# fails to load with: electron/js2c/renderer_init: Error: Cannot find module 'jschardet'
# and the window immediately closes which renders VSCode unusable
# see https://github.com/NixOS/nixpkgs/issues/152939 for full log
ln -rs "$unpacked" "$packed"
'' + (
let
vscodeRipgrep =
if stdenv.isDarwin then
"Contents/Resources/app/node_modules.asar.unpacked/@vscode/ripgrep/bin/rg"
else
"resources/app/node_modules/@vscode/ripgrep/bin/rg";
in
if !useVSCodeRipgrep then ''
rm ${vscodeRipgrep}
ln -s ${ripgrep}/bin/rg ${vscodeRipgrep}
'' else ''
chmod +x ${vscodeRipgrep}
''
);
postFixup = lib.optionalString stdenv.isLinux ''
patchelf --add-needed ${libglvnd}/lib/libGLESv2.so.2 $out/lib/vscode/${executableName}
'';
inherit meta;
})

View File

@ -0,0 +1,101 @@
{ lib
, stdenv
, fetchFromGitHub
, alsa-lib
, AudioUnit
, autoreconfHook
, Carbon
, Cocoa
, ffmpeg
, fluidsynth
, freetype
, glib
, libpcap
, libpng
, libslirp
, libxkbfile
, libXrandr
, makeWrapper
, ncurses
, pkg-config
, SDL2
, SDL2_net
, testers
, yad
, zlib
}:
stdenv.mkDerivation (finalAttrs: {
pname = "dosbox-x";
version = "2023.10.06";
src = fetchFromGitHub {
owner = "joncampbell123";
repo = "dosbox-x";
rev = "dosbox-x-v${finalAttrs.version}";
hash = "sha256-YNYtYqcpTOx4xS/LXI53h3S+na8JVpn4w8Dhf4fWNBQ=";
};
strictDeps = true;
nativeBuildInputs = [
autoreconfHook
makeWrapper
pkg-config
];
buildInputs = [
ffmpeg
fluidsynth
freetype
glib
libpcap
libpng
libslirp
ncurses
SDL2
SDL2_net
zlib
] ++ lib.optionals stdenv.hostPlatform.isLinux [
alsa-lib
libxkbfile
libXrandr
] ++ lib.optionals stdenv.hostPlatform.isDarwin [
AudioUnit
Carbon
Cocoa
];
configureFlags = [ "--enable-sdl2" ];
enableParallelBuilding = true;
hardeningDisable = [ "format" ]; # https://github.com/joncampbell123/dosbox-x/issues/4436
postInstall = lib.optionalString stdenv.hostPlatform.isLinux ''
wrapProgram $out/bin/dosbox-x \
--prefix PATH : ${lib.makeBinPath [ yad ]}
'';
passthru.tests.version = testers.testVersion {
package = finalAttrs.finalPackage;
# Version output on stderr, program returns status code 1
command = "${lib.getExe finalAttrs.finalPackage} -version 2>&1 || true";
};
meta = {
homepage = "https://dosbox-x.com";
description = "A cross-platform DOS emulator based on the DOSBox project";
longDescription = ''
DOSBox-X is an expanded fork of DOSBox with specific focus on running
Windows 3.x/9x/Me, PC-98 and 3D support via 3dfx.
The full expanded feature list is available here:
https://dosbox-x.com/wiki/DOSBox%E2%80%90X%E2%80%99s-Feature-Highlights
'';
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ hughobrien OPNA2608 ];
platforms = lib.platforms.unix;
mainProgram = "dosbox-x";
};
})

View File

@ -9,13 +9,13 @@
multiStdenv.mkDerivation rec {
pname = "wineasio";
version = "1.1.0";
version = "1.2.0";
src = fetchFromGitHub {
owner = pname;
repo = pname;
rev = "v${version}";
hash = "sha256-HEnJj9yfXe+NQuPATMpPvseFs+3TkiMLd1L+fIfQd+o=";
hash = "sha256-d5BGJAkaM5XZXyqm6K/UzFE4sD6QVHHGnLi1bcHxiaM=";
fetchSubmodules = true;
};
@ -36,10 +36,10 @@ multiStdenv.mkDerivation rec {
installPhase = ''
runHook preInstall
install -D build32/wineasio.dll $out/lib/wine/i386-windows/wineasio.dll
install -D build32/wineasio.dll.so $out/lib/wine/i386-unix/wineasio.dll.so
install -D build64/wineasio.dll $out/lib/wine/x86_64-windows/wineasio.dll
install -D build64/wineasio.dll.so $out/lib/wine/x86_64-unix/wineasio.dll.so
install -D build32/wineasio32.dll $out/lib/wine/i386-windows/wineasio32.dll
install -D build32/wineasio32.dll.so $out/lib/wine/i386-unix/wineasio32.dll.so
install -D build64/wineasio64.dll $out/lib/wine/x86_64-windows/wineasio64.dll
install -D build64/wineasio64.dll.so $out/lib/wine/x86_64-unix/wineasio64.dll.so
runHook postInstall
'';

View File

@ -5,13 +5,13 @@
stdenv.mkDerivation rec {
pname = "feh";
version = "3.10";
version = "3.10.1";
src = fetchFromGitHub {
owner = "derf";
repo = pname;
rev = version;
hash = "sha256-9NJ6zgQHcFJPmRlqJuCMXcKjLvDPUG+QvKGTJlWvWK4=";
hash = "sha256-1dz04RcaoP79EoE+SsatXm2wMRCbNnmAzMECYk3y3jg=";
};
outputs = [ "out" "man" "doc" ];

View File

@ -21,5 +21,6 @@ buildGoModule rec {
homepage = "https://github.com/nomad-software/meme";
license = licenses.mit;
maintainers = [ maintainers.fgaz ];
mainProgram = "meme";
};
}

View File

@ -1,13 +1,13 @@
{ lib, stdenv, mkDerivation, fetchFromGitLab, qmake, qtbase, qttools, qtserialport, libGLU }:
mkDerivation rec {
pname = "OSCAR";
version = "1.5.0";
version = "1.5.1";
src = fetchFromGitLab {
owner = "pholy";
repo = "OSCAR-code";
rev = "v${version}";
sha256 = "sha256-eaj2/ioh9dXxWv7X/IZv7m/oVcU6t7r+mK5YrrViF2w=";
sha256 = "sha256-FBHbPtMZeIgcR1pQflfEWK2FS8bquctXaeY/yaZofHg=";
};
buildInputs = [ qtbase qttools qtserialport libGLU ];

View File

@ -6,7 +6,7 @@
, zlib, zstd, fftw, opensubdiv, freetype, jemalloc, ocl-icd, addOpenGLRunpath
, jackaudioSupport ? false, libjack2
, cudaSupport ? config.cudaSupport, cudaPackages ? { }
, hipSupport ? false, hip # comes with a significantly larger closure size
, hipSupport ? false, rocmPackages # comes with a significantly larger closure size
, colladaSupport ? true, opencollada
, spaceNavSupport ? stdenv.isLinux, libspnav
, makeWrapper
@ -103,8 +103,8 @@ stdenv.mkDerivation (finalAttrs: rec {
substituteInPlace extern/clew/src/clew.c --replace '"libOpenCL.so"' '"${ocl-icd}/lib/libOpenCL.so"'
'') +
(lib.optionalString hipSupport ''
substituteInPlace extern/hipew/src/hipew.c --replace '"/opt/rocm/hip/lib/libamdhip64.so"' '"${hip}/lib/libamdhip64.so"'
substituteInPlace extern/hipew/src/hipew.c --replace '"opt/rocm/hip/bin"' '"${hip}/bin"'
substituteInPlace extern/hipew/src/hipew.c --replace '"/opt/rocm/hip/lib/libamdhip64.so"' '"${rocmPackages.clr}/lib/libamdhip64.so"'
substituteInPlace extern/hipew/src/hipew.c --replace '"opt/rocm/hip/bin"' '"${rocmPackages.clr}/bin"'
'');
cmakeFlags =

View File

@ -10,16 +10,16 @@
rustPlatform.buildRustPackage rec {
pname = "comodoro";
version = "0.0.9";
version = "0.0.10";
src = fetchFromGitHub {
owner = "soywod";
repo = "comodoro";
rev = "v${version}";
hash = "sha256-pxe3Nv1N85uWsiv4s0wtD++zlZZgMADH51f5RMK9huA=";
hash = "sha256-Y9SuxqI8wvoF0+X6CLNDlSFCwlSU8R73NYF/LjACP18=";
};
cargoSha256 = "E5oHeMow9MrVrlDX+v0tX9Nv3gHUxDNUpRAT5jPa+DI=";
cargoHash = "sha256-1WJIIsTzbChWqvdBSR/OpLC1iR8FgLmypJFQEtpalbw=";
nativeBuildInputs = lib.optional (installManPages || installShellCompletions) installShellFiles;

View File

@ -2,11 +2,11 @@
stdenv.mkDerivation (finalAttrs: {
pname = "flashprint";
version = "5.7.1";
version = "5.8.0";
src = fetchurl {
url = "http://www.ishare3d.com/3dapp/public/FlashPrint-5/FlashPrint/flashprint5_${finalAttrs.version}_amd64.deb";
hash = "sha256-kxvqEgXlKQlfzlCqKb5o3hvop82vDsJmQDK9XOCq61g=";
hash = "sha256-T7NHSTDFqM/LygTU3zO64Ut/tdd3vDPQoZuhAv7PWHU=";
};
nativeBuildInputs = [ dpkg autoPatchelfHook wrapQtAppsHook ];

View File

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "gsimplecal";
version = "2.4.1";
version = "2.5.1";
src = fetchFromGitHub {
owner = "dmedvinsky";
repo = "gsimplecal";
rev = "v${version}";
sha256 = "sha256-8faYw8tg8pOkpImcv8TM4UUpQEEtDKjAk4iKbXDC9no=";
sha256 = "sha256-Q8vK+rIRr+Tzwq0Xw5a1pYoLkSwF6PEdqc3/Dk01++o=";
};
postPatch = ''

View File

@ -5,10 +5,10 @@ let
in
stdenv.mkDerivation rec {
pname = "jotta-cli";
version = "0.15.89752";
version = "0.15.93226";
src = fetchzip {
url = "https://repo.jotta.us/archives/linux/${arch}/jotta-cli-${version}_linux_${arch}.tar.gz";
sha256 = "sha256-vYI9jbY2npPrmP0lMRSbLneVbQvQVsL0plM5jOvtdzA=";
sha256 = "sha256-RMN/OQHnHCx/xbi/J9LiK6m0TkPvd34GtmR6lr66pKs=";
stripRoot = false;
};

View File

@ -23,7 +23,7 @@ let
doCheck = false;
});
# version 3.3.0+ does not support SQLAlchemy 1.3
factory_boy = super.factory_boy.overridePythonAttrs (oldAttrs: rec {
factory-boy = super.factory-boy.overridePythonAttrs (oldAttrs: rec {
version = "3.2.1";
src = oldAttrs.src.override {
inherit version;

View File

@ -7,16 +7,16 @@
buildGoModule rec {
pname = "typioca";
version = "2.5.0";
version = "2.6.0";
src = fetchFromGitHub {
owner = "bloznelis";
repo = "typioca";
rev = version;
hash = "sha256-u/vpS9BQxeKd8eaJicmn2wMk9EYjCO7LXdoshCBa4rw=";
hash = "sha256-m6vt4wpLpKJJNP8qCCeLMgNfAAZengDGjBVmFI5ZeSQ=";
};
vendorHash = "sha256-m6hPj1IZr+jEA/h2qbz03tuVq3aPEMmcnWiEC0LKtxI=";
vendorHash = "sha256-q22t4/eum/RSWyzVQfJ0VZkEHgBu12nyRgmkJffi7PM=";
ldflags = [
"-s"

View File

@ -33,7 +33,7 @@
stdenv.mkDerivation rec {
pname = "calls";
version = "44.2";
version = "45.0";
src = fetchFromGitLab {
domain = "gitlab.gnome.org";
@ -41,7 +41,7 @@ stdenv.mkDerivation rec {
repo = pname;
rev = "v${version}";
fetchSubmodules = true;
hash = "sha256-mdv/yDUi6tzYc3C7dtmkAWtk4IqzHvOZVO2CA3TP9TE=";
hash = "sha256-NIQFKVpZSxY2QOb73WfYsCzMQwB9XySoADCL7IlmGe8=";
};
outputs = [ "out" "devdoc" ];

View File

@ -35,13 +35,13 @@ let
in
buildGoModule rec {
pname = "argo";
version = "3.4.10";
version = "3.4.11";
src = fetchFromGitHub {
owner = "argoproj";
repo = "argo";
rev = "refs/tags/v${version}";
hash = "sha256-uhXwCaAVFLlGeqkBbeA5DINo9CjNMzU9rRmOYoYJASI=";
hash = "sha256-H14a1JzFvzxoNDv8WGzHgfalLnDZ+nX19BbM5ptrEes=";
};
vendorHash = "sha256-0563OHMNkKZcmLY1nHS70pbtrufY1d1WNXrxcCl6MKY=";

View File

@ -2,13 +2,13 @@
buildGoModule rec {
pname = "civo";
version = "1.0.66";
version = "1.0.67";
src = fetchFromGitHub {
owner = "civo";
repo = "cli";
rev = "v${version}";
sha256 = "sha256-17dRFRG3HpYJvqE4+SFI6a6nP6umkKc61rwQu4FiG6Q=";
sha256 = "sha256-EBpKJrQ+zdoMlTbOsWCAj2Hfu8OqQTFb0l+i2UdkNSs=";
};
vendorHash = "sha256-AvAS3S7bepaTFPelE+Bj5/UuQIXEDvSAtDuFaPRC9sk=";

View File

@ -6,13 +6,13 @@
buildGoModule rec {
pname = "gatekeeper";
version = "3.13.0";
version = "3.13.2";
src = fetchFromGitHub {
owner = "open-policy-agent";
repo = "gatekeeper";
rev = "v${version}";
hash = "sha256-7ciI8KgkC1NRYP8bFW5RnZ2oLXaCuPHQBd2tvgQ+YO8=";
hash = "sha256-4d0AZknOPQR84HbZiYgXAR/HA82cYes+gzoLWw4SVgA=";
};
vendorHash = null;

View File

@ -2,16 +2,16 @@
buildGoModule rec {
pname = "helm-s3";
version = "0.14.0";
version = "0.15.1";
src = fetchFromGitHub {
owner = "hypnoglow";
repo = pname;
rev = "v${version}";
hash = "sha256-81Rzqu2fj6xSZbKvAhHzaGnr/3ACZvqJhYe+6Vyc0qk=";
hash = "sha256-D79nUIueOV2FC3I2LreHMzl/xOpzNa+OsfL5wcnyY78=";
};
vendorHash = "sha256-Jvfl0sdZXV497RIgoZUJD0zK/pXK6yeAnuSdq42nky8=";
vendorHash = "sha256-dKKggD/VlBiopt2ygh07+6bTBbRgQfWbiY/1qJSSx/0=";
# NOTE: Remove the install and upgrade hooks.
postPatch = ''

View File

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "helm-secrets";
version = "4.5.0";
version = "4.5.1";
src = fetchFromGitHub {
owner = "jkroepke";
repo = pname;
rev = "v${version}";
hash = "sha256-zytorArHhdwF7F9c2QkaX3KxLNlWySKieK2K1b5omFI=";
hash = "sha256-UB69cGsELQ2CFXVsPV0MDNOYRTYgfA2NXHKbsaZl9NQ=";
};
nativeBuildInputs = [ makeWrapper ];

View File

@ -5,14 +5,14 @@
python3.pkgs.buildPythonApplication rec {
pname = "terraform-compliance";
version = "1.3.44";
version = "1.3.45";
format = "setuptools";
src = fetchFromGitHub {
owner = "terraform-compliance";
repo = "cli";
rev = "refs/tags/${version}";
sha256 = "sha256-eE9bqu9ipuas+rdcJpn09V6nkdoYPOpChHgPH8U0rNw=";
sha256 = "sha256-Q7EzDL8yt2UPrM4u4f4ttDI5Da0ZzQwZmOlk7RrNN5E=";
};
postPatch = ''

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchurl, fetchpatch, ncurses }:
{ lib, stdenv, fetchurl, fetchpatch, ncurses, autoreconfHook }:
stdenv.mkDerivation rec {
version = "0.7.4";
@ -20,8 +20,23 @@ stdenv.mkDerivation rec {
name = "nload-0.7.4-Eliminate-flicker-on-some-terminals.patch";
sha256 = "10yppy5l50wzpcvagsqkbyf1rcan6aj30am4rw8hmkgnbidf4zbq";
})
# Patches configure.in file to make configure compile on macOS.
# Patch taken from MacPorts.
(fetchpatch {
url = "https://github.com/macports/macports-ports/raw/28814c34711e7545929fd391feb6ce079bd73fd4/net/nload/files/patch-configure.in.diff";
extraPrefix = "";
hash = "sha256-lGbBG5ZOgMVnrwlwXVFGbUZx6RkmQwYSVLB3oqkAWRs=";
})
# Fixes crash on F2 and garbage in adapter name.
# Patch taken from Homebrew.
(fetchpatch {
url = "https://sourceforge.net/p/nload/bugs/_discuss/thread/c9b68d8e/4a65/attachment/devreader-bsd.cpp.patch";
extraPrefix = "";
hash = "sha256-umRQDqcRUOGELOx5iB6CPFRkjaD8HXkMCWiKsYdaUa0=";
})
];
nativeBuildInputs = lib.optional stdenv.isDarwin autoreconfHook;
buildInputs = [ ncurses ];
meta = {
@ -34,7 +49,7 @@ stdenv.mkDerivation rec {
'';
homepage = "http://www.roland-riegel.de/nload/index.html";
license = lib.licenses.gpl2;
platforms = lib.platforms.linux;
platforms = lib.platforms.unix;
maintainers = [ lib.maintainers.devhell ];
mainProgram = "nload";
};

View File

@ -242,7 +242,7 @@ python.pkgs.buildPythonApplication rec {
nativeCheckInputs = with python.pkgs; [
daphne
factory_boy
factory-boy
imagehash
pdfminer-six
pytest-django

View File

@ -37,11 +37,7 @@
# and for Nvidia see https://github.com/cp2k/cp2k/blob/master/INSTALL.md#2i-cuda-optional-improved-performance-on-gpu-systems
, gpuVersion ? "Mi100"
, gpuArch ? "gfx908"
, rocm-core
, hip
, hipblas
, hipfft
, rocblas
, rocmPackages
}:
assert builtins.elem gpuBackend [ "none" "cuda" "rocm" ];
@ -86,7 +82,13 @@ stdenv.mkDerivation rec {
]
++ lib.optional enableElpa elpa
++ lib.optional (gpuBackend == "cuda") cudaPackages.cudatoolkit
++ lib.optional (gpuBackend == "rocm") [hip rocm-core hipblas hipfft rocblas]
++ lib.optional (gpuBackend == "rocm") [
rocmPackages.clr
rocmPackages.rocm-core
rocmPackages.hipblas
rocmPackages.hipfft
rocmPackages.rocblas
]
;
propagatedBuildInputs = [ mpi ];
@ -126,7 +128,7 @@ stdenv.mkDerivation rec {
${lib.strings.optionalString (gpuBackend == "rocm") ''
GPUVER = ${gpuVersion}
OFFLOAD_CC = hipcc
OFFLOAD_FLAGS = -fopenmp -m64 -pthread -fPIC -D__GRID_HIP -O2 --offload-arch=${gpuArch} --rocm-path=${rocm-core}
OFFLOAD_FLAGS = -fopenmp -m64 -pthread -fPIC -D__GRID_HIP -O2 --offload-arch=${gpuArch} --rocm-path=${rocmPackages.rocm-core}
OFFLOAD_TARGET = hip
CXX = mpicxx
CXXFLAGS = -std=c++11 -fopenmp -D__HIP_PLATFORM_AMD__

View File

@ -1,11 +1,11 @@
{ stdenv, fetchurl, lib, expat, octave, libxml2, texinfo, zip }:
stdenv.mkDerivation rec {
pname = "gama";
version = "2.25";
version = "2.26";
src = fetchurl {
url = "mirror://gnu/${pname}/${pname}-${version}.tar.gz";
sha256 = "sha256-1j4fsPQEaftqmrdk6ZPWKSl7ywA/UPN8bdddGVlPxDQ=";
sha256 = "sha256-8zKPPpbp66tD2zMmcv2H5xeCSdDhUk0uYPhqwpGqx9Y=";
};
buildInputs = [ expat ];

View File

@ -2,13 +2,13 @@
stdenv.mkDerivation rec {
pname = "cadical";
version = "1.5.3";
version = "1.8.0";
src = fetchFromGitHub {
owner = "arminbiere";
repo = "cadical";
rev = "rel-${version}";
sha256 = "sha256-3H/vowWfE1jfomYg2hOi3B3zjWa4CaLHAJXnoKWzskU=";
sha256 = "sha256-hY7+gTwBqQegbm5RjLKhM2vfBOjIRz797Z6wd6usj9s=";
};
outputs = [ "out" "dev" "lib" ];

View File

@ -2,31 +2,42 @@
stdenv.mkDerivation rec {
pname = "cryptoverif";
version = "2.05";
version = "2.07";
src = fetchurl {
url = "http://prosecco.gforge.inria.fr/personal/bblanche/cryptoverif/cryptoverif${version}.tar.gz";
sha256 = "sha256-F5eVN5ATYo9Ivpi2eYh96ktuTWUeoqgWMR4BqHu8EFs=";
hash = "sha256-GXXql4+JZ396BM6W2I3kN0u59xos7UCAtzR0IjMIETY=";
};
/* Fix up the frontend to load the 'default' cryptoverif library
** from under $out/libexec. By default, it expects to find the files
** in $CWD which doesn't work. */
postPatch = ''
substituteInPlace ./src/syntax.ml \
--replace \"default\" \"$out/libexec/default\"
'';
strictDeps = true;
nativeBuildInputs = [ ocaml ];
/* Fix up the frontend to load the 'default' cryptoverif library
** from under $out/libexec. By default, it expects to find the files
** in $CWD which doesn't work. */
patchPhase = ''
substituteInPlace ./src/syntax.ml \
--replace \"default\" \"$out/libexec/default\"
buildPhase = ''
runHook preBuild
./build
runHook postBuild
'';
buildPhase = "./build";
installPhase = ''
runHook preInstall
mkdir -p $out/bin $out/libexec
cp ./cryptoverif $out/bin
cp ./default.cvl $out/libexec
cp ./default.ocvl $out/libexec
runHook postInstall
'';
meta = {

View File

@ -4,13 +4,13 @@
stdenv.mkDerivation rec {
pname = "kissat";
version = "3.1.0";
version = "3.1.1";
src = fetchFromGitHub {
owner = "arminbiere";
repo = "kissat";
rev = "rel-${version}";
sha256 = "sha256-AFUVkkD+toOfVEvIKfz3ncEdABLRxs9yQ8aJx6Q0ETM=";
sha256 = "sha256-zK20/vhbVihrxmd52DjByDUO99pBAr8SlJtQpX5fmwY=";
};
outputs = [ "out" "dev" "lib" ];

View File

@ -1,134 +0,0 @@
{ lib, stdenv, fetchFromGitHub, cmake
, fetchpatch
, openblas, blas, lapack, opencv3, libzip, boost, protobuf, mpi
, onebitSGDSupport ? false
, config
, cudaSupport ? config.cudaSupport, cudaPackages ? { }, addOpenGLRunpath, cudatoolkit, nvidia_x11
, cudnnSupport ? cudaSupport
}:
let
inherit (cudaPackages) cudatoolkit cudnn;
in
assert cudnnSupport -> cudaSupport;
assert blas.implementation == "openblas" && lapack.implementation == "openblas";
let
# Old specific version required for CNTK.
cub = fetchFromGitHub {
owner = "NVlabs";
repo = "cub";
rev = "1.7.4";
sha256 = "0ksd5n1lxqhm5l5cd2lps4cszhjkf6gmzahaycs7nxb06qci8c66";
};
in stdenv.mkDerivation rec {
pname = "CNTK";
version = "2.7";
src = fetchFromGitHub {
owner = "Microsoft";
repo = "CNTK";
rev = "v${version}";
sha256 = "sha256-2rIrPJyvZhnM5EO6tNhF6ARTocfUHce4N0IZk/SZiaI=";
fetchSubmodules = true;
};
patches = [
# Fix build with protobuf 3.18+
# Remove with onnx submodule bump to 1.9+
(fetchpatch {
url = "https://github.com/onnx/onnx/commit/d3bc82770474761571f950347560d62a35d519d7.patch";
extraPrefix = "Source/CNTKv2LibraryDll/proto/onnx/onnx_repo/";
stripLen = 1;
sha256 = "00raqj8wx30b06ky6cdp5vvc1mrzs7hglyi6h58hchw5lhrwkzxp";
})
];
postPatch = ''
# Fix build with protobuf 3.18+
substituteInPlace Source/CNTKv2LibraryDll/Serialization.cpp \
--replace 'SetTotalBytesLimit(INT_MAX, INT_MAX)' \
'SetTotalBytesLimit(INT_MAX)' \
--replace 'SetTotalBytesLimit(limit, limit)' \
'SetTotalBytesLimit(limit)'
'';
nativeBuildInputs = [ cmake ] ++ lib.optional cudaSupport addOpenGLRunpath;
# Force OpenMPI to use g++ in PATH.
OMPI_CXX = "g++";
# Uses some deprecated tensorflow functions
env.NIX_CFLAGS_COMPILE = "-Wno-error=deprecated-declarations";
buildInputs = [ openblas opencv3 libzip boost protobuf mpi ]
++ lib.optional cudaSupport cudatoolkit
++ lib.optional cudnnSupport cudnn;
configureFlags = [
"--with-opencv=${opencv3}"
"--with-libzip=${libzip.dev}"
"--with-openblas=${openblas.dev}"
"--with-boost=${boost.dev}"
"--with-protobuf=${protobuf}"
"--with-mpi=${mpi}"
"--cuda=${if cudaSupport then "yes" else "no"}"
# FIXME
"--asgd=no"
] ++ lib.optionals cudaSupport [
"--with-cuda=${cudatoolkit}"
"--with-gdk-include=${cudatoolkit}/include"
"--with-gdk-nvml-lib=${nvidia_x11}/lib"
"--with-cub=${cub}"
] ++ lib.optional onebitSGDSupport "--1bitsgd=yes";
configurePhase = ''
sed -i \
-e 's,^GIT_STATUS=.*,GIT_STATUS=,' \
-e 's,^GIT_COMMIT=.*,GIT_COMMIT=v${version},' \
-e 's,^GIT_BRANCH=.*,GIT_BRANCH=v${version},' \
-e 's,^BUILDER=.*,BUILDER=nixbld,' \
-e 's,^BUILDMACHINE=.*,BUILDMACHINE=machine,' \
-e 's,^BUILDPATH=.*,BUILDPATH=/homeless-shelter,' \
-e '/git does not exist/d' \
Tools/generate_build_info
patchShebangs .
mkdir build
cd build
${lib.optionalString cudnnSupport ''
mkdir cuda
ln -s ${cudnn}/include cuda
export configureFlags="$configureFlags --with-cudnn=$PWD"
''}
../configure $configureFlags
'';
installPhase = ''
mkdir -p $out/bin
# Moving to make patchelf remove references later.
mv lib $out
cp bin/cntk $out/bin
'';
postFixup = lib.optionalString cudaSupport ''
for lib in $out/lib/*; do
addOpenGLRunpath "$lib"
done
'';
meta = with lib; {
homepage = "https://github.com/Microsoft/CNTK";
description = "An open source deep-learning toolkit";
license = if onebitSGDSupport then licenses.unfreeRedistributable else licenses.mit;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ abbradar ];
# Newer cub is included with cudatoolkit now and it breaks the build.
# https://github.com/Microsoft/CNTK/issues/3191
# broken = cudaSupport;
broken = true; # at 2022-11-23
};
}

View File

@ -2,13 +2,13 @@
buildGoModule rec {
pname = "git-codereview";
version = "1.6.0";
version = "1.7.0";
src = fetchFromGitHub {
owner = "golang";
repo = "review";
rev = "v${version}";
hash = "sha256-oHW73Y31z+0jOJdSJJa550mJYV8IP2fN+oNwT+3sySM=";
hash = "sha256-vq/rrDOZUn/apHgk6YPnfG7hmKRSapuw49ZyFVMWNqs=";
};
vendorHash = null;

View File

@ -2,13 +2,13 @@
buildGoModule rec {
pname = "git-credential-oauth";
version = "0.10.1";
version = "0.11.0";
src = fetchFromGitHub {
owner = "hickford";
repo = pname;
rev = "v${version}";
hash = "sha256-0sgoBvNVQZI8mOfKI5XWVQ6+615gKi1pO/4DPI6/fKA=";
hash = "sha256-Zxdd4JhSoaAFx8neZqdOZSZEOTtupZHnX+5ziYxbw6s=";
};
ldflags = [
@ -17,7 +17,7 @@ buildGoModule rec {
"-X main.version=${version}"
];
vendorHash = "sha256-STwBiqdUwiyhTySPENqfJLUTMwxaq5nYtrAX6+pcKoc=";
vendorHash = "sha256-cCqbEv4kBnF6FWvfaXCOxadPVXR/AxXS3nXHf6WmsSs=";
meta = {
description = "Git credential helper that securely authenticates to GitHub, GitLab and BitBucket using OAuth";

View File

@ -10,7 +10,7 @@
}:
let
version = "5.12.156";
version = "5.12.157";
in
rustPlatform.buildRustPackage {
pname = "git-mit";
@ -20,10 +20,10 @@ rustPlatform.buildRustPackage {
owner = "PurpleBooth";
repo = "git-mit";
rev = "v${version}";
hash = "sha256-AY+1zJsH4KgMiOfGDuNGxn5XmmYrWARapqiEZhckako=";
hash = "sha256-Okb+HOCgtGLKSbhmhwA63BxS43ulZlSkHDOPsYzO2ZE=";
};
cargoHash = "sha256-Rz0bgSlvekay5c/TYCu8FJUN3xnXjVFMa0wcUB72nw8=";
cargoHash = "sha256-I3sP6nhjMBXnANRrPT3+3HlY62TvfX6lFea7tHefOV8=";
nativeBuildInputs = [ pkg-config ];

View File

@ -2,13 +2,13 @@
buildGoModule rec {
pname = "glab";
version = "1.32.0";
version = "1.33.0";
src = fetchFromGitLab {
owner = "gitlab-org";
repo = "cli";
rev = "v${version}";
hash = "sha256-7XFekLlWcifqGJL6IIONpixdMAyGBJJmqo+l6RKCfC8=";
hash = "sha256-sBovwqL+3UmOdGf5pnAVzAiAbu69PJi7YhfcJqdejTY=";
};
vendorHash = "sha256-HiU6Kx/du8QLNKUDsSMm349msxSxyNRppxadtIpglBg=";

View File

@ -31,13 +31,6 @@ rustPlatform.buildRustPackage rec {
cargoHash = "sha256-fs1cWhBFp2u3HiEx/mMnbwvgwKo97KmftA/sr4dGsiM=";
buildNoDefaultFeatures = true;
buildFeatures = [
# enable 'packaging' feature, which enables extra features such as support
# for watchman
"packaging"
];
cargoBuildFlags = [ "--bin" "jj" ]; # don't install the fake editors
useNextest = true; # nextest is the upstream integration framework
ZSTD_SYS_USE_PKG_CONFIG = "1"; # disable vendored zlib

View File

@ -6,7 +6,7 @@
let
pname = "lefthook";
version = "1.5.1";
version = "1.5.2";
in
buildGoModule rec {
inherit pname version;
@ -15,7 +15,7 @@ buildGoModule rec {
owner = "evilmartians";
repo = "lefthook";
rev = "v${version}";
hash = "sha256-v6COZt4ylhpPfPNQLSN0XDpjVk8E2ZUDIP4TU+Uzk5A=";
hash = "sha256-9lAgKHcUAhg3Z8fMNYu3JrjfSd0HaT7YhvjKlpLMi0E=";
};
vendorHash = "sha256-/VLS7+nPERjIU7V2CzqXH69Z3/y+GKZbAFn+KcRKRuA=";

View File

@ -7,7 +7,7 @@
, alembic
, pystache
, pytest
, factory_boy
, factory-boy
, python
, unzip
}:
@ -54,7 +54,7 @@ buildPythonPackage rec {
# pytest tests fail
nativeCheckInputs = [
pytest
factory_boy
factory-boy
];
dontUseSetuptoolsCheck = true;

View File

@ -2,11 +2,11 @@
stdenv.mkDerivation rec {
pname = "freetube";
version = "0.19.0";
version = "0.19.1";
src = fetchurl {
url = "https://github.com/FreeTubeApp/FreeTube/releases/download/v${version}-beta/freetube_${version}_amd64.AppImage";
sha256 = "0yr5k9s3r4yvcx85bzwn6y4m03964ljnmhz7nf068zj87m9q8rcc";
sha256 = "add96ad3509d4d5c6d8658b005dfd046963cd6bb0a4e1f3e88f726a86c05810f";
};
appimageContents = appimageTools.extractType2 {

View File

@ -11,13 +11,13 @@
buildGoModule rec {
pname = "containerd";
version = "1.7.5";
version = "1.7.7";
src = fetchFromGitHub {
owner = "containerd";
repo = "containerd";
rev = "v${version}";
hash = "sha256-g+1JfXO1k0ijPpVTo+WxmXro4p4MbRCIZdgtgy58M60=";
hash = "sha256-5Tw7xltrsp+yGrdJ0O4MoFUvIaEiCQpMip5X1kfV/iM=";
};
vendorHash = null;

View File

@ -446,7 +446,7 @@ rec {
'';
postMount = ''
mkdir -p mnt/{dev,proc,sys} mnt${storeDir}
mkdir -p mnt/{dev,proc,sys,tmp} mnt${storeDir}
# Mount /dev, /sys and the nix store as shared folders.
mount --rbind /dev mnt/dev

View File

@ -0,0 +1,56 @@
diff --git a/config.mk b/config.mk
index 1ebfd49..ec076b3 100644
--- a/config.mk
+++ b/config.mk
@@ -1,25 +1,17 @@
# Customize to fit your system
# paths
-PREFIX = /usr/local/plan9
MANPREFIX = ${PREFIX}/share/man
VERSION = 7
-OBJTYPE = 386
-#OBJTYPE = arm
-#OBJTYPE = x86_64
-#OBJTYPE     = sun4u
# Linux/BSD
#CFLAGS += -Wall -Wno-missing-braces -Wno-parentheses -Wno-switch -c -I. -DPREFIX="\"${PREFIX}\""
CFLAGS += -c -I. -DPLAN9PORT -DPREFIX="\"${PREFIX}\""
-LDFLAGS += -static
# Solaris
#CFLAGS = -fast -xtarget=ultra -D__sun__ -c -I. -DPREFIX="\"${PREFIX}\""
#LDFLAGS = -dn
# compiler
-AR = ar rc
-CC = cc
YACC = ../yacc/9yacc
diff --git a/lib9/Makefile b/lib9/Makefile
index b83ab2b..e3744a4 100644
--- a/lib9/Makefile
+++ b/lib9/Makefile
@@ -221,7 +221,7 @@ uninstall:
${LIB}: ${OFILES}
@echo AR ${TARG}
- @${AR} ${LIB} ${OFILES}
+ @${AR} rc ${LIB} ${OFILES}
.c.o:
@echo CC $<
diff --git a/troff/Makefile b/troff/Makefile
index b4e3d88..3aac6bf 100644
--- a/troff/Makefile
+++ b/troff/Makefile
@@ -6,7 +6,7 @@ TARG = troff
OFILES = n1.o n2.o n3.o n4.o n5.o t6.o n6.o n7.o n8.o n9.o t10.o\
n10.o t11.o ni.o hytab.o suftab.o dwbinit.o mbwc.o
MANFILES = troff.1
-TROFFDIR = ${PREFIX}/lib/troff
+TROFFDIR = ${PREFIX_TROFF}/lib/troff
include ../std.mk

View File

@ -0,0 +1,12 @@
diff --git a/sam/Makefile b/sam/Makefile
index 17ada1f..1e9e9b8 100644
--- a/sam/Makefile
+++ b/sam/Makefile
@@ -10,7 +10,6 @@ MANFILES = sam.1
include ../config.mk
all: ${TARG}
- @strip ${TARG}
@echo built ${TARG}
install: ${TARG}

View File

@ -0,0 +1,115 @@
diff --git a/lib9/Makefile b/lib9/Makefile
index b83ab2b..2836b38 100644
--- a/lib9/Makefile
+++ b/lib9/Makefile
@@ -145,7 +145,7 @@ LIB9OFILES=\
exitcode.o\
fcallfmt.o\
get9root.o\
- getcallerpc-$(OBJTYPE).o\
+ getcallerpc.o\
getenv.o\
getfields.o\
getnetconn.o\
diff --git a/lib9/getcallerpc-386.c b/lib9/getcallerpc-386.c
deleted file mode 100644
index 1367370..0000000
--- a/lib9/getcallerpc-386.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <lib9.h>
-
-ulong
-getcallerpc(void *x)
-{
- return (((ulong*)(x))[-1]);
-}
diff --git a/lib9/getcallerpc-PowerMacintosh.c b/lib9/getcallerpc-PowerMacintosh.c
deleted file mode 100644
index 679a72c..0000000
--- a/lib9/getcallerpc-PowerMacintosh.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <lib9.h>
-
-ulong
-getcallerpc(void *x)
-{
- return (((ulong*)(x))[-4]);
-}
diff --git a/lib9/getcallerpc-arm.c b/lib9/getcallerpc-arm.c
deleted file mode 100644
index 9bb4a95..0000000
--- a/lib9/getcallerpc-arm.c
+++ /dev/null
@@ -1,8 +0,0 @@
-#include <lib9.h>
-
-ulong
-getcallerpc(void *x)
-{
- return ((ulong*)x)[-2];
-}
-
diff --git a/lib9/getcallerpc-power.c b/lib9/getcallerpc-power.c
deleted file mode 100644
index b4bf698..0000000
--- a/lib9/getcallerpc-power.c
+++ /dev/null
@@ -1,11 +0,0 @@
-#include <lib9.h>
-
-ulong
-getcallerpc(void *x)
-{
- ulong *lp;
-
- lp = x;
-
- return lp[-1];
-}
diff --git a/lib9/getcallerpc-ppc.c b/lib9/getcallerpc-ppc.c
deleted file mode 100644
index 679a72c..0000000
--- a/lib9/getcallerpc-ppc.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <lib9.h>
-
-ulong
-getcallerpc(void *x)
-{
- return (((ulong*)(x))[-4]);
-}
diff --git a/lib9/getcallerpc-x86_64.c b/lib9/getcallerpc-x86_64.c
deleted file mode 100644
index 1367370..0000000
--- a/lib9/getcallerpc-x86_64.c
+++ /dev/null
@@ -1,7 +0,0 @@
-#include <lib9.h>
-
-ulong
-getcallerpc(void *x)
-{
- return (((ulong*)(x))[-1]);
-}
diff --git a/lib9/getcallerpc.c b/lib9/getcallerpc.c
new file mode 100644
index 0000000..7d2cdd7
--- /dev/null
+++ b/lib9/getcallerpc.c
@@ -0,0 +1,12 @@
+#include <lib9.h>
+
+/*
+ * On gcc and clang, getcallerpc is a macro invoking a compiler builtin.
+ * If the macro in libc.h did not trigger, there's no implementation.
+ */
+#undef getcallerpc
+ulong
+getcallerpc(void *v)
+{
+ return 1;
+}
\ No newline at end of file

View File

@ -0,0 +1,77 @@
{ lib
, stdenv
, fetchgit
, pkg-config
, patches ? [ ]
, pkgsBuildHost
, enableStatic ? stdenv.hostPlatform.isStatic
}:
stdenv.mkDerivation {
pname = "9base";
version = "unstable-2019-09-11";
src = fetchgit {
url = "https://git.suckless.org/9base";
rev = "63916da7bd6d73d9a405ce83fc4ca34845667cce";
hash = "sha256-CNK7Ycmcl5vkmtA5VKwKxGZz8AoIG1JH/LTKoYmWSBI=";
};
patches = [
# expects to be used with getcallerpc macro or stub patch
# AR env var is now the location of `ar` not including the arg (`ar rc`)
./config-substitutions.patch
./dont-strip.patch
# plan9port dropped their own getcallerpc implementations
# in favour of using gcc/clang's macros or a stub
# we can do this here too to extend platform support
# https://github.com/9fans/plan9port/commit/540caa5873bcc3bc2a0e1896119f5b53a0e8e630
# https://github.com/9fans/plan9port/commit/323e1a8fac276f008e6d5146a83cbc88edeabc87
./getcallerpc-use-macro-or-stub.patch
] ++ patches;
# the 9yacc script needs to be executed to build other items
preBuild = lib.optionalString (!stdenv.buildPlatform.canExecute stdenv.hostPlatform) ''
substituteInPlace ./yacc/9yacc \
--replace "../yacc/yacc" "${lib.getExe' pkgsBuildHost._9base "yacc"}"
'';
enableParallelBuilding = true;
strictDeps = true;
nativeBuildInputs = [ pkg-config ];
NIX_CFLAGS_COMPILE = [
# workaround build failure on -fno-common toolchains like upstream
# gcc-10. Otherwise build fails as:
# ld: diffio.o:(.bss+0x16): multiple definition of `bflag'; diffdir.o:(.bss+0x6): first defined here
"-fcommon"
# hide really common warning that floods the logs:
# warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
"-D_DEFAULT_SOURCE"
];
LDFLAGS = lib.optionalString enableStatic "-static";
makeFlags = [
"PREFIX=${placeholder "out"}"
];
installFlags = [
"PREFIX_TROFF=${placeholder "troff"}"
];
outputs = [ "out" "man" "troff" ];
meta = with lib; {
homepage = "https://tools.suckless.org/9base/";
description = "9base is a port of various original Plan 9 tools for Unix, based on plan9port";
longDescription = ''
9base is a port of various original Plan 9 tools for Unix, based on plan9port.
It also contains the Plan 9 libc, libbio, libregexp, libfmt and libutf.
The overall SLOC is about 66kSLOC, so this userland + all libs is much smaller than, e.g. bash.
9base can be used to run werc instead of the full blown plan9port.
'';
license = with licenses; [ mit /* and */ lpl-102 ];
maintainers = with maintainers; [ jk ];
platforms = platforms.unix;
# needs additional work to support aarch64-darwin
# due to usage of _DARWIN_NO_64_BIT_INODE
broken = stdenv.isAarch64 && stdenv.isDarwin;
};
}

View File

@ -0,0 +1,27 @@
{ lib
, rustPlatform
, fetchFromGitHub
}:
rustPlatform.buildRustPackage rec {
pname = "action-validator";
version = "0.5.3";
src = fetchFromGitHub {
owner = "mpalmer";
repo = "action-validator";
rev = "v${version}";
hash = "sha256-22oYPYGnNp4K68pbNMolGcIGDYqjT/3FibO/jv3IEvg=";
fetchSubmodules = true;
};
cargoHash = "sha256-CVDqXuAxI1vCZV4w8DS3fOrsYFvJoI35fbe+hnSahLc=";
meta = with lib; {
description = "Tool to validate GitHub Action and Workflow YAML files";
homepage = "https://github.com/mpalmer/action-validator";
license = licenses.gpl3Plus;
mainProgram = "action-validator";
maintainers = with maintainers; [ thiagokokada ];
};
}

View File

@ -0,0 +1,36 @@
{ lib
, python3
, python3Packages
, fetchFromGitHub
}:
python3Packages.buildPythonApplication rec {
pname = "arxiv-latex-cleaner";
version = "1.0.1";
src = fetchFromGitHub {
owner = "google-research";
repo = "arxiv-latex-cleaner";
rev = "v${version}";
hash = "sha256-1IWSDKEoAM4hBKAEEcPq7X89WYDprifDL2GTEJQtdcQ=";
};
propagatedBuildInputs = with python3Packages; [
pillow
pyyaml
regex
absl-py
];
checkPhase = ''
runHook preCheck
${python3.interpreter} -m unittest arxiv_latex_cleaner.tests.arxiv_latex_cleaner_test
runHook postCheck
'';
meta = with lib; {
homepage = "https://github.com/google-research/arxiv-latex-cleaner";
description = "Easily clean the LaTeX code of your paper to submit to arXiv";
license = licenses.asl20;
maintainers = with maintainers; [ arkivm ];
};
}

View File

@ -0,0 +1,30 @@
{ lib
, stdenv
, fetchurl
, ncurses
}:
stdenv.mkDerivation (finalAttrs: {
pname = "cdk";
version = "5.0-20230201";
src = fetchurl {
url = "https://invisible-mirror.net/archives/cdk/cdk-${finalAttrs.version}.tgz";
hash = "sha256-oxJ7Wf5QX16Jjao90VsM9yShJ0zmgWW3eb4vKdTE8vY=";
};
buildInputs = [
ncurses
];
enableParallelBuilding = true;
meta = {
description = "Curses development kit";
homepage = "https://invisible-island.net/cdk/";
changelog = "https://invisible-island.net/cdk/CHANGES.html";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ raskin AndersonTorres ];
inherit (ncurses.meta) platforms;
};
})

View File

@ -3,23 +3,24 @@
, fetchurl
, libtool
, ncurses
, enableShared ? !stdenv.isDarwin
, enableShared ? !stdenv.isDarwin && !stdenv.hostPlatform.isStatic
, unicodeSupport ? true
, withLibrary ? false
, withLibrary ? true
}:
assert unicodeSupport -> ncurses.unicodeSupport;
stdenv.mkDerivation (finalAttrs: {
pname = "dialog";
version = "1.3-20230209";
version = "1.3-20231002";
src = fetchurl {
url = "https://invisible-island.net/archives/dialog/dialog-${finalAttrs.version}.tgz";
hash = "sha256-DCYoIwUmS+IhfzNfN5j0ix3OPPEsWgdr8jHK33em1qg=";
hash = "sha256-MVZAqwcZIl1cvKsTBYXAXweR/PBzBypf6UeZaaorgzs=";
};
nativeBuildInputs = lib.optional withLibrary libtool;
nativeBuildInputs = lib.optionals withLibrary [
libtool
];
buildInputs = [
ncurses
@ -42,6 +43,7 @@ stdenv.mkDerivation (finalAttrs: {
homepage = "https://invisible-island.net/dialog/dialog.html";
description = "Display dialog boxes from shell";
license = lib.licenses.lgpl21Plus;
mainProgram = "dialog";
maintainers = with lib.maintainers; [ AndersonTorres spacefrogg ];
inherit (ncurses.meta) platforms;
};

View File

@ -0,0 +1,70 @@
{ lib
, stdenv
, fetchFromGitHub
, rustPlatform
, darwin
, libiconv
, makeBinaryWrapper
, installShellFiles
, fortuneAlias ? true
}:
rustPlatform.buildRustPackage rec {
pname = "fortune-kind";
version = "0.1.3";
src = fetchFromGitHub {
owner = "cafkafk";
repo = "fortune-kind";
rev = "v${version}";
hash = "sha256-q4r1Qdyh2L1vTi+CKln+a9lKGgyRAhvg1aJRd0CIEJs=";
};
cargoHash = "sha256-ArVOGWaKbge8nxxGpAT8TttFZYJpuFF5u/tHYC9Qkeo=";
nativeBuildInputs = [ makeBinaryWrapper installShellFiles ];
buildInputs = lib.optionals stdenv.isDarwin [ libiconv darwin.apple_sdk.frameworks.Security ];
buildNoDefaultFeatures = true;
MAN_OUT = "./man";
preBuild = ''
mkdir -p "./$MAN_OUT";
'';
preInstall = ''
installManPage man/fortune-kind.1
installShellCompletion \
--fish man/fortune-kind.fish \
--bash man/fortune-kind.bash \
--zsh man/_fortune-kind
mkdir -p $out
cp -r $src/fortunes $out/fortunes;
'';
postInstall = ''
wrapProgram $out/bin/fortune-kind \
--prefix FORTUNE_DIR : "$out/fortunes"
''+ lib.optionalString fortuneAlias ''
ln -s fortune-kind $out/bin/fortune
'';
meta = with lib; {
description = "A kinder, curated fortune, written in rust";
longDescription = ''
Historically, contributions to fortune-mod have had a less-than ideal
quality control process, and as such, many of the fortunes that a user may
receive from the program read more like cryptic inside jokes, or at the
very worst, locker-room banter. One of the major goals of fortune-kind is
defining and applying a somewhat more rigorous moderation and editing
process to the fortune adoption workflow.
'';
homepage = "https://github.com/cafkafk/fortune-kind";
changelog = "https://github.com/cafkafk/fortune-kind/releases/tag/v${version}";
license = licenses.gpl3Only;
mainProgram = "fortune-kind";
maintainers = with maintainers; [ cafkafk ];
platforms = platforms.unix ++ platforms.windows;
};
}

View File

@ -0,0 +1,22 @@
{ lib, buildGoModule, fetchFromGitHub }:
buildGoModule rec {
pname = "regols";
version = "0.2.2";
src = fetchFromGitHub {
owner = "kitagry";
repo = "regols";
rev = "v${version}";
hash = "sha256-2ZwmIlv3kJ26p15t7NvB9sX2GO+B3ypeNl50b7XA0Iw=";
};
vendorHash = "sha256-N6gtkZSNLXz3B961grM3xHzm7x4/kzcLkDOgiFLGp8U=";
meta = with lib; {
description = "OPA Rego language server";
homepage = "https://github.com/kitagry/regols";
license = licenses.mit;
maintainers = with maintainers; [ alias-dev ];
};
}

View File

@ -9,18 +9,18 @@
buildGoModule rec {
pname = "shopware-cli";
version = "0.3.4";
version = "0.3.5";
src = fetchFromGitHub {
repo = "shopware-cli";
owner = "FriendsOfShopware";
rev = version;
hash = "sha256-1lOcr3XiQCh1T07iYRlGwMzsmQx1QYgkrStWlUM1XCo=";
hash = "sha256-xjeko2aFnz3vjQqqn/VimYGg9lZaz5trDX5HC8a+XgE=";
};
nativeBuildInputs = [ installShellFiles makeWrapper ];
nativeCheckInputs = [ git dart-sass ];
vendorHash = "sha256-j133hlcfRKTkIcNdZQmGn5yiWfKHp/5UVwLAs1njNdM=";
vendorHash = "sha256-QZ/zU67oUW75T8DOzjQwmEAr6gjIg/6ZO4Vm/47Lc40=";
postInstall = ''
export HOME="$(mktemp -d)"

View File

@ -23,8 +23,7 @@
, llvmPackages
, gpuBackend ? "none"
, cudaPackages
, hip
, rocblas
, rocmPackages
}:
assert builtins.elem gpuBackend [ "none" "cuda" "rocm" ];
@ -67,8 +66,10 @@ stdenv.mkDerivation rec {
libvdwxc
]
++ lib.optional (gpuBackend == "cuda") cudaPackages.cudatoolkit
++ lib.optionals (gpuBackend == "rocm") [ hip rocblas ]
++ lib.optional stdenv.isDarwin llvmPackages.openmp
++ lib.optionals (gpuBackend == "rocm") [
rocmPackages.clr
rocmPackages.rocblas
] ++ lib.optional stdenv.isDarwin llvmPackages.openmp
;
propagatedBuildInputs = [ mpi ];
@ -87,7 +88,7 @@ stdenv.mkDerivation rec {
]
++ lib.optionals (gpuBackend == "rocm") [
"-DUSE_ROCM=ON"
"-DHIP_ROOT_DIR=${hip}"
"-DHIP_ROOT_DIR=${rocmPackages.clr}"
];
doCheck = true;

View File

@ -8,9 +8,7 @@
, llvmPackages
, gpuBackend ? "none"
, cudaPackages
, hip
, rocfft
, hipfft
, rocmPackages
}:
assert builtins.elem gpuBackend [ "none" "cuda" "rocm" ];
@ -35,8 +33,11 @@ stdenv.mkDerivation rec {
fftw
]
++ lib.optional (gpuBackend == "cuda") cudaPackages.cudatoolkit
++ lib.optionals (gpuBackend == "rocm") [ hip rocfft hipfft ]
++ lib.optional stdenv.isDarwin llvmPackages.openmp
++ lib.optionals (gpuBackend == "rocm") [
rocmPackages.clr
rocmPackages.rocfft
rocmPackages.hipfft
] ++ lib.optional stdenv.isDarwin llvmPackages.openmp
;
propagatedBuildInputs = [ mpi ];
@ -53,7 +54,7 @@ stdenv.mkDerivation rec {
++ lib.optional (gpuBackend == "cuda") "-DSPFFT_GPU_BACKEND=CUDA"
++ lib.optionals (gpuBackend == "rocm") [
"-DSPFFT_GPU_BACKEND=ROCM"
"-DHIP_ROOT_DIR=${hip}"
"-DHIP_ROOT_DIR=${rocmPackages.clr}"
];

View File

@ -8,8 +8,7 @@
, llvmPackages
, gpuBackend ? "none"
, cudaPackages
, hip
, rocblas
, rocmPackages
}:
assert builtins.elem gpuBackend [ "none" "cuda" "rocm" ];
@ -39,8 +38,10 @@ stdenv.mkDerivation rec {
blas
]
++ lib.optional (gpuBackend == "cuda") cudaPackages.cudatoolkit
++ lib.optionals (gpuBackend == "rocm") [ hip rocblas rocblas ]
++ lib.optional stdenv.isDarwin llvmPackages.openmp
++ lib.optionals (gpuBackend == "rocm") [
rocmPackages.clr
rocmPackages.rocblas
] ++ lib.optional stdenv.isDarwin llvmPackages.openmp
;
propagatedBuildInputs = [ mpi ];

View File

@ -0,0 +1,25 @@
{ lib, stdenvNoCC, fetchzip }:
stdenvNoCC.mkDerivation rec {
pname = "udev-gothic-nf";
version = "1.3.1";
src = fetchzip {
url = "https://github.com/yuru7/udev-gothic/releases/download/v${version}/UDEVGothic_NF_v${version}.zip";
hash = "sha256-4392vZX5CWg+tEpti1N+WQSx4ES5ZXoSiow6ufxqmsY=";
};
installPhase = ''
runHook preInstall
install -Dm644 *.ttf -t $out/share/fonts/${pname}
runHook postInstall
'';
meta = with lib; {
description = "A programming font that combines BIZ UD Gothic, JetBrains Mono and nerd-fonts";
homepage = "https://github.com/yuru7/udev-gothic";
license = licenses.ofl;
maintainers = with maintainers; [ haruki7049 ];
platforms = platforms.all;
};
}

View File

@ -0,0 +1,25 @@
{ lib, stdenvNoCC, fetchzip }:
stdenvNoCC.mkDerivation rec {
pname = "udev-gothic";
version = "1.3.1";
src = fetchzip {
url = "https://github.com/yuru7/udev-gothic/releases/download/v${version}/UDEVGothic_v${version}.zip";
hash = "sha256-W1ekR3fWuS/ks1reCBAvZ5lR+aGh9qfaxn80Q2KlRM0=";
};
installPhase = ''
runHook preInstall
install -Dm644 *.ttf -t $out/share/fonts/${pname}
runHook postInstall
'';
meta = with lib; {
description = "A programming font that combines BIZ UD Gothic and JetBrains Mono";
homepage = "https://github.com/yuru7/udev-gothic";
license = licenses.ofl;
maintainers = with maintainers; [ haruki7049 ];
platforms = platforms.all;
};
}

View File

@ -1,4 +1,4 @@
{ lib, iosevka, fetchFromSourcehut, fetchFromGitHub, buildNpmPackage }:
{ lib, iosevka, fetchFromGitHub, buildNpmPackage }:
let
sets = [
@ -20,17 +20,17 @@ let
"comfy-wide-motion-fixed" # Slab | Wide | Monospaced | No |
"comfy-wide-motion-duo" # Slab | Wide | Duospaced | Yes |
];
version = "1.3.0";
src = fetchFromSourcehut {
owner = "~protesilaos";
version = "1.4.0";
src = fetchFromGitHub {
owner = "protesilaos";
repo = "iosevka-comfy";
rev = version;
sha256 = "sha256-ajzUbobNf+Je8ls9htOCLPsB0OPSiqZzrc8bO6hQvio=";
sha256 = "sha256-kfEEJ6F1/dsG9CSLWcr0QOOnQxHPgPgb4QhgFrHTklE=";
};
privateBuildPlan = src.outPath + "/private-build-plans.toml";
makeIosevkaFont = set:
let superBuildNpmPackage = buildNpmPackage; in
(iosevka.override rec {
(iosevka.override {
inherit set privateBuildPlan;
buildNpmPackage = args: superBuildNpmPackage
(args // {
@ -39,11 +39,11 @@ let
src = fetchFromGitHub {
owner = "be5invis";
repo = "iosevka";
rev = "7ef24b8d87fe50793444f9f84b140767f7e47029";
hash = "sha256-RVBgJVMNyxV1KeNniwySsJUOmLDh6sFZju8szvzKlH4=";
rev = "f6e57fbf0b1242ad3069d45c815d79b9d68871a2";
hash = "sha256-cS3SCKzUjVXF+n0Rt5eBLzieATB7W+hwEbzh6OQrMo4=";
};
npmDepsHash = "sha256-yogUBf+yfjfK8DE4gGgoGaTaYZagW8R1pCn7y0rEPt4=";
npmDepsHash = "sha256-c+ltdh5e3+idclYfqp0Xh9IUwoj7XYP1uzJG6+a5gFU=";
meta = with lib; {
inherit (src.meta) homepage;

View File

@ -0,0 +1,39 @@
{ fetchFromGitHub
, lib
, stdenvNoCC
, variant ? "macchiato"
}:
let
pname = "catppuccin-bat";
validVariants = [ "latte" "frappe" "macchiato" "mocha" ];
in
lib.checkListOfEnum "${pname}: color variant" validVariants [ variant ]
stdenvNoCC.mkDerivation {
inherit pname;
version = "unstable-2022-11-10";
src = fetchFromGitHub {
owner = "catppuccin";
repo = "bat";
rev = "ba4d16880d63e656acced2b7d4e034e4a93f74b1";
hash = "sha256-6WVKQErGdaqb++oaXnY3i6/GuH2FhTgK0v4TN4Y0Wbw=";
};
installPhase = ''
runHook preInstall
mkdir -p $out
cp "Catppuccin-${variant}.tmTheme" $out
runHook postInstall
'';
meta = {
description = "Soothing pastel theme for bat";
homepage = "https://github.com/catppuccin/bat";
license = lib.licenses.mit;
platforms = lib.platforms.all;
maintainers = [ lib.maintainers.khaneliman ];
};
}

View File

@ -2,13 +2,13 @@
stdenv.mkDerivation (finalAttrs: {
pname = "gnome-shell-extension-EasyScreenCast";
version = "1.7.0";
version = "1.7.1";
src = fetchFromGitHub {
owner = "EasyScreenCast";
repo = "EasyScreenCast";
rev = finalAttrs.version;
hash = "sha256-+cH/gczCdxoSrLp5nD82Spo8bSGyRnUUut3Xkmr9f3o=";
hash = "sha256-G7wdRFA0qL+6inVRLAmKoP0E0IOyvlmQIUwbDv/DbLI=";
};
patches = [

View File

@ -9,7 +9,7 @@
stdenv.mkDerivation rec {
pname = "gcc-arm-embedded";
version = "12.2.rel1";
version = "12.3.rel1";
platform = {
aarch64-darwin = "darwin-arm64";
@ -21,10 +21,10 @@ stdenv.mkDerivation rec {
src = fetchurl {
url = "https://developer.arm.com/-/media/Files/downloads/gnu/${version}/binrel/arm-gnu-toolchain-${version}-${platform}-arm-none-eabi.tar.xz";
sha256 = {
aarch64-darwin = "0j12n631bmbfvnfbmv4q7cfhmh4l7ka3vcjcvyw0vjqb4msyia91";
aarch64-linux = "131ydgndff7dyhkivfchbk43lv3cv2p172knkqilx64aapvk5qvy";
x86_64-darwin = "00i9gd1ny00681pwinh6ng9x45xsyrnwc6hm2vr348z9gasyxh00";
x86_64-linux = "0rv8r5zh0a5621v0xygxi8f6932qgwinw2s9vnniasp9z7897gl4";
aarch64-darwin = "sha256-Oy7uC99xwbvrPDt0JPv3vZ1cPw9aOkp4FZyeOtIZ570=";
aarch64-linux = "sha256-FMBIfVdT9gcdJOVoiB98fmf4DdgxZd7FFks3MTlK9DE=";
x86_64-darwin = "sha256-5u2L+TD62c4z4SCrkLNpV7H3efzKpt5snKmliYLAQpE=";
x86_64-linux = "sha256-EqKBVkQxjrzOr4S+q7Zl0JJLbnniEEhFLFMxpWMyswk=";
}.${stdenv.hostPlatform.system} or (throw "Unsupported system: ${stdenv.hostPlatform.system}");
};

View File

@ -1,129 +0,0 @@
diff --git a/bin/hipcc.pl b/bin/hipcc.pl
index da9559b..7aaa540 100755
--- a/bin/hipcc.pl
+++ b/bin/hipcc.pl
@@ -185,7 +185,7 @@ if ($HIP_PLATFORM eq "amd") {
chomp($HIP_CLANG_TARGET);
if (! defined $HIP_CLANG_INCLUDE_PATH) {
- $HIP_CLANG_INCLUDE_PATH = abs_path("$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/include");
+ $HIP_CLANG_INCLUDE_PATH = abs_path("@clang@/resource-root/include");
}
if (! defined $HIP_INCLUDE_PATH) {
$HIP_INCLUDE_PATH = "$HIP_PATH/include";
@@ -206,8 +206,8 @@ if ($HIP_PLATFORM eq "amd") {
print ("HIP_CLANG_TARGET=$HIP_CLANG_TARGET\n");
}
- $HIPCXXFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH/..\"";
- $HIPCFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH/..\"";
+ $HIPCXXFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH\"";
+ $HIPCFLAGS .= " -isystem \"$HIP_CLANG_INCLUDE_PATH\"";
$HIPLDFLAGS .= " -L\"$HIP_LIB_PATH\"";
if ($isWindows) {
$HIPLDFLAGS .= " -lamdhip64";
@@ -625,7 +625,7 @@ if($HIP_PLATFORM eq "amd"){
$targetsStr = $ENV{HCC_AMDGPU_TARGET};
} elsif (not $isWindows) {
# Else try using rocm_agent_enumerator
- $ROCM_AGENT_ENUM = "${ROCM_PATH}/bin/rocm_agent_enumerator";
+ $ROCM_AGENT_ENUM = "@rocminfo@/bin/rocm_agent_enumerator";
$targetsStr = `${ROCM_AGENT_ENUM} -t GPU`;
$targetsStr =~ s/\n/,/g;
}
@@ -724,16 +724,16 @@ if ($HIP_PLATFORM eq "amd") {
if (not $isWindows and not $compileOnly) {
if ($linkType eq 0) {
- $toolArgs = " -L$HIP_LIB_PATH -lamdhip64 -L$ROCM_PATH/lib -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
+ $toolArgs = " -L$HIP_LIB_PATH -lamdhip64 -L@rocm_runtime@/lib -lhsa-runtime64 -ldl -lnuma " . ${toolArgs};
} else {
$toolArgs = ${toolArgs} . " -Wl,-rpath=$HIP_LIB_PATH:$ROCM_PATH/lib -lamdhip64 ";
}
# To support __fp16 and _Float16, explicitly link with compiler-rt
- $HIP_CLANG_BUILTIN_LIB="$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a";
+ $HIP_CLANG_BUILTIN_LIB="@clang@/resource-root/lib/$HIP_CLANG_TARGET/libclang_rt.builtins.a";
if (-e $HIP_CLANG_BUILTIN_LIB) {
- $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/$HIP_CLANG_TARGET -lclang_rt.builtins "
+ $toolArgs .= " -L@clang@/resource-root/lib/$HIP_CLANG_TARGET -lclang_rt.builtins "
} else {
- $toolArgs .= " -L$HIP_CLANG_PATH/../lib/clang/$HIP_CLANG_VERSION/lib/linux -lclang_rt.builtins-x86_64 "
+ $toolArgs .= " -L@clang@/resource-root/lib/linux -lclang_rt.builtins-x86_64 "
}
}
}
diff --git a/bin/hipconfig.pl b/bin/hipconfig.pl
index 5ddb8e9..6a76a2e 100755
--- a/bin/hipconfig.pl
+++ b/bin/hipconfig.pl
@@ -77,7 +77,7 @@ if ($HIP_COMPILER eq "clang") {
$CPP_CONFIG = " -D__HIP_PLATFORM_HCC__= -D__HIP_PLATFORM_AMD__=";
$HIP_PATH_INCLUDE = $HIP_PATH."/include";
- $HIP_CLANG_INCLUDE = $HIP_CLANG_PATH."/../lib/clang/".$HIP_CLANG_VERSION;
+ $HIP_CLANG_INCLUDE = "@clang@/resource-root/include";
if($isWindows) {
$CPP_CONFIG .= " -I\"$HIP_PATH_INCLUDE\" -I\"$HIP_CLANG_INCLUDE\"";
} else {
@@ -168,7 +168,7 @@ if (!$printed or $p_full) {
print ("HIP_CLANG_PATH : $HIP_CLANG_PATH\n");
if ($isWindows) {
system("\"$HIP_CLANG_PATH/clang++\" --version");
- system("\"$HIP_CLANG_PATH/llc\" --version");
+ system("\"@llvm@/bin/llc\" --version");
printf("hip-clang-cxxflags : ");
$win_output = `perl \"$HIP_PATH/bin/hipcc\" --cxxflags`;
printf("$win_output \n");
@@ -177,7 +177,7 @@ if (!$printed or $p_full) {
printf("$win_output \n");
} else {
system("$HIP_CLANG_PATH/clang++ --version");
- system("$HIP_CLANG_PATH/llc --version");
+ system("@llvm@/bin/llc --version");
print ("hip-clang-cxxflags : ");
system("$HIP_PATH/bin/hipcc --cxxflags");
printf("\n");
@@ -219,8 +219,8 @@ if (!$printed or $p_full) {
system ("uname -a");
}
- if (-e "/usr/bin/lsb_release") {
- system ("/usr/bin/lsb_release -a");
+ if (-e "@lsb_release@/bin/lsb_release") {
+ system ("@lsb_release@/bin/lsb_release -a");
}
print "\n" ;
diff --git a/hip-lang-config.cmake.in b/hip-lang-config.cmake.in
index 9250a68..f6e27b7 100644
--- a/hip-lang-config.cmake.in
+++ b/hip-lang-config.cmake.in
@@ -71,8 +71,8 @@ get_filename_component(_IMPORT_PREFIX "${_DIR}/../../../" REALPATH)
#need _IMPORT_PREFIX to be set #FILE_REORG_BACKWARD_COMPATIBILITY
-file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "${_IMPORT_PREFIX}/../llvm/lib/clang/*/include")
-file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG "${_IMPORT_PREFIX}/llvm/lib/clang/*/include")
+file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "@clang@/resource-root/include")
+file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG "@clang@/resource-root/include")
find_path(HIP_CLANG_INCLUDE_PATH __clang_cuda_math.h
HINTS ${HIP_CLANG_INCLUDE_SEARCH_PATHS}
${HIP_CLANG_INCLUDE_SEARCH_PATHS_REORG}
@@ -89,7 +89,7 @@ find_path(HSA_HEADER hsa/hsa.h
PATHS
"${_IMPORT_PREFIX}/../include" #FILE_REORG_BACKWARD_COMPATIBILITY
"${_IMPORT_PREFIX}/include"
- "${ROCM_PATH}/include"
+ "@rocm_runtime@/include"
)
if (NOT HSA_HEADER)
@@ -97,7 +97,7 @@ if (NOT HSA_HEADER)
endif()
get_filename_component(HIP_COMPILER_INSTALL_PATH ${CMAKE_HIP_COMPILER} DIRECTORY)
-file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "${HIP_COMPILER_INSTALL_PATH}/../lib/clang/*/lib/*")
+file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "@clang@/resource-root/lib/*")
find_library(CLANGRT_BUILTINS
NAMES
clang_rt.builtins

View File

@ -1,62 +0,0 @@
diff --git a/hip-config.cmake.in b/hip-config.cmake.in
index 89d1224..dc9ba05 100755
--- a/hip-config.cmake.in
+++ b/hip-config.cmake.in
@@ -142,7 +142,7 @@ if(HIP_COMPILER STREQUAL "clang")
file(TO_CMAKE_PATH "${HIP_PATH}/../lc" HIP_CLANG_ROOT)
endif()
else()
- set(HIP_CLANG_ROOT "${ROCM_PATH}/llvm")
+ set(HIP_CLANG_ROOT "@clang@")
endif()
if(NOT HIP_CXX_COMPILER)
set(HIP_CXX_COMPILER ${CMAKE_CXX_COMPILER})
@@ -171,7 +171,7 @@ if(HIP_COMPILER STREQUAL "clang")
get_filename_component(_HIP_CLANG_BIN_PATH "${_HIP_CLANG_REAL_PATH}" DIRECTORY)
get_filename_component(HIP_CLANG_ROOT "${_HIP_CLANG_BIN_PATH}" DIRECTORY)
endif()
- file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS ${HIP_CLANG_ROOT}/lib/clang/*/include)
+ file(GLOB HIP_CLANG_INCLUDE_SEARCH_PATHS "@clang@/resource-root/include")
find_path(HIP_CLANG_INCLUDE_PATH stddef.h
HINTS
${HIP_CLANG_INCLUDE_SEARCH_PATHS}
@@ -209,7 +209,7 @@ if(NOT WIN32)
"${_IMPORT_PREFIX}/include"
#FILE_REORG_BACKWARD_COMPATIBILITY ${_IMPORT_PREFIX}/../include is for Backward compatibility
"${_IMPORT_PREFIX}/../include"
- ${ROCM_PATH}/include
+ "@rocm_runtime@/include"
)
if (NOT HSA_HEADER)
@@ -291,7 +291,7 @@ if(HIP_COMPILER STREQUAL "clang")
endif()
endif()
- file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "${HIP_CLANG_ROOT}/lib/clang/*/lib/*")
+ file(GLOB HIP_CLANGRT_LIB_SEARCH_PATHS "@clang@/resource-root/lib/*")
find_library(CLANGRT_BUILTINS
NAMES
clang_rt.builtins
diff --git a/src/hip_embed_pch.sh b/src/hip_embed_pch.sh
index 0a1572b..2feb19a 100755
--- a/src/hip_embed_pch.sh
+++ b/src/hip_embed_pch.sh
@@ -149,7 +149,7 @@ EOF
$LLVM_DIR/bin/clang -cc1 -O3 -emit-pch -triple amdgcn-amd-amdhsa -aux-triple x86_64-unknown-linux-gnu -fcuda-is-device -std=c++17 -fgnuc-version=4.2.1 -o $tmp/hip_wave64.pch -x hip-cpp-output - <$tmp/pch_wave64.cui &&
- $LLVM_DIR/bin/llvm-mc -o hip_pch.o $tmp/hip_pch.mcin --filetype=obj &&
+ @llvm@/bin/llvm-mc -o hip_pch.o $tmp/hip_pch.mcin --filetype=obj &&
rm -rf $tmp
}
@@ -195,7 +195,7 @@ EOF
set -x
$LLVM_DIR/bin/clang -O3 --rocm-path=$HIP_INC_DIR/.. -std=c++14 -nogpulib --hip-version=4.4 -isystem $HIP_INC_DIR -isystem $HIP_BUILD_INC_DIR -isystem $HIP_AMD_INC_DIR --cuda-device-only -D__HIPCC_RTC__ -x hip $tmp/hipRTC_header.h -E -o $tmp/hiprtc &&
cat $macroFile >> $tmp/hiprtc &&
- $LLVM_DIR/bin/llvm-mc -o $tmp/hiprtc_header.o $tmp/hipRTC_header.mcin --filetype=obj &&
+ @llvm@/bin/llvm-mc -o $tmp/hiprtc_header.o $tmp/hipRTC_header.mcin --filetype=obj &&
$LLVM_DIR/bin/clang $tmp/hiprtc_header.o -o $rtc_shared_lib_out -shared &&
$LLVM_DIR/bin/clang -O3 --rocm-path=$HIP_INC_DIR/.. -std=c++14 -nogpulib -nogpuinc -emit-llvm -c -o $tmp/tmp.bc --cuda-device-only -D__HIPCC_RTC__ --offload-arch=gfx906 -x hip-cpp-output $tmp/hiprtc &&
rm -rf $tmp

View File

@ -1,197 +0,0 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, rocmUpdateScript
, substituteAll
, makeWrapper
, hip-common
, hipcc
, rocclr
, roctracer
, cmake
, perl
, llvm
, rocminfo
, rocm-thunk
, rocm-comgr
, rocm-device-libs
, rocm-runtime
, rocm-opencl-runtime
, cudatoolkit
, numactl
, libxml2
, libX11
, libglvnd
, doxygen
, graphviz
, fontconfig
, python3Packages
, buildDocs ? true
, buildTests ? false
, useNVIDIA ? false
}:
let
hipPlatform = if useNVIDIA then "nvidia" else "amd";
wrapperArgs = [
"--prefix PATH : $out/bin"
"--prefix LD_LIBRARY_PATH : ${rocm-runtime}"
"--set HIP_PLATFORM ${hipPlatform}"
"--set HIP_PATH $out"
"--set HIP_CLANG_PATH ${stdenv.cc}/bin"
"--set DEVICE_LIB_PATH ${rocm-device-libs}/amdgcn/bitcode"
"--set HSA_PATH ${rocm-runtime}"
"--set ROCM_PATH $out"
] ++ lib.optionals useNVIDIA [
"--set CUDA_PATH ${cudatoolkit}"
];
in stdenv.mkDerivation (finalAttrs: {
pname = "hip-${hipPlatform}";
version = "5.4.4";
outputs = [
"out"
] ++ lib.optionals buildDocs [
"doc"
];
src = fetchFromGitHub {
owner = "ROCm-Developer-Tools";
repo = "hipamd";
rev = "rocm-${finalAttrs.version}";
hash = "sha256-FcuylhkG7HqLYXH1J6ND6IVEIbDzHp7h7jg2ZZ4XoFM=";
};
patches = [
(substituteAll {
src = ./0000-fixup-paths.patch;
inherit llvm;
clang = stdenv.cc;
rocm_runtime = rocm-runtime;
})
# https://github.com/ROCm-Developer-Tools/hipamd/commit/be33ec55acc104a59d01df5912261d007c7f3ee9
(fetchpatch {
url = "https://github.com/ROCm-Developer-Tools/hipamd/commit/be33ec55acc104a59d01df5912261d007c7f3ee9.patch";
hash = "sha256-eTC4mUIN1FwRce1n38uDOlITFL/vpcOhvnaZTo5R7lo=";
})
];
nativeBuildInputs = [
makeWrapper
cmake
perl
python3Packages.python
python3Packages.cppheaderparser
] ++ lib.optionals buildDocs [
doxygen
graphviz
fontconfig
];
buildInputs = [
numactl
libxml2
libX11
libglvnd
];
propagatedBuildInputs = [
stdenv.cc
llvm
rocminfo
rocm-thunk
rocm-comgr
rocm-device-libs
rocm-runtime
rocm-opencl-runtime
] ++ lib.optionals useNVIDIA [
cudatoolkit
];
cmakeFlags = [
"-DROCM_PATH=${rocminfo}"
"-DHIP_PLATFORM=${hipPlatform}"
"-DHIP_COMMON_DIR=${hip-common}"
"-DHIPCC_BIN_DIR=${hipcc}/bin"
"-DHIP_LLVM_ROOT=${stdenv.cc}"
"-DROCCLR_PATH=${rocclr}"
"-DAMD_OPENCL_PATH=${rocm-opencl-runtime.src}"
"-DPROF_API_HEADER_PATH=${roctracer.src}/inc/ext"
# Temporarily set variables to work around upstream CMakeLists issue
# Can be removed once https://github.com/ROCm-Developer-Tools/hipamd/issues/55 is fixed
"-DCMAKE_INSTALL_BINDIR=bin"
"-DCMAKE_INSTALL_INCLUDEDIR=include"
"-DCMAKE_INSTALL_LIBDIR=lib"
] ++ lib.optionals buildTests [
"-DHIP_CATCH_TEST=1"
];
postPatch = ''
export HIP_CLANG_PATH=${stdenv.cc}/bin
patchShebangs src
'' + lib.optionalString buildDocs ''
export HOME=$(mktemp -d)
export FONTCONFIG_FILE=${fontconfig.out}/etc/fonts/fonts.conf
'';
doCheck = buildTests;
checkTarget = "build_tests";
preCheck = lib.optionalString buildTests ''
export ROCM_PATH=$PWD
export DEVICE_LIB_PATH=${rocm-device-libs}/amdgcn/bitcode
patchShebangs bin
'';
postInstall = ''
patchShebangs $out/bin
cp -a $out/bin/hipcc $out/bin/hipcc-pl
cp -a $out/bin/hipconfig $out/bin/hipconfig-pl
wrapProgram $out/bin/hipcc --set HIP_USE_PERL_SCRIPTS 0
wrapProgram $out/bin/hipconfig --set HIP_USE_PERL_SCRIPTS 0
wrapProgram $out/bin/hipcc.bin ${lib.concatStringsSep " " wrapperArgs}
wrapProgram $out/bin/hipconfig.bin ${lib.concatStringsSep " " wrapperArgs}
wrapProgram $out/bin/hipcc-pl --set HIP_USE_PERL_SCRIPTS 1
wrapProgram $out/bin/hipconfig-pl --set HIP_USE_PERL_SCRIPTS 1
wrapProgram $out/bin/hipcc.pl ${lib.concatStringsSep " " wrapperArgs}
wrapProgram $out/bin/hipconfig.pl ${lib.concatStringsSep " " wrapperArgs}
'';
passthru = {
# All known and valid general GPU targets
# We cannot use this for each ROCm library, as each defines their own supported targets
# See: https://github.com/RadeonOpenCompute/ROCm/blob/77cbac4abab13046ee93d8b5bf410684caf91145/README.md#library-target-matrix
gpuTargets = lib.forEach [
"803"
"900"
"906"
"908"
"90a"
"1010"
"1012"
"1030"
] (target: "gfx${target}");
updateScript = rocmUpdateScript {
name = finalAttrs.pname;
owner = finalAttrs.src.owner;
repo = finalAttrs.src.repo;
};
};
meta = with lib; {
description = "C++ Heterogeneous-Compute Interface for Portability specifically for AMD platform";
homepage = "https://github.com/ROCm-Developer-Tools/hipamd";
license = with licenses; [ mit ];
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
platforms = platforms.linux;
# Tests require GPU, also include issues
broken =
versions.minor finalAttrs.version != versions.minor hip-common.version ||
versions.minor finalAttrs.version != versions.minor hipcc.version ||
buildTests;
};
})

View File

@ -1,130 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c21f247..5bd3e45 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,6 +17,6 @@ if (NOT WIN32) # C++17 does not require the std lib linking
target_link_libraries(hipconfig.bin ${LINK_LIBS} ) # for hipconfig.bin
endif()
-set(HIP_VERSION_MAJOR 4 PARENT_SCOPE)
-set(HIP_VERSION_MINOR 4 PARENT_SCOPE)
-set(HIP_VERSION_PATCH 4 PARENT_SCOPE)
+set(HIP_VERSION_MAJOR @version_major@)
+set(HIP_VERSION_MINOR @version_minor@)
+set(HIP_VERSION_PATCH @version_patch@)
diff --git a/src/hipBin_amd.h b/src/hipBin_amd.h
index f94e4a5..f0b1b83 100644
--- a/src/hipBin_amd.h
+++ b/src/hipBin_amd.h
@@ -207,7 +207,7 @@ void HipBinAmd::initializeHipCXXFlags() {
hipClangIncludePath = getCompilerIncludePath();
hipCXXFlags += " -isystem \"" + hipClangIncludePath;
fs::path hipCXXFlagsTempFs = hipCXXFlags;
- hipCXXFlagsTempFs /= "..\"";
+ hipCXXFlagsTempFs /= "\"";
hipCXXFlags = hipCXXFlagsTempFs.string();
const EnvVariables& var = getEnvVariables();
// Allow __fp16 as function parameter and return type.
@@ -266,7 +266,7 @@ void HipBinAmd::printCompilerInfo() const {
string cmd = hipClangPath + "/clang++ --version";
system(cmd.c_str()); // hipclang version
cout << "llc-version :" << endl;
- cmd = hipClangPath + "/llc --version";
+ cmd = "@llvm@/bin/llc --version";
system(cmd.c_str()); // llc version
cout << "hip-clang-cxxflags :" << endl;
cmd = hipPath + "/bin/hipcc --cxxflags";
@@ -278,7 +278,7 @@ void HipBinAmd::printCompilerInfo() const {
} else {
string cmd = hipClangPath + "/clang++ --version";
system(cmd.c_str()); // hipclang version
- cmd = hipClangPath + "/llc --version";
+ cmd = "@llvm@/bin/llc --version";
system(cmd.c_str()); // llc version
cout << "hip-clang-cxxflags :" << endl;
cmd = hipPath + "/bin/hipcc --cxxflags";
@@ -331,10 +331,7 @@ string HipBinAmd::getCppConfig() {
hipPathInclude /= "include";
const string& compilerPath = getCompilerPath();
- hipClangInclude = compilerPath;
- hipClangInclude = hipClangInclude.parent_path();
- hipClangInclude /= "lib/clang/";
- hipClangInclude /= compilerVersion;
+ hipClangInclude = "@clang@/resource-root/include";
string hipClangPath = hipClangInclude.string();
const OsType& osInfo = getOSInfo();
@@ -442,17 +439,7 @@ string HipBinAmd::getHipCC() const {
string HipBinAmd::getCompilerIncludePath() {
- string hipClangVersion, includePath, compilerIncludePath;
- const string& hipClangPath = getCompilerPath();
- hipClangVersion = getCompilerVersion();
- fs::path includePathfs = hipClangPath;
- includePathfs = includePathfs.parent_path();
- includePathfs /= "lib/clang/";
- includePathfs /= hipClangVersion;
- includePathfs /= "include";
- includePathfs = fs::absolute(includePathfs).string();
- compilerIncludePath = includePathfs.string();
- return compilerIncludePath;
+ return "@clang@/resource-root/include";
}
@@ -506,8 +493,8 @@ void HipBinAmd::printFull() {
cout << endl << "== Envirnoment Variables" << endl;
printEnvironmentVariables();
getSystemInfo();
- if (fs::exists("/usr/bin/lsb_release"))
- system("/usr/bin/lsb_release -a");
+ if (fs::exists("@lsb_release@/bin/lsb_release"))
+ system("@lsb_release@/bin/lsb_release -a");
cout << endl;
}
@@ -993,7 +980,7 @@ void HipBinAmd::executeHipCCCmd(vector<string> argv) {
} else if (os != windows) {
// Else try using rocm_agent_enumerator
string ROCM_AGENT_ENUM;
- ROCM_AGENT_ENUM = roccmPath + "/bin/rocm_agent_enumerator";
+ ROCM_AGENT_ENUM = "@rocminfo@/bin/rocm_agent_enumerator";
targetsStr = ROCM_AGENT_ENUM +" -t GPU";
SystemCmdOut sysOut = hipBinUtilPtr_->exec(targetsStr.c_str());
regex toReplace("\n+");
@@ -1097,7 +1084,7 @@ void HipBinAmd::executeHipCCCmd(vector<string> argv) {
string hipClangVersion, toolArgTemp;
if (linkType == 0) {
toolArgTemp = " -L"+ hipLibPath + "-lamdhip64 -L" +
- roccmPath+ "/lib -lhsa-runtime64 -ldl -lnuma " + toolArgs;
+ "@rocm_runtime@/lib -lhsa-runtime64 -ldl -lnuma " + toolArgs;
toolArgs = toolArgTemp;
} else {
toolArgTemp = toolArgs + " -Wl,--enable-new-dtags -Wl,-rpath=" + hipLibPath + ":"
@@ -1107,8 +1094,7 @@ void HipBinAmd::executeHipCCCmd(vector<string> argv) {
hipClangVersion = getCompilerVersion();
// To support __fp16 and _Float16, explicitly link with compiler-rt
- toolArgs += " -L" + hipClangPath + "/../lib/clang/" +
- hipClangVersion + "/lib/linux -lclang_rt.builtins-x86_64 ";
+ toolArgs += " -L@clang@/resource-root/lib/linux -lclang_rt.builtins-x86_64 ";
}
if (!var.hipccCompileFlagsAppendEnv_.empty()) {
HIPCXXFLAGS += " " + var.hipccCompileFlagsAppendEnv_ + " ";
diff --git a/src/hipBin_nvidia.h b/src/hipBin_nvidia.h
index 6feb315..b61739d 100644
--- a/src/hipBin_nvidia.h
+++ b/src/hipBin_nvidia.h
@@ -157,8 +157,8 @@ void HipBinNvidia::printFull() {
cout << endl << "== Envirnoment Variables" << endl;
printEnvironmentVariables();
getSystemInfo();
- if (fs::exists("/usr/bin/lsb_release"))
- system("/usr/bin/lsb_release -a");
+ if (fs::exists("@lsb_release@/bin/lsb_release"))
+ system("@lsb_release@/bin/lsb_release -a");
}
// returns hip include

View File

@ -1,18 +0,0 @@
diff --git a/libomptarget/plugins/amdgpu/impl/impl.cpp b/libomptarget/plugins/amdgpu/impl/impl.cpp
index 80e024789..3a14e0889 100644
--- a/libomptarget/plugins/amdgpu/impl/impl.cpp
+++ b/libomptarget/plugins/amdgpu/impl/impl.cpp
@@ -21,10 +21,11 @@ bool is_locked(void *ptr, hsa_status_t *err_p, void **agentBaseAddress) {
info.size = sizeof(hsa_amd_pointer_info_t);
err = hsa_amd_pointer_info(ptr, &info, nullptr, nullptr, nullptr);
- if (err != HSA_STATUS_SUCCESS)
+ if (err != HSA_STATUS_SUCCESS) {
DP("Error when getting pointer info\n");
- else
+ } else {
is_locked = (info.type == HSA_EXT_POINTER_TYPE_LOCKED);
+ }
if (is_locked && agentBaseAddress != nullptr) {
// When user passes in a basePtr+offset we need to fix the

View File

@ -1,603 +0,0 @@
{ lib
, stdenv
, callPackage
, overrideCC
, wrapCCWith
, wrapBintoolsWith
, runCommand
, lit
, glibc
, spirv-llvm-translator
, xz
, swig
, lua5_3
, gtest
, hip
, rocm-comgr
, vulkan-loader
, vulkan-headers
, glslang
, shaderc
, perl
, rocm-device-libs
, rocm-runtime
, elfutils
, python3Packages
}:
let
# Stage 1
# Base
llvm = callPackage ./llvm.nix {
requiredSystemFeatures = [ "big-parallel" ];
isBroken = stdenv.isAarch64; # https://github.com/RadeonOpenCompute/ROCm/issues/1831#issuecomment-1278205344
};
# Projects
clang-unwrapped = callPackage ./llvm.nix rec {
targetName = "clang";
targetDir = targetName;
extraBuildInputs = [ llvm ];
extraCMakeFlags = [
"-DCMAKE_POLICY_DEFAULT_CMP0116=NEW"
"-DCLANG_INCLUDE_DOCS=ON"
"-DCLANG_INCLUDE_TESTS=ON"
];
extraPostPatch = ''
# Looks like they forgot to add finding libedit to the standalone build
ln -s ../cmake/Modules/FindLibEdit.cmake cmake/modules
substituteInPlace CMakeLists.txt \
--replace "include(CheckIncludeFile)" "include(CheckIncludeFile)''\nfind_package(LibEdit)"
# `No such file or directory: '/build/source/clang/tools/scan-build/bin/scan-build'`
rm test/Analysis/scan-build/*.test
rm test/Analysis/scan-build/rebuild_index/rebuild_index.test
# `does not depend on a module exporting 'baz.h'`
rm test/Modules/header-attribs.cpp
# `fatal error: 'stdio.h' file not found`
rm test/OpenMP/amdgcn_emit_llvm.c
'';
extraPostInstall = ''
mv bin/clang-tblgen $out/bin
'';
};
lld = callPackage ./llvm.nix rec {
buildMan = false; # No man pages to build
targetName = "lld";
targetDir = targetName;
extraBuildInputs = [ llvm ];
extraCMakeFlags = [ "-DCMAKE_POLICY_DEFAULT_CMP0116=NEW" ];
checkTargets = [ "check-lld" ];
};
# Runtimes
runtimes = callPackage ./llvm.nix {
buildDocs = false;
buildMan = false;
buildTests = false;
targetDir = "runtimes";
targetRuntimes = [
# "libc" https://github.com/llvm/llvm-project/issues/57719
"libunwind"
"libcxxabi"
"libcxx"
"compiler-rt"
];
extraBuildInputs = [ llvm ];
extraCMakeFlags = [
"-DCMAKE_POLICY_DEFAULT_CMP0114=NEW"
"-DLIBCXX_INCLUDE_BENCHMARKS=OFF"
"-DLIBCXX_CXX_ABI=libcxxabi"
];
extraLicenses = [ lib.licenses.mit ];
};
# Stage 2
# Helpers
rStdenv = overrideCC stdenv (wrapCCWith rec {
inherit bintools;
libcxx = runtimes;
cc = clang-unwrapped;
extraPackages = [
llvm
lld
];
nixSupport.cc-cflags = [
"-resource-dir=$out/resource-root"
"-fuse-ld=lld"
"-rtlib=compiler-rt"
"-unwindlib=libunwind"
"-Wno-unused-command-line-argument"
];
extraBuildCommands = ''
clang_version=`${cc}/bin/clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"`
mkdir -p $out/resource-root
ln -s ${cc}/lib/clang/$clang_version/include $out/resource-root
ln -s ${runtimes}/lib $out/resource-root
'';
});
bintools = wrapBintoolsWith { bintools = bintools-unwrapped; };
bintools-unwrapped = runCommand "rocm-llvm-binutils-${llvm.version}" { preferLocalBuild = true; } ''
mkdir -p $out/bin
for prog in ${lld}/bin/*; do
ln -s $prog $out/bin/$(basename $prog)
done
for prog in ${llvm}/bin/*; do
ln -sf $prog $out/bin/$(basename $prog)
done
ln -s ${llvm}/bin/llvm-ar $out/bin/ar
ln -s ${llvm}/bin/llvm-as $out/bin/as
ln -s ${llvm}/bin/llvm-dwp $out/bin/dwp
ln -s ${llvm}/bin/llvm-nm $out/bin/nm
ln -s ${llvm}/bin/llvm-objcopy $out/bin/objcopy
ln -s ${llvm}/bin/llvm-objdump $out/bin/objdump
ln -s ${llvm}/bin/llvm-ranlib $out/bin/ranlib
ln -s ${llvm}/bin/llvm-readelf $out/bin/readelf
ln -s ${llvm}/bin/llvm-size $out/bin/size
ln -s ${llvm}/bin/llvm-strip $out/bin/strip
ln -s ${lld}/bin/lld $out/bin/ld
'';
in rec {
inherit
llvm
clang-unwrapped
lld
bintools
bintools-unwrapped;
# Runtimes
libc = callPackage ./llvm.nix rec {
stdenv = rStdenv;
targetName = "libc";
targetDir = "runtimes";
targetRuntimes = [ targetName ];
isBroken = true; # https://github.com/llvm/llvm-project/issues/57719
};
libunwind = callPackage ./llvm.nix rec {
stdenv = rStdenv;
buildMan = false; # No man pages to build
targetName = "libunwind";
targetDir = "runtimes";
targetRuntimes = [ targetName ];
extraCMakeFlags = [
"-DLIBUNWIND_INCLUDE_DOCS=ON"
"-DLIBUNWIND_INCLUDE_TESTS=ON"
"-DLIBUNWIND_USE_COMPILER_RT=ON"
];
};
libcxxabi = callPackage ./llvm.nix rec {
stdenv = rStdenv;
buildDocs = false; # No documentation to build
buildMan = false; # No man pages to build
targetName = "libcxxabi";
targetDir = "runtimes";
targetRuntimes = [
"libunwind"
targetName
"libcxx"
];
extraCMakeFlags = [
"-DLIBCXXABI_INCLUDE_TESTS=ON"
"-DLIBCXXABI_USE_LLVM_UNWINDER=ON"
"-DLIBCXXABI_USE_COMPILER_RT=ON"
# Workaround having to build combined
"-DLIBUNWIND_INCLUDE_DOCS=OFF"
"-DLIBUNWIND_INCLUDE_TESTS=OFF"
"-DLIBUNWIND_USE_COMPILER_RT=ON"
"-DLIBUNWIND_INSTALL_LIBRARY=OFF"
"-DLIBUNWIND_INSTALL_HEADERS=OFF"
"-DLIBCXX_INCLUDE_DOCS=OFF"
"-DLIBCXX_INCLUDE_TESTS=OFF"
"-DLIBCXX_USE_COMPILER_RT=ON"
"-DLIBCXX_CXX_ABI=libcxxabi"
"-DLIBCXX_INSTALL_LIBRARY=OFF"
"-DLIBCXX_INSTALL_HEADERS=OFF"
];
};
libcxx = callPackage ./llvm.nix rec {
stdenv = rStdenv;
buildMan = false; # No man pages to build
targetName = "libcxx";
targetDir = "runtimes";
targetRuntimes = [
"libunwind"
"libcxxabi"
targetName
];
extraCMakeFlags = [
"-DLIBCXX_INCLUDE_DOCS=ON"
"-DLIBCXX_INCLUDE_TESTS=ON"
"-DLIBCXX_USE_COMPILER_RT=ON"
"-DLIBCXX_CXX_ABI=libcxxabi"
# Workaround having to build combined
"-DLIBUNWIND_INCLUDE_DOCS=OFF"
"-DLIBUNWIND_INCLUDE_TESTS=OFF"
"-DLIBUNWIND_USE_COMPILER_RT=ON"
"-DLIBUNWIND_INSTALL_LIBRARY=OFF"
"-DLIBUNWIND_INSTALL_HEADERS=OFF"
"-DLIBCXXABI_INCLUDE_TESTS=OFF"
"-DLIBCXXABI_USE_LLVM_UNWINDER=ON"
"-DLIBCXXABI_USE_COMPILER_RT=ON"
"-DLIBCXXABI_INSTALL_LIBRARY=OFF"
"-DLIBCXXABI_INSTALL_HEADERS=OFF"
];
# Most of these can't find `bash` or `mkdir`, might just be hard-coded paths, or PATH is altered
extraPostPatch = ''
chmod +w -R ../libcxx/test/{libcxx,std}
rm -rf ../libcxx/test/libcxx/input.output/filesystems
rm ../libcxx/test/libcxx/selftest/remote-substitutions.sh.cpp
rm ../libcxx/test/std/input.output/file.streams/fstreams/filebuf.virtuals/pbackfail.pass.cpp
rm ../libcxx/test/std/localization/locales/locale.convenience/conversions/conversions.buffer/pbackfail.pass.cpp
rm ../libcxx/test/std/utilities/optional/optional.object/optional.object.assign/emplace_initializer_list.pass.cpp
rm ../libcxx/test/std/utilities/optional/optional.object/optional.object.assign/nullopt_t.pass.cpp
rm -rf ../libcxx/test/std/utilities/optional/optional.object/optional.object.ctor
rm -rf ../libcxx/test/std/input.output/filesystems/{class.directory_entry,class.directory_iterator,class.rec.dir.itr,fs.op.funcs}
'';
};
compiler-rt = callPackage ./llvm.nix rec {
stdenv = rStdenv;
buildDocs = false; # No documentation to build
buildMan = false; # No man pages to build
targetName = "compiler-rt";
targetDir = "runtimes";
targetRuntimes = [
"libunwind"
"libcxxabi"
"libcxx"
targetName
];
extraCMakeFlags = [
"-DCMAKE_POLICY_DEFAULT_CMP0114=NEW"
"-DCOMPILER_RT_INCLUDE_TESTS=ON"
"-DCOMPILER_RT_USE_LLVM_UNWINDER=ON"
"-DCOMPILER_RT_CXX_LIBRARY=libcxx"
"-DCOMPILER_RT_CAN_EXECUTE_TESTS=OFF" # We can't run most of these
# Workaround having to build combined
"-DLIBUNWIND_INCLUDE_DOCS=OFF"
"-DLIBUNWIND_INCLUDE_TESTS=OFF"
"-DLIBUNWIND_USE_COMPILER_RT=ON"
"-DLIBUNWIND_INSTALL_LIBRARY=OFF"
"-DLIBUNWIND_INSTALL_HEADERS=OFF"
"-DLIBCXXABI_INCLUDE_TESTS=OFF"
"-DLIBCXXABI_USE_LLVM_UNWINDER=ON"
"-DLIBCXXABI_USE_COMPILER_RT=ON"
"-DLIBCXXABI_INSTALL_LIBRARY=OFF"
"-DLIBCXXABI_INSTALL_HEADERS=OFF"
"-DLIBCXX_INCLUDE_DOCS=OFF"
"-DLIBCXX_INCLUDE_TESTS=OFF"
"-DLIBCXX_USE_COMPILER_RT=ON"
"-DLIBCXX_CXX_ABI=libcxxabi"
"-DLIBCXX_INSTALL_LIBRARY=OFF"
"-DLIBCXX_INSTALL_HEADERS=OFF"
];
extraPostPatch = ''
# `No such file or directory: 'ldd'`
substituteInPlace ../compiler-rt/test/lit.common.cfg.py \
--replace "'ldd'," "'${glibc.bin}/bin/ldd',"
# We can run these
substituteInPlace ../compiler-rt/test/CMakeLists.txt \
--replace "endfunction()" "endfunction()''\nadd_subdirectory(builtins)''\nadd_subdirectory(shadowcallstack)"
'';
extraLicenses = [ lib.licenses.mit ];
};
# Stage 3
# Helpers
rocmClangStdenv = overrideCC stdenv clang;
clang = wrapCCWith rec {
# inherit libc libcxx bintools;
inherit libcxx bintools;
# We do this to avoid HIP pathing problems, and mimic a monolithic install
cc = stdenv.mkDerivation (finalAttrs: {
inherit (clang-unwrapped) pname version;
dontUnpack = true;
installPhase = ''
runHook preInstall
clang_version=`${clang-unwrapped}/bin/clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"`
mkdir -p $out/{bin,include/c++/v1,lib/{cmake,clang/$clang_version/{include,lib}},libexec,share}
for path in ${llvm} ${clang-unwrapped} ${lld} ${libunwind} ${libcxxabi} ${libcxx} ${compiler-rt}; do
cp -as $path/* $out
chmod +w $out/{*,include/c++/v1,lib/{clang/$clang_version/include,cmake}}
rm -f $out/lib/libc++.so
done
ln -s $out/lib/* $out/lib/clang/$clang_version/lib
ln -s $out/include/* $out/lib/clang/$clang_version/include
runHook postInstall
'';
passthru.isClang = true;
});
extraPackages = [
llvm
lld
libunwind
libcxxabi
compiler-rt
];
nixSupport.cc-cflags = [
"-resource-dir=$out/resource-root"
"-fuse-ld=lld"
"-rtlib=compiler-rt"
"-unwindlib=libunwind"
"-Wno-unused-command-line-argument"
];
extraBuildCommands = ''
clang_version=`${cc}/bin/clang -v 2>&1 | grep "clang version " | grep -E -o "[0-9.-]+"`
mkdir -p $out/resource-root
ln -s ${cc}/lib/clang/$clang_version/{include,lib} $out/resource-root
# Not sure why, but hardening seems to make things break
rm $out/nix-support/add-hardening.sh
touch $out/nix-support/add-hardening.sh
# GPU compilation uses builtin `lld`
substituteInPlace $out/bin/{clang,clang++} \
--replace "-MM) dontLink=1 ;;" "-MM | --cuda-device-only) dontLink=1 ;;''\n--cuda-host-only | --cuda-compile-host-device) dontLink=0 ;;"
'';
};
# Base
# Unfortunately, we cannot build `clang-tools-extra` separately.
clang-tools-extra = callPackage ./llvm.nix {
stdenv = rocmClangStdenv;
buildTests = false; # `invalid operands to binary expression ('std::basic_stringstream<char>' and 'const llvm::StringRef')`
targetName = "clang-tools-extra";
targetProjects = [
"clang"
"clang-tools-extra"
];
extraBuildInputs = [ gtest ];
extraCMakeFlags = [
"-DLLVM_INCLUDE_DOCS=OFF"
"-DLLVM_INCLUDE_TESTS=OFF"
"-DCLANG_INCLUDE_DOCS=OFF"
"-DCLANG_INCLUDE_TESTS=ON"
"-DCLANG_TOOLS_EXTRA_INCLUDE_DOCS=ON"
];
extraPostInstall = ''
# Remove LLVM and Clang
for path in `find ${llvm} ${clang-unwrapped}`; do
if [ $path != ${llvm} ] && [ $path != ${clang-unwrapped} ]; then
rm -f $out''${path#${llvm}} $out''${path#${clang-unwrapped}} || true
fi
done
# Cleanup empty directories
find $out -type d -empty -delete
'';
};
# Projects
libclc = let
spirv = (spirv-llvm-translator.override { inherit llvm; });
in callPackage ./llvm.nix rec {
stdenv = rocmClangStdenv;
buildDocs = false; # No documentation to build
buildMan = false; # No man pages to build
targetName = "libclc";
targetDir = targetName;
extraBuildInputs = [ spirv ];
# `spirv-mesa3d` isn't compiling with LLVM 15.0.0, it does with LLVM 14.0.0
# Try removing the `spirv-mesa3d` and `clspv` patches next update
# `clspv` tests fail, unresolved calls
extraPostPatch = ''
substituteInPlace CMakeLists.txt \
--replace "find_program( LLVM_CLANG clang PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \
"find_program( LLVM_CLANG clang PATHS \"${clang}/bin\" NO_DEFAULT_PATH )" \
--replace "find_program( LLVM_SPIRV llvm-spirv PATHS \''${LLVM_BINDIR} NO_DEFAULT_PATH )" \
"find_program( LLVM_SPIRV llvm-spirv PATHS \"${spirv}/bin\" NO_DEFAULT_PATH )" \
--replace " spirv-mesa3d-" "" \
--replace " spirv64-mesa3d-" "" \
--replace "NOT \''${t} MATCHES" \
"NOT \''${ARCH} STREQUAL \"clspv\" AND NOT \''${ARCH} STREQUAL \"clspv64\" AND NOT \''${t} MATCHES"
'';
checkTargets = [ ];
};
lldb = callPackage ./llvm.nix rec {
stdenv = rocmClangStdenv;
buildTests = false; # ld.lld: error: unable to find library -lllvm_gtest_main
targetName = "lldb";
targetDir = targetName;
extraNativeBuildInputs = [ python3Packages.sphinx-automodapi ];
extraBuildInputs = [
xz
swig
lua5_3
gtest
];
extraCMakeFlags = [
"-DLLVM_EXTERNAL_LIT=${lit}/bin/.lit-wrapped"
"-DLLDB_INCLUDE_TESTS=ON"
"-DLLDB_INCLUDE_UNITTESTS=ON"
];
};
mlir = callPackage ./llvm.nix rec {
stdenv = rocmClangStdenv;
buildDocs = false; # No decent way to hack this to work
buildMan = false; # No man pages to build
targetName = "mlir";
targetDir = targetName;
extraNativeBuildInputs = [ hip ];
extraBuildInputs = [
rocm-comgr
vulkan-headers
vulkan-loader
glslang
shaderc
];
extraCMakeFlags = [
"-DCMAKE_POLICY_DEFAULT_CMP0116=NEW"
"-DMLIR_INCLUDE_DOCS=ON"
"-DMLIR_INCLUDE_TESTS=ON"
"-DMLIR_ENABLE_ROCM_RUNNER=ON"
"-DMLIR_ENABLE_SPIRV_CPU_RUNNER=ON"
"-DMLIR_ENABLE_VULKAN_RUNNER=ON"
"-DROCM_TEST_CHIPSET=gfx000" # CPU runner
];
extraPostPatch = ''
chmod +w ../llvm
mkdir -p ../llvm/build/bin
ln -s ${lit}/bin/lit ../llvm/build/bin/llvm-lit
substituteInPlace test/CMakeLists.txt \
--replace "FileCheck count not" "" \
--replace "list(APPEND MLIR_TEST_DEPENDS mlir_rocm_runtime)" ""
substituteInPlace lib/ExecutionEngine/CMakeLists.txt \
--replace "return()" ""
# Remove problematic tests
rm test/CAPI/execution_engine.c
rm test/Target/LLVMIR/llvmir-intrinsics.mlir
rm test/Target/LLVMIR/llvmir.mlir
rm test/Target/LLVMIR/openmp-llvm.mlir
rm test/mlir-cpu-runner/*.mlir
rm test/mlir-vulkan-runner/*.mlir
'';
extraPostInstall = ''
mkdir -p $out/bin
mv bin/mlir-tblgen $out/bin
'';
checkTargets = [ "check-${targetName}" ];
};
polly = callPackage ./llvm.nix rec {
stdenv = rocmClangStdenv;
targetName = "polly";
targetDir = targetName;
checkTargets = [ "check-${targetName}" ];
};
flang = callPackage ./llvm.nix rec {
stdenv = rocmClangStdenv;
buildTests = false; # `Executable "flang1" doesn't exist!`
targetName = "flang";
targetDir = targetName;
extraNativeBuildInputs = [ python3Packages.sphinx-markdown-tables ];
extraBuildInputs = [ mlir ];
extraCMakeFlags = [
"-DCMAKE_POLICY_DEFAULT_CMP0116=NEW"
"-DCLANG_DIR=${clang-unwrapped}/lib/cmake/clang"
"-DFLANG_INCLUDE_TESTS=OFF"
"-DMLIR_TABLEGEN_EXE=${mlir}/bin/mlir-tblgen"
];
extraPostPatch = ''
substituteInPlace test/CMakeLists.txt \
--replace "FileCheck" "" \
--replace "count" "" \
--replace "not" ""
substituteInPlace docs/CMakeLists.txt \
--replace "CLANG_TABLEGEN_EXE clang-tblgen" "CLANG_TABLEGEN_EXE ${clang-unwrapped}/bin/clang-tblgen"
'';
};
openmp = callPackage ./llvm.nix rec {
stdenv = rocmClangStdenv;
buildTests = false; # Too many failures, most pass
targetName = "openmp";
targetDir = targetName;
extraPatches = [ ./0000-fix-openmp.patch ];
extraNativeBuildInputs = [ perl ];
extraBuildInputs = [
rocm-device-libs
rocm-runtime
elfutils
];
extraCMakeFlags = [
"-DCMAKE_MODULE_PATH=/build/source/llvm/cmake/modules" # For docs
"-DCLANG_TOOL=${clang}/bin/clang"
"-DCLANG_OFFLOAD_BUNDLER_TOOL=${clang-unwrapped}/bin/clang-offload-bundler"
"-DOPENMP_LLVM_TOOLS_DIR=${llvm}/bin"
"-DOPENMP_LLVM_LIT_EXECUTABLE=${lit}/bin/.lit-wrapped"
"-DDEVICELIBS_ROOT=${rocm-device-libs.src}"
];
extraPostPatch = ''
# We can't build this target at the moment
substituteInPlace libomptarget/DeviceRTL/CMakeLists.txt \
--replace "gfx1010" ""
'';
checkTargets = [ "check-${targetName}" ];
extraLicenses = [ lib.licenses.mit ];
};
# Runtimes
pstl = callPackage ./llvm.nix rec {
stdenv = rocmClangStdenv;
buildDocs = false; # No documentation to build
buildMan = false; # No man pages to build
buildTests = false; # Too many errors
targetName = "pstl";
targetDir = "runtimes";
targetRuntimes = [ targetName ];
checkTargets = [ "check-${targetName}" ];
};
}

View File

@ -2,15 +2,13 @@
, fetchFromGitHub
, llvmPackages_15
, lld_15
, rocm-device-libs
, python3
, rocm-runtime
, cmake
, boost
, libxml2
, libffi
, makeWrapper
, hip
, rocmPackages
, rocmSupport ? false
}:
let
@ -40,8 +38,8 @@ stdenv.mkDerivation rec {
llvmPackages_15.libclang.dev
llvmPackages_15.llvm
] ++ lib.optionals rocmSupport [
hip
rocm-runtime
rocmPackages.clr
rocmPackages.rocm-runtime
];
# opensycl makes use of clangs internal headers. Its cmake does not successfully discover them automatically on nixos, so we supply the path manually
@ -55,7 +53,7 @@ stdenv.mkDerivation rec {
--add-flags "-L${llvmPackages_15.openmp}/lib" \
--add-flags "-I${llvmPackages_15.openmp.dev}/include" \
'' + lib.optionalString rocmSupport ''
--add-flags "--rocm-device-lib-path=${rocm-device-libs}/amdgcn/bitcode"
--add-flags "--rocm-device-lib-path=${rocmPackages.rocm-device-libs}/amdgcn/bitcode"
'';
meta = with lib; {

View File

@ -8,7 +8,7 @@
stdenv.mkDerivation rec {
pname = "polyml";
version = "5.9";
version = "5.9.1";
prePatch = lib.optionalString stdenv.isDarwin ''
substituteInPlace configure.ac --replace stdc++ c++
@ -28,7 +28,7 @@ stdenv.mkDerivation rec {
owner = "polyml";
repo = "polyml";
rev = "v${version}";
sha256 = "sha256-4oo4AB54CivhS99RuZVTP9+Ic0CDpsBb+OiHvOhmZnM=";
sha256 = "sha256-72wm8dt+Id59A5058mVE5P9TkXW5/LZRthZoxUustVA=";
};
meta = with lib; {

View File

@ -13,13 +13,17 @@ let
llvmMajor = lib.versions.major llvm.version;
isROCm = lib.hasPrefix "rocm" llvm.pname;
# ROCm will always be at the latest version
# ROCm, if actively updated will always be at the latest version
branch =
if llvmMajor == "16" then rec {
if llvmMajor == "17" || isROCm then rec {
version = "17.0.0";
rev = "v${version}";
hash = "sha256-Rzm5Py9IPFtS9G7kME+uSwZ/0gPGW6MlL35ZWk4LfHM=";
} else if llvmMajor == "16" then rec {
version = "16.0.0";
rev = "v${version}";
hash = "sha256-EUabcYqSjXshbPmcs1DRLvCSL1nd9rEdpqELBrItCW8=";
} else if llvmMajor == "15" || isROCm then rec {
} else if llvmMajor == "15" then rec {
version = "15.0.0";
rev = "v${version}";
hash = "sha256-OsDohXRxovtEXaWiRGp8gJ0dXmoALyO+ZimeSO8aPVI=";

View File

@ -1,29 +0,0 @@
{ lib, stdenv, fetchurl, ncurses }:
stdenv.mkDerivation rec {
pname = "cdk";
version = "5.0-20221025";
src = fetchurl {
urls = [
"ftp://ftp.invisible-island.net/cdk/cdk-${version}.tgz"
"https://invisible-mirror.net/archives/cdk/cdk-${version}.tgz"
];
hash = "sha256-A8z6Icn8PWHd0P2hnaVFNZBVu+71ociC37n/SPN0avI=";
};
buildInputs = [
ncurses
];
enableParallelBuilding = true;
meta = with lib; {
description = "Curses development kit";
homepage = "https://invisible-island.net/cdk/";
changelog = "https://invisible-island.net/cdk/CHANGES";
license = licenses.mit;
maintainers = with maintainers; [ raskin ];
platforms = platforms.linux;
};
}

View File

@ -0,0 +1,53 @@
{ lib
, stdenv
, fetchFromGitHub
, gitUpdater
, cmake
, functionalplus
, eigen
, nlohmann_json
, doctest
, python3Packages
, buildTests ? false # Needs tensorflow
}:
stdenv.mkDerivation (finalAttrs: {
pname = "frugally-deep";
version = "0.15.24-p0";
src = fetchFromGitHub {
owner = "Dobiasd";
repo = "frugally-deep";
rev = "v${finalAttrs.version}";
hash = "sha256-yg2SMsYOOSOgsdwIH1bU3iPM45z6c7WeIrgOddt3um4=";
};
nativeBuildInputs = [
cmake
] ++ lib.optionals buildTests [
python3Packages.python
python3Packages.numpy
];
buildInputs = lib.optionals buildTests [
doctest
python3Packages.tensorflow
];
propagatedBuildInputs = [
functionalplus
eigen
nlohmann_json
];
cmakeFlags = lib.optionals buildTests [ "-DFDEEP_BUILD_UNITTEST=ON" ];
passthru.updateScript = gitUpdater;
meta = with lib; {
description = "Header-only library for using Keras (TensorFlow) models in C++";
homepage = "https://github.com/Dobiasd/frugally-deep";
license = with licenses; [ mit ];
maintainers = with maintainers; [ Madouura ];
platforms = platforms.linux;
};
})

View File

@ -1,4 +1,4 @@
{ lib, stdenv, fetchFromGitHub, cmake, bison, flex }:
{ lib, stdenv, fetchFromGitHub, fetchpatch, cmake, bison, flex }:
stdenv.mkDerivation rec {
pname = "libcue";
@ -11,6 +11,14 @@ stdenv.mkDerivation rec {
sha256 = "1iqw4n01rv2jyk9lksagyxj8ml0kcfwk67n79zy1r6zv1xfp5ywm";
};
patches = [
(fetchpatch {
name = "CVE-2023-43641.patch";
url = "https://github.com/lipnitsk/libcue/commit/fdf72c8bded8d24cfa0608b8e97f2eed210a920e.patch";
hash = "sha256-NjnSMUfman/SwLFWDIhtz2jCOLfpXGGGjO3QwRGURNg=";
})
];
nativeBuildInputs = [ cmake bison flex ];
doCheck = false; # fails all the tests (ctest)

View File

@ -1,190 +0,0 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchurl
, rocmUpdateScript
, pkg-config
, cmake
, rocm-cmake
, rocblas
, rocmlir
, hip
, clang-tools-extra
, clang-ocl
, llvm
, miopengemm
, composable_kernel
, half
, boost
, sqlite
, bzip2
, nlohmann_json
, texlive
, doxygen
, sphinx
, zlib
, gtest
, rocm-comgr
, python3Packages
, buildDocs ? true
, buildTests ? false
, fetchKDBs ? true
, useOpenCL ? false
}:
let
latex = lib.optionalAttrs buildDocs texlive.combine {
inherit (texlive) scheme-small
latexmk
tex-gyre
fncychap
wrapfig
capt-of
framed
needspace
tabulary
varwidth
titlesec;
};
kdbs = lib.optionalAttrs fetchKDBs import ./deps.nix {
inherit fetchurl;
mirror = "https://repo.radeon.com/rocm/miopen-kernel/rel-5.0";
};
in stdenv.mkDerivation (finalAttrs: {
pname = "miopen";
version = "5.4.2";
outputs = [
"out"
] ++ lib.optionals buildDocs [
"doc"
] ++ lib.optionals buildTests [
"test"
];
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "MIOpen";
rev = "rocm-${finalAttrs.version}";
hash = "sha256-GfXPCXiVJVve3d8sQCQcFLb/vEnKkVEn7xYUhHkEEVI=";
};
nativeBuildInputs = [
pkg-config
cmake
rocm-cmake
hip
clang-tools-extra
];
buildInputs = [
llvm
rocblas
rocmlir
clang-ocl
miopengemm
composable_kernel
half
boost
sqlite
bzip2
nlohmann_json
] ++ lib.optionals buildDocs [
latex
doxygen
sphinx
python3Packages.sphinx-rtd-theme
python3Packages.breathe
python3Packages.myst-parser
] ++ lib.optionals buildTests [
zlib
];
cmakeFlags = [
"-DMIOPEN_USE_MIOPENGEMM=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 (!useOpenCL) [
"-DCMAKE_C_COMPILER=hipcc"
"-DCMAKE_CXX_COMPILER=hipcc"
"-DMIOPEN_BACKEND=HIP"
] ++ lib.optionals useOpenCL [
"-DMIOPEN_BACKEND=OpenCL"
] ++ lib.optionals buildTests [
"-DBUILD_TESTS=ON"
"-DMIOPEN_TEST_ALL=ON"
"-DMIOPEN_TEST_GFX900=ON"
"-DMIOPEN_TEST_GFX906=ON"
"-DMIOPEN_TEST_GFX908=ON"
"-DMIOPEN_TEST_GFX90A=ON"
"-DMIOPEN_TEST_GFX103X=ON"
"-DGOOGLETEST_DIR=${gtest.src}" # Custom linker names
];
postPatch = ''
substituteInPlace CMakeLists.txt \
--replace "enable_testing()" "" \
--replace "MIOPEN_HIP_COMPILER MATCHES \".*clang\\\\+\\\\+$\"" "true" \
--replace "set(MIOPEN_TIDY_ERRORS ALL)" "" # error: missing required key 'key'
'' + lib.optionalString buildTests ''
substituteInPlace test/gtest/CMakeLists.txt \
--replace "enable_testing()" ""
'' + lib.optionalString (!buildTests) ''
substituteInPlace CMakeLists.txt \
--replace "add_subdirectory(test)" ""
'' + lib.optionalString fetchKDBs ''
ln -sf ${kdbs.gfx1030_36} src/kernels/gfx1030_36.kdb
ln -sf ${kdbs.gfx900_56} src/kernels/gfx900_56.kdb
ln -sf ${kdbs.gfx900_64} src/kernels/gfx900_64.kdb
ln -sf ${kdbs.gfx906_60} src/kernels/gfx906_60.kdb
ln -sf ${kdbs.gfx906_64} src/kernels/gfx906_64.kdb
ln -sf ${kdbs.gfx90878} src/kernels/gfx90878.kdb
ln -sf ${kdbs.gfx90a68} src/kernels/gfx90a68.kdb
ln -sf ${kdbs.gfx90a6e} src/kernels/gfx90a6e.kdb
'';
# Unfortunately, it seems like we have to call make on these manually
postBuild = lib.optionalString buildDocs ''
export HOME=$(mktemp -d)
make -j$NIX_BUILD_CORES doc
'' + lib.optionalString buildTests ''
make -j$NIX_BUILD_CORES check
'';
postInstall = ''
rm $out/bin/install_precompiled_kernels.sh
'' + lib.optionalString buildDocs ''
mv ../doc/html $out/share/doc/miopen-${if useOpenCL then "opencl" else "hip"}
mv ../doc/pdf/miopen.pdf $out/share/doc/miopen-${if useOpenCL then "opencl" else "hip"}
'' + lib.optionalString buildTests ''
mkdir -p $test/bin
mv bin/test_* $test/bin
patchelf --set-rpath $out/lib:${lib.makeLibraryPath (finalAttrs.buildInputs ++
[ hip rocm-comgr ])} $test/bin/*
'' + lib.optionalString fetchKDBs ''
# Apparently gfx1030_40 wasn't generated so the developers suggest just renaming gfx1030_36 to it
# Should be fixed in the next miopen kernel generation batch
ln -s ${kdbs.gfx1030_36} $out/share/miopen/db/gfx1030_40.kdb
'';
requiredSystemFeatures = [ "big-parallel" ];
passthru.updateScript = rocmUpdateScript {
name = finalAttrs.pname;
owner = finalAttrs.src.owner;
repo = finalAttrs.src.repo;
};
meta = with lib; {
description = "Machine intelligence library for ROCm";
homepage = "https://github.com/ROCmSoftwarePlatform/MIOpen";
license = with licenses; [ mit ];
maintainers = teams.rocm.members;
platforms = platforms.linux;
broken = versions.minor finalAttrs.version != versions.minor hip.version;
};
})

View File

@ -1,45 +0,0 @@
{ fetchurl
, mirror
}:
{
gfx1030_36 = fetchurl {
sha256 = "sha256-zEXDLkRWAHS15LDA5IRyqG5rO7HHPBiVgPlQ8JjSqNc=";
url = "${mirror}/gfx1030_36.kdb";
};
gfx900_56 = fetchurl {
sha256 = "sha256-ZTqUPhVKcQzjO6bxykvZMJk1VZh31dRVs+XqcxEtmeI=";
url = "${mirror}/gfx900_56.kdb";
};
gfx900_64 = fetchurl {
sha256 = "sha256-ZTqUPhVKcQzjO6bxykvZMJk1VZh31dRVs+XqcxEtmeI=";
url = "${mirror}/gfx900_64.kdb";
};
gfx906_60 = fetchurl {
sha256 = "sha256-U6pDo8ICfs6fVIEqRziWeE5/4Vzvu41JkcRVn3ou1e4=";
url = "${mirror}/gfx906_60.kdb";
};
gfx906_64 = fetchurl {
sha256 = "sha256-U6pDo8ICfs6fVIEqRziWeE5/4Vzvu41JkcRVn3ou1e4=";
url = "${mirror}/gfx906_64.kdb";
};
gfx90878 = fetchurl {
sha256 = "sha256-r7DRhNH+jHUXAu64b9vWsZzGD4w5oSHnxH0l2RN0qlQ=";
url = "${mirror}/gfx90878.kdb";
};
gfx90a68 = fetchurl {
sha256 = "sha256-NT//zIPTbzsPJyaVycxwU6BcMTzGc/d+Z4Ab9FImDko=";
url = "${mirror}/gfx90a68.kdb";
};
gfx90a6e = fetchurl {
sha256 = "sha256-ENZHbf+/MGYgSTpALKh2meuZPNhH5bG+WrW/jzvGpBs=";
url = "${mirror}/gfx90a6e.kdb";
};
}

View File

@ -1,139 +0,0 @@
{ lib
, stdenv
, fetchFromGitHub
, rocmUpdateScript
, cmake
, rocm-cmake
, hip
, python3
, tensile
, msgpack
, libxml2
, gtest
, gfortran
, openmp
, amd-blis
, python3Packages
, buildTensile ? true
, buildTests ? false
, buildBenchmarks ? false
, tensileLogic ? "asm_full"
, tensileCOVersion ? "V3"
, tensileSepArch ? true
, tensileLazyLib ? true
, tensileLibFormat ? "msgpack"
, gpuTargets ? [ "all" ]
}:
stdenv.mkDerivation (finalAttrs: {
pname = "rocblas";
version = "5.4.3";
outputs = [
"out"
] ++ lib.optionals buildTests [
"test"
] ++ lib.optionals buildBenchmarks [
"benchmark"
];
src = fetchFromGitHub {
owner = "ROCmSoftwarePlatform";
repo = "rocBLAS";
rev = "rocm-${finalAttrs.version}";
hash = "sha256-XhYpzBXviMnUdbF6lZi9g0LARKpzWLtDxJxLI3MuHiM=";
};
nativeBuildInputs = [
cmake
rocm-cmake
hip
];
buildInputs = [
python3
] ++ lib.optionals buildTensile [
msgpack
libxml2
python3Packages.msgpack
] ++ lib.optionals buildTests [
gtest
] ++ lib.optionals (buildTests || buildBenchmarks) [
gfortran
openmp
amd-blis
] ++ lib.optionals (buildTensile || buildTests || buildBenchmarks) [
python3Packages.pyyaml
];
cmakeFlags = [
"-DCMAKE_C_COMPILER=hipcc"
"-DCMAKE_CXX_COMPILER=hipcc"
"-Dpython=python3"
"-DAMDGPU_TARGETS=${lib.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"
] ++ lib.optionals (buildTests || buildBenchmarks) [
"-DCMAKE_CXX_FLAGS=-I${amd-blis}/include/blis"
];
# Tensile REALLY wants to write to the nix directory if we include it normally
postPatch = lib.optionalString buildTensile ''
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})" ""
'';
postInstall = lib.optionalString buildTests ''
mkdir -p $test/bin
cp -a $out/bin/* $test/bin
rm $test/bin/*-bench || true
'' + lib.optionalString buildBenchmarks ''
mkdir -p $benchmark/bin
cp -a $out/bin/* $benchmark/bin
rm $benchmark/bin/*-test || true
'' + lib.optionalString (buildTests || buildBenchmarks ) ''
rm -rf $out/bin
'';
passthru.updateScript = rocmUpdateScript {
name = finalAttrs.pname;
owner = finalAttrs.src.owner;
repo = finalAttrs.src.repo;
};
requiredSystemFeatures = [ "big-parallel" ];
meta = with lib; {
description = "BLAS implementation for ROCm platform";
homepage = "https://github.com/ROCmSoftwarePlatform/rocBLAS";
license = with licenses; [ mit ];
maintainers = teams.rocm.members;
platforms = platforms.linux;
broken = versions.minor finalAttrs.version != versions.minor hip.version;
};
})

View File

@ -1,64 +0,0 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, rocmUpdateScript
, rocm-comgr
}:
stdenv.mkDerivation (finalAttrs: {
pname = "rocclr";
version = "5.4.4";
src = fetchFromGitHub {
owner = "ROCm-Developer-Tools";
repo = "ROCclr";
rev = "rocm-${finalAttrs.version}";
hash = "sha256-DbN7kL8oyaPeYQB19Q96L3wX66v62TMSWl0Yor7Q4kE=";
};
patches = [
# Enable support for gfx8 again
# See the upstream issue: https://github.com/RadeonOpenCompute/ROCm/issues/1659
# And the arch patch: https://github.com/rocm-arch/rocm-arch/pull/742
(fetchpatch {
url = "https://raw.githubusercontent.com/John-Gee/rocm-arch/d6812d308fee3caf2b6bb01b4d19fe03a6a0e3bd/rocm-opencl-runtime/enable-gfx800.patch";
hash = "sha256-59jFDIIsTTZcNns9RyMVWPRUggn/bSlAGrky4quu8B4=";
})
];
postPatch = ''
substituteInPlace device/comgrctx.cpp \
--replace "libamd_comgr.so" "${rocm-comgr}/lib/libamd_comgr.so"
'';
dontConfigure = true;
dontBuild = true;
installPhase = ''
runHook preInstall
mkdir -p $out
cp -a * $out/
runHook postInstall
'';
passthru.updateScript = rocmUpdateScript {
name = finalAttrs.pname;
owner = finalAttrs.src.owner;
repo = finalAttrs.src.repo;
};
meta = with lib; {
description = "Source package of the Radeon Open Compute common language runtime";
homepage = "https://github.com/ROCm-Developer-Tools/ROCclr";
license = licenses.mit;
maintainers = with maintainers; [ lovesegfault ] ++ teams.rocm.members;
# rocclr seems to have some AArch64 ifdefs, but does not seem
# to be supported yet by the build infrastructure. Recheck in
# the future.
platforms = [ "x86_64-linux" ];
broken = versions.minor finalAttrs.version != versions.minor stdenv.cc.version;
};
})

View File

@ -1,15 +0,0 @@
diff --git a/library/src/device/CMakeLists.txt b/library/src/device/CMakeLists.txt
index 73a8ec9..9bfd4b8 100644
--- a/library/src/device/CMakeLists.txt
+++ b/library/src/device/CMakeLists.txt
@@ -255,4 +255,10 @@ foreach( sub ${AMDGPU_TARGETS} )
if( NOT BUILD_SHARED_LIBS )
set_target_properties( rocfft-device-${sub} PROPERTIES PREFIX "lib" )
endif( )
+
+ rocm_install_targets(
+ TARGETS
+ rocfft-device-${sub}
+ COMPONENT device
+ )
endforeach()

View File

@ -1,124 +0,0 @@
diff --git a/library/src/CMakeLists.txt b/library/src/CMakeLists.txt
index 3a16304..606b711 100644
--- a/library/src/CMakeLists.txt
+++ b/library/src/CMakeLists.txt
@@ -250,12 +250,12 @@ foreach( target
endforeach()
-add_executable( rocfft_aot_helper
+add_executable( rocfft_aot_helper EXCLUDE_FROM_ALL
rocfft_aot_helper.cpp
rocfft_stub.cpp
)
-add_executable( rocfft_config_search
+add_executable( rocfft_config_search EXCLUDE_FROM_ALL
rocfft_config_search.cpp
rocfft_stub.cpp
)
@@ -279,10 +279,10 @@ endif()
target_link_libraries( rocfft PRIVATE ${ROCFFT_DEVICE_LINK_LIBS} )
-target_link_libraries( rocfft PRIVATE rocfft-device-0 )
-target_link_libraries( rocfft PRIVATE rocfft-device-1 )
-target_link_libraries( rocfft PRIVATE rocfft-device-2 )
-target_link_libraries( rocfft PRIVATE rocfft-device-3 )
+foreach( sub ${AMDGPU_TARGETS} )
+ target_link_libraries( rocfft PRIVATE -lrocfft-device-${sub} )
+endforeach()
+
foreach( target rocfft rocfft_aot_helper rocfft_config_search )
# RTC uses dladdr to find the RTC helper program
if( NOT WIN32 )
@@ -347,7 +347,7 @@ add_custom_command(
DEPENDS rocfft_aot_helper rocfft_rtc_helper
COMMENT "Compile kernels into shipped cache file"
)
-add_custom_target( rocfft_kernel_cache_target ALL
+add_custom_target( rocfft_kernel_cache_target
DEPENDS rocfft_kernel_cache.db
VERBATIM
)
@@ -392,7 +392,8 @@ else()
endif()
rocm_install(FILES ${ROCFFT_KERNEL_CACHE_PATH}
DESTINATION "${ROCFFT_KERNEL_CACHE_INSTALL_DIR}"
- COMPONENT runtime
+ COMPONENT kernel_cache
+ EXCLUDE_FROM_ALL
)
# PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ GROUP_EXECUTE GROUP_READ WORLD_EXECUTE WORLD_READ
diff --git a/library/src/device/CMakeLists.txt b/library/src/device/CMakeLists.txt
index 9f7b85f..73a8ec9 100644
--- a/library/src/device/CMakeLists.txt
+++ b/library/src/device/CMakeLists.txt
@@ -170,11 +170,11 @@ list( SORT rocfft_device_source )
# functions callable by rocFFT and depends on amdhip64, and another
# one usable by AOT RTC that contains no device code
list( FILTER rocfft_device_source EXCLUDE REGEX function_pool.cpp )
-add_library( rocfft-function-pool OBJECT
+add_library( rocfft-function-pool OBJECT EXCLUDE_FROM_ALL
function_pool.cpp
)
target_compile_definitions( rocfft-function-pool PRIVATE FUNCTION_POOL_STANDALONE_BODY= )
-add_library( rocfft-function-pool-standalone OBJECT
+add_library( rocfft-function-pool-standalone OBJECT EXCLUDE_FROM_ALL
function_pool.cpp
)
target_compile_definitions( rocfft-function-pool-standalone PRIVATE FUNCTION_POOL_STANDALONE_BODY={} )
@@ -193,26 +193,15 @@ foreach( pool rocfft-function-pool rocfft-function-pool-standalone )
add_dependencies(${pool} gen_headers_target)
endforeach()
-list( LENGTH rocfft_device_source rocfft_device_source_len )
-math(EXPR split_len "${rocfft_device_source_len} / 4")
-math(EXPR split_idx_2 "${rocfft_device_source_len} / 4 * 2")
-math(EXPR split_idx_3 "${rocfft_device_source_len} / 4 * 3")
-
-list( SUBLIST rocfft_device_source 0 ${split_len} rocfft_device_source_0 )
-list( SUBLIST rocfft_device_source ${split_len} ${split_len} rocfft_device_source_1 )
-list( SUBLIST rocfft_device_source ${split_idx_2} ${split_len} rocfft_device_source_2 )
-list( SUBLIST rocfft_device_source ${split_idx_3} -1 rocfft_device_source_3 )
-
-foreach( sub RANGE 3 )
- set( rocfft_device_source_var rocfft_device_source_${sub} )
+foreach( sub ${AMDGPU_TARGETS} )
if(NOT SINGLELIB)
- add_library( rocfft-device-${sub}
- ${${rocfft_device_source_var}} )
+ add_library( rocfft-device-${sub} EXCLUDE_FROM_ALL
+ ${rocfft_device_source} )
else()
# Compile the device lib as a static library, which is then linked
# into librocfft.so Useful for testing purposes.
- add_library( rocfft-device-${sub} STATIC
- ${${rocfft_device_source_var}} )
+ add_library( rocfft-device-${sub} STATIC EXCLUDE_FROM_ALL
+ ${rocfft_device_source} )
# if we're building singlelib, we don't want to export any of the
# device library symbols to the main library
@@ -241,9 +230,7 @@ foreach( sub RANGE 3 )
# Set AMD GPU architecture options
# Enable compilation of desired architectures
- foreach( target ${AMDGPU_TARGETS} )
- target_compile_options( rocfft-device-${sub} PRIVATE --offload-arch=${target} )
- endforeach( )
+ target_compile_options( rocfft-device-${sub} PRIVATE --offload-arch=${sub} )
target_include_directories( rocfft-device-${sub}
PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
@@ -268,9 +255,4 @@ foreach( sub RANGE 3 )
if( NOT BUILD_SHARED_LIBS )
set_target_properties( rocfft-device-${sub} PROPERTIES PREFIX "lib" )
endif( )
-
- rocm_install_targets(
- TARGETS
- rocfft-device-${sub}
- )
endforeach()

View File

@ -1,365 +0,0 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 62b857b..d21c7f4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -147,8 +147,8 @@ if (UNIX)
list(APPEND AMD_COMGR_PUBLIC_LINKER_OPTIONS -pthread)
if (NOT APPLE AND COMGR_BUILD_SHARED_LIBS)
configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/src/exportmap.in
- ${CMAKE_CURRENT_BINARY_DIR}/src/exportmap @ONLY)
+ src/exportmap.in
+ src/exportmap @ONLY)
list(APPEND AMD_COMGR_PRIVATE_LINKER_OPTIONS
"-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/src/exportmap")
# When building a shared library with -fsanitize=address we can't be
@@ -175,10 +175,6 @@ endif()
# the shared header.
list(APPEND AMD_COMGR_PRIVATE_COMPILE_DEFINITIONS AMD_COMGR_EXPORT)
-configure_file(
- ${CMAKE_CURRENT_SOURCE_DIR}/include/amd_comgr.h.in
- ${CMAKE_CURRENT_BINARY_DIR}/include/amd_comgr.h @ONLY)
-
include(bc2h)
include(opencl_pch)
include(DeviceLibs)
@@ -212,10 +208,14 @@ target_include_directories(amd_comgr
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:include>)
+configure_file(
+ include/amd_comgr.h.in
+ include/amd_comgr.h @ONLY)
+
set(AMD_COMGR_CONFIG_NAME amd_comgr-config.cmake)
set(AMD_COMGR_TARGETS_NAME amd_comgr-targets.cmake)
set(AMD_COMGR_VERSION_NAME amd_comgr-config-version.cmake)
-set(AMD_COMGR_PACKAGE_PREFIX ${CMAKE_INSTALL_LIBDIR}/cmake/amd_comgr)
+set(AMD_COMGR_PACKAGE_PREFIX cmake/amd_comgr)
# Generate the build-tree package.
set(AMD_COMGR_PREFIX_CODE)
@@ -226,13 +226,13 @@ if (NOT COMGR_BUILD_SHARED_LIBS)
endif()
set(AMD_COMGR_TARGETS_PATH
- "${CMAKE_CURRENT_BINARY_DIR}/${AMD_COMGR_PACKAGE_PREFIX}/${AMD_COMGR_TARGETS_NAME}")
+ "${CMAKE_CURRENT_BINARY_DIR}/lib/${AMD_COMGR_PACKAGE_PREFIX}/${AMD_COMGR_TARGETS_NAME}")
set(AMD_COMGR_VERSION_PATH
- "${CMAKE_CURRENT_BINARY_DIR}/${AMD_COMGR_PACKAGE_PREFIX}/${AMD_COMGR_VERSION_NAME}")
+ "${CMAKE_CURRENT_BINARY_DIR}/lib/${AMD_COMGR_PACKAGE_PREFIX}/${AMD_COMGR_VERSION_NAME}")
export(TARGETS amd_comgr
- FILE "${AMD_COMGR_PACKAGE_PREFIX}/${AMD_COMGR_TARGETS_NAME}")
+ FILE "lib/${AMD_COMGR_PACKAGE_PREFIX}/${AMD_COMGR_TARGETS_NAME}")
configure_file("cmake/${AMD_COMGR_CONFIG_NAME}.in"
- "${AMD_COMGR_PACKAGE_PREFIX}/${AMD_COMGR_CONFIG_NAME}"
+ "lib/${AMD_COMGR_PACKAGE_PREFIX}/${AMD_COMGR_CONFIG_NAME}"
@ONLY)
write_basic_package_version_file("${AMD_COMGR_VERSION_PATH}"
VERSION "${amd_comgr_VERSION}"
@@ -266,7 +266,7 @@ install(FILES
set(AMD_COMGR_PREFIX_CODE "
# Derive absolute install prefix from config file path.
get_filename_component(AMD_COMGR_PREFIX \"\${CMAKE_CURRENT_LIST_FILE}\" PATH)")
-string(REGEX REPLACE "/" ";" count "${AMD_COMGR_PACKAGE_PREFIX}")
+string(REGEX REPLACE "/" ";" count "${CMAKE_INSTALL_LIBDIR}/${AMD_COMGR_PACKAGE_PREFIX}")
foreach(p ${count})
set(AMD_COMGR_PREFIX_CODE "${AMD_COMGR_PREFIX_CODE}
get_filename_component(AMD_COMGR_PREFIX \"\${AMD_COMGR_PREFIX}\" PATH)")
@@ -278,20 +278,20 @@ if (NOT COMGR_BUILD_SHARED_LIBS)
string(APPEND AMD_COMGR_PREFIX_CODE "find_dependency(LLD REQUIRED)\n")
endif()
-set(AMD_COMGR_TARGETS_PATH "\${AMD_COMGR_PREFIX}/${AMD_COMGR_PACKAGE_PREFIX}/${AMD_COMGR_TARGETS_NAME}")
+set(AMD_COMGR_TARGETS_PATH "\${AMD_COMGR_PREFIX}/${CMAKE_INSTALL_LIBDIR}/${AMD_COMGR_PACKAGE_PREFIX}/${AMD_COMGR_TARGETS_NAME}")
configure_file("cmake/${AMD_COMGR_CONFIG_NAME}.in"
- "${CMAKE_CURRENT_BINARY_DIR}/${AMD_COMGR_CONFIG_NAME}.install"
+ "${AMD_COMGR_CONFIG_NAME}.install"
@ONLY)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${AMD_COMGR_CONFIG_NAME}.install"
- DESTINATION "${AMD_COMGR_PACKAGE_PREFIX}"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/${AMD_COMGR_PACKAGE_PREFIX}"
RENAME "${AMD_COMGR_CONFIG_NAME}")
install(EXPORT amd_comgr_export
- DESTINATION "${AMD_COMGR_PACKAGE_PREFIX}"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/${AMD_COMGR_PACKAGE_PREFIX}"
FILE "${AMD_COMGR_TARGETS_NAME}")
install(FILES
"${AMD_COMGR_VERSION_PATH}"
- DESTINATION "${AMD_COMGR_PACKAGE_PREFIX}")
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/${AMD_COMGR_PACKAGE_PREFIX}")
if(TARGET clangFrontendTool)
set(CLANG_LIBS
diff --git a/cmake/DeviceLibs.cmake b/cmake/DeviceLibs.cmake
index 27e9546..dfe1b57 100644
--- a/cmake/DeviceLibs.cmake
+++ b/cmake/DeviceLibs.cmake
@@ -1,8 +1,7 @@
set(INC_DIR ${CMAKE_CURRENT_BINARY_DIR}/include)
set(GEN_LIBRARY_INC_FILE ${INC_DIR}/libraries.inc)
-
-file(WRITE ${GEN_LIBRARY_INC_FILE} "// Automatically generated file; DO NOT EDIT.\n")
+set(GEN_LIBRARY_DEFS_INC_FILE ${INC_DIR}/libraries_defs.inc)
# cmake does not provide a way to query targets produced by a project,
# so we have to make one up. Ordinarily, individual library target
@@ -23,6 +22,7 @@ if(NOT AMD_DEVICE_LIBS_TARGETS)
message(FATAL_ERROR "Could not find list of device libraries")
endif()
+set(TARGETS_INCLUDES "")
foreach(AMDGCN_LIB_TARGET ${AMD_DEVICE_LIBS_TARGETS})
set(header ${AMDGCN_LIB_TARGET}.inc)
@@ -54,75 +54,52 @@ foreach(AMDGCN_LIB_TARGET ${AMD_DEVICE_LIBS_TARGETS})
add_custom_target(${AMDGCN_LIB_TARGET}_header DEPENDS ${INC_DIR}/${header})
add_dependencies(amd_comgr ${AMDGCN_LIB_TARGET}_header)
- file(APPEND ${GEN_LIBRARY_INC_FILE} "#include \"${header}\"\n")
+ list(APPEND TARGETS_INCLUDES "#include \"${header}\"")
+endforeach()
+
+list(JOIN TARGETS_INCLUDES "\n" TARGETS_INCLUDES)
+file(GENERATE OUTPUT ${GEN_LIBRARY_INC_FILE} CONTENT "${TARGETS_INCLUDES}")
+
+foreach(OPENCL_VERSION 1.2 2.0)
+ string(REPLACE . _ OPENCL_UNDERSCORE_VERSION ${OPENCL_VERSION})
+ add_custom_command(OUTPUT ${INC_DIR}/opencl${OPENCL_VERSION}-c.inc
+ COMMAND bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl${OPENCL_VERSION}-c.pch
+ ${INC_DIR}/opencl${OPENCL_VERSION}-c.inc
+ opencl${OPENCL_UNDERSCORE_VERSION}_c
+ DEPENDS bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl${OPENCL_VERSION}-c.pch
+ COMMENT "Generating opencl${OPENCL_VERSION}-c.inc"
+ )
+ set_property(DIRECTORY APPEND PROPERTY
+ ADDITIONAL_MAKE_CLEAN_FILES ${INC_DIR}/opencl${OPENCL_VERSION}-c.inc)
+ add_custom_target(opencl${OPENCL_VERSION}-c.inc_target DEPENDS ${INC_DIR}/opencl${OPENCL_VERSION}-c.inc)
+ add_dependencies(amd_comgr opencl${OPENCL_VERSION}-c.inc_target)
endforeach()
-add_custom_command(OUTPUT ${INC_DIR}/opencl1.2-c.inc
- COMMAND bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.pch
- ${INC_DIR}/opencl1.2-c.inc
- opencl1_2_c
- DEPENDS bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl1.2-c.pch
- COMMENT "Generating opencl1.2-c.inc"
-)
-set_property(DIRECTORY APPEND PROPERTY
- ADDITIONAL_MAKE_CLEAN_FILES ${INC_DIR}/opencl1.2-c.inc)
-add_custom_target(opencl1.2-c.inc_target DEPENDS ${INC_DIR}/opencl1.2-c.inc)
-add_dependencies(amd_comgr opencl1.2-c.inc_target)
-file(APPEND ${GEN_LIBRARY_INC_FILE} "#include \"opencl1.2-c.inc\"\n")
-
-add_custom_command(OUTPUT ${INC_DIR}/opencl2.0-c.inc
- COMMAND bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.pch
- ${INC_DIR}/opencl2.0-c.inc
- opencl2_0_c
- DEPENDS bc2h ${CMAKE_CURRENT_BINARY_DIR}/opencl2.0-c.pch
- COMMENT "Generating opencl2.0-c.inc"
-)
-set_property(DIRECTORY APPEND PROPERTY
- ADDITIONAL_MAKE_CLEAN_FILES ${INC_DIR}/opencl2.0-c.inc)
-add_custom_target(opencl2.0-c.inc_target DEPENDS ${INC_DIR}/opencl2.0-c.inc)
-add_dependencies(amd_comgr opencl2.0-c.inc_target)
-file(APPEND ${GEN_LIBRARY_INC_FILE} "#include \"opencl2.0-c.inc\"\n")
-
-# Generate function to select libraries for a given GFXIP number.
-file(APPEND ${GEN_LIBRARY_INC_FILE} "#include \"llvm/ADT/StringRef.h\"\n")
-file(APPEND ${GEN_LIBRARY_INC_FILE}
- "static std::tuple<const char*, const void*, size_t> get_oclc_isa_version(llvm::StringRef gfxip) {")
+set(TARGETS_DEFS "")
+list(APPEND TARGETS_DEFS "#ifndef AMD_DEVICE_LIBS_TARGET\n#define AMD_DEVICE_LIBS_TARGET(t)\n#endif")
+list(APPEND TARGETS_DEFS "#ifndef AMD_DEVICE_LIBS_GFXIP\n#define AMD_DEVICE_LIBS_GFXIP(t, g)\n#endif")
+list(APPEND TARGETS_DEFS "#ifndef AMD_DEVICE_LIBS_FUNCTION\n#define AMD_DEVICE_LIBS_FUNCTION(t, f)\n#endif")
+list(APPEND TARGETS_DEFS "")
foreach(AMDGCN_LIB_TARGET ${AMD_DEVICE_LIBS_TARGETS})
+ list(APPEND TARGETS_DEFS "AMD_DEVICE_LIBS_TARGET(${AMDGCN_LIB_TARGET})")
+ # Generate function to select libraries for a given GFXIP number.
if (${AMDGCN_LIB_TARGET} MATCHES "^oclc_isa_version_.+$")
string(REGEX REPLACE "^oclc_isa_version_(.+)$" "\\1" gfxip ${AMDGCN_LIB_TARGET})
- file(APPEND ${GEN_LIBRARY_INC_FILE}
- "if (gfxip == \"${gfxip}\") return std::make_tuple(\"${AMDGCN_LIB_TARGET}.bc\", ${AMDGCN_LIB_TARGET}_lib, ${AMDGCN_LIB_TARGET}_lib_size);")
+ list(APPEND TARGETS_DEFS "AMD_DEVICE_LIBS_GFXIP(${AMDGCN_LIB_TARGET}, \"${gfxip}\")")
endif()
-endforeach()
-file(APPEND ${GEN_LIBRARY_INC_FILE}
- "return std::make_tuple(nullptr, nullptr, 0); }")
-
-# Generate function to select libraries for given feature.
-foreach(AMDGCN_LIB_TARGET ${AMD_DEVICE_LIBS_TARGETS})
+ # Generate function to select libraries for given feature.
if (${AMDGCN_LIB_TARGET} MATCHES "^oclc_.*_on$")
string(REGEX REPLACE "^oclc_(.*)_on" "\\1" function ${AMDGCN_LIB_TARGET})
- file(APPEND ${GEN_LIBRARY_INC_FILE}
- "static std::tuple<const char*, const void*, size_t> get_oclc_${function}(bool on) { \
- return std::make_tuple( \
- on ? \"oclc_${function}_on_lib.bc\" : \"oclc_${function}_off_lib.bc\", \
- on ? oclc_${function}_on_lib : oclc_${function}_off_lib, \
- on ? oclc_${function}_on_lib_size : oclc_${function}_off_lib_size \
- ); }")
+ list(APPEND TARGETS_DEFS "AMD_DEVICE_LIBS_FUNCTION(${AMDGCN_LIB_TARGET}, ${function})")
endif()
endforeach()
-# Generate function yield all libraries.
-file(APPEND ${GEN_LIBRARY_INC_FILE} "\n#include \"llvm/ADT/ArrayRef.h\"\n")
-file(APPEND ${GEN_LIBRARY_INC_FILE}
- "llvm::ArrayRef<std::tuple<llvm::StringRef, llvm::StringRef>> COMGR::getDeviceLibraries() { \
- static std::tuple<llvm::StringRef, llvm::StringRef> DeviceLibs[] = {")
-foreach(AMDGCN_LIB_TARGET ${AMD_DEVICE_LIBS_TARGETS})
- file(APPEND ${GEN_LIBRARY_INC_FILE}
- "{\"${AMDGCN_LIB_TARGET}.bc\", llvm::StringRef(reinterpret_cast<const char *>(${AMDGCN_LIB_TARGET}_lib), ${AMDGCN_LIB_TARGET}_lib_size)},")
-endforeach()
-file(APPEND ${GEN_LIBRARY_INC_FILE}
- "}; \
- return DeviceLibs; \
- }")
+list(APPEND TARGETS_DEFS "")
+list(APPEND TARGETS_DEFS "#undef AMD_DEVICE_LIBS_TARGET")
+list(APPEND TARGETS_DEFS "#undef AMD_DEVICE_LIBS_GFXIP")
+list(APPEND TARGETS_DEFS "#undef AMD_DEVICE_LIBS_FUNCTION")
+
+list(JOIN TARGETS_DEFS "\n" TARGETS_DEFS)
+file(GENERATE OUTPUT ${GEN_LIBRARY_DEFS_INC_FILE} CONTENT "${TARGETS_DEFS}")
include_directories(${INC_DIR})
diff --git a/cmake/bc2h.cmake b/cmake/bc2h.cmake
index 146fe2b..9134985 100644
--- a/cmake/bc2h.cmake
+++ b/cmake/bc2h.cmake
@@ -1,40 +1,41 @@
-file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/bc2h.c
-"#include <stdio.h>\n"
-"int main(int argc, char **argv){\n"
-" FILE *ifp, *ofp;\n"
-" int c, i, l;\n"
-" if (argc != 4) return 1;\n"
-" ifp = fopen(argv[1], \"rb\");\n"
-" if (!ifp) return 1;\n"
-" i = fseek(ifp, 0, SEEK_END);\n"
-" if (i < 0) return 1;\n"
-" l = ftell(ifp);\n"
-" if (l < 0) return 1;\n"
-" i = fseek(ifp, 0, SEEK_SET);\n"
-" if (i < 0) return 1;\n"
-" ofp = fopen(argv[2], \"wb+\");\n"
-" if (!ofp) return 1;\n"
-" fprintf(ofp, \"#define %s_size %d\\n\\n\"\n"
-" \"#if defined __GNUC__\\n\"\n"
-" \"__attribute__((aligned (4096)))\\n\"\n"
-" \"#elif defined _MSC_VER\\n\"\n"
-" \"__declspec(align(4096))\\n\"\n"
-" \"#endif\\n\"\n"
-" \"static const unsigned char %s[%s_size+1] = {\",\n"
-" argv[3], l,\n"
-" argv[3], argv[3]);\n"
-" i = 0;\n"
-" while ((c = getc(ifp)) != EOF) {\n"
-" if (0 == (i&7)) fprintf(ofp, \"\\n \");\n"
-" fprintf(ofp, \" 0x%02x,\", c);\n"
-" ++i;\n"
-" }\n"
-" fprintf(ofp, \" 0x00\\n};\\n\\n\");\n"
-" fclose(ifp);\n"
-" fclose(ofp);\n"
-" return 0;\n"
-"}\n"
-)
+file(GENERATE OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/bc2h.c
+ CONTENT
+"#include <stdio.h>
+int main(int argc, char **argv){
+ FILE *ifp, *ofp;
+ int c, i, l;
+ if (argc != 4) return 1;
+ ifp = fopen(argv[1], \"rb\");
+ if (!ifp) return 1;
+ i = fseek(ifp, 0, SEEK_END);
+ if (i < 0) return 1;
+ l = ftell(ifp);
+ if (l < 0) return 1;
+ i = fseek(ifp, 0, SEEK_SET);
+ if (i < 0) return 1;
+ ofp = fopen(argv[2], \"wb+\");
+ if (!ofp) return 1;
+ fprintf(ofp, \"#define %s_size %d\\n\\n\"
+ \"#if defined __GNUC__\\n\"
+ \"__attribute__((aligned (4096)))\\n\"
+ \"#elif defined _MSC_VER\\n\"
+ \"__declspec(align(4096))\\n\"
+ \"#endif\\n\"
+ \"static const unsigned char %s[%s_size+1] = {\",
+ argv[3], l,
+ argv[3], argv[3]);
+ i = 0;
+ while ((c = getc(ifp)) != EOF) {
+ if (0 == (i&7)) fprintf(ofp, \"\\n \");
+ fprintf(ofp, \" 0x%02x,\", c);
+ ++i;
+ }
+ fprintf(ofp, \" 0x00\\n};\\n\\n\");
+ fclose(ifp);
+ fclose(ofp);
+ return 0;
+}
+")
add_executable(bc2h ${CMAKE_CURRENT_BINARY_DIR}/bc2h.c)
if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
diff --git a/src/comgr-device-libs.cpp b/src/comgr-device-libs.cpp
index 4d2b914..80786d1 100644
--- a/src/comgr-device-libs.cpp
+++ b/src/comgr-device-libs.cpp
@@ -35,7 +35,7 @@
#include "comgr-device-libs.h"
#include "comgr.h"
-#include "libraries.inc"
+#include "comgr-libraries.h"
#include "llvm/ADT/StringSwitch.h"
#include <cstdint>
diff --git a/src/comgr-libraries.h b/src/comgr-libraries.h
new file mode 100644
index 0000000..3caa0a0
--- /dev/null
+++ b/src/comgr-libraries.h
@@ -0,0 +1,34 @@
+#include "libraries.inc"
+#include "opencl1.2-c.inc"
+#include "opencl2.0-c.inc"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/ADT/ArrayRef.h"
+
+static std::tuple<const char*, const void*, size_t> get_oclc_isa_version(llvm::StringRef gfxip) {
+#define AMD_DEVICE_LIBS_GFXIP(target, target_gfxip) \
+ if (gfxip == target_gfxip) return std::make_tuple(#target ".bc", target##_lib, target##_lib_size);
+#include "libraries_defs.inc"
+
+ return std::make_tuple(nullptr, nullptr, 0);
+}
+
+#define AMD_DEVICE_LIBS_FUNCTION(target, function) \
+ static std::tuple<const char*, const void*, size_t> get_oclc_##function(bool on) { \
+ return std::make_tuple( \
+ on ? "oclc_" #function "_on_lib.bc" : "oclc_" #function "_off_lib.bc", \
+ on ? oclc_##function##_on_lib : oclc_##function##_off_lib, \
+ on ? oclc_##function##_on_lib_size : oclc_##function##_off_lib_size \
+ ); \
+ }
+#include "libraries_defs.inc"
+
+llvm::ArrayRef<std::tuple<llvm::StringRef, llvm::StringRef>> COMGR::getDeviceLibraries() {
+ static std::tuple<llvm::StringRef, llvm::StringRef> DeviceLibs[] = {
+#define AMD_DEVICE_LIBS_TARGET(target) \
+ {#target ".bc", llvm::StringRef(reinterpret_cast<const char *>(target##_lib), target##_lib_size)},
+#include "libraries_defs.inc"
+ };
+ return DeviceLibs;
+}
+
+

View File

@ -1,58 +0,0 @@
{ lib
, stdenv
, fetchFromGitHub
, runCommand
, substituteAll
, cmake
}:
let
rocm_version = with lib; concatStrings (intersperse "0" (splitString "." stdenv.cc.version));
in stdenv.mkDerivation (finalAttrs: {
pname = "rocm-core";
version = stdenv.cc.version;
# Based on https://github.com/rocm-arch/rocm-arch/tree/ad0b15690d403e5822db062ffff4db3912de6669/rocm-core
src = let
rocm_major = lib.versions.major finalAttrs.version;
rocm_minor = lib.versions.minor finalAttrs.version;
rocm_patch = lib.versions.patch finalAttrs.version;
cmake_lists = substituteAll {
inherit rocm_version;
src = ./src/CMakeLists.txt;
};
version_c = substituteAll {
inherit rocm_major rocm_minor rocm_patch;
src = ./src/rocm_version.c;
};
version_h = substituteAll {
inherit rocm_major rocm_minor rocm_patch;
src = ./src/rocm_version.h;
};
in runCommand "rocm-core-${finalAttrs.version}-source" { preferLocalBuild = true; } ''
mkdir -p $out/rocm-core
ln -s ${cmake_lists} $out/CMakeLists.txt
ln -s ${version_c} $out/rocm_version.c
ln -s ${version_h} $out/rocm-core/rocm_version.h
'';
nativeBuildInputs = [ cmake ];
postInstall = ''
mkdir -p $out/include
cp -a ../rocm-core $out/include
ln -s $out/include/rocm-core/rocm_version.h $out/include
ln -s $out/lib/librocm-core.so.1.0.${rocm_version} $out/lib/librocm-core.so.1
'';
meta = with lib; {
description = "ROCm core";
homepage = "https://docs.amd.com";
license = with licenses; [ ncsa ]; # See src/rocm_version.h
maintainers = teams.rocm.members;
platforms = platforms.linux;
};
})

Some files were not shown because too many files have changed in this diff Show More