Merge remote-tracking branch 'upstream/master' into staging

This commit is contained in:
John Ericson 2021-04-15 03:16:06 +00:00
commit b60fc42130
7 changed files with 126 additions and 20 deletions

View File

@ -8,6 +8,11 @@ let
cfg = config.programs.fish;
fishAbbrs = concatStringsSep "\n" (
mapAttrsFlatten (k: v: "abbr -ag ${k} ${escapeShellArg v}")
cfg.shellAbbrs
);
fishAliases = concatStringsSep "\n" (
mapAttrsFlatten (k: v: "alias ${k} ${escapeShellArg v}")
(filterAttrs (k: v: v != null) cfg.shellAliases)
@ -83,6 +88,18 @@ in
'';
};
shellAbbrs = mkOption {
default = {};
example = {
gco = "git checkout";
npu = "nix-prefetch-url";
};
description = ''
Set of fish abbreviations.
'';
type = with types; attrsOf str;
};
shellAliases = mkOption {
default = {};
description = ''
@ -205,6 +222,7 @@ in
# if we haven't sourced the interactive config, do it
status --is-interactive; and not set -q __fish_nixos_interactive_config_sourced
and begin
${fishAbbrs}
${fishAliases}
${sourceEnv "interactiveShellInit"}

View File

@ -0,0 +1,80 @@
{ lib, gcc9Stdenv, fetchFromGitHub, runCommand, cosmopolitan }:
gcc9Stdenv.mkDerivation rec {
pname = "cosmopolitan";
version = "0.3";
src = fetchFromGitHub {
owner = "jart";
repo = "cosmopolitan";
rev = version;
sha256 = "sha256-OVdOObO82W6JN63OWKHaERS7y0uvgxt+WLp6Y0LsmJk=";
};
postPatch = ''
patchShebangs build/
rm -r third_party/gcc
'';
dontConfigure = true;
dontFixup = true;
enableParallelBuilding = true;
preBuild = ''
makeFlagsArray=(
SHELL=/bin/sh
AS=${gcc9Stdenv.cc.targetPrefix}as
CC=${gcc9Stdenv.cc.targetPrefix}gcc
GCC=${gcc9Stdenv.cc.targetPrefix}gcc
CXX=${gcc9Stdenv.cc.targetPrefix}g++
LD=${gcc9Stdenv.cc.targetPrefix}ld
OBJCOPY=${gcc9Stdenv.cc.targetPrefix}objcopy
"MKDIR=mkdir -p"
)
'';
installPhase = ''
runHook preInstall
mkdir -p $out/{bin,lib/include}
install o/cosmopolitan.h $out/lib/include
install o/cosmopolitan.a o/libc/crt/crt.o o/ape/ape.{o,lds} $out/lib
cat > $out/bin/cosmoc <<EOF
#!${gcc9Stdenv.shell}
exec ${gcc9Stdenv.cc}/bin/${gcc9Stdenv.cc.targetPrefix}gcc \
-O -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone \
"\$@" \
-Wl,--oformat=binary -Wl,--gc-sections -Wl,-z,max-page-size=0x1000 \
-fuse-ld=bfd -Wl,-T,$out/lib/ape.lds \
-include $out/lib/{include/cosmopolitan.h,crt.o,ape.o,cosmopolitan.a}
EOF
chmod +x $out/bin/cosmoc
runHook postInstall
'';
passthru.tests = lib.optional (gcc9Stdenv.buildPlatform == gcc9Stdenv.hostPlatform) {
hello = runCommand "hello-world" { } ''
printf 'main() { printf("hello world\\n"); }\n' >hello.c
${gcc9Stdenv.cc}/bin/gcc -g -O -static -nostdlib -nostdinc -fno-pie -no-pie -mno-red-zone -o hello.com.dbg hello.c \
-fuse-ld=bfd -Wl,-T,${cosmopolitan}/lib/ape.lds \
-include ${cosmopolitan}/lib/{include/cosmopolitan.h,crt.o,ape.o,cosmopolitan.a}
${gcc9Stdenv.cc.bintools.bintools_bin}/bin/objcopy -S -O binary hello.com.dbg hello.com
./hello.com
printf "test successful" > $out
'';
cosmoc = runCommand "cosmoc-hello" { } ''
printf 'main() { printf("hello world\\n"); }\n' >hello.c
${cosmopolitan}/bin/cosmoc hello.c
./a.out
printf "test successful" > $out
'';
};
meta = with lib; {
homepage = "https://justine.lol/cosmopolitan/";
description = "Your build-once run-anywhere c library";
platforms = platforms.x86_64;
badPlatforms = platforms.darwin;
license = licenses.isc;
maintainers = with maintainers; [ lourkeur tomberek ];
};
}

View File

@ -9,6 +9,8 @@ stdenv.mkDerivation rec {
sha256 = "11x8q45jvjvf2dvgclds64mscyg10lva33qinf2hwgc84v3svf1l";
};
outputs = [ "out" "dev" "man" ];
# darwin changes configure.ac which means we need to regenerate
# the configure scripts
nativeBuildInputs = [ autoreconfHook ];

View File

@ -1,5 +1,6 @@
{ buildPythonPackage,
fetchPypi,
fetchpatch,
cairosvg,
pyphen,
cffi,
@ -7,7 +8,6 @@
lxml,
html5lib,
tinycss,
pygobject2,
glib,
pango,
fontconfig,
@ -43,9 +43,15 @@ buildPythonPackage rec {
FONTCONFIG_FILE = "${fontconfig.out}/etc/fonts/fonts.conf";
propagatedBuildInputs = [ cairosvg pyphen cffi cssselect lxml html5lib tinycss pygobject2 ];
propagatedBuildInputs = [ cairosvg pyphen cffi cssselect lxml html5lib tinycss ];
# 47043a1fd7e50a892b9836466f521df85d597c4.patch can be removed after next release of weasyprint, see:
# https://github.com/Kozea/WeasyPrint/issues/1333#issuecomment-818062970
patches = [
(fetchpatch {
url = "https://github.com/Kozea/WeasyPrint/commit/47043a1fd7e50a892b9836466f521df85d597c44.patch";
sha256 = "0l9z0hrav3bcdajlg3vbzljq0lkw7hlj8ppzrq3v21hbj1il1nsb";
})
(substituteAll {
src = ./library-paths.patch;
fontconfig = "${fontconfig.lib}/lib/libfontconfig${stdenv.hostPlatform.extensions.sharedLibrary}";

View File

@ -1,6 +1,8 @@
{ lib, stdenv
, makeWrapper
, awscli
, jq
, unixtools
, fetchgit
, installShellFiles
, bashInteractive
@ -22,9 +24,10 @@ stdenv.mkDerivation rec {
propagatedBuildInputs = [
awscli
jq
unixtools.column
bashInteractive
];
nativeBuildInputs = [ installShellFiles ];
nativeBuildInputs = [ makeWrapper installShellFiles ];
checkPhase = ''
pushd test
@ -50,6 +53,7 @@ stdenv.mkDerivation rec {
--replace .bash-my-aws ""
substituteInPlace bin/bma \
--replace '~/.bash-my-aws' $out
wrapProgram $out/bin/bma --prefix PATH : ${lib.makeBinPath [awscli jq unixtools.column bashInteractive ]}
installShellCompletion --bash --name bash-my-aws.bash bash_completion.sh
chmod +x $out/lib/*
patchShebangs --host $out/lib

View File

@ -1,29 +1,23 @@
{ lib, stdenv, fetchurl
, SystemConfiguration ? null, Foundation ? null
}:
assert stdenv.isDarwin -> SystemConfiguration != null
&& Foundation != null;
{ lib, stdenv, fetchFromGitHub, zlib, libpng, SystemConfiguration, Foundation }:
stdenv.mkDerivation rec {
version = "1.8.29";
pname = "htmldoc";
src = fetchurl {
url = "https://github.com/michaelrsweet/htmldoc/releases/download"
+ "/release-${version}/htmldoc-${version}-source.tar.gz";
sha256 = "15x0xdf487j4i4gfap5yr83airxnbp2v4lxaz79a4s3iirrq39p0";
version = "1.9.11";
src = fetchFromGitHub {
owner = "michaelrsweet";
repo = "htmldoc";
rev = "v${version}";
sha256 = "0660829zjfdm6vzx14z7gvsfipsb7h0z74gbkyp2ncg3g2432s4n";
};
buildInputs = with stdenv;
lib.optional isDarwin SystemConfiguration
++ lib.optional isDarwin Foundation;
buildInputs = [ zlib libpng ]
++ lib.optionals stdenv.isDarwin [ Foundation SystemConfiguration ];
meta = with lib; {
description = "Converts HTML files to PostScript and PDF";
homepage = "https://michaelrsweet.github.io/htmldoc";
license = licenses.gpl2;
license = licenses.gpl2Only;
maintainers = with maintainers; [ shanemikel ];
platforms = with platforms; linux ++ darwin;
platforms = platforms.unix;
longDescription = ''
HTMLDOC is a program that reads HTML source files or web pages and

View File

@ -13952,6 +13952,8 @@ in
cog = callPackage ../development/web/cog { };
cosmopolitan = callPackage ../development/libraries/cosmopolitan { };
ctl = callPackage ../development/libraries/ctl { };
ctpp2 = callPackage ../development/libraries/ctpp2 { };