diff options
author | Yarny0 <41838844+Yarny0@users.noreply.github.com> | 2021-11-28 21:52:04 +0100 |
---|---|---|
committer | Yarny0 <41838844+Yarny0@users.noreply.github.com> | 2022-01-17 12:09:26 +0100 |
commit | 6d134acc4a18897eb248e7ce7daeecc06e68d517 (patch) | |
tree | b20437f0bcfb07dde4fb042c4a07e24380750c38 /pkgs/tools/backup | |
parent | ce6eea6002704b5a2285fb7800e247e3e0946f6c (diff) | |
download | nixpkgs-6d134acc4a18897eb248e7ce7daeecc06e68d517.tar nixpkgs-6d134acc4a18897eb248e7ce7daeecc06e68d517.tar.gz nixpkgs-6d134acc4a18897eb248e7ce7daeecc06e68d517.tar.bz2 nixpkgs-6d134acc4a18897eb248e7ce7daeecc06e68d517.tar.lz nixpkgs-6d134acc4a18897eb248e7ce7daeecc06e68d517.tar.xz nixpkgs-6d134acc4a18897eb248e7ce7daeecc06e68d517.tar.zst nixpkgs-6d134acc4a18897eb248e7ce7daeecc06e68d517.zip |
tsm-client: use explicit package option for Java GUI
The tsm-client package comes in two flavours: command line only (`tsm-client`) and with a Java-backed GUI (`tsm-client-withGui`). To control which package is built, the build recipe simply used to check if the `jdk8` package was provided as package input. This commit changes this mechanism: The build recipe now accepts the explicit option `enableGui`, which is set to `false` by default. As the commit at hand touches the build recipe arguments, it also changes argument sorting following https://nixos.org/manual/nixpkgs/stable/#sec-syntax
Diffstat (limited to 'pkgs/tools/backup')
-rw-r--r-- | pkgs/tools/backup/tsm-client/default.nix | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/pkgs/tools/backup/tsm-client/default.nix b/pkgs/tools/backup/tsm-client/default.nix index e1f5055b221..bd7b21be764 100644 --- a/pkgs/tools/backup/tsm-client/default.nix +++ b/pkgs/tools/backup/tsm-client/default.nix @@ -1,16 +1,16 @@ { lib , stdenv -, autoPatchelfHook -, buildEnv , fetchurl +, autoPatchelfHook +, zlib +, lvm2 # LVM image backup and restore functions (optional) +, acl # EXT2/EXT3/XFS ACL support (optional) , gnugrep -, makeWrapper , procps -, zlib -# optional packages that enable certain features -, acl ? null # EXT2/EXT3/XFS ACL support -, jdk8 ? null # Java GUI -, lvm2 ? null # LVM image backup and restore functions +, jdk8 # Java GUI (needed for `enableGui`) +, buildEnv +, makeWrapper +, enableGui ? false # enables Java GUI `dsmj` # path to `dsm.sys` configuration files , dsmSysCli ? "/etc/tsm-client/cli.dsm.sys" , dsmSysApi ? "/etc/tsm-client/api.dsm.sys" @@ -127,6 +127,9 @@ let ''; }; + binPath = lib.makeBinPath ([ acl gnugrep procps ] + ++ lib.optional enableGui jdk8); + in buildEnv { @@ -145,7 +148,7 @@ buildEnv { # to the so-called "installation directories" # * Add symlinks to the "installation directories" # that point to the `dsm.sys` configuration files - # * Drop the Java GUI executable unless `jdk` is present + # * Drop the Java GUI executable unless `enableGui` is set # * Create wrappers for the command-line interface to # prepare `PATH` and `DSM_DIR` environment variables postBuild = '' @@ -153,13 +156,13 @@ buildEnv { ln --symbolic --no-target-directory opt/tivoli/tsm/client/api/bin64 $out/dsmi_dir ln --symbolic --no-target-directory "${dsmSysCli}" $out/dsm_dir/dsm.sys ln --symbolic --no-target-directory "${dsmSysApi}" $out/dsmi_dir/dsm.sys - ${lib.optionalString (jdk8==null) "rm $out/bin/dsmj"} + ${lib.optionalString (!enableGui) "rm $out/bin/dsmj"} for bin in $out/bin/* do target=$(readlink "$bin") rm "$bin" makeWrapper "$target" "$bin" \ - --prefix PATH : "$out/dsm_dir:${lib.makeBinPath [ procps gnugrep acl jdk8 ]}" \ + --prefix PATH : "$out/dsm_dir:${binPath}" \ --set DSM_DIR $out/dsm_dir done ''; |