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,15 @@
diff --git a/config/application.rb b/config/application.rb
index d85a17491..90ea5e387 100644
--- a/config/application.rb
+++ b/config/application.rb
@@ -3,6 +3,7 @@
require_relative 'boot'
require 'rails/all'
+require 'nulldb'
require_relative 'issue_2656_workaround_for_rails_issue_33600'
# DO NOT REMOVE THIS LINE - see issue #2037
diff --git a/db/schema.rb b/db/schema.rb
new file mode 100644
index 000000000..e69de29bb

View file

@ -0,0 +1,141 @@
{ stdenv
, lib
, fetchFromGitHub
, applyPatches
, bundlerEnv
, defaultGemConfig
, callPackage
, writeText
, procps
, ruby_2_7
, postgresql
, imlib2
, jq
, moreutils
, nodejs
, yarn
, yarn2nix-moretea
, v8
, cacert
}:
let
pname = "zammad";
version = "5.1.1";
src = applyPatches {
src = fetchFromGitHub (lib.importJSON ./source.json);
patches = [ ./0001-nulldb.patch ];
postPatch = ''
sed -i -e "s|ruby '2.7.4'|ruby '${ruby_2_7.version}'|" Gemfile
sed -i -e "s|ruby 2.7.4p191|ruby ${ruby_2_7.version}|" Gemfile.lock
sed -i -e "s|2.7.4|${ruby_2_7.version}|" .ruby-version
${jq}/bin/jq '. += {name: "Zammad", version: "${version}"}' package.json | ${moreutils}/bin/sponge package.json
'';
};
databaseConfig = writeText "database.yml" ''
production:
url: <%= ENV['DATABASE_URL'] %>
'';
secretsConfig = writeText "secrets.yml" ''
production:
secret_key_base: <%= ENV['SECRET_KEY_BASE'] %>
'';
rubyEnv = bundlerEnv {
name = "${pname}-gems-${version}";
inherit version;
# Which ruby version to select:
# https://docs.zammad.org/en/latest/prerequisites/software.html#ruby-programming-language
inherit ruby_2_7;
gemdir = src;
gemset = ./gemset.nix;
groups = [
"assets"
"unicorn" # server
"nulldb"
"test"
"mysql"
"puma"
"development"
"postgres" # database
];
gemConfig = defaultGemConfig // {
pg = attrs: {
buildFlags = [ "--with-pg-config=${postgresql}/bin/pg_config" ];
};
rszr = attrs: {
buildInputs = [ imlib2 imlib2.dev ];
buildFlags = [ "--without-imlib2-config" ];
};
mini_racer = attrs: {
buildFlags = [
"--with-v8-dir=\"${v8}\""
];
dontBuild = false;
postPatch = ''
substituteInPlace ext/mini_racer_extension/extconf.rb \
--replace Libv8.configure_makefile '$CPPFLAGS += " -x c++"; Libv8.configure_makefile'
'';
};
};
};
yarnEnv = yarn2nix-moretea.mkYarnPackage {
pname = "${pname}-node-modules";
inherit version src;
yarnLock = ./yarn.lock;
yarnNix = ./yarn.nix;
packageJSON = ./package.json;
};
in
stdenv.mkDerivation {
inherit pname version src;
buildInputs = [
rubyEnv
rubyEnv.wrappedRuby
rubyEnv.bundler
yarn
nodejs
procps
cacert
];
RAILS_ENV = "production";
buildPhase = ''
node_modules=${yarnEnv}/libexec/Zammad/node_modules
${yarn2nix-moretea.linkNodeModulesHook}
rake DATABASE_URL="nulldb://user:pass@127.0.0.1/dbname" assets:precompile
'';
installPhase = ''
cp -R . $out
cp ${databaseConfig} $out/config/database.yml
cp ${secretsConfig} $out/config/secrets.yml
sed -i -e "s|info|debug|" $out/config/environments/production.rb
'';
passthru = {
inherit rubyEnv yarnEnv;
updateScript = [ "${callPackage ./update.nix {}}/bin/update.sh" pname (toString ./.) ];
};
meta = with lib; {
description = "Zammad, a web-based, open source user support/ticketing solution.";
homepage = "https://zammad.org";
license = licenses.agpl3Plus;
platforms = [ "x86_64-linux" ];
maintainers = with maintainers; [ n0emis garbas taeer ];
};
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,18 @@
{
"scripts": {
"lint:css": "stylelint \"**/*.{css,scss}\"",
"lint:css:fix": "stylelint \"**/*.{css,scss}\" --fix"
},
"devDependencies": {
"postcss": "^8.4.4",
"postcss-html": "^1.3.0",
"prettier": "2.5.0",
"stylelint": "^14.1.0",
"stylelint-config-prettier": "^9.0.3",
"stylelint-config-standard": "^24.0.0",
"stylelint-config-standard-scss": "^3.0.0",
"stylelint-prettier": "^2.0.0"
},
"name": "Zammad",
"version": "5.1.1"
}

View file

@ -0,0 +1,8 @@
{
"owner": "zammad",
"repo": "zammad",
"rev": "d71bd90ef964426230664cdfbaa2572325bfed4f",
"sha256": "yzDTkjnRBl71REtSKRblkanJWhj7gp/+exhWjxGCFWw=",
"fetchSubmodules": true
}

View file

@ -0,0 +1,37 @@
{ stdenv
, lib
, makeWrapper
, bundix
, common-updater-scripts
, jq
, nix-prefetch-github
, yarn
, yarn2nix
}:
stdenv.mkDerivation rec {
name = "zammad-update-script";
installPhase = ''
mkdir -p $out/bin
cp ${./update.sh} $out/bin/update.sh
patchShebangs $out/bin/update.sh
wrapProgram $out/bin/update.sh --prefix PATH : ${lib.makeBinPath buildInputs}
'';
phases = [ "installPhase" ];
nativeBuildInputs = [ makeWrapper ];
buildInputs = [
bundix
common-updater-scripts
jq
nix-prefetch-github
yarn
yarn2nix
];
meta = {
maintainers = with lib.maintainers; [ n0emis ];
description = "Utility to generate Nix expressions for Zammad's dependencies";
platforms = lib.platforms.unix;
};
}

View file

@ -0,0 +1,68 @@
#!/usr/bin/env bash
set -euo pipefail
if [ "$#" -gt 2 ] || [[ "$1" == -* ]]; then
echo "Regenerates packaging data for the zammad packages."
echo "Usage: $0 [package name] [zammad directory in nixpkgs]"
exit 1
fi
VERSION=$(curl -s https://ftp.zammad.com/ | grep -v latest | grep tar.gz | sed "s/<a href=\".*\">zammad-//" | sort -h | tail -n 1 | awk '{print $1}' | sed 's/.tar.gz<\/a>//')
TARGET_DIR="$2"
WORK_DIR=$(mktemp -d)
SOURCE_DIR=$WORK_DIR/zammad-$VERSION
pushd $TARGET_DIR
rm -rf \
./source.json \
./gemset.nix \
./yarn.lock \
./yarn.nix
# Check that working directory was created.
if [[ ! "$WORK_DIR" || ! -d "$WORK_DIR" ]]; then
echo "Could not create temporary directory."
exit 1
fi
# Delete the working directory on exit.
function cleanup {
rm -rf "$WORK_DIR"
}
trap cleanup EXIT
pushd $WORK_DIR
echo ":: Creating source.json"
nix-prefetch-github zammad zammad --rev $VERSION --json --fetch-submodules | jq 'del(.leaveDotGit) | del(.deepClone)' > $TARGET_DIR/source.json
echo >> $TARGET_DIR/source.json
echo ":: Fetching source"
curl -L https://github.com/zammad/zammad/archive/$VERSION.tar.gz --output source.tar.gz
tar zxf source.tar.gz
if [[ ! "$SOURCE_DIR" || ! -d "$SOURCE_DIR" ]]; then
echo "Source directory does not exists."
exit 1
fi
pushd $SOURCE_DIR
echo ":: Creating gemset.nix"
bundix --lockfile=./Gemfile.lock --gemfile=./Gemfile --gemset=$TARGET_DIR/gemset.nix
echo ":: Creating yarn.nix"
yarn install
cp yarn.lock $TARGET_DIR
yarn2nix > $TARGET_DIR/yarn.nix
# needed to avoid import from derivation
jq --arg VERSION "$VERSION" '. += {name: "Zammad", version: $VERSION}' package.json > $TARGET_DIR/package.json
popd
popd
popd

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff