commit ad842e751cdb9a7215a164af79de057d79f9c28e Author: AG Date: Mon Oct 20 15:30:08 2025 +0200 Init with apache-hop diff --git a/default.nix b/default.nix new file mode 100644 index 0000000..9b63703 --- /dev/null +++ b/default.nix @@ -0,0 +1,8 @@ +{ system ? builtins.currentSystem }: + +let + pkgs = import { inherit system; }; +in +{ + apache-hop = pkgs.callPackage ./pkgs/apache-hop { }; +} diff --git a/pkgs/apache-hop/default.nix b/pkgs/apache-hop/default.nix new file mode 100644 index 0000000..19b3a0b --- /dev/null +++ b/pkgs/apache-hop/default.nix @@ -0,0 +1,93 @@ +{ pkgs ? import { } }: + +pkgs.stdenv.mkDerivation rec { + pname = "apache-hop"; + version = "2.15.0"; + + src = pkgs.fetchurl { + url = "https://dlcdn.apache.org/hop/2.15.0/apache-hop-client-2.15.0.zip"; + name = "apache-hop-client-2.15.0.zip"; + sha512 = "9581f48551e35a661a9a12f3e57f9dd5f0df7dc3f49e7931942c308e35aac1ab4ac05da727b290a6ba28a96bb99ea45d4f43dc749106a9846bd87fd0a08ee0e8"; + }; + + nativeBuildInputs = with pkgs; [ + makeWrapper + jdk17 + unzip + ]; + + buildInputs = with pkgs; [ + gtk3 + glib + webkitgtk_4_1 + libsoup_2_4 + cairo + gdk-pixbuf + atk + pango + ]; + + dontBuild = true; + dontConfigure = true; + + installPhase = '' + runHook preInstall + + 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 + +export HOP_CONFIG_FOLDER="\$HOME/.hop/config" +export HOP_AUDIT_FOLDER="\$HOME/.hop/audit" + +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 + +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 + + 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 + + # Make sure shell scripts are executable + chmod +x $out/opt/apache-hop/*.sh + + runHook postInstall + ''; + + meta = with pkgs.lib; { + description = "Apache Hop - Data Integration Platform"; + homepage = "https://hop.apache.org/"; + license = licenses.asl20; + platforms = platforms.linux; + maintainers = with lib.maintainers; [ AmjadGhoufrane ]; + }; +}