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