Merge master into haskell-updates

This commit is contained in:
github-actions[bot] 2023-08-05 00:13:26 +00:00 committed by GitHub
commit 272e4425d8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
268 changed files with 2397 additions and 1682 deletions

1
.gitignore vendored
View File

@ -9,6 +9,7 @@
outputs/
result-*
result
repl-result-*
!pkgs/development/python-modules/result
/doc/NEWS.html
/doc/NEWS.txt

View File

@ -70,7 +70,7 @@ A list of the maintainers of this Nix expression. Maintainers are defined in [`n
### `mainProgram` {#var-meta-mainProgram}
The name of the main binary for the package. This affects the binary `nix run` executes and falls back to the name of the package. Example: `"rg"`
The name of the main binary for the package. This affects the binary `nix run` executes. Example: `"rg"`
### `priority` {#var-meta-priority}

View File

@ -132,10 +132,9 @@ rec {
{ shortName = licstr; }
);
/* Get the path to the main program of a derivation with either
meta.mainProgram or pname or name
/* Get the path to the main program of a package based on meta.mainProgram
Type: getExe :: derivation -> string
Type: getExe :: package -> string
Example:
getExe pkgs.hello

View File

@ -187,6 +187,27 @@ Decision: All functions remove trailing slashes in their results.
</details>
### Prefer returning subpaths over components
[subpath-preference]: #prefer-returning-subpaths-over-components
Observing: Functions could return subpaths or lists of path component strings.
Considering: Subpaths are used as inputs for some functions. Using them for outputs, too, makes the library more consistent and composable.
Decision: Subpaths should be preferred over list of path component strings.
<details>
<summary>Arguments</summary>
- (+) It is consistent with functions accepting subpaths, making the library more composable
- (-) It is less efficient when the components are needed, because after creating the normalised subpath string, it will have to be parsed into components again
- (+) If necessary, we can still make it faster by adding builtins to Nix
- (+) Alternatively if necessary, versions of these functions that return components could later still be introduced.
- (+) It makes the path library simpler because there's only two types (paths and subpaths). Only `lib.path.subpath.components` can be used to get a list of components.
And once we have a list of component strings, `lib.lists` and `lib.strings` can be used to operate on them.
For completeness, `lib.path.subpath.join` allows converting the list of components back to a subpath.
</details>
## Other implementations and references
- [Rust](https://doc.rust-lang.org/std/path/struct.Path.html)

View File

@ -438,6 +438,37 @@ in /* No rec! Add dependencies on this file at the top. */ {
${subpathInvalidReason path}''
) 0 subpaths;
/*
Split [a subpath](#function-library-lib.path.subpath.isValid) into its path component strings.
Throw an error if the subpath isn't valid.
Note that the returned path components are also valid subpath strings, though they are intentionally not [normalised](#function-library-lib.path.subpath.normalise).
Laws:
- Splitting a subpath into components and [joining](#function-library-lib.path.subpath.join) the components gives the same subpath but [normalised](#function-library-lib.path.subpath.normalise):
subpath.join (subpath.components s) == subpath.normalise s
Type:
subpath.components :: String -> [ String ]
Example:
subpath.components "."
=> [ ]
subpath.components "./foo//bar/./baz/"
=> [ "foo" "bar" "baz" ]
subpath.components "/foo"
=> <error>
*/
subpath.components =
subpath:
assert assertMsg (isValid subpath) ''
lib.path.subpath.components: Argument is not a valid subpath string:
${subpathInvalidReason subpath}'';
splitRelPath subpath;
/* Normalise a subpath. Throw an error if the subpath isn't valid, see
`lib.path.subpath.isValid`

View File

@ -238,6 +238,19 @@ let
expr = (builtins.tryEval (subpath.normalise "..")).success;
expected = false;
};
testSubpathComponentsExample1 = {
expr = subpath.components ".";
expected = [ ];
};
testSubpathComponentsExample2 = {
expr = subpath.components "./foo//bar/./baz/";
expected = [ "foo" "bar" "baz" ];
};
testSubpathComponentsExample3 = {
expr = (builtins.tryEval (subpath.components "/foo")).success;
expected = false;
};
};
in
if cases == [] then "Unit tests successful"

View File

@ -650,6 +650,13 @@
githubId = 82811;
name = "Aldo Borrero";
};
alejandrosame = {
email = "alejandrosanchzmedina@gmail.com";
matrix = "@alejandrosame:matrix.org";
github = "alejandrosame";
githubId = 1078000;
name = "Alejandro Sánchez Medina";
};
aleksana = {
email = "me@aleksana.moe";
github = "Aleksanaa";
@ -9932,6 +9939,15 @@
githubId = 1168435;
name = "Ludovic Courtès";
};
ludovicopiero = {
email = "ludovicopiero@pm.me";
github = "ludovicopiero";
githubId = 44255157;
name = "Ludovico Piero";
keys = [{
fingerprint = "72CA 4F61 46C6 0DAB 6193 4D35 3911 DD27 6CFE 779C";
}];
};
lufia = {
email = "lufia@lufia.org";
github = "lufia";

View File

@ -62,7 +62,7 @@ config.security.apparmor.includes = {
include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/base"
r ${pkgs.stdenv.cc.libc}/share/locale/**,
r ${pkgs.stdenv.cc.libc}/share/locale.alias,
${lib.optionalString (pkgs.glibcLocales != null) "r ${pkgs.glibcLocales}/lib/locale/locale-archive,"}
r ${config.i18n.glibcLocales}/lib/locale/locale-archive,
${etcRule "localtime"}
r ${pkgs.tzdata}/share/zoneinfo/**,
r ${pkgs.stdenv.cc.libc}/share/i18n/**,
@ -72,7 +72,7 @@ config.security.apparmor.includes = {
# bash inspects filesystems at startup
# and /etc/mtab is linked to /proc/mounts
@{PROC}/mounts
r @{PROC}/mounts,
# system-wide bash configuration
'' + lib.concatMapStringsSep "\n" etcRule [
@ -211,6 +211,9 @@ config.security.apparmor.includes = {
"abstractions/nis" = ''
include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/nis"
'';
"abstractions/nss-systemd" = ''
include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/nss-systemd"
'';
"abstractions/nvidia" = ''
include "${pkgs.apparmor-profiles}/etc/apparmor.d/abstractions/nvidia"
${etcRule "vdpau_wrapper.cfg"}
@ -279,6 +282,8 @@ config.security.apparmor.includes = {
r /var/lib/acme/*/chain.pem,
r /var/lib/acme/*/fullchain.pem,
r /etc/pki/tls/certs/,
'' + lib.concatMapStringsSep "\n" etcRule [
"ssl/certs/ca-certificates.crt"
"ssl/certs/ca-bundle.crt"

View File

@ -15,6 +15,7 @@ let
APP_NAME = ${cfg.appName}
RUN_USER = ${cfg.user}
RUN_MODE = prod
WORK_PATH = ${cfg.stateDir}
${generators.toINI {} cfg.settings}

View File

@ -355,5 +355,37 @@ in
'';
destination = "/share/dbus-1/system.d/murmur.conf";
})];
security.apparmor.policies."bin.mumble-server".profile = ''
include <tunables/global>
${cfg.package}/bin/{mumble-server,.mumble-server-wrapped} {
include <abstractions/base>
include <abstractions/nameservice>
include <abstractions/ssl_certs>
include "${pkgs.apparmorRulesFromClosure { name = "mumble-server"; } cfg.package}"
pix ${cfg.package}/bin/.mumble-server-wrapped,
r ${config.environment.etc."os-release".source},
r ${config.environment.etc."lsb-release".source},
owner rwk /var/lib/murmur/murmur.sqlite,
owner rw /var/lib/murmur/murmur.sqlite-journal,
owner r /var/lib/murmur/,
r /run/murmur/murmurd.pid,
r /run/murmur/murmurd.ini,
r ${configFile},
'' + optionalString (cfg.logFile != null) ''
rw ${cfg.logFile},
'' + optionalString (cfg.sslCert != "") ''
r ${cfg.sslCert},
'' + optionalString (cfg.sslKey != "") ''
r ${cfg.sslKey},
'' + optionalString (cfg.sslCa != "") ''
r ${cfg.sslCa},
'' + optionalString (cfg.dbus != null) ''
dbus bus=${cfg.dbus}
'' + ''
}
'';
};
}

View File

@ -130,5 +130,17 @@ in
environment = cfg.config;
};
environment.systemPackages = [ cfg.package ];
security.apparmor.policies."bin.miniflux".profile = ''
include <tunables/global>
${cfg.package}/bin/miniflux {
include <abstractions/base>
include <abstractions/nameservice>
include <abstractions/ssl_certs>
include "${pkgs.apparmorRulesFromClosure { name = "miniflux"; } cfg.package}"
r ${cfg.package}/bin/miniflux,
r @{sys}/kernel/mm/transparent_hugepage/hpage_pmd_size,
}
'';
};
}

View File

@ -25,6 +25,7 @@ in
default =
{ ... }:
{
security.apparmor.enable = true;
services.miniflux = {
enable = true;
inherit adminCredentialsFile;
@ -34,6 +35,7 @@ in
withoutSudo =
{ ... }:
{
security.apparmor.enable = true;
services.miniflux = {
enable = true;
inherit adminCredentialsFile;
@ -44,6 +46,7 @@ in
customized =
{ ... }:
{
security.apparmor.enable = true;
services.miniflux = {
enable = true;
config = {
@ -63,6 +66,7 @@ in
default.succeed(
"curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep '\"is_admin\":true'"
)
default.fail('journalctl -b --no-pager --grep "^audit: .*apparmor=\\"DENIED\\""')
withoutSudo.wait_for_unit("miniflux.service")
withoutSudo.wait_for_open_port(${toString defaultPort})
@ -70,6 +74,7 @@ in
withoutSudo.succeed(
"curl 'http://localhost:${toString defaultPort}/v1/me' -u '${defaultUsername}:${defaultPassword}' -H Content-Type:application/json | grep '\"is_admin\":true'"
)
withoutSudo.fail('journalctl -b --no-pager --grep "^audit: .*apparmor=\\"DENIED\\""')
customized.wait_for_unit("miniflux.service")
customized.wait_for_open_port(${toString port})
@ -77,5 +82,6 @@ in
customized.succeed(
"curl 'http://localhost:${toString port}/v1/me' -u '${username}:${password}' -H Content-Type:application/json | grep '\"is_admin\":true'"
)
customized.fail('journalctl -b --no-pager --grep "^audit: .*apparmor=\\"DENIED\\""')
'';
})

View File

@ -20,6 +20,7 @@ in
nodes = {
server = { config, ... }: {
security.apparmor.enable = true;
services.murmur.enable = true;
services.murmur.registerName = "NixOS tests";
services.murmur.password = "$MURMURD_PASSWORD";
@ -81,5 +82,8 @@ in
server.sleep(5) # wait to get screenshot
client1.screenshot("screen1")
client2.screenshot("screen2")
# check if apparmor denied anything
server.fail('journalctl -b --no-pager --grep "^audit: .*apparmor=\\"DENIED\\""')
'';
})

View File

@ -29,23 +29,49 @@ let
ipv6.addresses = [ { address = "fd00:1234:5678:${toString n}::1"; prefixLength = 64; } ];
})));
};
services.dhcpd4 = {
enable = true;
interfaces = map (n: "eth${toString n}") vlanIfs;
extraConfig = flip concatMapStrings vlanIfs (n: ''
subnet 192.168.${toString n}.0 netmask 255.255.255.0 {
option routers 192.168.${toString n}.1;
range 192.168.${toString n}.3 192.168.${toString n}.254;
}
'')
;
machines = flip map vlanIfs (vlan:
{
hostName = "client${toString vlan}";
ethernetAddress = qemu-common.qemuNicMac vlan 1;
ipAddress = "192.168.${toString vlan}.2";
}
);
services.kea = {
dhcp4 = {
enable = true;
settings = {
interfaces-config = {
interfaces = map (n: "eth${toString n}") vlanIfs;
dhcp-socket-type = "raw";
service-sockets-require-all = true;
service-sockets-max-retries = 5;
service-sockets-retry-wait-time = 2500;
};
subnet4 = map (n: {
id = n;
subnet = "192.168.${toString n}.0/24";
pools = [{ pool = "192.168.${toString n}.3 - 192.168.${toString n}.254"; }];
option-data = [{ name = "routers"; data = "192.168.${toString n}.1"; }];
reservations = [{
hw-address = qemu-common.qemuNicMac n 1;
hostname = "client${toString n}";
ip-address = "192.168.${toString n}.2";
}];
}) vlanIfs;
};
};
dhcp6 = {
enable = true;
settings = {
interfaces-config = {
interfaces = map (n: "eth${toString n}") vlanIfs;
service-sockets-require-all = true;
service-sockets-max-retries = 5;
service-sockets-retry-wait-time = 2500;
};
subnet6 = map (n: {
id = n;
subnet = "fd00:1234:5678:${toString n}::/64";
interface = "eth${toString n}";
pools = [{ pool = "fd00:1234:5678:${toString n}::2-fd00:1234:5678:${toString n}::2"; }];
}) vlanIfs;
};
};
};
services.radvd = {
enable = true;
@ -61,17 +87,6 @@ let
};
'');
};
services.dhcpd6 = {
enable = true;
interfaces = map (n: "eth${toString n}") vlanIfs;
extraConfig = ''
authoritative;
'' + flip concatMapStrings vlanIfs (n: ''
subnet6 fd00:1234:5678:${toString n}::/64 {
range6 fd00:1234:5678:${toString n}::2 fd00:1234:5678:${toString n}::2;
}
'');
};
};
testCases = {
@ -117,8 +132,9 @@ let
client.wait_for_unit("network.target")
router.wait_for_unit("network-online.target")
with subtest("Make sure dhcpcd is not started"):
client.fail("systemctl status dhcpcd.service")
with subtest("Make sure DHCP server is not started"):
client.fail("systemctl status kea-dhcp4-server.service")
client.fail("systemctl status kea-dhcp6-server.service")
with subtest("Test vlan 1"):
client.wait_until_succeeds("ping -c 1 192.168.1.1")
@ -1035,7 +1051,7 @@ let
testScript = ''
machine.succeed("udevadm settle")
print(machine.succeed("ip link show dev enCustom"))
machine.wait_until_succeeds("ip link show dev enCustom | grep -q '52:54:00:12:0b:01")
machine.wait_until_succeeds("ip link show dev enCustom | grep -q 52:54:00:12:0b:01")
'';
};
};

View File

@ -107,5 +107,6 @@ mkDerivation rec {
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ ];
platforms = [ "x86_64-linux" ];
mainProgram = "cadence";
};
}

View File

@ -28,5 +28,6 @@ stdenv.mkDerivation rec {
license = licenses.mit;
maintainers = with maintainers; [ offline mirrexagon ];
platforms = platforms.linux;
mainProgram = "cava";
};
}

View File

@ -1,5 +1,5 @@
{ lib, stdenv, fetchurl, pkg-config
, libjack2, gettext, intltool, guile_2_0, lilypond
, libjack2, gettext, intltool, guile_2_2, lilypond
, glib, libxml2, librsvg, libsndfile, aubio
, gtk3, gtksourceview, evince, fluidsynth, rubberband
, portaudio, portmidi, fftw, wrapGAppsHook }:
@ -14,7 +14,7 @@ stdenv.mkDerivation rec {
};
buildInputs = [
libjack2 guile_2_0 lilypond glib libxml2 librsvg libsndfile
libjack2 guile_2_2 lilypond glib libxml2 librsvg libsndfile
aubio gtk3 gtksourceview evince fluidsynth rubberband portaudio fftw portmidi
];

View File

@ -107,5 +107,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl3Plus;
maintainers = with maintainers; [ ];
platforms = platforms.linux;
mainProgram = "easyeffects";
};
}

View File

@ -58,5 +58,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl3Only;
maintainers = with maintainers; [ fufexan ];
platforms = platforms.linux;
mainProgram = "helvum";
};
}

View File

@ -106,5 +106,6 @@ python3.pkgs.buildPythonApplication rec {
license = licenses.gpl3Plus;
maintainers = with maintainers; [ lovesegfault ];
platforms = platforms.linux;
mainProgram = "lollypop";
};
}

View File

@ -58,5 +58,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl2Plus;
maintainers = with maintainers; [ AndersonTorres ];
platforms = with platforms; unix;
mainProgram = "mpc";
};
}

View File

@ -51,5 +51,6 @@ python3Packages.buildPythonApplication rec {
license = licenses.gpl3Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ apfelkuchen6 ];
mainProgram = "mpdevil";
};
}

View File

@ -48,5 +48,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl2Plus;
maintainers = with maintainers; [ jfrankenau koral lovek323 ];
platforms = platforms.all;
mainProgram = "ncmpcpp";
};
}

File diff suppressed because it is too large Load Diff

View File

@ -23,22 +23,26 @@
stdenv.mkDerivation rec {
pname = "netease-cloud-music-gtk";
version = "2.0.3";
version = "2.2.0";
src = fetchFromGitHub {
owner = "gmg137";
repo = pname;
rev = version;
hash = "sha256-A3mvf6TZ3+aiWA6rg9G5NMaDKvO0VQzwIM1t0MaTpTc=";
hash = "sha256-9qUzRmm3WQEVjzhzHMT1vNw3r3ymWGlBWXnnPsYGSnk=";
};
cargoDeps = rustPlatform.importCargoLock {
lockFile = ./Cargo.lock;
outputHashes = {
"netease-cloud-music-api-1.0.2" = "sha256-7Yp2ZBg5wHnDPtdPLwZQnqcSlVuGCrXpV5M/dp/IaOE=";
"netease-cloud-music-api-1.2.0" = "sha256-MR1yVPrNzhZC65mQen88t7NbLfRcoWvT6DMSLGCMeTY=";
};
};
postPatch = ''
cp ${./Cargo.lock} Cargo.lock
'';
nativeBuildInputs = [
meson
ninja
@ -75,5 +79,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl3Plus;
maintainers = with maintainers; [ diffumist ];
mainProgram = "netease-cloud-music-gtk4";
platforms = platforms.linux;
};
}

View File

@ -51,5 +51,6 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ abbradar globin ];
platforms = platforms.linux;
mainProgram = "pavucontrol";
};
}

View File

@ -2,12 +2,12 @@
let
pname = "plexamp";
version = "4.8.1";
version = "4.8.2";
src = fetchurl {
url = "https://plexamp.plex.tv/plexamp.plex.tv/desktop/Plexamp-${version}.AppImage";
name="${pname}-${version}.AppImage";
sha512 = "iPCiBbb6alQspEPccxn1XHik0GbksZoe5jb0u8VuUdybO+xVb6sIxTNi6sxTG32uSRH6o16EHNUhLKeb6OcEtA==";
sha512 = "7NQmH42yzItReQ5WPdcbNPr/xed74H4UyDNlX5PGmoJRBpV1RdeuW1KRweIWfYNhw0KeqULVTjr/aCggoWp4WA==";
};
appimageContents = appimageTools.extractType2 {
@ -33,7 +33,7 @@ in appimageTools.wrapType2 {
meta = with lib; {
description = "A beautiful Plex music player for audiophiles, curators, and hipsters";
homepage = "https://plexamp.com/";
changelog = "https://forums.plex.tv/t/plexamp-release-notes/221280/51";
changelog = "https://forums.plex.tv/t/plexamp-release-notes/221280/52";
license = licenses.unfree;
maintainers = with maintainers; [ killercup synthetica ];
platforms = [ "x86_64-linux" ];

View File

@ -5,14 +5,14 @@
mkDerivation rec {
pname = "qpwgraph";
version = "0.4.5";
version = "0.5.1";
src = fetchFromGitLab {
domain = "gitlab.freedesktop.org";
owner = "rncbc";
repo = "qpwgraph";
rev = "v${version}";
sha256 = "sha256-VMTVaJJHMgx5mJT4ZRL5CDOJp7UPOkZOjqulCFSd7xo=";
sha256 = "sha256-HVeuqgqYf/gO1KdteXV4dWd13Q58GqHUz8CAYpruc18=";
};
nativeBuildInputs = [ cmake pkg-config ];
@ -29,6 +29,6 @@ mkDerivation rec {
homepage = "https://gitlab.freedesktop.org/rncbc/qpwgraph";
license = licenses.gpl2Plus;
platforms = platforms.linux;
maintainers = with maintainers; [ kanashimia exi ];
maintainers = with maintainers; [ kanashimia exi Scrumplex ];
};
}

View File

@ -15,6 +15,7 @@ let
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
license = licenses.unfree;
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ];
mainProgram = "spotify";
};
in if stdenv.isDarwin

View File

@ -116,5 +116,6 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ peterhoeg ];
# upstream says darwin should work but they lack maintainers as of 0.6.6
platforms = platforms.linux;
mainProgram = "strawberry";
};
}

View File

@ -50,5 +50,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl2;
maintainers = [ maintainers.matthiasbeyer ];
platforms = platforms.linux;
mainProgram = "tageditor";
};
}

View File

@ -95,6 +95,6 @@ in python3.pkgs.buildPythonApplication rec {
description = "A CD ripper aiming for accuracy over speed";
maintainers = with maintainers; [ emily ];
license = licenses.gpl3Plus;
platforms = platforms.linux;
platforms = platforms.unix;
};
}

View File

@ -34,5 +34,6 @@ appimageTools.wrapType2 rec {
sourceProvenance = with sourceTypes; [ binaryNativeCode ];
platforms = platforms.linux;
maintainers = [ maintainers.aacebedo ];
mainProgram = "youtube-music";
};
}

View File

@ -32,5 +32,6 @@ in appimageTools.wrapType2 rec {
license = licenses.cc0;
platforms = platforms.linux;
maintainers = [ maintainers.lgcl ];
mainProgram = "ytmdesktop";
};
}

View File

@ -32,6 +32,7 @@ let
matthewbauer
];
platforms = lib.platforms.all;
mainProgram = "emacs";
};
in
{

View File

@ -64,5 +64,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl2;
maintainers = with maintainers; [ frlan ];
platforms = platforms.all;
mainProgram = "geany";
};
}

View File

@ -96,5 +96,6 @@ stdenv.mkDerivation rec {
maintainers = [ ];
license = licenses.gpl2Plus;
platforms = platforms.unix;
mainProgram = "gedit";
};
}

View File

@ -41,5 +41,6 @@ buildGoModule rec {
description = "Modern and intuitive terminal-based text editor";
license = licenses.mit;
maintainers = with maintainers; [ dtzWill ];
mainProgram = "micro";
};
}

View File

@ -75,5 +75,6 @@ in stdenv.mkDerivation rec {
license = licenses.gpl3Plus;
maintainers = with maintainers; [ joachifm nequissimus ];
platforms = platforms.all;
mainProgram = "nano";
};
}

View File

@ -1,30 +1,22 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, ncurses
, perl
}:
stdenv.mkDerivation rec {
pname = "openvi";
version = "7.3.22";
version = "7.4.23";
src = fetchFromGitHub {
owner = "johnsonjh";
repo = "OpenVi";
rev = version;
hash = "sha256-yXYiH2FCT7ffRPmb28V54+KO1RLs8L9KHk3remkMWmA=";
hash = "sha256-DwecSnByRkjBFqy3gWJ0+1srF2YsNACqKrAITn6wXJw=";
};
patches = [
# do not attempt to install to /var/tmp/vi.recover
(fetchpatch {
url = "https://github.com/johnsonjh/OpenVi/commit/5205f0234369963c443e83ca5028ca63feaaac91.patch";
hash = "sha256-hoKzQLnpdRbc48wffWbzFtivr20VqEPs4WRPXuDa/88=";
})
];
buildInputs = [ ncurses ];
buildInputs = [ ncurses perl ];
makeFlags = [
"PREFIX=$(out)"

View File

@ -27,5 +27,6 @@ rec {
license = licenses.vim;
maintainers = with maintainers; [ das_j equirosa ];
platforms = platforms.unix;
mainProgram = "vim";
};
}

View File

@ -9376,6 +9376,18 @@ final: prev:
meta.homepage = "https://github.com/nvim-telescope/telescope-project.nvim/";
};
telescope-sg = buildVimPluginFrom2Nix {
pname = "telescope-sg";
version = "2023-08-02";
src = fetchFromGitHub {
owner = "Marskey";
repo = "telescope-sg";
rev = "df40e78ed1c1ba3cb3591a799c8e4292c88e1ff0";
sha256 = "0mqqh15jl7y4i1ycb5lpw9fvad4qm03vw5x7paxw8h2yzi39qp0p";
};
meta.homepage = "https://github.com/Marskey/telescope-sg/";
};
telescope-symbols-nvim = buildVimPluginFrom2Nix {
pname = "telescope-symbols.nvim";
version = "2023-02-19";

View File

@ -787,6 +787,7 @@ https://github.com/gbrlsnchs/telescope-lsp-handlers.nvim/,,
https://github.com/MrcJkb/telescope-manix/,HEAD,
https://github.com/nvim-telescope/telescope-media-files.nvim/,HEAD,
https://github.com/nvim-telescope/telescope-project.nvim/,,
https://github.com/Marskey/telescope-sg/,HEAD,
https://github.com/nvim-telescope/telescope-symbols.nvim/,,
https://github.com/nvim-telescope/telescope-ui-select.nvim/,,
https://github.com/fhill2/telescope-ultisnips.nvim/,,

View File

@ -128,5 +128,6 @@ stdenv.mkDerivation rec {
license = licenses.mpl20;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ zhaofengli baduhai ];
mainProgram = "cemu";
};
}

View File

@ -1,6 +1,7 @@
{ lib
, stdenv
, fetchFromGitHub
, fetchpatch
, callPackage
, patchelf
, unzip
@ -15,18 +16,18 @@
}:
let
version = "2.7.4";
version = "2.7.5";
craftos2-lua = fetchFromGitHub {
owner = "MCJack123";
repo = "craftos2-lua";
rev = "v${version}";
sha256 = "sha256-JMBsSoO/yTLw7K1Ri3BzKr5bz5UirXiPr/Q0YoMumhY=";
hash = "sha256-JMBsSoO/yTLw7K1Ri3BzKr5bz5UirXiPr/Q0YoMumhY=";
};
craftos2-rom = fetchFromGitHub {
owner = "McJack123";
repo = "craftos2-rom";
rev = "v${version}";
sha256 = "sha256-BXTsBMlsymQHABWQCiv22Ia5jm2xv1jNy7Unwymtyp0=";
rev = "v${version}.1"; # Author released a hotfix; remove trailing '.1' on next update
hash = "sha256-WZs/KIdpqLLzvpH2hiJpe/AehluoQMtewBbAb4htz8k=";
};
in
@ -38,7 +39,7 @@ stdenv.mkDerivation rec {
owner = "MCJack123";
repo = "craftos2";
rev = "v${version}";
sha256 = "sha256-9XMc7zmtPxlt3WgS93lUJNMFtUJ/llG9SFGtgdFqZEA=";
hash = "sha256-t2yhSuNPFCF2NaQFWuN9Nos5ZPinAvecV6EZNO0Cy9I=";
};
buildInputs = [ patchelf poco openssl SDL2 SDL2_mixer ncurses libpng pngpp libwebp ];

View File

@ -77,5 +77,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl2Plus;
maintainers = with maintainers; [ matthewbauer ];
platforms = platforms.unix;
mainProgram = "dosbox";
};
}

View File

@ -37,5 +37,6 @@ stdenv.mkDerivation {
maintainers = [ lib.maintainers.edwtjo ];
license = lib.licenses.mit;
platforms = lib.platforms.linux;
mainProgram = "emulationstation";
};
}

View File

@ -196,5 +196,6 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ thiagokokada ];
platforms = platforms.unix;
broken = stdenv.isDarwin;
mainProgram = "mame";
};
}

View File

@ -49,5 +49,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl3Plus;
maintainers = with maintainers; [ artemist benley shamilton xfix ];
platforms = platforms.linux;
mainProgram = "melonDS";
};
}

View File

@ -81,5 +81,6 @@ stdenv.mkDerivation (finalAttrs: {
license = licenses.mpl20;
maintainers = with maintainers; [ MP2E AndersonTorres ];
platforms = platforms.linux;
mainProgram = "mgba";
};
})

View File

@ -38,5 +38,6 @@ stdenv.mkDerivation rec {
homepage = "http://www.mupen64plus.org/";
maintainers = [ maintainers.sander ];
platforms = [ "x86_64-linux" ];
mainProgram = "mupen64plus";
};
}

View File

@ -67,6 +67,7 @@ stdenv.mkDerivation rec {
license = lib.licenses.gpl2;
platforms = lib.platforms.linux;
maintainers = with lib.maintainers; [ MP2E ];
mainProgram = "nestopia";
};
}

View File

@ -92,5 +92,6 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ rardiol ];
license = licenses.gpl2Plus;
platforms = platforms.all;
mainProgram = "pcsxr";
};
}

View File

@ -101,5 +101,6 @@ stdenv.mkDerivation {
maintainers = with maintainers; [ abbradar neonfuz ilian zane ];
license = licenses.gpl2Only;
platforms = [ "x86_64-linux" "aarch64-linux" ];
mainProgram = "rpcs3";
};
}

View File

@ -123,5 +123,6 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ qknight xfix thiagokokada ];
platforms = platforms.unix;
broken = (withGtk && stdenv.isDarwin);
mainProgram = "snes9x";
};
}

View File

@ -133,5 +133,6 @@ stdenv.mkDerivation (finalAttrs: {
license = lib.licenses.gpl2Plus;
maintainers = with lib.maintainers; [ AndersonTorres genericnerdyusername ];
platforms = lib.platforms.linux;
mainProgram = "xemu";
};
})

View File

@ -43,5 +43,6 @@ mkDerivation rec {
description = "Norton/Total Commander clone for KDE";
license = licenses.gpl2Only;
maintainers = with maintainers; [ sander turion ];
mainProgram = "krusader";
};
}

View File

@ -93,5 +93,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl2Plus;
maintainers = with maintainers; [ sander ];
platforms = with platforms; linux ++ darwin;
mainProgram = "mc";
};
}

View File

@ -78,5 +78,6 @@ stdenv.mkDerivation (finalAttrs: {
license = licenses.bsd2;
platforms = platforms.all;
maintainers = with maintainers; [ jfrankenau Br1ght0ne ];
mainProgram = "nnn";
};
})

View File

@ -39,5 +39,6 @@ stdenv.mkDerivation rec {
description = "File manager with GTK interface";
maintainers = [ maintainers.ttuegel ];
platforms = platforms.linux;
mainProgram = "pcmanfm";
};
}

View File

@ -55,5 +55,6 @@ python3Packages.buildPythonApplication rec {
license = licenses.gpl3Only;
platforms = platforms.unix;
maintainers = with maintainers; [ toonn magnetophon ];
mainProgram = "ranger";
};
}

View File

@ -151,5 +151,6 @@ mkDerivation rec {
license = licenses.gpl2;
homepage = "https://www.digikam.org";
platforms = platforms.linux;
mainProgram = "digikam";
};
}

View File

@ -42,5 +42,6 @@ stdenv.mkDerivation rec {
license = licenses.mit-feh;
maintainers = with maintainers; [ viric willibutz globin ma27 ];
platforms = platforms.unix;
mainProgram = "feh";
};
}

View File

@ -159,6 +159,7 @@ stdenv.mkDerivation rec {
license = licenses.gpl3Plus;
maintainers = [ maintainers.jtojnar ];
platforms = platforms.all;
mainProgram = "inkscape";
longDescription = ''
Inkscape is a feature-rich vector graphics editor that edits
files in the W3C SVG (Scalable Vector Graphics) file format.

View File

@ -61,6 +61,7 @@ let
license = licenses.unfree;
maintainers = with maintainers; [ timstott savannidgerinel maxeaubrey sebtm ];
platforms = builtins.attrNames sources.${channel};
mainProgram = "1password";
};
in if stdenv.isDarwin

View File

@ -63,5 +63,6 @@ stdenv.mkDerivation rec {
license = licenses.unfree;
maintainers = with maintainers; [ iammrinal0 ];
platforms = [ "x86_64-linux" ];
mainProgram = "authy";
};
}

View File

@ -49,5 +49,6 @@ mkDerivation rec {
license = lib.licenses.gpl2;
maintainers = [ lib.maintainers.phryneas ];
platforms = lib.platforms.linux;
mainProgram = "barrier";
};
}

View File

@ -65,5 +65,6 @@ python3Packages.buildPythonApplication rec {
longDescription = "BleachBit helps you easily clean your computer to free space and maintain privacy.";
license = licenses.gpl3;
maintainers = with maintainers; [ leonardoce mbprtpmnr ];
mainProgram = "bleachbit";
};
}

View File

@ -196,5 +196,6 @@ stdenv.mkDerivation rec {
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" ];
broken = stdenv.isDarwin;
maintainers = with maintainers; [ goibhniu veprbl ];
mainProgram = "blender";
};
}

View File

@ -109,5 +109,6 @@ python3Packages.buildPythonApplication rec {
license = licenses.gpl3Only;
maintainers = with maintainers; [ psydvl shamilton ];
platforms = platforms.linux;
mainProgram = "bottles";
};
}

View File

@ -135,5 +135,6 @@ mavenJdk17.buildMavenPackage rec {
license = licenses.asl20;
platforms = [ "x86_64-linux" "x86_64-darwin" "aarch64-linux" "aarch64-darwin" ];
maintainers = with maintainers; [ jojosch mkg20001 ];
mainProgram = "dbeaver";
};
}

View File

@ -30,5 +30,6 @@ stdenv.mkDerivation rec {
license = licenses.mit;
maintainers = with maintainers; [ pSub globin ];
platforms = platforms.all;
mainProgram = "dmenu";
};
}

View File

@ -57,5 +57,6 @@ stdenv.mkDerivation rec {
# NOTE: 'unix' or even 'all' COULD work too, I'm not sure
platforms = platforms.linux;
maintainers = with maintainers; [ domenkozar ];
mainProgram = "dunst";
};
}

View File

@ -63,5 +63,6 @@ python3Packages.buildPythonApplication rec {
license = licenses.bsd3;
platforms = platforms.unix;
maintainers = [ maintainers.novoxd ];
mainProgram = "dupeguru";
};
}

View File

@ -2,12 +2,12 @@
stdenvNoCC.mkDerivation rec {
pname = "fluidd";
version = "1.24.1";
version = "1.24.2";
src = fetchurl {
name = "fluidd-v${version}.zip";
url = "https://github.com/cadriel/fluidd/releases/download/v${version}/fluidd.zip";
sha256 = "sha256-iTh8vU6NrJZLyUdeY1wegUue0NIHQtpCEr9pJnC2Wx4=";
sha256 = "sha256-w0IqcvVbeYG9Ly8QzJIxgWIMeYQBf4Ogwi+eRLfD8kk=";
};
nativeBuildInputs = [ unzip ];

View File

@ -36,5 +36,6 @@ stdenv.mkDerivation rec {
license = licenses.mit;
platforms = platforms.unix;
maintainers = [ maintainers.erictapen ];
mainProgram = "fontpreview";
};
}

View File

@ -117,5 +117,6 @@ in buildDotnetPackage rec {
maintainers = with lib.maintainers; [ amorsillo obadz ];
platforms = with lib.platforms; all;
license = lib.licenses.gpl2;
mainProgram = "keepass";
};
}

View File

@ -147,5 +147,6 @@ buildPythonApplication rec {
license = licenses.gpl3Plus;
maintainers = with maintainers; [ Madouura ];
platforms = platforms.linux;
mainProgram = "lutris";
};
}

View File

@ -32,5 +32,6 @@ stdenv.mkDerivation rec {
license = licenses.bsd2;
platforms = platforms.unix;
maintainers = [ maintainers.devhell ];
mainProgram = "mediainfo-gui";
};
}

View File

@ -28,5 +28,6 @@ stdenv.mkDerivation rec {
license = licenses.bsd2;
platforms = platforms.unix;
maintainers = [ maintainers.devhell ];
mainProgram = "mediainfo";
};
}

View File

@ -152,5 +152,6 @@ stdenv.mkDerivation rec {
license = licenses.agpl3Plus;
maintainers = with maintainers; [ vrthra fpletz ];
platforms = platforms.unix;
mainProgram = "mupdf";
};
}

View File

@ -0,0 +1,26 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 273968c..236e5fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,10 +3,6 @@ project(mya)
set(CMAKE_C_STANDARD 11 )
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -Wall")
-if(UNIX)
- set(LINUX TRUE)
-endif()
-
set(SRC_DIR src)
set(INC_DIR include)
@@ -17,7 +13,8 @@ set_target_properties(mya PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DI
target_include_directories(mya PRIVATE ${INC_DIR})
set(LIBS curl json-c bsd)
-if(LINUX)
- list(APPEND LIBS)
+find_library(ARGP argp)
+if(ARGP)
+ list(APPEND LIBS argp)
endif()
target_link_libraries(mya ${LIBS})

View File

@ -0,0 +1,67 @@
{ lib
, stdenv
, fetchFromGitHub
, cmake
, ninja
, curl
, json_c
, libbsd
, argp-standalone
}:
stdenv.mkDerivation (finalAttrs: {
pname = "mya";
version = "1.0.0";
src = fetchFromGitHub {
owner = "jmakhack";
repo = "myanimelist-cli";
rev = "refs/tags/v${finalAttrs.version}";
hash = "sha256-EmdkPpYEUIk9hr6rbnixjvznKSEnTCSMZz/17BfHGCk=";
};
nativeBuildInputs = [
cmake
ninja
];
buildInputs = [
curl
json_c
libbsd
] ++ lib.optionals (!stdenv.hostPlatform.isGnu) [
argp-standalone
];
patches = [
./argp.patch
];
installPhase = ''
runHook preInstall
# Based on the upstream PKGBUILD
mkdir -p $out/share/doc/${finalAttrs.pname}
cp -a bin $out
cp $cmakeDir/README.md $out/share/doc/${finalAttrs.pname}
runHook postInstall
'';
meta = with lib; {
description = "Minimalistic command line interface for fetching user anime data from MyAnimeList";
longDescription = ''
Minimalistic command line interface for fetching user anime data from MyAnimeList.
You have to run this with the MYANIMELIST_CLIENT_ID environ variable set.
Where to get one: <https://myanimelist.net/apiconfig>.
Select the type `other`.
'';
homepage = "https://github.com/jmakhack/myanimelist-cli";
changelog = "https://github.com/jmakhack/myanimelist-cli/releases/tag/v${finalAttrs.version}";
license = licenses.mit;
maintainers = with maintainers; [ pbsds ];
mainProgram = "mya";
platforms = platforms.all;
};
})

View File

@ -196,5 +196,6 @@ in stdenv.mkDerivation rec {
license = licenses.gpl2;
maintainers = [ ];
platforms = platforms.linux;
mainProgram = "mysql-workbench";
};
}

View File

@ -55,5 +55,6 @@ python310Packages.buildPythonApplication rec {
license = lib.licenses.mit;
platforms = lib.platforms.linux;
maintainers = [ ];
mainProgram = "nwg-displays";
};
}

View File

@ -54,5 +54,6 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ jonringer ];
license = licenses.gpl2Plus;
platforms = platforms.linux;
mainProgram = "openrgb";
};
}

View File

@ -53,5 +53,6 @@ mkDerivation {
license = licenses.gpl2Plus;
maintainers = with maintainers; [ ];
platforms = platforms.linux;
mainProgram = "qdirstat";
};
}

View File

@ -31,5 +31,6 @@ buildPythonApplication rec {
license = licenses.mit;
maintainers = with maintainers; [ equirosa dit7ya ];
platforms = platforms.linux;
mainProgram = "rofi-rbw";
};
}

View File

@ -67,5 +67,6 @@ stdenv.mkDerivation rec {
license = licenses.mit;
maintainers = with maintainers; [ bew ];
platforms = with platforms; linux;
mainProgram = "rofi";
};
}

View File

@ -7,6 +7,8 @@
, libnotify
, wlrctl
, gtk3
, safeeyes
, testers
, xprintidle
, xprop
, wrapGAppsHook
@ -16,11 +18,11 @@ with python3.pkgs;
buildPythonApplication rec {
pname = "safeeyes";
version = "2.1.5";
version = "2.1.6";
src = fetchPypi {
inherit pname version;
sha256 = "sha256-IjFDhkqtMitdcQORerRqwty3ZMP8jamPtb9oMHdre4I=";
hash = "sha256-tvsBTf6+zKBzB5aL+LUcEvE4jmVHnnoY0L4xoKMJ0vM=";
};
nativeBuildInputs = [
@ -49,7 +51,7 @@ buildPythonApplication rec {
postInstall = ''
mkdir -p $out/share/applications
cp -r safeeyes/platform/icons $out/share/icons/
cp safeeyes/platform/safeeyes.desktop $out/share/applications/safeeyes.desktop
cp safeeyes/platform/io.github.slgobinath.SafeEyes.desktop $out/share/applications/io.github.slgobinath.SafeEyes.desktop
'';
preFixup = ''
@ -61,6 +63,8 @@ buildPythonApplication rec {
doCheck = false; # no tests
passthru.tests.version = testers.testVersion { package = safeeyes; };
meta = with lib; {
homepage = "http://slgobinath.github.io/SafeEyes";
description = "Protect your eyes from eye strain using this simple and beautiful, yet extensible break reminder. A Free and Open Source Linux alternative to EyeLeo";

View File

@ -38,5 +38,6 @@ buildGoModule rec {
homepage = "https://github.com/spicetify/spicetify-cli/";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ jonringer mdarocha ];
mainProgram = "spicetify-cli";
};
}

View File

@ -142,5 +142,6 @@ stdenv.mkDerivation rec {
maintainers = with maintainers; [ FlorianFranzen minijackson synthetica lovesegfault rodrgz ];
platforms = platforms.unix;
homepage = "https://github.com/alexays/waybar";
mainProgram = "waybar";
};
}

View File

@ -39,5 +39,6 @@ stdenv.mkDerivation rec {
license = licenses.gpl3Only;
maintainers = with maintainers; [ ];
platforms = with platforms; linux;
mainProgram = "wofi";
};
}

View File

@ -25,5 +25,6 @@ rustPlatform.buildRustPackage rec {
homepage = "https://github.com/bjesus/wttrbar";
license = lib.licenses.mit;
maintainers = with lib.maintainers; [ khaneliman ];
mainProgram = "wttrbar";
};
}

View File

@ -1,41 +1,12 @@
{ appimageTools
, lib
, fetchurl
, texlive
, pandoc
}:
{ callPackage, texlive }:
# Based on https://gist.github.com/msteen/96cb7df66a359b827497c5269ccbbf94 and joplin-desktop nixpkgs.
let
pname = "zettlr";
version = "2.3.0";
name = "${pname}-${version}";
src = fetchurl {
url = "https://github.com/Zettlr/Zettlr/releases/download/v${version}/Zettlr-${version}-x86_64.appimage";
sha256 = "sha256-3p9RO6hpioYF6kdGV+/9guoqxaPCJG73OsrN69SHQHk=";
builtins.mapAttrs (pname: attrs: callPackage ./generic.nix (attrs // { inherit pname; inherit texlive; })) {
zettlr = {
version = "2.3.0";
hash = "sha256-3p9RO6hpioYF6kdGV+/9guoqxaPCJG73OsrN69SHQHk=";
};
appimageContents = appimageTools.extractType2 {
inherit name src;
};
in
appimageTools.wrapType2 rec {
inherit name src;
multiArch = false; # no 32bit needed
extraPkgs = pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs) ++ [ texlive pandoc ];
extraInstallCommands = ''
mv $out/bin/{${name},${pname}}
install -m 444 -D ${appimageContents}/Zettlr.desktop $out/share/applications/Zettlr.desktop
install -m 444 -D ${appimageContents}/Zettlr.png $out/share/icons/hicolor/512x512/apps/Zettlr.png
substituteInPlace $out/share/applications/Zettlr.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
'';
meta = with lib; {
description = "A markdown editor for writing academic texts and taking notes";
homepage = "https://www.zettlr.com";
platforms = [ "x86_64-linux" ];
license = licenses.gpl3;
maintainers = with maintainers; [ tfmoraes ];
zettlr-beta = {
version = "3.0.0-beta.7";
hash = "sha256-zIZaINE27bcjbs8yCGQ3UKAwStFdvhHD3Q1F93LrG4U=";
};
}

View File

@ -0,0 +1,42 @@
{ pname
, version
, hash
, appimageTools
, lib
, fetchurl
, texlive
, pandoc
}:
# Based on https://gist.github.com/msteen/96cb7df66a359b827497c5269ccbbf94 and joplin-desktop nixpkgs.
let
name = "${pname}-${version}";
src = fetchurl {
url = "https://github.com/Zettlr/Zettlr/releases/download/v${version}/Zettlr-${version}-x86_64.appimage";
inherit hash;
};
appimageContents = appimageTools.extractType2 {
inherit name src;
};
in
appimageTools.wrapType2 rec {
inherit name src;
multiArch = false; # no 32bit needed
extraPkgs = pkgs: (appimageTools.defaultFhsEnvArgs.multiPkgs pkgs) ++ [ texlive pandoc ];
extraInstallCommands = ''
mv $out/bin/{${name},${pname}}
install -m 444 -D ${appimageContents}/Zettlr.desktop $out/share/applications/Zettlr.desktop
install -m 444 -D ${appimageContents}/Zettlr.png $out/share/icons/hicolor/512x512/apps/Zettlr.png
substituteInPlace $out/share/applications/Zettlr.desktop \
--replace 'Exec=AppRun' 'Exec=${pname}'
'';
meta = with lib; {
description = "A markdown editor for writing academic texts and taking notes";
homepage = "https://www.zettlr.com";
platforms = [ "x86_64-linux" ];
license = licenses.gpl3;
maintainers = with maintainers; [ tfmoraes ];
};
}

View File

@ -91,11 +91,11 @@ in
stdenv.mkDerivation rec {
pname = "brave";
version = "1.56.9";
version = "1.56.20";
src = fetchurl {
url = "https://github.com/brave/brave-browser/releases/download/v${version}/brave-browser_${version}_amd64.deb";
sha256 = "sha256-cw41xUewYB/M6xHZhhL9nX1J9vnNGA9TFJWI/Qwdu/k=";
sha256 = "sha256-ub44AI0Fu3V8SRhiBrQueJZaSdl4/cI6DQ3QYJfGseo=";
};
dontConfigure = true;

View File

@ -6,7 +6,7 @@
mkChromiumDerivation (base: rec {
name = "chromium-browser";
packageName = "chromium";
buildTargets = [ "mksnapshot" "chrome_sandbox" "chrome" ];
buildTargets = [ "run_mksnapshot_default" "chrome_sandbox" "chrome" ];
outputs = ["out" "sandbox"];

View File

@ -1,4 +1,7 @@
{ stdenv, lib, fetchurl, fetchpatch
, buildPackages
, pkgsBuildBuild
, pkgsBuildTarget
# Channel data:
, channel, upstream-info
# Helper functions:
@ -8,8 +11,10 @@
, ninja, pkg-config
, python3, perl
, which
, llvmPackages
, llvmPackages_attrName
, rustc
, libuuid
, overrideCC
# postPatch:
, pkgsBuildHost
# configurePhase:
@ -116,6 +121,33 @@ let
inherit (upstream-info.deps.ungoogled-patches) rev sha256;
};
# There currently isn't a (much) more concise way to get a stdenv
# that uses lld as its linker without bootstrapping pkgsLLVM; see
# https://github.com/NixOS/nixpkgs/issues/142901
buildPlatformLlvmStdenv =
let
llvmPackages = pkgsBuildBuild.${llvmPackages_attrName};
in
overrideCC llvmPackages.stdenv
(llvmPackages.stdenv.cc.override {
inherit (llvmPackages) bintools;
});
chromiumRosettaStone = {
cpu = platform:
let name = platform.parsed.cpu.name;
in ({ "x86_64" = "x64";
"i686" = "x86";
"arm" = "arm";
"aarch64" = "arm64";
}.${platform.parsed.cpu.name}
or (throw "no chromium Rosetta Stone entry for cpu: ${name}"));
os = platform:
if platform.isLinux
then "linux"
else throw "no chromium Rosetta Stone entry for os: ${platform.config}";
};
base = rec {
pname = "${packageName}-unwrapped";
inherit (upstream-info) version;
@ -130,16 +162,35 @@ let
ninja pkg-config
python3WithPackages perl
which
llvmPackages.bintools
buildPackages.${llvmPackages_attrName}.bintools
bison gperf
];
depsBuildBuild = [
buildPlatformLlvmStdenv
buildPlatformLlvmStdenv.cc
pkg-config
libuuid
libpng # needed for "host/generate_colors_info"
]
# When cross-compiling, chromium builds a huge proportion of its
# components for both the `buildPlatform` (which it calls
# `host`) as well as for the `hostPlatform` -- easily more than
# half of the dependencies are needed here. To avoid having to
# maintain a separate list of buildPlatform-dependencies, we
# simply throw in the kitchen sink.
++ buildInputs
;
buildInputs = [
(libpng.override { apngSupport = false; }) # https://bugs.chromium.org/p/chromium/issues/detail?id=752403
bzip2 flac speex opusWithCustomModes
libevent expat libjpeg snappy
libcap
xdg-utils minizip libwebp
] ++ lib.optionals (!xdg-utils.meta.broken) [
xdg-utils
] ++ [
minizip libwebp
libusb1 re2
ffmpeg libxslt libxml2
nasm
@ -162,6 +213,7 @@ let
++ lib.optional pulseSupport libpulseaudio;
patches = [
./cross-compile.patch
# Optional patch to use SOURCE_DATE_EPOCH in compute_build_timestamp.py (should be upstreamed):
./patches/no-build-timestamps.patch
# For bundling Widevine (DRM), might be replaceable via bundle_widevine_cdm=true in gnFlags:
@ -225,6 +277,7 @@ let
'/usr/share/locale/' \
'${glibc}/share/locale/'
'' + lib.optionalString (!xdg-utils.meta.broken) ''
sed -i -e 's@"\(#!\)\?.*xdg-@"\1${xdg-utils}/bin/xdg-@' \
chrome/browser/shell_integration_linux.cc
@ -268,9 +321,27 @@ let
# weaken or disable security measures like sandboxing or ASLR):
is_official_build = true;
disable_fieldtrial_testing_config = true;
# note: chromium calls buildPlatform "host" and calls hostPlatform "target"
host_cpu = chromiumRosettaStone.cpu stdenv.buildPlatform;
host_os = chromiumRosettaStone.os stdenv.buildPlatform;
target_cpu = chromiumRosettaStone.cpu stdenv.hostPlatform;
v8_target_cpu = chromiumRosettaStone.cpu stdenv.hostPlatform;
target_os = chromiumRosettaStone.os stdenv.hostPlatform;
# Build Chromium using the system toolchain (for Linux distributions):
#
# What you would expect to be caled "target_toolchain" is
# actually called either "default_toolchain" or "custom_toolchain",
# depending on which part of the codebase you are in; see:
# https://github.com/chromium/chromium/blob/d36462cc9279464395aea5e65d0893d76444a296/build/config/BUILDCONFIG.gn#L17-L44
custom_toolchain = "//build/toolchain/linux/unbundle:default";
host_toolchain = "//build/toolchain/linux/unbundle:default";
host_toolchain = "//build/toolchain/linux/unbundle:host";
v8_snapshot_toolchain = "//build/toolchain/linux/unbundle:host";
host_pkg_config = "${pkgsBuildBuild.pkg-config}/bin/pkg-config";
pkg_config = "${pkgsBuildHost.pkg-config}/bin/${stdenv.cc.targetPrefix}pkg-config";
# Don't build against a sysroot image downloaded from Cloud Storage:
use_sysroot = false;
# Because we use a different toolchain / compiler version:
@ -304,7 +375,7 @@ let
rtc_use_pipewire = true;
# Disable PGO because the profile data requires a newer compiler version (LLVM 14 isn't sufficient):
chrome_pgo_phase = 0;
clang_base_path = "${llvmPackages.stdenv.cc}";
clang_base_path = "${pkgsBuildTarget.${llvmPackages_attrName}.stdenv.cc}";
use_qt = false;
# To fix the build as we don't provide libffi_pic.a
# (ld.lld: error: unable to find library -l:libffi_pic.a):
@ -313,6 +384,9 @@ let
# We do intentionally not set rustc_version as nixpkgs will never do incremental
# rebuilds, thus leaving this empty is fine.
rust_sysroot_absolute = "${rustc}";
} // lib.optionalAttrs (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform)) {
# https://www.mail-archive.com/v8-users@googlegroups.com/msg14528.html
arm_control_flow_integrity = "none";
} // lib.optionalAttrs proprietaryCodecs {
# enable support for the H.264 codec
proprietary_codecs = true;
@ -342,6 +416,11 @@ let
# our Clang is always older than Chromium's and the build logs have a size
# of approx. 25 MB without this option (and this saves e.g. 66 %).
env.NIX_CFLAGS_COMPILE = "-Wno-unknown-warning-option";
env.BUILD_CC = "$CC_FOR_BUILD";
env.BUILD_CXX = "$CXX_FOR_BUILD";
env.BUILD_AR = "$AR_FOR_BUILD";
env.BUILD_NM = "$NM_FOR_BUILD";
env.BUILD_READELF = "$READELF_FOR_BUILD";
buildPhase = let
buildCommand = target: ''

View File

@ -0,0 +1,31 @@
diff --git a/build/toolchain/linux/unbundle/BUILD.gn b/build/toolchain/linux/unbundle/BUILD.gn
index a091491236bb1..d36fd4e652fbf 100644
--- a/build/toolchain/linux/unbundle/BUILD.gn
+++ b/build/toolchain/linux/unbundle/BUILD.gn
@@ -9,6 +9,7 @@ gcc_toolchain("default") {
cxx = getenv("CXX")
ar = getenv("AR")
nm = getenv("NM")
+ readelf = getenv("READELF")
ld = cxx
extra_cflags = getenv("CFLAGS")
@@ -27,6 +28,7 @@ gcc_toolchain("host") {
cxx = getenv("BUILD_CXX")
ar = getenv("BUILD_AR")
nm = getenv("BUILD_NM")
+ readelf = getenv("BUILD_READELF")
ld = cxx
extra_cflags = getenv("BUILD_CFLAGS")
@@ -35,7 +37,8 @@ gcc_toolchain("host") {
extra_ldflags = getenv("BUILD_LDFLAGS")
toolchain_args = {
- current_cpu = current_cpu
- current_os = current_os
+ current_cpu = host_cpu
+ current_os = host_os
+ v8_current_cpu = target_cpu
}
}

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