Get vue things to work
This commit is contained in:
parent
8d707f9a53
commit
68e6c1afc2
2 changed files with 1116 additions and 3 deletions
|
@ -1,18 +1,26 @@
|
||||||
{stdenv,
|
{
|
||||||
|
pkgs,
|
||||||
|
lib,
|
||||||
|
buildPackages,
|
||||||
|
buildNpmPackage,
|
||||||
|
fetchFromGitHub,
|
||||||
|
stdenv,
|
||||||
writeShellScriptBin,
|
writeShellScriptBin,
|
||||||
writeText,
|
writeText,
|
||||||
symlinkJoin,
|
symlinkJoin,
|
||||||
callPackage,
|
callPackage,
|
||||||
bundlerEnv,
|
bundlerEnv,
|
||||||
ruby_3_2,
|
ruby_3_2,
|
||||||
postgresql
|
esbuild,
|
||||||
}:
|
}:
|
||||||
let
|
let
|
||||||
gemfile-patch = callPackage ./gemfile-patch.nix {};
|
gemfile-patch = callPackage ./gemfile-patch.nix {};
|
||||||
|
|
||||||
src = callPackage ./source.nix {
|
src = callPackage ./source.nix {
|
||||||
patches = [
|
patches = [
|
||||||
gemfile-patch
|
gemfile-patch
|
||||||
./creds.patch
|
./creds.patch
|
||||||
|
./esbuild-linux-64.patch
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
gems = bundlerEnv {
|
gems = bundlerEnv {
|
||||||
|
@ -22,6 +30,37 @@ let
|
||||||
gemdir = src;
|
gemdir = src;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
vue = buildNpmPackage {
|
||||||
|
name = "loomio-vue";
|
||||||
|
src = "${src}";
|
||||||
|
|
||||||
|
npmRoot = "vue";
|
||||||
|
|
||||||
|
npmDepsHash = "sha256-DtzB1XIbdhJkLV88h1caKQeWfErwWBBf4OiQuKM/oQc=";
|
||||||
|
|
||||||
|
buildPhase = ''
|
||||||
|
runHook preBuild
|
||||||
|
|
||||||
|
if [ -n "''${npmRoot-}" ]; then
|
||||||
|
pushd "$npmRoot"
|
||||||
|
fi
|
||||||
|
|
||||||
|
npm run build
|
||||||
|
|
||||||
|
if [ -n "''${npmRoot-}" ]; then
|
||||||
|
popd
|
||||||
|
fi
|
||||||
|
|
||||||
|
runHook postBuild
|
||||||
|
'';
|
||||||
|
dontNpmInstall = true;
|
||||||
|
|
||||||
|
installPhase = ''
|
||||||
|
mkdir $out
|
||||||
|
cp -r * $out
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
databaseConfig = writeText "database.yml" ''
|
databaseConfig = writeText "database.yml" ''
|
||||||
production:
|
production:
|
||||||
adapter: postgresql
|
adapter: postgresql
|
||||||
|
@ -31,7 +70,7 @@ let
|
||||||
|
|
||||||
in stdenv.mkDerivation {
|
in stdenv.mkDerivation {
|
||||||
name = "loomio";
|
name = "loomio";
|
||||||
inherit src;
|
src = vue;
|
||||||
nativeBuildInputs = [ gems gems.wrappedRuby ];
|
nativeBuildInputs = [ gems gems.wrappedRuby ];
|
||||||
buildInputs = [gems ruby_3_2];
|
buildInputs = [gems ruby_3_2];
|
||||||
buildPhase = ''
|
buildPhase = ''
|
||||||
|
@ -39,6 +78,8 @@ in stdenv.mkDerivation {
|
||||||
|
|
||||||
cp ${databaseConfig} config/database.yml
|
cp ${databaseConfig} config/database.yml
|
||||||
cp ${./puma.rb} config/puma.rb
|
cp ${./puma.rb} config/puma.rb
|
||||||
|
# ln -s ''${vueNodeModules} vue/node_modules
|
||||||
|
# ln -s ''${vue} vue-built
|
||||||
|
|
||||||
export BUNDLE_FORCE_RUBY_PLATFORM=true
|
export BUNDLE_FORCE_RUBY_PLATFORM=true
|
||||||
${gems}/bin/bundle exec bootsnap precompile --gemfile app/ lib/
|
${gems}/bin/bundle exec bootsnap precompile --gemfile app/ lib/
|
||||||
|
|
1072
pkg/loomio/esbuild-linux-64.patch
Normal file
1072
pkg/loomio/esbuild-linux-64.patch
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Add table
Reference in a new issue