uboot: (firmwareOdroidC2/C4) don't invoke patch tool, use patches = [] instead

https://github.com/NixOS/nixpkgs/blob/master/pkgs/stdenv/generic/setup.sh#L948
this can do it nicely.

Signed-off-by: Anton Arapov <anton@deadbeef.mx>
This commit is contained in:
Anton Arapov 2021-04-03 12:58:10 +02:00 committed by Alan Daniels
commit 56de2bcd43
30691 changed files with 3076956 additions and 0 deletions

View file

@ -0,0 +1,24 @@
{ mkDerivation, base, containers, fetchFromGitHub, hedgehog, lib
, optparse-applicative, parsec, template-haskell, text
}:
mkDerivation {
pname = "dconf2nix";
version = "0.0.11";
src = fetchFromGitHub {
owner = "gvolpe";
repo = "dconf2nix";
rev = "fe7e3d973caa87b1b706096aff3d670f65e39fda";
sha256 = "sha256-zuhiFVA8LvFKOPMMvqFu+ofv0CrIl2pMZbPQE/tCaM8=";
};
isLibrary = true;
isExecutable = true;
libraryHaskellDepends = [
base containers optparse-applicative parsec text
];
executableHaskellDepends = [ base ];
testHaskellDepends = [
base containers hedgehog parsec template-haskell text
];
description = "Convert dconf files to Nix, as expected by Home Manager";
license = lib.licenses.asl20;
}

View file

@ -0,0 +1,32 @@
{ haskell, haskellPackages, lib, runCommand }:
let
dconf2nix =
haskell.lib.compose.justStaticExecutables
(haskell.lib.compose.overrideCabal (oldAttrs: {
maintainers = (oldAttrs.maintainers or []) ++ [
lib.maintainers.gvolpe
];
}) haskellPackages.dconf2nix);
in
dconf2nix.overrideAttrs (oldAttrs: {
passthru = (oldAttrs.passthru or {}) // {
updateScript = ./update.sh;
# These tests can be run with the following command.
#
# $ nix-build -A dconf2nix.passthru.tests
tests =
runCommand
"dconf2nix-tests"
{
nativeBuildInputs = [
dconf2nix
];
}
''
dconf2nix > $out
'';
};
})

View file

@ -0,0 +1,26 @@
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p cabal2nix curl jq
#
# This script will update the dconf2nix derivation to the latest version using
# cabal2nix.
set -eo pipefail
# This is the directory of this update.sh script.
script_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# dconf2nix derivation created with cabal2nix.
dconf2nix_derivation_file="${script_dir}/dconf2nix.nix"
# This is the current revision of dconf2nix in Nixpkgs.
old_version="$(sed -En 's/.*\bversion = "(.*?)".*/\1/p' "$dconf2nix_derivation_file")"
# This is the latest release version of dconf2nix on GitHub.
new_version=$(curl --silent "https://api.github.com/repos/gvolpe/dconf2nix/releases" | jq '.[0].tag_name' --raw-output)
echo "Updating dconf2nix from old version $old_version to new version $new_version."
echo "Running cabal2nix and outputting to ${dconf2nix_derivation_file}..."
cabal2nix --revision "$new_version" "https://github.com/gvolpe/dconf2nix.git" > "$dconf2nix_derivation_file"
echo "Finished."

View file

@ -0,0 +1,64 @@
{ lib
, stdenv
, supportedGhcVersions ? [ "884" "8107" "902" "923" ]
, dynamic ? false
, haskellPackages
, haskell
}:
#
# The recommended way to override this package is
#
# pkgs.haskell-language-server.override { supportedGhcVersions = [ "902" ]; }
#
# for example. Read more about this in the haskell-language-server section of the nixpkgs manual.
#
let
inherit (lib) concatStringsSep concatMapStringsSep take splitString pipe optionals;
inherit (haskell.lib.compose) justStaticExecutables overrideCabal enableCabalFlag disableCabalFlag;
getPackages = version: haskell.packages."ghc${version}";
tunedHls = hsPkgs:
lib.pipe hsPkgs.haskell-language-server ([
(haskell.lib.compose.overrideCabal (old: {
enableSharedExecutables = dynamic;
${if !dynamic then "postInstall" else null} = ''
${old.postInstall or ""}
remove-references-to -t ${hsPkgs.ghc} $out/bin/haskell-language-server
'';
}))
((if dynamic then enableCabalFlag else disableCabalFlag) "dynamic")
] ++ optionals (!dynamic) [
justStaticExecutables
]);
targets = version:
let packages = getPackages version;
in [
"haskell-language-server-${packages.ghc.version}"
];
makeSymlinks = version:
concatMapStringsSep "\n" (x:
"ln -s ${
tunedHls (getPackages version)
}/bin/haskell-language-server $out/bin/${x}") (targets version);
pkg = tunedHls haskellPackages;
in stdenv.mkDerivation {
pname = "haskell-language-server";
version = haskellPackages.haskell-language-server.version;
buildCommand = ''
mkdir -p $out/bin
ln -s ${pkg}/bin/haskell-language-server $out/bin/haskell-language-server
ln -s ${pkg}/bin/haskell-language-server-wrapper $out/bin/haskell-language-server-wrapper
${concatMapStringsSep "\n" makeSymlinks supportedGhcVersions}
'';
meta = haskellPackages.haskell-language-server.meta // {
maintainers = [ lib.maintainers.maralorn ];
longDescription = ''
This package provides haskell-language-server, haskell-language-server-wrapper, ${
concatMapStringsSep ", " (x: concatStringsSep ", " (targets x))
supportedGhcVersions
}.
You can override the list supportedGhcVersions.
'';
};
}

View file

@ -0,0 +1,53 @@
{ lib, stdenvNoCC, fetchFromGitHub, jshon, electron_10
, runtimeShell, hyper-haskell-server, extra-packages ? [] }:
let
binPath = lib.makeBinPath ([ hyper-haskell-server ] ++ extra-packages);
electron = electron_10;
in stdenvNoCC.mkDerivation rec {
pname = "hyper-haskell";
version = "0.2.3.0";
src = fetchFromGitHub {
owner = "HeinrichApfelmus";
repo = "hyper-haskell";
rev = "v${version}";
sha256 = "1nmkry4wh6a2dy98fcs81mq2p7zhxp1k0f4m3szr6fm3j1zwrd43";
};
propagatedBuildInputs = extra-packages;
dontBuild = true;
installPhase = ''
mkdir -p $out/bin $out/share/hyper-haskell/worksheets $out/share/applications $out/share/icons/hicolor/scalable/apps $out/share/mime/packages
# Electron app
cp -R app $out
# Desktop Launcher
cp resources/hyper-haskell.desktop $out/share/applications/hyper-haskell.desktop
cp resources/icons/icon.svg $out/share/icons/hicolor/scalable/apps/hyper-haskell.svg
cp resources/shared-mime-info.xml $out/share/mime/packages/hyper-haskell.xml
# install example worksheets with backend set to nix
for worksheet in "worksheets/"*.hhs; do
${jshon}/bin/jshon -e settings -s nix -i packageTool -p < $worksheet > $out/share/hyper-haskell/worksheets/`basename $worksheet`
done
# install electron wrapper script
cat > $out/bin/hyper-haskell <<EOF
#!${runtimeShell}
export PATH="${binPath}:\$PATH"
exec ${electron}/bin/electron $out/app "\$@"
EOF
chmod 755 $out/bin/hyper-haskell
'';
meta = with lib; {
description = "The strongly hyped graphical interpreter for the Haskell programming language";
homepage = "https://github.com/HeinrichApfelmus/hyper-haskell";
license = licenses.bsd3;
maintainers = [ maintainers.rvl ];
};
}

View file

@ -0,0 +1,29 @@
{ stdenv, ghcWithPackages, makeWrapper, packages, lib }:
let
hyperHaskellEnv = ghcWithPackages (self: [ self.hyper-haskell-server ] ++ packages self);
in stdenv.mkDerivation {
pname = "hyper-haskell-server-with-packages";
version = hyperHaskellEnv.version;
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''
mkdir -p $out/bin
makeWrapper ${hyperHaskellEnv}/bin/hyper-haskell-server $out/bin/hyper-haskell-server \
--set NIX_GHC ${hyperHaskellEnv}/bin/ghc \
--set NIX_GHCPKG ${hyperHaskellEnv}/bin/ghc-pkg \
--set NIX_GHC_LIBDIR ${hyperHaskellEnv}/lib/ghc-*
'';
# trivial derivation
preferLocalBuild = true;
allowSubstitutes = false;
meta = {
# Marked as broken because the underlying
# haskellPackages.hyper-haskell-server is marked as broken.
hydraPlatforms = lib.platforms.none;
broken = true;
};
}

View file

@ -0,0 +1,27 @@
{ lib, stdenv, writeScriptBin, makeWrapper, buildEnv, haskell, ghcWithPackages, jupyter, packages }:
let
ihaskellEnv = ghcWithPackages (self: [
self.ihaskell
self.ihaskell-blaze
self.ihaskell-diagrams
] ++ packages self);
ihaskellSh = writeScriptBin "ihaskell-notebook" ''
#! ${stdenv.shell}
export GHC_PACKAGE_PATH="$(echo ${ihaskellEnv}/lib/*/package.conf.d| tr ' ' ':'):$GHC_PACKAGE_PATH"
export PATH="${lib.makeBinPath ([ ihaskellEnv jupyter ])}''${PATH:+:}$PATH"
${ihaskellEnv}/bin/ihaskell install -l $(${ihaskellEnv}/bin/ghc --print-libdir) && ${jupyter}/bin/jupyter notebook
'';
in
buildEnv {
name = "ihaskell-with-packages";
buildInputs = [ makeWrapper ];
paths = [ ihaskellEnv jupyter ];
postBuild = ''
ln -s ${ihaskellSh}/bin/ihaskell-notebook $out/bin/
for prg in $out/bin"/"*;do
if [[ -f $prg && -x $prg ]]; then
wrapProgram $prg --set PYTHONPATH "$(echo ${jupyter}/lib/*/site-packages)"
fi
done
'';
}

View file

@ -0,0 +1,49 @@
diff --git a/src/Main.hs b/src/Main.hs
index 61da2f3..39e5c9b 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -73,11 +73,14 @@ main = do
config' <- sequence config
dir <- P.getDataDir
exitWith <=< lambdabotMain modulesInfo $
- [dataDir ==> dir, lbVersion ==> P.version] ++ config'
+ [dataDir ==> dir, lbVersion ==> P.version] ++ configInfo ++ config'
-- special online target for ghci use
online :: [String] -> IO ()
online strs = do
dir <- P.getDataDir
- void $ lambdabotMain modulesInfo
- [dataDir ==> dir, lbVersion ==> P.version, onStartupCmds ==> strs]
+ void $ lambdabotMain modulesInfo $
+ [dataDir ==> dir, lbVersion ==> P.version, onStartupCmds ==> strs] ++ configInfo
+
+configInfo :: [DSum Config Identity]
+configInfo = @config@
diff --git a/src/Modules.hs b/src/Modules.hs
index 036ea1f..eaafa50 100644
--- a/src/Modules.hs
+++ b/src/Modules.hs
@@ -14,10 +14,15 @@ import Lambdabot.Plugin.Reference
import Lambdabot.Plugin.Social
modulesInfo :: Modules
-modulesInfo = $(modules $ corePlugins
- ++ haskellPlugins
- ++ ["irc", "localtime", "topic"] -- ircPlugins
- ++ ["dummy", "fresh", "todo"] -- miscPlugins
- ++ ["bf", "dice", "elite", "filter", "quote", "slap", "unlambda", "vixen"] -- noveltyPlugins
- ++ referencePlugins
- ++ socialPlugins)
+modulesInfo =
+ $(modules $
+ let oldDefaultModules =
+ corePlugins
+ ++ haskellPlugins
+ ++ ["irc", "localtime", "topic"] -- ircPlugins
+ ++ ["dummy", "fresh", "todo"] -- miscPlugins
+ ++ ["bf", "dice", "elite", "filter", "quote", "slap", "unlambda", "vixen"] -- noveltyPlugins
+ ++ referencePlugins
+ ++ socialPlugins
+ in @modules@
+ )

View file

@ -0,0 +1,41 @@
{ lib, haskellLib, makeWrapper, haskellPackages
, mueval
, withDjinn ? true
, aspell ? null
, packages ? (pkgs: [])
, modules ? "oldDefaultModules"
, configuration ? "[]"
}:
let allPkgs = pkgs: mueval.defaultPkgs pkgs ++ [ pkgs.lambdabot-trusted ] ++ packages pkgs;
mueval' = mueval.override {
inherit haskellPackages;
packages = allPkgs;
};
bins = lib.makeBinPath ([ mueval'
(haskellPackages.ghcWithHoogle allPkgs)
haskellPackages.unlambda
haskellPackages.brainfuck
]
++ lib.optional withDjinn haskellPackages.djinn
++ lib.optional (aspell != null) aspell
);
modulesStr = lib.replaceChars ["\n"] [" "] modules;
configStr = lib.replaceChars ["\n"] [" "] configuration;
in haskellLib.overrideCabal (self: {
patches = (self.patches or []) ++ [ ./custom-config.patch ];
postPatch = (self.postPatch or "") + ''
substituteInPlace src/Main.hs \
--replace '@config@' '${configStr}'
substituteInPlace src/Modules.hs \
--replace '@modules@' '${modulesStr}'
'';
buildTools = (self.buildTools or []) ++ [ makeWrapper ];
postInstall = (self.postInstall or "") + ''
wrapProgram $out/bin/lambdabot \
--prefix PATH ":" '${bins}'
'';
}) haskellPackages.lambdabot

View file

@ -0,0 +1,32 @@
{ stdenv, makeWrapper, haskellPackages, packages ? (pkgs: [])
}:
let defaultPkgs = pkgs: [ pkgs.show
pkgs.simple-reflect
pkgs.QuickCheck
pkgs.mtl
];
env = haskellPackages.ghcWithPackages
(pkgs: defaultPkgs pkgs ++ packages pkgs);
libDir = "${env}/lib/ghc-${env.version}";
in stdenv.mkDerivation {
name = "mueval-env";
inherit (haskellPackages) mueval;
nativeBuildInputs = [ makeWrapper ];
buildCommand = ''
mkdir -p $out/bin
makeWrapper $mueval/bin/mueval $out/bin/mueval \
--prefix PATH ":" "$out/bin"
makeWrapper $mueval/bin/mueval-core $out/bin/mueval \
--set "NIX_GHC_LIBDIR" "${libDir}"
'';
passthru = { inherit defaultPkgs; };
}

View file

@ -0,0 +1,99 @@
{ mkDerivation
, async
, base
, bytestring
, connection
, containers
, directory
, hpack
, hspec
, hspec-discover
, hspec-expectations
, http-client
, http-conduit
, lens
, lens-aeson
, megaparsec
, mtl
, optparse-applicative
, parser-combinators
, retry
, lib
, text
, unix
, unordered-containers
, utf8-string
, fetchFromGitHub
, dotenv
}:
mkDerivation rec {
pname = "vaultenv";
version = "0.14.0";
src = fetchFromGitHub {
owner = "channable";
repo = "vaultenv";
rev = "v${version}";
sha256 = "sha256-sH4iaKQXgwI/WISXzMR7xqh9Dyx61U/gjYn7exgUetI=";
};
buildTools = [ hpack ];
prePatch = ''
substituteInPlace package.yaml \
--replace -Werror ""
'';
isLibrary = false;
isExecutable = true;
executableHaskellDepends = [
async
base
bytestring
connection
containers
http-client
http-conduit
lens
lens-aeson
megaparsec
mtl
optparse-applicative
parser-combinators
retry
text
unix
unordered-containers
utf8-string
dotenv
];
testHaskellDepends = [
async
base
bytestring
connection
containers
directory
hspec
hspec-discover
hspec-expectations
http-client
http-conduit
lens
lens-aeson
megaparsec
mtl
optparse-applicative
parser-combinators
retry
text
unix
unordered-containers
utf8-string
];
preConfigure = "hpack";
homepage = "https://github.com/channable/vaultenv#readme";
description = "Runs processes with secrets from HashiCorp Vault";
license = lib.licenses.bsd3;
maintainers = with lib.maintainers; [ lnl7 manveru ];
}