summary refs log tree commit diff
path: root/pkgs/tools/security/rhash
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2021-06-11 19:20:57 +0000
committerJonathan Ringer <jonringer@users.noreply.github.com>2021-06-11 16:11:01 -0700
commite45f6131a6295cb427b0448833e3157b8d7f919c (patch)
treed5c16b07a5b718719d822364a99b027babdffac1 /pkgs/tools/security/rhash
parentb0b5ef7286dca098f40f5075175105c3c0dfbe05 (diff)
downloadnixpkgs-e45f6131a6295cb427b0448833e3157b8d7f919c.tar
nixpkgs-e45f6131a6295cb427b0448833e3157b8d7f919c.tar.gz
nixpkgs-e45f6131a6295cb427b0448833e3157b8d7f919c.tar.bz2
nixpkgs-e45f6131a6295cb427b0448833e3157b8d7f919c.tar.lz
nixpkgs-e45f6131a6295cb427b0448833e3157b8d7f919c.tar.xz
nixpkgs-e45f6131a6295cb427b0448833e3157b8d7f919c.tar.zst
nixpkgs-e45f6131a6295cb427b0448833e3157b8d7f919c.zip
rhash: fix static build
Diffstat (limited to 'pkgs/tools/security/rhash')
-rw-r--r--pkgs/tools/security/rhash/default.nix13
1 files changed, 11 insertions, 2 deletions
diff --git a/pkgs/tools/security/rhash/default.nix b/pkgs/tools/security/rhash/default.nix
index c602ec622cd..68bf35a751e 100644
--- a/pkgs/tools/security/rhash/default.nix
+++ b/pkgs/tools/security/rhash/default.nix
@@ -1,4 +1,6 @@
-{ lib, stdenv, fetchFromGitHub, which }:
+{ lib, stdenv, fetchFromGitHub, which
+, enableStatic ? stdenv.hostPlatform.isStatic
+}:
 
 stdenv.mkDerivation rec {
   version = "1.4.1";
@@ -14,13 +16,20 @@ stdenv.mkDerivation rec {
   nativeBuildInputs = [ which ];
 
   # configure script is not autotools-based, doesn't support these options
+  dontAddStaticConfigureFlags = true;
   configurePlatforms = [ ];
+  configureFlags = [
+    "--ar=${stdenv.cc.targetPrefix}ar"
+    (lib.enableFeature enableStatic "static")
+    (lib.enableFeature enableStatic "lib-static")
+  ];
 
   doCheck = true;
 
   checkTarget = "test-full";
 
-  installTargets = [ "install" "install-lib-shared" "install-lib-so-link" "install-lib-headers" ];
+  installTargets = [ "install" "install-lib-headers" ]
+    ++ lib.optional (!enableStatic) "install-lib-so-link";
 
   meta = with lib; {
     homepage = "http://rhash.sourceforge.net/";