Update default.nix

This commit is contained in:
AG 2025-10-30 15:27:03 +01:00
parent eac26713c7
commit f1faa10d33
1 changed files with 55 additions and 45 deletions

View File

@ -1,4 +1,6 @@
{ pkgs ? import <nixpkgs> { } }:
{
pkgs ? import <nixpkgs> { },
}:
pkgs.stdenv.mkDerivation rec {
pname = "apache-hop";
@ -32,60 +34,62 @@ pkgs.stdenv.mkDerivation rec {
dontConfigure = true;
installPhase = ''
runHook preInstall
runHook preInstall
mkdir -p $out/opt/apache-hop
cp -r . $out/opt/apache-hop/
mkdir -p $out/bin
mkdir -p $out/opt/apache-hop
cp -r . $out/opt/apache-hop/
mkdir -p $out/bin
create_wrapper_script() {
local script_name=$1
cat > $out/bin/$script_name << EOF
#!/usr/bin/env bash
set -e
create_wrapper_script() {
local script_name=$1
cat > $out/bin/$script_name << EOF
#!/usr/bin/env bash
set -e
export HOP_CONFIG_FOLDER="\$HOME/.hop/config"
export HOP_AUDIT_FOLDER="\$HOME/.hop/audit"
export HOP_CONFIG_FOLDER="\$HOME/.hop/config"
export HOP_AUDIT_FOLDER="\$HOME/.hop/audit"
mkdir -p "\$HOP_CONFIG_FOLDER" "\$HOP_AUDIT_FOLDER"
mkdir -p "\$HOP_CONFIG_FOLDER" "\$HOP_AUDIT_FOLDER"
if [ ! -f "\$HOP_CONFIG_FOLDER/hop-config.json" ]; then
cp -r $out/opt/apache-hop/config/* "\$HOP_CONFIG_FOLDER/"
fi
if [ ! -f "\$HOP_CONFIG_FOLDER/hop-config.json" ]; then
cp -r $out/opt/apache-hop/config/* "\$HOP_CONFIG_FOLDER/"
fi
exec $out/opt/apache-hop/$script_name.sh "\$@"
EOF
chmod +x $out/bin/$script_name
}
exec $out/opt/apache-hop/$script_name.sh "\$@"
EOF
chmod +x $out/bin/$script_name
}
create_wrapper_script hop-gui
create_wrapper_script hop-run
create_wrapper_script hop-server
create_wrapper_script hop-gui
create_wrapper_script hop-run
create_wrapper_script hop-server
for script in hop-gui hop-run hop-server; do
mv $out/bin/$script $out/bin/.$script-wrapped
makeWrapper $out/bin/.$script-wrapped $out/bin/$script \
--set JAVA_HOME "${pkgs.jdk17}" \
--prefix LD_LIBRARY_PATH : "${pkgs.lib.makeLibraryPath [
pkgs.gtk3
pkgs.glib
pkgs.webkitgtk_4_1
pkgs.libsoup_2_4
pkgs.cairo
pkgs.gdk-pixbuf
pkgs.atk
pkgs.pango
]}"
done
for script in hop-gui hop-run hop-server; do
mv $out/bin/$script $out/bin/.$script-wrapped
makeWrapper $out/bin/.$script-wrapped $out/bin/$script \
--set JAVA_HOME "${pkgs.jdk17}" \
--prefix LD_LIBRARY_PATH : "${
pkgs.lib.makeLibraryPath [
pkgs.gtk3
pkgs.glib
pkgs.webkitgtk_4_1
pkgs.libsoup_3
pkgs.cairo
pkgs.gdk-pixbuf
pkgs.atk
pkgs.pango
]
}"
done
chmod +x $out/opt/apache-hop/*.sh
chmod +x $out/opt/apache-hop/*.sh
mkdir -p $out/share/applications
mkdir -p $out/share/pixmaps
mkdir -p $out/share/applications
mkdir -p $out/share/pixmaps
cp $out/opt/apache-hop/hop.ico $out/share/pixmaps/hop.ico
cp $out/opt/apache-hop/hop.ico $out/share/pixmaps/hop.ico
runHook postInstall
runHook postInstall
'';
desktopItems = [
@ -95,8 +99,14 @@ EOF
comment = "Data Integration Platform";
exec = "hop-gui";
icon = "hop";
categories = [ "Development" "Database" ];
mimeTypes = [ "application/x-hop-workflow" "application/x-hop-pipeline" ];
categories = [
"Development"
"Database"
];
mimeTypes = [
"application/x-hop-workflow"
"application/x-hop-pipeline"
];
})
];